29 deltaEt_min = iConfig.
getParameter<
double>(
"minDeltaEt");
30 deltaEt_max = iConfig.
getParameter<
double>(
"maxDeltaEt");
48 const candidateCollection *truth_candidates;
49 const candidateCollection *reco_candidates;
57 bool isGen = iEvent.
getByToken(inputTruthLabel_, truth_hnd);
59 std::cout <<
"Warning : no Gen jets in input !" << std::endl;
63 truth_candidates = truth_hnd.
product();
67 bool isReco = iEvent.
getByToken(inputRecoLabel_, reco_hnd);
69 std::cout <<
"Warning : no Reco jets in input !" << std::endl;
72 reco_candidates = reco_hnd.
product();
73 if (!truth_candidates || !reco_candidates)
78 for (
unsigned int i = 0;
i < reco_candidates->size();
i++) {
82 assert(particle !=
nullptr);
84 double rec_pt = particle->
pt();
85 double rec_eta = particle->
eta();
86 double rec_phi = particle->
phi();
89 if (rec_pt < recPt_cut)
107 if (!Barrel && !Endcap)
113 for (
unsigned int j = 0; j < reco_candidates->size(); j++) {
117 double deltaR = algo_->deltaR(particle, other);
118 if (deltaR < deltaRmin && other->
pt() > 0.25 * particle->
pt() && other->
pt() > recPt_cut) {
122 if (deltaRmin < deltaR_min)
125 if (deltaRmin < deltaR_min)
129 const reco::Candidate *gen_particle = algo_->matchByDeltaR(particle, truth_candidates);
132 if (gen_particle ==
nullptr)
136 double deltaR = algo_->deltaR(particle, gen_particle);
137 if (deltaR > deltaR_max)
141 double true_pt = gen_particle->
pt();
142 double true_eta = gen_particle->
eta();
143 double true_phi = gen_particle->
phi();
146 if (true_pt < genPt_cut)
150 double resPt = (rec_pt - true_pt) / true_pt;
152 double avera = response(true_pt, Barrel);
153 double nSig = (resPt - avera) / sigma;
155 if (nSig > deltaEt_max || nSig < deltaEt_min) {
158 std::cout <<
"Entry " <<
entry <<
" resPt = " << resPt <<
" sigma/avera/nSig = " << sigma <<
"/" << avera <<
"/" 159 << nSig <<
" pT (T/R) " << true_pt <<
"/" << rec_pt <<
" Eta (T/R) " << true_eta <<
"/" << rec_eta
160 <<
" Phi (T/R) " << true_phi <<
"/" << rec_phi <<
" deltaRMin/ptmin " << deltaRmin <<
"/" << ptmin
175 double p0 = barrel ? 1.19200e-02 : 8.45341e-03;
176 double p1 = barrel ? 1.06138e+00 : 7.96855e-01;
177 double p2 = barrel ? -2.05929e+00 : -3.12076e-01;
179 double resp = p0 + p1 /
sqrt(pt) + p2 /
pt;
184 double p0 = barrel ? 1.09906E-1 : 6.91939E+1;
185 double p1 = barrel ? -1.61443E-1 : -6.92733E+1;
186 double p2 = barrel ? 3.45489E+3 : 1.58207E+6;
188 double resp = p0 + p1 *
std::exp(-pt / p2);
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double response(double, bool)
deltaRmin
maximum deltaR of track to jet.
Abs< T >::type abs(const T &t)
PFJetFilter(const edm::ParameterSet &)
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
virtual double eta() const =0
momentum pseudorapidity
T const * product() const
virtual double pt() const =0
transverse momentum
bool filter(edm::Event &, const edm::EventSetup &) override
virtual double phi() const =0
momentum azimuthal angle
double resolution(double, bool)