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