99 {
100
101
102 SG::ReadDecorHandle<xAOD::TruthParticleContainer, unsigned int> mcParticleOrigin{
m_mcReadDecor, ctx} ;
103 if (!mcParticleOrigin.isValid()) {
105 return StatusCode::FAILURE;
106 }
107
108 SG::ReadHandle<xAOD::JetContainer> truthjets{
m_truthJetsKey, ctx};
111 return StatusCode::FAILURE;
112 }
113
114
115 genFiltHT = 0.;
116 genFiltHTinclNu = 0.;
117 for (const auto *const tj : *truthjets) {
120 << ", eta " << tj->eta()
121 << ", phi " << tj->phi()
122 << ", nconst = " << tj->numConstituents());
123 genFiltHT += tj->pt();
124 genFiltHTinclNu += tj->pt();
125 }
126 }
127
128
129 float MEx(0.), MEy(0.);
130 for (const auto *const tp : *mcParticleOrigin){
131 int pdgid =
tp->pdgId();
135
139 genFiltHT +=
tp->pt();
140 genFiltHTinclNu +=
tp->pt();
141 }
142 }
143
144
145
146
147 unsigned int orig = mcParticleOrigin (*tp);
150 <<
", eta " <<
tp->eta()
151 <<
", phi " <<
tp->phi()
152 <<
", status " <<
tp->status()
153 << ", pdgId " << pdgid);
154 genFiltHTinclNu +=
tp->pt();
155 }
156
159 <<
", eta " <<
tp->eta()
160 <<
", phi " <<
tp->phi()
161 <<
", status " <<
tp->status()
162 << ", pdgId " << pdgid);
165 }
166 }
167 genFiltMET = std::sqrt(MEx*MEx+MEy*MEy);
168
169
170 float PtZ(.0);
171 float MinPt_PTZ(5000.), MaxEta_PTZ(5.0), MinMass_PTZ(20000.), MaxMass_PTZ(14000000.);
172 bool AllowElecMu_PTZ = false;
173 bool AllowSameCharge_PTZ = false;
175 const int pdgId1 = pitr1->pdgId();
178
180 if (pitr1->pt() >= MinPt_PTZ && std::abs(pitr1->eta()) <= MaxEta_PTZ){
182 if (pitr2==pitr1) continue;
185 const int pdgId2 = pitr2->pdgId();
186
187
188
190 if ( ( AllowSameCharge_PTZ && ( AllowElecMu_PTZ || std::abs(pdgId2) == std::abs(pdgId1) ) ) ||
191 ( !AllowSameCharge_PTZ && ( pdgId2 == -1*pdgId1 || (AllowElecMu_PTZ &&
MC::charge3(pdgId1) ==
MC::charge3(pdgId2) ) ) )
192 ) {
193 if (pitr2->pt() >= MinPt_PTZ && std::abs(pitr2->eta()) <= MaxEta_PTZ){
194 double invMass = (pitr1->p4()+pitr2->p4()).M();
195 double dilepPt = (pitr1->p4()+pitr2->p4()).Pt();
196
197 if (MinMass_PTZ < invMass && invMass < MaxMass_PTZ) {
198 if (dilepPt > PtZ) PtZ = dilepPt;
199 }
200 }
201 }
202 }
203 }
204 }
205 }
206 genFiltPTZ = PtZ;
207
208
209
213 return StatusCode::FAILURE;
214 }
215 genFiltFatJ=0.;
216 for (const auto *const j : *truthjets10) {
217 if (j->pt()>genFiltFatJ) genFiltFatJ=j->pt();
218 }
219
220
221 return StatusCode::SUCCESS;
222 }
static bool isFromWZTau(unsigned int orig)
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
bool isZeroEnergyPhoton(const T &p)
Identify a photon with zero energy. Probably a workaround for a generator bug.
bool isSpecialNonInteracting(const T &p)
Identify a special non-interacting particles.
bool isElectron(const T &p)
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
double invMass(const I4Momentum &pA, const I4Momentum &pB)
invariant mass from two I4momentum references
TruthParticle_v1 TruthParticle
Typedef to implementation.