Determines the applicability of the fast sim model to this particular track.
Checks that geometric location, energy, and particle type are within bounds. Also checks for containment of the particle's shower within a specific detector region.
81{
82
83 #ifdef FCS_DEBUG
84 G4cout<<"[FastCaloSim::ModelTrigger] Got particle with " <<"\n"
85 <<" pdg=" <<fastTrack.GetPrimaryTrack() -> GetDefinition()->GetPDGEncoding() <<"\n"
86 <<" Ekin="<<fastTrack.GetPrimaryTrack() -> GetKineticEnergy() <<"\n"
87 <<" p=" <<fastTrack.GetPrimaryTrack() -> GetMomentum().mag() <<"\n"
88 <<" x=" <<fastTrack.GetPrimaryTrack() -> GetPosition().x() <<"\n"
89 <<" y=" <<fastTrack.GetPrimaryTrack() -> GetPosition().y() <<"\n"
90 <<" z=" <<fastTrack.GetPrimaryTrack() -> GetPosition().z() <<"\n"
91 <<" r=" <<fastTrack.GetPrimaryTrack() -> GetPosition().perp() <<"\n"
92 <<" eta=" <<fastTrack.GetPrimaryTrack() -> GetMomentum().eta() <<"\n"
93 <<" phi=" <<fastTrack.GetPrimaryTrack() -> GetMomentum().phi() <<"\n"
94 <<G4endl;
95 #endif
96
97
98
99 if (fastTrack.GetPrimaryTrack() -> GetKineticEnergy() < 0.05) {
100 #ifdef FCS_DEBUG
101 G4cout<<"[FastCaloSim::ModelTrigger] Particle below 50 keV threshold. Passing to G4. "<<G4endl;
102 #endif
103 return false;
104 }
105
106
108 #ifdef FCS_DEBUG
109 G4cout<<"[FastCaloSim::ModelTrigger] Particle failed passedIDCaloBoundary z="<<fastTrack.GetPrimaryTrack() -> GetPosition().z()<<" r="<<fastTrack.GetPrimaryTrack() -> GetPosition().perp()<<G4endl;
110 #endif
111 return false;
112 }
113
114
115 float minEkinPions = 200;
116 float minEkinOtherHadrons = 400;
117
118
119 const G4ParticleDefinition * G4Particle = fastTrack.GetPrimaryTrack() -> GetDefinition();
120
121 const float Ekin = fastTrack.GetPrimaryTrack() -> GetKineticEnergy();
122
123
124 bool isPhoton = G4Particle == G4Gamma::Definition();
125 bool isElectron = G4Particle == G4Electron::Definition();
126 bool isPositron = G4Particle == G4Positron::Definition();
127 bool isPionPlus = G4Particle == G4PionPlus::Definition();
128 bool isPionMinus = G4Particle == G4PionMinus::Definition();
129
130
132 #ifdef FCS_DEBUG
133 G4cout<<"[FastCaloSim::ModelTrigger] Model triggered"<<G4endl;
134 #endif
135 return true;
136 }
137
138
139 if (isPionPlus || isPionMinus){
140 bool passMinEkinPions = Ekin > minEkinPions;
141
142 #ifdef FCS_DEBUG
143 if(passMinEkinPions) G4cout<<"[FastCaloSim::ModelTrigger] Model triggered"<<G4endl;
144 else G4cout<<"[FastCaloSim::ModelTrigger] Pion with Ekin="<<Ekin<<" below the minimum "<<minEkinPions<<" MeV threshold. Model not triggered."<<G4endl;
145 #endif
146
147 return passMinEkinPions;
148
149 }
150
151
152 bool passMinEkinOtherHadrons = Ekin > minEkinOtherHadrons;
153
154 #ifdef FCS_DEBUG
155 if(passMinEkinOtherHadrons) G4cout<<"[FastCaloSim::ModelTrigger] Model triggered"<<G4endl;
156 else G4cout<<"[FastCaloSim::ModelTrigger] Other hadron with Ekin="<<Ekin<<" below the minimum "<<minEkinOtherHadrons<<" MeV threshold. Model not triggered."<<G4endl;
157 #endif
158
159 return passMinEkinOtherHadrons;
160}
G4bool passedIDCaloBoundary(const G4FastTrack &fastTrack)
Check if the particle is located at the proper ID-Calo parametrization boundary and is travelling out...