/scratch0/jsnuveri/BDSIM/BDSIMgit/bdsim/src/BDSBackScatterBias.cc

00001 //BackScatterBias - particles being backscattered are split
00002 
00003 #include "BDSBackScatterBias.hh"
00004 
00005 BDSBackScatterBias::BDSBackScatterBias(const G4String& aName,
00006                                          G4ProcessType   aType)
00007   : G4WrapperProcess(aName, aType), eFactor(1.0)
00008 {
00009 }
00010 
00011 BDSBackScatterBias::BDSBackScatterBias(const BDSBackScatterBias& right)
00012   : G4WrapperProcess(right), eFactor(right.eFactor)
00013 {
00014 }
00015 
00016 BDSBackScatterBias::~BDSBackScatterBias()
00017 {
00018 }
00019 
00020 
00021 
00022 G4VParticleChange* BDSBackScatterBias::PostStepDoIt(
00023                                                    const G4Track& track,
00024                                                    const G4Step&  stepData
00025                                                    )
00026 {
00027 #ifdef BDSDEBUG
00028   G4cout <<" ###PostStepDoIt " << G4endl;
00029   G4cout << "BDSBackScatterBias::PostStepDoit  Getting pChange" << G4endl;
00030 #endif
00031   G4VParticleChange* pChange = pRegProcess->PostStepDoIt( track, stepData );
00032   pChange->SetVerboseLevel(0);
00033 #ifdef BDSDEBUG
00034   G4cout << "BDSBackScatterBias::PostStepDoit Choosing setsecondaryweightbyprocess" << G4endl;
00035 #endif
00036   pChange->SetSecondaryWeightByProcess(true);
00037   pChange->SetParentWeightByProcess(true);
00038 #ifdef BDSDEBUG
00039   G4cout << "BDSBackScatterBias::PostStepDoit Getting parent weight" << G4endl;
00040 #endif
00041   G4double w =  pChange->GetParentWeight();
00042   G4double ws = w / eFactor;
00043   //  G4double survivalProb = w - ws;
00044   
00045 #ifdef BDSDEBUG
00046   G4cout << "BDSBackScatterBias::PostStepDoit Getting number of secondaries" << G4endl;
00047 #endif
00048   G4int iNSec = pChange->GetNumberOfSecondaries();
00049 
00050 #ifdef BDSDEBUG  
00051   G4cout << "BDSBackScatterBias::PostStepDoit Setting secondary weights" << G4endl;
00052 #endif
00053 
00054   for (G4int i = 0; i < iNSec; i++) {
00055     pChange->GetSecondary(i)->SetWeight(ws); 
00056   }
00057   
00058 #ifdef BDSDEBUG  
00059   G4cout << "BDSBackScatterBias::PostStepDoIt number of secondaries: " << pChange->GetNumberOfSecondaries() << G4endl;
00060 #endif
00061   return pChange;
00062 }
00063 

Generated on 28 Jun 2015 for BDSIM by  doxygen 1.4.7