43 CCalStackingAction::CCalStackingAction(): isInitialized(false) {}
51 if(!isInitialized) initialize();
54 acceptSecondaries = 1;
58 void CCalStackingAction::initialize(){
64 G4cout <<
"CCalStackingAction look for " << numberOfSD
65 <<
" calorimeter-like SD" <<
G4endl;
68 for (i=0; i<numberOfSD; i++) {
80 for (i=0; i<numberOfSD; i++){
85 G4cout <<
"CCalStackingAction::initialize: No SD with name " << SDName[i]
86 <<
" in this Setup " <<
G4endl;
89 theCaloSD[i] =
dynamic_cast<CCaloSD*
>(aSD);
94 G4cout <<
"CCalStackingAction::initialize: Could not get SD Manager !"
114 <<
" from previous event. Should not happen" <<
G4endl;
115 G4cout <<
"returning classification= " << classification <<
G4endl;
117 return classification=
fKill;
127 return classification=
fKill;
134 if (parentID == 0 ) {
148 if (acceptSecondaries == 1) {
149 if (trackStartsInCalo(const_cast<G4Track *>(aTrack))!=0 )
168 G4cout <<
" returning classification= " << classification
171 return classification;
179 G4cout <<
"In NewStage with stage = " << stage <<
G4endl;
184 acceptSecondaries = 0;
186 acceptSecondaries = 1;
194 G4bool CCalStackingAction::trackStartsInCalo(
const G4Track* ){
206 void CCalStackingAction::setPrimaryID(
G4int id){
208 for (
int i=0; i<numberOfSD; i++){