CMS 3D CMS Logo

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

double correction (const LorentzVector &fJet) const override
 get correction using Jet information only More...
 
bool eventRequired () const override
 if correction needs event information More...
 
 JetPartonCorrector (const edm::ParameterSet &fConfig)
 
void setParameters (std::string aCalibrationType, double aJetFinderRadius, int aPartonMixture)
 
 ~JetPartonCorrector () override
 
- 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

◆ ParametersMap

Definition at line 34 of file JetPartonCorrector.h.

Constructor & Destructor Documentation

◆ JetPartonCorrector()

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

Definition at line 143 of file JetPartonCorrector.cc.

References edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

143  {
144  thePartonMixture = fConfig.getParameter<int>("MixtureType");
145  theJetFinderRadius = fConfig.getParameter<double>("Radius");
147 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void setParameters(std::string aCalibrationType, double aJetFinderRadius, int aPartonMixture)

◆ ~JetPartonCorrector()

JetPartonCorrector::~JetPartonCorrector ( )
override

Definition at line 149 of file JetPartonCorrector.cc.

References stringResolutionProvider_cfi::parametrization.

149  {
150  for (ParametersMap::iterator ip = parametrization.begin(); ip != parametrization.end(); ip++)
151  delete ip->second;
152 }
ParametersMap parametrization

Member Function Documentation

◆ correction()

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

get correction using Jet information only

Implements JetCorrector.

Definition at line 197 of file JetPartonCorrector.cc.

References gather_cfg::cout, EgHLTOffHistBins_cfi::et, PVValHelper::eta, HLT_2022v12_cff::eta1, HLT_2022v12_cff::eta2, stringResolutionProvider_cfi::parametrization, and edm::second().

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

◆ eventRequired()

bool JetPartonCorrector::eventRequired ( ) const
inlineoverridevirtual

if correction needs event information

Implements JetCorrector.

Definition at line 31 of file JetPartonCorrector.h.

31 { return false; }

◆ setParameters()

void JetPartonCorrector::setParameters ( std::string  aCalibrationType,
double  aJetFinderRadius,
int  aPartonMixture 
)

Definition at line 154 of file JetPartonCorrector.cc.

References LEDCalibrationChannels::ieta, stringResolutionProvider_cfi::parametrization, muonDTDigis_cfi::pset, and edm::second().

154  {
155  theJetFinderRadius = aJetFinderRadius;
156  thePartonMixture = aPartonMixture;
157 
159 
160  if ((!pset.valid()) && (aCalibrationType != "no")) {
161  edm::LogError("JetPartonCorrector: Jet Corrections not found ")
162  << aCalibrationType
163  << " not found! Cannot apply any correction ... For JetPlusTrack calibration only radii 0.5 and 0.7 are "
164  "included for JetParton"
165  << endl;
166  return;
167  }
168  if (aCalibrationType == "no")
169  return;
170 
171  map<int, vector<double> > pq;
172  map<int, vector<double> > pg;
173  map<int, vector<double> > pqcd;
174  int iq = 0;
175  int ig = 0;
176  int iqcd = 0;
177  for (int ieta = 0; ieta < pset.neta(); ieta++) {
178  if (pset.type(ieta) == 1) {
179  pq[iq] = pset.parameters(ieta);
180  iq++;
181  };
182  if (pset.type(ieta) == 2) {
183  pg[ig] = pset.parameters(ieta);
184  ig++;
185  };
186  if (pset.type(ieta) == 3) {
187  pqcd[iqcd] = pset.parameters(ieta);
188  iqcd++;
189  };
190  }
191 
192  for (int ieta = 0; ieta < iq; ieta++) {
194  thePartonMixture, (*pq.find(ieta)).second, (*pg.find(ieta)).second, (*pqcd.find(ieta)).second);
195  }
196 }
Log< level::Error, false > LogError
ParametersMap parametrization
U second(std::pair< T, U > const &p)

Member Data Documentation

◆ parametrization

ParametersMap JetPartonCorrector::parametrization
private

Definition at line 35 of file JetPartonCorrector.h.

◆ theJetFinderRadius

double JetPartonCorrector::theJetFinderRadius
private

Definition at line 37 of file JetPartonCorrector.h.

◆ thePartonMixture

int JetPartonCorrector::thePartonMixture
private

Definition at line 36 of file JetPartonCorrector.h.