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++){
G4ParticleDefinition * GetDefinition() const
G4int GetParentID() const
static CCalSDList * getInstance()
G4TrackStatus GetTrackStatus() const
const G4String & GetParticleName() const
G4int GetNUrgentTrack() const
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *aTrack)
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
virtual void PrepareNewEvent()
G4VSensitiveDetector * FindSensitiveDetector(G4String dName, G4bool warning=true)
G4ClassificationOfNewTrack
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *aTrack)
G4StackManager * stackManager
static G4SDManager * GetSDMpointerIfExist()