You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (deltaR < drMin) // check if particle is within drMin of photon, for isolation
57
+
{
58
+
particles_pt.push_back((*q)->momentum().perp());
59
+
particles_deltar.push_back(deltaR);
60
+
}
61
+
}
62
+
}
63
+
}
64
+
//order particles_pt and particles_deltar according to increasing particles_deltar
65
+
for (unsignedint i = 0; i < particles_deltar.size(); i++)
66
+
{
67
+
for (unsignedint j = i + 1; j < particles_deltar.size(); j++)
68
+
{
69
+
if (particles_deltar[i] > particles_deltar[j])
70
+
{
71
+
double temp = particles_deltar[i];
72
+
particles_deltar[i] = particles_deltar[j];
73
+
particles_deltar[j] = temp;
74
+
temp = particles_pt[i];
75
+
particles_pt[i] = particles_pt[j];
76
+
particles_pt[j] = temp;
54
77
}
55
78
}
56
79
}
57
-
if (accepted_photon)
58
-
returntrue;
80
+
//calculate frixione isolation
81
+
double total_pt = 0;
82
+
for (unsignedint i = 0; i < particles_deltar.size(); i++)
83
+
{
84
+
total_pt += particles_pt[i];
85
+
if (total_pt > frixione_isolation_coefficient * (1 - cos(particles_deltar[i])))
86
+
{
87
+
good_photon = false; // if for some delta R the isolation condition is not satisfied, the photon is not good
88
+
break;
89
+
}
90
+
}
91
+
if (good_photon){
92
+
if (hasAncestor(*p,[](int x){return x == 11 || x == 13 || x ==15;}) || hasAncestor(*p,[](int x){return x == 24 || x == 5;},true,false)) { // check if photon is from decay and defines the event as acceptable
93
+
accepted_event = true;
94
+
}
95
+
if (!hasAncestor(*p,[](int x){return x == 11 || x == 13 || x ==15;}) && hasAncestor(*p,[](int x){return x == 24 || x == 5;},false,true)) { // check if photon comes from the hard process and discards it, in case it is
96
+
returnfalse;
97
+
}
98
+
}
59
99
}
60
100
}
61
101
}
62
102
63
103
// Implementation for event filtering
64
-
returnfalse; //Return true if event passes the filter, false otherwise
104
+
returnaccepted_event; //Accept if it has found at least one good photon from decay and none from hard process
boolPhotonGenFilter::hasAncestor(HepMC::GenParticle* particle, function<bool(int)> check,bool isWorBFromDecayCheck,bool isWorBPromptCheck) const { // function to check if a particle has a certain ancestor
returnhasAncestor(*parent,[](int x){return x == 6;},false,false); // if the photon has a W or b quark ancestor, check if it comes from a top quark
137
+
}
138
+
elseif (isWorBPromptCheck) {
139
+
return !hasAncestor(*parent,[](int x){return x == 6;},false,false); // if the photon has a W or b quark ancestor, check that it doesn't come from a top quark decay (therefore it comes form the hard process)
140
+
}
141
+
elsereturntrue;
142
+
}
143
+
144
+
returnhasAncestor(*parent, check,isWorBFromDecayCheck,isWorBPromptCheck); // Recursively check the ancestry of the parent
0 commit comments