35 : functionmap_(), ptResol_(nullptr), phiResol_(nullptr) {
43 const double &
eta)
const {
55 const double &
p)
const {
66 double eta = candidate->
eta();
67 double phi = candidate->
phi();
75 name =
"PFChargedHadron";
91 name =
"PFNeutralHadron";
107 double d_et = 0, d_phi = 0;
110 d_phi =
et * trackRef->phiError();
111 d_et = (
type == 2) ? ElectronPtResolution(candidate) : trackRef->ptError();
114 d_et = eval(thetype,
ET,
et, phi,
eta);
115 d_phi = eval(thetype,
PHI,
et, phi,
eta);
124 double jphi =
jet->phi();
126 double jdeltapt = 999.;
127 double jdeltapphi = 999.;
129 if (
jpt < ptResolThreshold_ &&
jpt < 20.) {
132 int ipt =
jpt > 3. ?
int(
jpt - 3. / 2) : 0;
133 jdeltapt = jdpt[
ieta][ipt];
134 jdeltapphi =
jpt * jdphi[
ieta][ipt];
141 double jptForEval =
jpt > ptResolThreshold_ ?
jpt : ptResolThreshold_;
142 jdeltapt =
jpt * ptResol_->parameterEtaEval(
"sigma",
jeta, jptForEval);
143 jdeltapphi =
jpt * phiResol_->parameterEtaEval(
"sigma",
jeta, jptForEval);
158 ptResolThreshold_ = iConfig.
getParameter<
double>(
"ptresolthreshold");
171 std::vector<double> ebet = iConfig.
getParameter<std::vector<double> >(
"EB_EtResPar");
172 std::vector<double> ebphi = iConfig.
getParameter<std::vector<double> >(
"EB_PhiResPar");
174 etparameters[0] = ebet[0];
175 etparameters[1] = ebet[1];
176 etparameters[2] = ebet[2];
177 phiparameters[0] = ebphi[0];
178 addfunction(
caloEB,
ET, etparameters);
181 std::vector<double> eeet = iConfig.
getParameter<std::vector<double> >(
"EE_EtResPar");
182 std::vector<double> eephi = iConfig.
getParameter<std::vector<double> >(
"EE_PhiResPar");
184 etparameters[0] = eeet[0];
185 etparameters[1] = eeet[1];
186 etparameters[2] = eeet[2];
187 phiparameters[0] = eephi[0];
188 addfunction(
caloEE,
ET, etparameters);
191 std::vector<double> hbet = iConfig.
getParameter<std::vector<double> >(
"HB_EtResPar");
192 std::vector<double> hbphi = iConfig.
getParameter<std::vector<double> >(
"HB_PhiResPar");
194 etparameters[0] = hbet[0];
195 etparameters[1] = hbet[1];
196 etparameters[2] = hbet[2];
197 phiparameters[0] = hbphi[0];
198 addfunction(
caloHB,
ET, etparameters);
201 std::vector<double> heet = iConfig.
getParameter<std::vector<double> >(
"HE_EtResPar");
202 std::vector<double> hephi = iConfig.
getParameter<std::vector<double> >(
"HE_PhiResPar");
204 etparameters[0] = heet[0];
205 etparameters[1] = heet[1];
206 etparameters[2] = heet[2];
207 phiparameters[0] = hephi[0];
208 addfunction(
caloHE,
ET, etparameters);
211 std::vector<double> hoet = iConfig.
getParameter<std::vector<double> >(
"HO_EtResPar");
212 std::vector<double> hophi = iConfig.
getParameter<std::vector<double> >(
"HO_PhiResPar");
214 etparameters[0] = hoet[0];
215 etparameters[1] = hoet[1];
216 etparameters[2] = hoet[2];
217 phiparameters[0] = hophi[0];
218 addfunction(
caloHO,
ET, etparameters);
221 std::vector<double> hfet = iConfig.
getParameter<std::vector<double> >(
"HF_EtResPar");
222 std::vector<double> hfphi = iConfig.
getParameter<std::vector<double> >(
"HF_PhiResPar");
224 etparameters[0] = hfet[0];
225 etparameters[1] = hfet[1];
226 etparameters[2] = hfet[2];
227 phiparameters[0] = hfphi[0];
228 addfunction(
caloHF,
ET, etparameters);
233 std::vector<double> pf1et = iConfig.
getParameter<std::vector<double> >(
"PF_EtResType1");
234 std::vector<double> pf1phi = iConfig.
getParameter<std::vector<double> >(
"PF_PhiResType1");
235 etparameters[0] = pf1et[0];
236 etparameters[1] = pf1et[1];
237 etparameters[2] = pf1et[2];
238 phiparameters[0] = pf1phi[0];
244 std::vector<double> pf2et = iConfig.
getParameter<std::vector<double> >(
"PF_EtResType2");
245 std::vector<double> pf2phi = iConfig.
getParameter<std::vector<double> >(
"PF_PhiResType2");
246 etparameters[0] = pf2et[0];
247 etparameters[1] = pf2et[1];
248 etparameters[2] = pf2et[2];
249 phiparameters[0] = pf2phi[0];
255 std::vector<double> pf3et = iConfig.
getParameter<std::vector<double> >(
"PF_EtResType3");
256 std::vector<double> pf3phi = iConfig.
getParameter<std::vector<double> >(
"PF_PhiResType3");
257 etparameters[0] = pf3et[0];
258 etparameters[1] = pf3et[1];
259 etparameters[2] = pf3et[2];
260 phiparameters[0] = pf3phi[0];
266 std::vector<double> pf4et = iConfig.
getParameter<std::vector<double> >(
"PF_EtResType4");
267 std::vector<double> pf4phi = iConfig.
getParameter<std::vector<double> >(
"PF_PhiResType4");
268 etparameters[0] = pf4et[0];
269 etparameters[1] = pf4et[1];
270 etparameters[2] = pf4et[2];
277 std::vector<double> pf5et = iConfig.
getParameter<std::vector<double> >(
"PF_EtResType5");
278 std::vector<double> pf5phi = iConfig.
getParameter<std::vector<double> >(
"PF_PhiResType5");
279 etparameters[0] = pf5et[0];
280 etparameters[1] = pf5et[1];
281 etparameters[2] = pf5et[2];
282 phiparameters[0] = pf5phi[0];
288 std::vector<double> pf6et = iConfig.
getParameter<std::vector<double> >(
"PF_EtResType6");
289 std::vector<double> pf6phi = iConfig.
getParameter<std::vector<double> >(
"PF_PhiResType6");
290 etparameters[0] = pf6et[0];
291 etparameters[1] = pf6et[1];
292 etparameters[2] = pf6et[2];
293 phiparameters[0] = pf6phi[0];
299 std::vector<double> pf7et = iConfig.
getParameter<std::vector<double> >(
"PF_EtResType7");
300 std::vector<double> pf7phi = iConfig.
getParameter<std::vector<double> >(
"PF_PhiResType7");
301 etparameters[0] = pf7et[0];
302 etparameters[1] = pf7et[1];
303 etparameters[2] = pf7et[2];
304 phiparameters[0] = pf7phi[0];
324 if (functionmap_.count(mypair) == 0) {
337 return PhiConstFunction(
x,
values);
353 double result =
et *
sqrt((par[2] * par[2]) + (par[1] * par[1] /
et) + (par[0] * par[0] / (
et *
et)));
364 if (par.size() != 1 && par.size() != 3) {
366 }
else if (par.size() == 1) {
369 return et *
sqrt((par[2] * par[2]) + (par[1] * par[1] /
et) + (par[0] * par[0] / (
et *
et)));
385 if (ptResol_ ==
nullptr) {
400 double eta =
c->eta();
402 double dEnergy = pfresol_->getEnergyResolutionEm(
energy,
eta);
404 return dEnergy / cosh(
eta);
T getParameter(std::string const &) const
double EtFunction(const functionPars &x, const functionPars &par) const
void addfunction(const resolutionType type, const resolutionFunc func, const std::vector< double > ¶meters)
metsig::SigInputObj evalPFJet(const reco::Jet *jet) const
Base class for all types of Jets.
Sin< T >::type sin(const T &t)
double PFunction(const functionPars &x, const functionPars &par) const
U second(std::pair< T, U > const &p)
double theta() const final
momentum polar angle
double PhiFunction(const functionPars &x, const functionPars &par) const
metsig::SigInputObj evalPF(const reco::PFCandidate *candidate) const
bool isNull() const
Checks for null.
std::vector< double > functionPars
double eval(const resolutionType &type, const resolutionFunc &func, const double &et, const double &phi, const double &eta, const double &p) const
double ElectronPtResolution(const reco::PFCandidate *c) const
Particle reconstructed by the particle flow algorithm.
void initializeJetResolutions(const edm::ParameterSet &iConfig)
reco::TrackRef trackRef() const
const std::string & fullPath() const
double PhiConstFunction(const functionPars &x, const functionPars &par) const
double phi() const final
momentum azimuthal angle
std::pair< metsig::resolutionType, metsig::resolutionFunc > functionCombo
double getfunc(const resolutionType &type, const resolutionFunc &func, std::vector< double > &x) const
void addResolutions(const edm::ParameterSet &iConfig)
double energy() const final
energy
virtual ParticleType particleId() const
double eta() const final
momentum pseudorapidity