9 #include "CaloEvent/CaloClusterContainer.h"
12 #include <TLorentzVector.h>
18 m_min(mMin), m_max(mMax) {
22 const std::unique_ptr<ITrigJetHypoInfoCollector>& collector)
const {
25 ip->getAttribute(
"EMFrac",jetEMF);
28 else LR= log10(
double(1./jetEMF - 1.));
32 bool pass = LR >
m_max;
35 auto jetPhi=
ip->phi();
36 auto jetEta=
ip->eta();
39 size_t nClusters = (*
ip->xAODJet())->numConstituents();
40 double clusterPU_sumEEM = 0;
double clusterPU_sumE = 0;
41 for (
size_t clust = 0; clust < nClusters; clust++) {
43 if (not aCluster)
continue;
54 if (lambda > 500)
continue;
55 double d_eta = aCluster->rawEta() - jetEta;
57 double d_R2 = d_eta*d_eta + d_phi*d_phi;
59 if (d_R2 < 0.15*0.15)
continue;
60 clusterPU_sumEEM+=clusEEM/1000.;
61 clusterPU_sumE+=aCluster->rawE()/1000.;
63 double jetEEM_EMscale = 0;
double jetE_EMscale = 0;
64 std::vector<double> samplingEnergy = (*
ip->xAODJet())->getAttribute<std::vector<double> >(
"EnergyPerSampling");
66 for(
size_t s=0;
s<samplingEnergy.size();
s++) {
67 double samplingE = 0.001*(samplingEnergy.at(
s));
68 if (
s < 8 || (
s > 20 &&
s < 28) ) jetEEM_EMscale+=samplingE;
69 jetE_EMscale+=samplingE;
72 else jetEMF = (jetEEM_EMscale - clusterPU_sumEEM)/(jetE_EMscale - clusterPU_sumE);
75 else {LR = log10(
double(1./jetEMF - 1.));
84 const void*
address =
static_cast<const void*
>(
this);
86 std::stringstream ss0;
87 ss0 <<
"PileupRemovalCondition: (" <<
address <<
") "
88 <<
" LR desired cut, LR necessary cut to start pileup removal algo " <<
m_max<<
","<<
m_min
89 <<
" pass: " << std::boolalpha << pass <<
'\n';
91 auto j_addr =
static_cast<const void*
>(
ip.get());
92 std::stringstream ss1;
93 ss1 <<
" jet : ("<< j_addr <<
")"
94 " LR desired cut, LR necessary cut to start pileup removal algo " <<
m_max<<
","<<
m_min<<
'\n';
96 collector->
collect(ss0.str(), ss1.str());
105 const std::unique_ptr<ITrigJetHypoInfoCollector>&
c)
const {
112 std::stringstream
ss;
113 ss <<
"PileupRemovalCondition (" <<
this <<
") "
114 <<
" LR thresh, LRcorr thresh "