12 #pragma GCC diagnostic push
13 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
29 #include <HepMC/GenEvent.h>
30 #include <HepMC/GenVertex.h>
31 #include <HepMC/GenParticle.h>
37 #pragma GCC diagnostic pop
41 using namespace findNode;
45 namespace SColdQcdCorrelatorAnalysis {
46 namespace SCorrelatorUtilities {
53 int pid = numeric_limits<int>::max();
54 int status = numeric_limits<int>::max();
55 int barcode = numeric_limits<int>::max();
56 int embedID = numeric_limits<int>::max();
57 float charge = numeric_limits<float>::max();
58 double mass = numeric_limits<double>::max();
59 double eta = numeric_limits<double>::max();
60 double phi = numeric_limits<double>::max();
61 double ene = numeric_limits<double>::max();
62 double px = numeric_limits<double>::max();
63 double py = numeric_limits<double>::max();
64 double pz = numeric_limits<double>::max();
65 double pt = numeric_limits<double>::max();
66 double vx = numeric_limits<double>::max();
67 double vy = numeric_limits<double>::max();
68 double vz = numeric_limits<double>::max();
69 double vr = numeric_limits<double>::max();
72 pid = particle -> pdg_id();
74 barcode = particle -> barcode();
85 vx = particle -> production_vertex() ->
position().x();
86 vy = particle -> production_vertex() ->
position().y();
87 vz = particle -> production_vertex() ->
position().z();
93 pid = numeric_limits<int>::max();
94 status = numeric_limits<int>::max();
95 barcode = numeric_limits<int>::max();
96 embedID = numeric_limits<int>::max();
97 charge = numeric_limits<float>::max();
98 mass = numeric_limits<double>::max();
99 eta = numeric_limits<double>::max();
100 phi = numeric_limits<double>::max();
101 ene = numeric_limits<double>::max();
102 px = numeric_limits<double>::max();
103 py = numeric_limits<double>::max();
104 pz = numeric_limits<double>::max();
105 pt = numeric_limits<double>::max();
106 vx = numeric_limits<double>::max();
107 vy = numeric_limits<double>::max();
108 vz = numeric_limits<double>::max();
109 vr = numeric_limits<double>::max();
114 vector<string> members = {
140 const bool isLessThan = (
157 const bool isGreaterThan = (
166 return isGreaterThan;
179 SetInfo(particle, event);
190 PHHepMCGenEventMap* mapMcEvts = getClass<PHHepMCGenEventMap>(topNode,
"PHHepMCGenEventMap");
193 <<
"PANIC: HEPMC event map node is missing!"
209 <<
"PANIC: Couldn't grab mc event!"
222 HepMC::GenEvent* genEvt = mcEvt -> getEvent();
225 <<
"PANIC: Couldn't grab HepMC event!"
239 return mcEvt -> get_embedding_id();
247 return ((particle >= minimum) && (particle <= maximum));
255 return (status == 1);
263 return ((status == HardScatterStatus::First) || (status == HardScatterStatus::Second));
271 const bool isLightQuark = ((pid == Parton::Down) || (pid == Parton::Up));
272 const bool isStrangeQuark = ((pid == Parton::Strange) || (pid == Parton::Charm));
273 const bool isHeavyQuark = ((pid == Parton::Bottom) || (pid == Parton::Top));
274 const bool isGluon = (pid == Parton::Gluon);
275 return (isLightQuark || isStrangeQuark || isHeavyQuark || isGluon);
284 const int pid = par -> pdg_id();
289 return isOutgoingParton;
298 float charge = MapPidOntoCharge[abs(pid)];
313 vector<int> subevents;
318 itEvt != mcEvtMap ->
end();
323 const int embedID = itEvt -> second -> get_embedding_id();
326 bool addToList =
false;
327 if (evtsToGrab.has_value()) {
328 for (
const int idToCheck : evtsToGrab.value()) {
329 if (embedID == idToCheck) {
339 if (addToList) subevents.push_back(embedID);
347 bool IsSubEvtGood(
const int embedID,
const int option,
const bool isEmbed) {
350 int signalID = SubEvt::NotEmbedSignal;
352 signalID = SubEvt::EmbedSignal;
355 bool isSubEvtGood =
true;
359 case SubEvtOpt::Everything:
364 case SubEvtOpt::OnlySignal:
365 isSubEvtGood = (embedID == signalID);
369 case SubEvtOpt::AllBkgd:
370 isSubEvtGood = (embedID <= SubEvt::Background);
374 case SubEvtOpt::PrimaryBkgd:
375 isSubEvtGood = (embedID == SubEvt::Background);
379 case SubEvtOpt::Pileup:
380 isSubEvtGood = (embedID < SubEvt::Background);
396 bool isSubEvtGood =
false;
397 for (
const int evtToUse : subEvtsToUse) {
398 if (embedID == evtToUse) {