21 double f = 0.2+et/1000.*(1.+.13*
exp(eta));
32 type = thePartonMixture;
38 double value(
double arg1,
double arg2)
const;
43 std::vector<double>
pq;
44 std::vector<double>
pg;
54 if(
abs(x-pq[2]) < pq[1]/pq[0] ||
abs(x-pg[2]) < pg[1]/pg[0] ||
abs(x-pqcd[2]) < pqcd[1]/pqcd[0] )
59 double kjetq = pq[0]-pq[1]/(x-pq[2]);
60 double kjetg = pg[0]-pg[1]/(x-pg[2]);
61 double kjetqcd = pqcd[0]-pqcd[1]/(x-pqcd[2]);
66 if(
abs(kjetq) > 0.0001 ) enew=e/kjetq;
71 if(
abs(kjetg) > 0.0001 ) enew=e/kjetg;
76 if(
abs(kjetqcd) > 0.0001 ) enew=e/kjetqcd;
81 cout<<
"[Jets] JetPartonCorrector: Warning! Calibration to b-quark - does not implemented yet. Light quark calibration is used instead "<<endl;
82 if(
abs(kjetq) > 0.0001 ) enew=e/kjetq;
88 double f = upm.
mixt(x,y);
89 double kjet=(f*kjetq+kjetg)/(f+1);
90 if(
abs(kjet) > 0.0001 ) enew=e/kjet;
95 cerr<<
"[Jets] JetPartonCorrector: Error! unknown parametrization type = "<<
type<<
" No correction applied ..."<<endl;
104 int neta(){
return etavector.size();}
105 double eta(
int ieta){
return etavector[ieta];}
106 int type(
int ieta){
return typevector[ieta];}
107 const vector<double>&
parameters(
int ieta){
return pars[ieta];}
108 bool valid(){
return !etavector.empty();}
117 JetPartonCalibrationParameterSet::JetPartonCalibrationParameterSet(
string tag){
129 while( std::getline(
in, line) ){
130 if(line.empty() || line[0]==
'#')
continue;
131 istringstream linestream(line);
134 linestream>>par>>
type;
135 etavector.push_back(par);
136 typevector.push_back(type);
137 pars.push_back(vector<double>());
138 while(linestream>>par)pars.back().push_back(par);
148 thePartonMixture = fConfig.
getParameter<
int>(
"MixtureType");
149 theJetFinderRadius = fConfig.
getParameter<
double>(
"Radius");
161 theJetFinderRadius = aJetFinderRadius;
162 thePartonMixture = aPartonMixture;
166 if((!pset.
valid()) && (aCalibrationType !=
"no"))
168 edm::LogError (
"JetPartonCorrector: Jet Corrections not found ") << aCalibrationType <<
169 " not found! Cannot apply any correction ... For JetPlusTrack calibration only radii 0.5 and 0.7 are included for JetParton" << endl;
172 if (aCalibrationType==
"no")
return;
175 map<int,vector<double> > pq;
176 map<int,vector<double> > pg;
177 map<int,vector<double> > pqcd;
181 for(
int ieta=0; ieta<pset.
neta();ieta++)
183 if( pset.
type(ieta) == 1 ) {pq[iq] = pset.
parameters(ieta); iq++;};
184 if( pset.
type(ieta) == 2 ) {pg[ig] = pset.
parameters(ieta);ig++;};
185 if( pset.
type(ieta) == 3 ) {pqcd[iqcd] = pset.
parameters(ieta);iqcd++;};
188 for(
int ieta=0; ieta<iq;ieta++){
197 double eta=fabs(fJet.Eta());
202 std::map<double,JetPartonNamespace::ParametrizationJetParton*>::const_iterator ip=
parametrization.upper_bound(eta);
205 etnew=ip->second->value(et,eta);
209 etnew=(--ip)->
second->value(et,eta);
213 double eta2=ip->first;
214 double et2=ip->second->value(et,eta);
216 double eta1=ip->first;
217 double et1=ip->second->value(et,eta);
219 etnew=(eta2*et1 - eta1*et2 + eta*et2 - eta*et1)/(eta2-eta1);
221 cout<<
" JetParton::The new energy found "<<etnew<<
" "<<et<<endl;
222 float mScale = 1000.;
224 if( et > 0.001) mScale = etnew/
et;
T getParameter(std::string const &) const
virtual ~UserPartonMixture()
JetPartonCorrector(const edm::ParameterSet &fConfig)
virtual double mixt(double et, double eta)
double correction(const LorentzVector &fJet) const override
get correction using Jet information only
const vector< double > & parameters(int ieta)
U second(std::pair< T, U > const &p)
parametrization
specify parametrization (see SWGuidePATKinematicResolutions for more details)
void setParameters(std::string aCalibrationType, double aJetFinderRadius, int aPartonMixture)
Abs< T >::type abs(const T &t)
vector< vector< double > > pars
std::vector< double > pqcd
~JetPartonCorrector() override
et
define resolution functions of each parameter
vector< double > etavector
std::string fullPath() const
ParametrizationJetParton(int thePartonMixture, const vector< double > &x, const vector< double > &y, const vector< double > &z)
reco::Particle::LorentzVector LorentzVector