28 double sumpTisolation(
const HEP::P4 &p4,
const HEP::Event* evt,
const double &DR);
31 double sumETIsolation(
const HEP::P4 &p4,
const HEP::Event* evt,
const double &DR);
37 double coneAreaApprox(
const HEP::P4 &p4,
const double &DR);
48 const double DeltaRp,
const double DeltaRE,
const double pratio,
const double Eratio);
71 template<
typename T1> std::vector<T1*> filterObjects(std::vector<T1*> &vec_t1,
const double &pTmin,
const double &absEtaMax)
74 std::vector<T1*> result;
78 if( (t1->pT() > pTmin) && (t1->abseta() < absEtaMax))
98 template<
typename T1> std::vector<T1*> filterObjects(std::vector<T1*> &vec_t1,
const double &pTmin,
const double &absEtaMax,
const HEP::Event* evt,std::mt19937 &engine,
bool (*select_condition)(T1*,
const HEP::Event*, std::mt19937&))
101 std::vector<T1*> result;
103 for(
auto t1 : vec_t1)
105 if( (t1->pT() > pTmin) && (t1->abseta() < absEtaMax))
110 if(select_condition(t1,evt,engine))
112 result.push_back(t1);
129 template<
typename T1> std::vector<T1*> filterObjects(std::vector<T1*> &vec_t1,
const HEP::Event* evt,std::mt19937 &engine,
bool (*select_condition)(T1*,
const HEP::Event*, std::mt19937&) )
132 std::vector<T1*> result;
134 for(
auto t1 : vec_t1)
137 if(select_condition(t1,evt,engine))
139 result.push_back(t1);
153 template<
typename T1>
void filterPhaseSpace(std::vector<T1*> &vec_t1,
const double &pTmin,
const double &absEtaMax)
158 auto it = vec_t1.begin();
159 while(it != vec_t1.end())
163 if( ((*it)->pT() < pTmin ) || ((*it)->abseta() > absEtaMax))
165 it = vec_t1.erase(it);
177 template<
typename T1>
void delete_and_filterPhaseSpace(std::vector<T1*> &vec_t1,
const double &pTmin,
const double &absEtaMax)
181 std::vector<T1*> out_vector;
182 for(
auto t1 : vec_t1)
184 if( (t1->pT() < pTmin ) || (t1->abseta() > absEtaMax))
190 out_vector.push_back(t1);
213 template<
typename T1,
typename T2> std::vector<T1*> FullRemoval(std::vector<T1*> &v1, std::vector<T2*> &v2,
const double &drmin)
217 std::vector<bool> mask(v1.size(),
false);
219 for (
unsigned int j=0;j<v1.size();j++)
221 for (
unsigned int i=0; !mask[j] && i<v2.size();i++)
223 if (v2[i]->mom().
deltaR_eta(v1[j]->mom()) < drmin)
231 std::vector<T1*> cleaned_v1;
232 for (
unsigned int i=0;i<v1.size();i++)
235 cleaned_v1.push_back(v1[i]);
250 template<
typename T1,
typename T2> std::vector<T1*>
251 Removal(std::vector<T1*> &v1, std::vector<T2*> &v2,
256 std::vector<bool> mask(v1.size(),
false);
258 for (
unsigned int j=0;j<v1.size();j++)
260 for (
unsigned int i=0; !mask[j] && i<v2.size();i++)
262 if (v2[i]->mom().
deltaR_eta(v1[j]->mom()) < drmin)
270 std::vector<T1*> cleaned_v1;
271 for (
unsigned int i=0;i<v1.size();i++)
272 if (!mask[i]) cleaned_v1.push_back(v1[i]);
280 template<
typename T1,
typename T2> std::vector<T1*>
281 Removal(std::vector<T1*> &v1, std::vector<T2*> &v2,
282 const double &drmin,
bool (*special_condition)(T1*,T2*))
286 std::vector<bool> mask(v1.size(),
false);
288 for (
unsigned int j=0;j<v1.size();j++)
290 for (
unsigned int i=0; !mask[j] && i<v2.size();i++)
292 if (special_condition(v1[j],v2[i]) && (v2[i]->mom().
deltaR_eta(v1[j]->mom()) < drmin))
300 std::vector<T1*> cleaned_v1;
301 for (
unsigned int i=0;i<v1.size();i++)
302 if (!mask[i]) cleaned_v1.push_back(v1[i]);
312 template<
typename T1> std::vector<T1*> SelfRemoval(std::vector<T1*> &v1,
const double &drmin)
316 std::vector<bool> mask(v1.size(),
false);
319 for (
unsigned int j=0;j<v1.size();j++){
320 for (
unsigned int i=j+1;i<v1.size();i++) {
322 tdr=v1[i]->mom().deltaR_eta(v1[j]->mom());
325 if(v1[i]->mom().pT() < v1[j]->mom().pT())
340 std::vector<T1*> cleaned_v1;
341 for (
unsigned int i=0;i<v1.size();i++)
342 if (!mask[i]) cleaned_v1.push_back(v1[i]);
350 template<
typename T1,
typename T2> std::vector<T1*>
351 RemovalJE(std::vector<T1*> &v1, std::vector<T2*> &v2)
355 std::vector<bool> mask(v1.size(),
false);
356 for (
unsigned int j=0;j<v1.size();j++)
360 if(drmin > 0.4) drmin=0.4;
362 for (
unsigned int i=0;!mask[j] && i<v2.size();i++)
363 if (v2[i]->mom().
deltaR_eta(v1[j]->mom()) < drmin)
371 std::vector<T1*> cleaned_v1;
372 for (
unsigned int i=0;i<v1.size();i++)
373 if (!mask[i]) cleaned_v1.push_back(v1[i]);
397 bool BTag70DL1r_ATLAS_Run2(
const HEP::Jet* jet,
const HEP::Event* event, std::mt19937& engine);
Simple event class, separating particles into classes.
Definition: heputil.h:227
A 4-momentum class for vectors.
Definition: Vectors.h:45
Definition: Particle.h:24
double deltaR_eta(const P4 &a, const P4 &b)
Difference in pseudorapidity-based R between two vectors.
Definition: Vectors.h:618