45 double p = et /
sin(theta);
46 return eval(type,func,et,phi,eta,p);
58 return getfunc(type,func,x);
63 double eta = candidate->
eta();
64 double phi = candidate->
phi();
72 thetype=
PFtype1;name=
"PFChargedHadron";
break;
74 thetype=
PFtype2;name=
"PFChargedEM";
break;
76 thetype=
PFtype3;name=
"PFMuon";
break;
78 thetype=
PFtype4;name=
"PFNeutralEM";
break;
80 thetype=
PFtype5;name=
"PFNeutralHadron";
break;
82 thetype=
PFtype6;name=
"PFtype6";
break;
84 thetype=
PFtype7;name=
"PFtype7";
break;
86 thetype=
PFtype7;name=
"PFunknown";
break;
89 double d_et=0, d_phi=0;
91 if(!trackRef.
isNull() && type!=2){
92 d_et = trackRef->ptError();
93 d_phi = et*trackRef->phiError();
96 d_et = eval(thetype,
ET,et,phi,eta);
97 d_phi = eval(thetype,
PHI,et,phi,eta);
108 double jpt = jet->
pt();
109 double jphi = jet->
phi();
110 double jeta = jet->
eta();
111 double jdeltapt = 999.;
112 double jdeltapphi = 999.;
114 if(jpt<ptResolThreshold_ && jpt<20.){
115 double feta = TMath::Abs(jeta);
116 int ieta = feta<5.? int(feta/0.5) : 9;
117 int ipt = jpt>3. ? int(jpt-3./2) : 0;
118 jdeltapt = jdpt[ieta][ipt];
119 jdeltapphi = jpt*jdphi[ieta][ipt];
122 TF1* fPtEta = ptResol_->parameterEta(
"sigma",jeta);
123 TF1* fPhiEta = phiResol_->parameterEta(
"sigma",jeta);
124 jdeltapt = jpt>ptResolThreshold_ ? jpt*fPtEta->Eval(jpt) : jpt*fPtEta->Eval(ptResolThreshold_);
125 jdeltapphi = jpt>ptResolThreshold_ ? jpt*fPhiEta->Eval(jpt) : jpt*fPhiEta->Eval(ptResolThreshold_);
130 std::string inputtype =
"jet";
143 ptResolThreshold_ = iConfig.
getParameter<
double>(
"ptresolthreshold");
147 for (
int ieta=0; ieta<10; ieta++){
148 jdpt[ieta] = iConfig.
getParameter<std::vector<double> >(Form(
"jdpt%d", ieta));
149 jdphi[ieta] = iConfig.
getParameter<std::vector<double> >(Form(
"jdphi%d", ieta));
158 std::vector<double> ebet = iConfig.
getParameter<std::vector<double> >(
"EB_EtResPar");
159 std::vector<double> ebphi = iConfig.
getParameter<std::vector<double> >(
"EB_PhiResPar");
161 etparameters[0]=ebet[0];
162 etparameters[1]=ebet[1];
163 etparameters[2]=ebet[2];
164 phiparameters[0]=ebphi[0];
165 addfunction(
caloEB,
ET,etparameters);
168 std::vector<double> eeet = iConfig.
getParameter<std::vector<double> >(
"EE_EtResPar");
169 std::vector<double> eephi = iConfig.
getParameter<std::vector<double> >(
"EE_PhiResPar");
171 etparameters[0]=eeet[0];
172 etparameters[1]=eeet[1];
173 etparameters[2]=eeet[2];
174 phiparameters[0]=eephi[0];
175 addfunction(
caloEE,
ET,etparameters);
178 std::vector<double> hbet = iConfig.
getParameter<std::vector<double> >(
"HB_EtResPar");
179 std::vector<double> hbphi = iConfig.
getParameter<std::vector<double> >(
"HB_PhiResPar");
181 etparameters[0]=hbet[0];
182 etparameters[1]=hbet[1];
183 etparameters[2]=hbet[2];
184 phiparameters[0]=hbphi[0];
185 addfunction(
caloHB,
ET,etparameters);
188 std::vector<double> heet = iConfig.
getParameter<std::vector<double> >(
"HE_EtResPar");
189 std::vector<double> hephi = iConfig.
getParameter<std::vector<double> >(
"HE_PhiResPar");
191 etparameters[0]=heet[0];
192 etparameters[1]=heet[1];
193 etparameters[2]=heet[2];
194 phiparameters[0]=hephi[0];
195 addfunction(
caloHE,
ET,etparameters);
198 std::vector<double> hoet = iConfig.
getParameter<std::vector<double> >(
"HO_EtResPar");
199 std::vector<double> hophi = iConfig.
getParameter<std::vector<double> >(
"HO_PhiResPar");
202 etparameters[0]=hoet[0];
203 etparameters[1]=hoet[1];
204 etparameters[2]=hoet[2];
205 phiparameters[0]=hophi[0];
206 addfunction(
caloHO,
ET,etparameters);
209 std::vector<double> hfet = iConfig.
getParameter<std::vector<double> >(
"HF_EtResPar");
210 std::vector<double> hfphi = iConfig.
getParameter<std::vector<double> >(
"HF_PhiResPar");
212 etparameters[0]=hfet[0];
213 etparameters[1]=hfet[1];
214 etparameters[2]=hfet[2];
215 phiparameters[0]=hfphi[0];
216 addfunction(
caloHF,
ET,etparameters);
222 std::vector<double> pf1et = iConfig.
getParameter<std::vector<double> >(
"PF_EtResType1");
223 std::vector<double> pf1phi = iConfig.
getParameter<std::vector<double> >(
"PF_PhiResType1");
224 etparameters[0]=pf1et[0];
225 etparameters[1]=pf1et[1];
226 etparameters[2]=pf1et[2];
227 phiparameters[0]=pf1phi[0];
233 std::vector<double> pf2et = iConfig.
getParameter<std::vector<double> >(
"PF_EtResType2");
234 std::vector<double> pf2phi = iConfig.
getParameter<std::vector<double> >(
"PF_PhiResType2");
235 etparameters[0]=pf2et[0];
236 etparameters[1]=pf2et[1];
237 etparameters[2]=pf2et[2];
238 phiparameters[0]=pf2phi[0];
244 std::vector<double> pf3et = iConfig.
getParameter<std::vector<double> >(
"PF_EtResType3");
245 std::vector<double> pf3phi = iConfig.
getParameter<std::vector<double> >(
"PF_PhiResType3");
246 etparameters[0]=pf3et[0];
247 etparameters[1]=pf3et[1];
248 etparameters[2]=pf3et[2];
249 phiparameters[0]=pf3phi[0];
255 std::vector<double> pf4et = iConfig.
getParameter<std::vector<double> >(
"PF_EtResType4");
256 std::vector<double> pf4phi = iConfig.
getParameter<std::vector<double> >(
"PF_PhiResType4");
257 etparameters[0]=pf4et[0];
258 etparameters[1]=pf4et[1];
259 etparameters[2]=pf4et[2];
266 std::vector<double> pf5et = iConfig.
getParameter<std::vector<double> >(
"PF_EtResType5");
267 std::vector<double> pf5phi = iConfig.
getParameter<std::vector<double> >(
"PF_PhiResType5");
268 etparameters[0]=pf5et[0];
269 etparameters[1]=pf5et[1];
270 etparameters[2]=pf5et[2];
271 phiparameters[0]=pf5phi[0];
277 std::vector<double> pf6et = iConfig.
getParameter<std::vector<double> >(
"PF_EtResType6");
278 std::vector<double> pf6phi = iConfig.
getParameter<std::vector<double> >(
"PF_PhiResType6");
279 etparameters[0]=pf6et[0];
280 etparameters[1]=pf6et[1];
281 etparameters[2]=pf6et[2];
282 phiparameters[0]=pf6phi[0];
289 std::vector<double> pf7et = iConfig.
getParameter<std::vector<double> >(
"PF_EtResType7");
290 std::vector<double> pf7phi = iConfig.
getParameter<std::vector<double> >(
"PF_PhiResType7");
291 etparameters[0]=pf7et[0];
292 etparameters[1]=pf7et[1];
293 etparameters[2]=pf7et[2];
294 phiparameters[0]=pf7phi[0];
313 if(functionmap_.count(mypair)==0){
320 return EtFunction(x,values);
322 return PhiFunction(x,values);
324 return PFunction(x,values);
326 return PhiConstFunction(x,values);
343 double result = et*
sqrt((par[2]*par[2])+(par[1]*par[1]/et)+(par[0]*par[0]/(et*et)));
356 if(par.size()!=1 && par.size()!=3){
359 else if(par.size()==1){
363 return et*
sqrt((par[2]*par[2])+(par[1]*par[1]/et)+(par[0]*par[0]/(et*et)));
384 if ( ptResol_ == 0 ) {
385 string resolutionsAlgo = iConfig.
getParameter<std::string>(
"resolutionsAlgo");
386 string resolutionsEra = iConfig.
getParameter<std::string>(
"resolutionsEra");
390 string path = cmssw_base +
"/src/CondFormats/JetMETObjects/data";
392 if (stat(path.c_str(),&st)!=0) {
393 path = cmssw_release_base +
"/src/CondFormats/JetMETObjects/data";
395 if (stat(path.c_str(),&st)!=0) {
396 cerr<<
"ERROR: tried to set path but failed, abort."<<endl;
398 string era(resolutionsEra);
399 string alg(resolutionsAlgo);
400 string ptFileName = path +
"/" + era +
"_PtResolution_" +alg+
".txt";
401 string phiFileName = path +
"/" + era +
"_PhiResolution_"+alg+
".txt";
T getParameter(std::string const &) const
double PhiFunction(const functionPars &x, const functionPars &par) const
double getfunc(const resolutionType &type, const resolutionFunc &func, std::vector< double > &x) const
Sin< T >::type sin(const T &t)
metsig::SigInputObj evalPF(const reco::PFCandidate *candidate) const
Geom::Theta< T > theta() const
Exp< T >::type exp(const T &t)
double eval(const resolutionType &type, const resolutionFunc &func, const double &et, const double &phi, const double &eta, const double &p) const
Jets made from PFObjects.
virtual double eta() const
momentum pseudorapidity
U second(std::pair< T, U > const &p)
virtual double energy() const
energy
bool isNull() const
Checks for null.
virtual double theta() const
momentum polar angle
double EtFunction(const functionPars &x, const functionPars &par) const
std::vector< double > functionPars
virtual double pt() const
transverse momentum
metsig::SigInputObj evalPFJet(const reco::PFJet *jet) const
Particle reconstructed by the particle flow algorithm.
void initializeJetResolutions(const edm::ParameterSet &iConfig)
double PhiConstFunction(const functionPars &x, const functionPars &par) const
virtual ParticleType particleId() const
void addfunction(const resolutionType type, const resolutionFunc func, std::vector< double > parameters)
virtual double phi() const
momentum azimuthal angle
std::pair< metsig::resolutionType, metsig::resolutionFunc > functionCombo
double PFunction(const functionPars &x, const functionPars &par) const
const double par[8 *NPar][4]
void addResolutions(const edm::ParameterSet &iConfig)
reco::TrackRef trackRef() const