CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Attributes
JetPartonCorrector Class Reference

#include <JetPartonCorrector.h>

Inheritance diagram for JetPartonCorrector:
JetCorrector

Public Member Functions

virtual double correction (const LorentzVector &fJet) const
 get correction using Jet information only More...
 
virtual bool eventRequired () const
 if correction needs event information More...
 
 JetPartonCorrector (const edm::ParameterSet &fConfig)
 
void setParameters (std::string aCalibrationType, double aJetFinderRadius, int aPartonMixture)
 
virtual ~JetPartonCorrector ()
 
- Public Member Functions inherited from JetCorrector
virtual double correction (const reco::Jet &fJet) const =0
 apply correction using Jet information only More...
 
virtual double correction (const reco::Jet &fJet, const edm::Event &fEvent, const edm::EventSetup &fSetup) const
 apply correction using all event information More...
 
virtual double correction (const reco::Jet &fJet, const edm::RefToBase< reco::Jet > &fJetRef, const edm::Event &fEvent, const edm::EventSetup &fSetup) const
 apply correction using all event information More...
 
virtual double correction (const reco::Jet &fJet, const edm::RefToBase< reco::Jet > &fJetRef, const edm::Event &fEvent, const edm::EventSetup &fSetup, LorentzVector &corrected) const
 Apply vectorial correction using all event information. More...
 
 JetCorrector ()
 
virtual bool refRequired () const =0
 if correction needs the jet reference More...
 
virtual bool vectorialCorrection () const
 if vectorial correction is provided More...
 
virtual ~JetCorrector ()
 

Private Types

typedef std::map< double,
JetPartonNamespace::ParametrizationJetParton * > 
ParametersMap
 

Private Attributes

ParametersMap parametrization
 
double theJetFinderRadius
 
int thePartonMixture
 

Additional Inherited Members

- Public Types inherited from JetCorrector
typedef
reco::Particle::LorentzVector 
LorentzVector
 
- Static Public Member Functions inherited from JetCorrector
static const JetCorrectorgetJetCorrector (const std::string &fName, const edm::EventSetup &fSetup)
 retrieve corrector from the event setup. troughs exception if something is missing More...
 

Detailed Description

Definition at line 21 of file JetPartonCorrector.h.

Member Typedef Documentation

Definition at line 36 of file JetPartonCorrector.h.

Constructor & Destructor Documentation

JetPartonCorrector::JetPartonCorrector ( const edm::ParameterSet fConfig)

Definition at line 146 of file JetPartonCorrector.cc.

References edm::ParameterSet::getParameter().

147 {
148  thePartonMixture = fConfig.getParameter<int>("MixtureType");
149  theJetFinderRadius = fConfig.getParameter<double>("Radius");
150  setParameters (fConfig.getParameter <std::string> ("tagName"),theJetFinderRadius,thePartonMixture );
151 }
T getParameter(std::string const &) const
void setParameters(std::string aCalibrationType, double aJetFinderRadius, int aPartonMixture)
JetPartonCorrector::~JetPartonCorrector ( )
virtual

Definition at line 153 of file JetPartonCorrector.cc.

154 {
155  for(ParametersMap::iterator ip=parametrization.begin();ip!=parametrization.end();ip++) delete ip->second;
156 }
ParametersMap parametrization

Member Function Documentation

double JetPartonCorrector::correction ( const LorentzVector fJet) const
virtual

get correction using Jet information only

Implements JetCorrector.

Definition at line 192 of file JetPartonCorrector.cc.

References gather_cfg::cout, eta(), and edm::second().

193 {
194  if(parametrization.empty()) { return 1.; }
195 
196  double et=fJet.Et();
197  double eta=fabs(fJet.Eta());
198 
199  //if(eta<10) { eta=abs(fJet.getY()); }
200 
201  double etnew;
202  std::map<double,JetPartonNamespace::ParametrizationJetParton*>::const_iterator ip=parametrization.upper_bound(eta);
203  if(ip==parametrization.begin())
204  {
205  etnew=ip->second->value(et,eta);
206  }
207  else if(ip==parametrization.end())
208  {
209  etnew=(--ip)->second->value(et,eta);
210  }
211  else
212  {
213  double eta2=ip->first;
214  double et2=ip->second->value(et,eta);
215  ip--;
216  double eta1=ip->first;
217  double et1=ip->second->value(et,eta);
218 
219  etnew=(eta2*et1 - eta1*et2 + eta*et2 - eta*et1)/(eta2-eta1);
220  }
221  cout<<" JetParton::The new energy found "<<etnew<<" "<<et<<endl;
222  float mScale = 1000.;
223 
224  if( et > 0.001) mScale = etnew/et;
225 
226  return mScale;
227 
228 
229 }
T eta() const
ParametersMap parametrization
U second(std::pair< T, U > const &p)
tuple cout
Definition: gather_cfg.py:121
virtual bool JetPartonCorrector::eventRequired ( ) const
inlinevirtual

if correction needs event information

Implements JetCorrector.

Definition at line 32 of file JetPartonCorrector.h.

32 {return false;}
void JetPartonCorrector::setParameters ( std::string  aCalibrationType,
double  aJetFinderRadius,
int  aPartonMixture 
)

Definition at line 158 of file JetPartonCorrector.cc.

References JetPartonNamespace::JetPartonCalibrationParameterSet::eta(), JetPartonNamespace::JetPartonCalibrationParameterSet::neta(), JetPartonNamespace::JetPartonCalibrationParameterSet::parameters(), edm::second(), JetPartonNamespace::JetPartonCalibrationParameterSet::type(), and JetPartonNamespace::JetPartonCalibrationParameterSet::valid().

159 {
160 
161  theJetFinderRadius = aJetFinderRadius;
162  thePartonMixture = aPartonMixture;
163 
165 
166  if((!pset.valid()) && (aCalibrationType != "no"))
167  {
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;
170  return;
171  }
172  if (aCalibrationType=="no") return;
173 
174 
175  map<int,vector<double> > pq;
176  map<int,vector<double> > pg;
177  map<int,vector<double> > pqcd;
178  int iq = 0;
179  int ig = 0;
180  int iqcd = 0;
181  for(int ieta=0; ieta<pset.neta();ieta++)
182  {
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++;};
186  }
187 
188  for(int ieta=0; ieta<iq;ieta++){
189  parametrization[pset.eta(ieta)]=new JetPartonNamespace::ParametrizationJetParton(thePartonMixture,(*pq.find(ieta)).second,(*pg.find(ieta)).second,(*pqcd.find(ieta)).second);
190  }
191 }
ParametersMap parametrization
U second(std::pair< T, U > const &p)

Member Data Documentation

ParametersMap JetPartonCorrector::parametrization
private

Definition at line 37 of file JetPartonCorrector.h.

double JetPartonCorrector::theJetFinderRadius
private

Definition at line 39 of file JetPartonCorrector.h.

int JetPartonCorrector::thePartonMixture
private

Definition at line 38 of file JetPartonCorrector.h.