Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CCalStackingAction Class Reference

#include <CCalStackingAction.hh>

Inheritance diagram for CCalStackingAction:
Collaboration diagram for CCalStackingAction:

Public Types

enum  stageLevel { firstStage, end }
 
enum  { maxNumberOfSD = 30 }
 

Public Member Functions

 ~CCalStackingAction ()
 
virtual G4ClassificationOfNewTrack ClassifyNewTrack (const G4Track *aTrack)
 
virtual void NewStage ()
 
virtual void PrepareNewEvent ()
 
- Public Member Functions inherited from G4UserStackingAction
 G4UserStackingAction ()
 
virtual ~G4UserStackingAction ()
 
void SetStackManager (G4StackManager *value)
 

Friends

class CCalSensAssign
 

Additional Inherited Members

- Protected Attributes inherited from G4UserStackingAction
G4StackManagerstackManager
 

Detailed Description

Definition at line 40 of file CCalStackingAction.hh.

Member Enumeration Documentation

anonymous enum
Enumerator
maxNumberOfSD 

Definition at line 56 of file CCalStackingAction.hh.

Constructor & Destructor Documentation

CCalStackingAction::~CCalStackingAction ( )

Definition at line 46 of file CCalStackingAction.cc.

46 {}

Member Function Documentation

G4ClassificationOfNewTrack CCalStackingAction::ClassifyNewTrack ( const G4Track aTrack)
virtual

PRIMARIES ///

SECONDARIES ///

Reimplemented from G4UserStackingAction.

Definition at line 101 of file CCalStackingAction.cc.

101  {
102 
103  G4ClassificationOfNewTrack classification=fKill;
104  int parentID = aTrack->GetParentID();
105 #ifdef ddebug
106  G4TrackStatus status = aTrack->GetTrackStatus();
107  G4cout << "Classifying track " << aTrack->GetTrackID()
108  << " with status " << aTrack->GetTrackStatus() << G4endl;
109 #endif
110 
111  if (parentID < 0) {
112 #ifdef debug
113  G4cout << "Killing track " << aTrack->GetTrackID()
114  << " from previous event. Should not happen" << G4endl;
115  G4cout << "returning classification= " << classification << G4endl;
116 #endif
117  return classification= fKill;
118  }
119 
120  if (aTrack->GetDefinition()->GetParticleName() == "gamma" &&
121  aTrack->GetKineticEnergy() < 1.*eV) {
122 #ifdef debug
123  G4cout << "Kills particle " << aTrack->GetDefinition()->GetParticleName()
124  << " of energy " << aTrack->GetKineticEnergy()/MeV << " MeV"
125  << G4endl;
126 #endif
127  return classification= fKill;
128  }
129 
130  if (stage<end) {
134  if (parentID == 0 ) {
135  if ( nurgent == 0) {
136  nurgent++;
137  classification = fUrgent;
138  setPrimaryID(aTrack->GetTrackID());
139  }
140  else classification = fWaiting;
141  }
142 
146 
147  if (parentID > 0) {
148  if (acceptSecondaries == 1) {
149  if (trackStartsInCalo(const_cast<G4Track *>(aTrack))!=0 )
150  classification = fUrgent;
151  else
152  classification = fWaiting;
153  } else {
154  if(nurgent == 0){
155  nurgent++;
156  classification = fUrgent;
157  setPrimaryID(aTrack->GetTrackID());
158  } else
159  classification = fWaiting;
160  }
161  }
162 
163 
164  } else
165  classification = G4UserStackingAction::ClassifyNewTrack(aTrack);
166 
167 #ifdef ddebug
168  G4cout << " returning classification= " << classification
169  << " for track "<< aTrack->GetTrackID() << G4endl;
170 #endif
171  return classification;
172 
173 }
G4ParticleDefinition * GetDefinition() const
G4int GetParentID() const
G4TrackStatus GetTrackStatus() const
const G4String & GetParticleName() const
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
static constexpr double eV
Definition: G4SIunits.hh:215
G4int GetTrackID() const
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *aTrack)
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
G4TrackStatus

Here is the call graph for this function:

void CCalStackingAction::NewStage ( )
virtual

Reimplemented from G4UserStackingAction.

Definition at line 176 of file CCalStackingAction.cc.

176  {
177 
178 #ifdef ddebug
179  G4cout << "In NewStage with stage = " << stage << G4endl;
180 #endif
181  if (stage <end) {
182  nurgent = 0;
183  setPrimaryID(0);
184  acceptSecondaries = 0;
186  acceptSecondaries = 1;
187  if (stackManager->GetNUrgentTrack() == 0) {
188  stage = stageLevel(stage+1);
189  }
190 
191  }
192 }
G4int GetNUrgentTrack() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4StackManager * stackManager

Here is the call graph for this function:

void CCalStackingAction::PrepareNewEvent ( )
virtual

Reimplemented from G4UserStackingAction.

Definition at line 49 of file CCalStackingAction.cc.

49  {
50 
52  stage = firstStage;
53  nurgent = 0;
54  acceptSecondaries = 1;
55 
56 }
void initialize(Config const *const theConfig)
Initialize the clustering model based on the Config object.
G4bool isInitialized()

Friends And Related Function Documentation

friend class CCalSensAssign
friend

Definition at line 42 of file CCalStackingAction.hh.


The documentation for this class was generated from the following files: