4 #include <Math/GenVector/PxPyPzE4D.h>
6 #include <HepMC/GenEvent.h>
7 #include <HepMC/GenParticle.h>
8 #include <HepMC/GenVertex.h>
18 partonicFinalState(
false),
19 onlyHardProcess(
false),
20 excludeResonances(
false),
27 partonicFinalState(params.getParameter<bool>(
"partonicFinalState")),
28 onlyHardProcess(params.getParameter<bool>(
"onlyHardProcess")),
29 excludeResonances(
false),
30 tausAsJets(params.getParameter<bool>(
"tausAsJets")),
33 if (params.
exists(
"ignoreParticleIDs"))
36 "ignoreParticleIDs"));
37 if (params.
exists(
"excludedResonances"))
40 "excludedResonances"));
41 if (params.
exists(
"excludedFromResonances"))
44 "excludedFromResonances"));
52 const std::vector<unsigned int> &particleIDs)
59 const std::vector<unsigned int> &particleIDs)
67 const std::vector<unsigned int> &particleIDs)
75 pdgId = (pdgId > 0 ? pdgId : -
pdgId) % 10000;
76 return (pdgId > 0 && pdgId < 6) || pdgId == 7 ||
77 pdgId == 9 || (
tausAsJets && pdgId == 15) || pdgId == 21;
84 pdgId = (pdgId > 0 ? pdgId : -
pdgId) % 10000;
85 return (pdgId > 100 && pdgId < 900) ||
86 (pdgId > 1000 && pdgId < 9000);
91 unsigned int absId = (
unsigned int)(
id > 0 ?
id : -
id);
92 std::vector<unsigned int>::const_iterator
pos =
93 std::lower_bound(list.begin(), list.end(), absId);
94 return pos != list.end() && *pos == absId;
101 pdgId = (pdgId > 0 ? pdgId : -
pdgId) % 10000;
102 return (pdgId > 21 && pdgId <= 39) || pdgId == 6 || pdgId == 8;
124 std::vector<const HepMC::GenVertex*>::const_iterator
pos =
125 std::lower_bound(hardProcess.begin(),
126 hardProcess.end(), vertex);
127 return pos != hardProcess.end() && *pos == vertex;
133 JetInput::ParticleVector::const_iterator
pos =
134 std::lower_bound(p.begin(), p.end(), particle);
135 if (pos == p.end() || *pos != particle)
137 <<
"HepMC::GenEvent corrupted: Unlisted particles"
138 " in decay tree." << std::endl;
140 return pos - p.begin();
145 const HepMC::GenVertex *
v)
150 for(HepMC::GenVertex::particles_out_const_iterator iter =
151 v->particles_out_const_begin();
152 iter != v->particles_out_const_end(); ++iter) {
153 unsigned int idx =
partIdx(p, *iter);
160 const HepMC::GenVertex *v = (*iter)->end_vertex();
167 const HepMC::GenVertex *
v)
const
172 for(HepMC::GenVertex::particles_out_const_iterator iter =
173 v->particles_out_const_begin();
174 iter != v->particles_out_const_end(); ++iter) {
175 unsigned int idx =
partIdx(p, *iter);
185 const HepMC::GenVertex *v = (*iter)->end_vertex();
206 unsigned int idx =
partIdx(p, particle);
211 const HepMC::GenVertex *
v = particle->production_vertex();
217 for(HepMC::GenVertex::particles_in_const_iterator iter =
218 v->particles_in_const_begin();
219 iter != v->particles_in_const_end(); ++iter)
229 const HepMC::GenVertex *signalVertex)
const
231 unsigned int idx =
partIdx(p, particle);
236 const HepMC::GenVertex *
v = particle->production_vertex();
239 else if (v == signalVertex)
242 for(HepMC::GenVertex::particles_in_const_iterator iter =
243 v->particles_in_const_begin();
244 iter != v->particles_in_const_end(); ++iter)
255 const HepMC::GenVertex *signalVertex,
258 unsigned int idx =
partIdx(p, particle);
259 int id = particle->pdg_id();
270 const HepMC::GenVertex *
v = particle->production_vertex();
278 for(HepMC::GenVertex::particles_in_const_iterator iter =
279 v->particles_in_const_begin();
280 iter != v->particles_in_const_end(); ++iter) {
283 signalVertex, hardProcess);
288 if ((*iter)->pdg_id() ==
id)
301 const HepMC::GenEvent *
event)
const
303 if (!event->signal_process_vertex())
305 <<
"HepMC event is lacking signal vertex."
309 std::pair<HepMC::GenParticle*,HepMC::GenParticle*> beamParticles =
310 event->beam_particles();
311 toLookAt.push_back(event->signal_process_vertex());
312 while(!toLookAt.empty()) {
313 std::vector<const HepMC::GenVertex*>
next;
314 for(std::vector<const HepMC::GenVertex*>::const_iterator
v =
315 toLookAt.begin();
v != toLookAt.end(); ++
v) {
320 for(HepMC::GenVertex::particles_in_const_iterator iter =
321 (*v)->particles_in_const_begin();
322 iter != (*v)->particles_in_const_end(); ++iter) {
323 if (*iter == beamParticles.first ||
324 *iter == beamParticles.second) {
332 hardProcess.push_back(*
v);
333 std::sort(hardProcess.begin(), hardProcess.end());
335 for(HepMC::GenVertex::particles_in_const_iterator iter =
336 (*v)->particles_in_const_begin();
337 iter != (*v)->particles_in_const_end(); ++iter) {
338 const HepMC::GenVertex *pv =
339 (*iter)->production_vertex();
346 std::sort(toLookAt.begin(), toLookAt.end());
350 for(HepMC::GenEvent::particle_const_iterator iter = event->particles_begin();
351 iter !=
event->particles_end(); ++iter)
352 particles.push_back(*iter);
354 std::sort(particles.begin(), particles.end());
355 unsigned int size = particles.size();
360 for(
unsigned int i = 0;
i <
size;
i++) {
364 if (particle->status() == 1)
368 if (!particle->end_vertex() &&
369 particle->status() != 1)
376 particle->end_vertex());
382 particle, hardProcess) &&
388 for(
unsigned int i = 0;
i <
size;
i++) {
390 if (!selected[
i] || invalid[
i])
395 event->signal_process_vertex(),
404 if (particle->momentum().perp() >=
ptMin)
405 result.push_back(particle);
T getParameter(std::string const &) const
static unsigned int partIdx(const JetInput::ParticleVector &p, const HepMC::GenParticle *particle)
static bool isContained(const std::vector< unsigned int > &list, int id)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
static void invalidateTree(JetInput::ParticleBitmap &invalid, const JetInput::ParticleVector &p, const HepMC::GenVertex *v)
tuple size
Write out results.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run