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.

143  {
144  thePartonMixture = fConfig.getParameter<int>("MixtureType");
145  theJetFinderRadius = fConfig.getParameter<double>("Radius");
147 }

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

◆ ~JetPartonCorrector()

JetPartonCorrector::~JetPartonCorrector ( )
override

Definition at line 149 of file JetPartonCorrector.cc.

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

References stringResolutionProvider_cfi::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.

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 }

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

◆ 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.

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 }

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

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.

JetPartonNamespace::ParametrizationJetParton
Definition: JetPartonCorrector.cc:25
gather_cfg.cout
cout
Definition: gather_cfg.py:144
HLT_2018_cff.eta1
eta1
Definition: HLT_2018_cff.py:8220
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
JetPartonCorrector::setParameters
void setParameters(std::string aCalibrationType, double aJetFinderRadius, int aPartonMixture)
Definition: JetPartonCorrector.cc:154
PVValHelper::eta
Definition: PVValidationHelpers.h:69
JetPartonCorrector::parametrization
ParametersMap parametrization
Definition: JetPartonCorrector.h:35
HLT_2018_cff.eta2
eta2
Definition: HLT_2018_cff.py:8221
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
edm::LogError
Definition: MessageLogger.h:183
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
JetPartonCorrector::thePartonMixture
int thePartonMixture
Definition: JetPartonCorrector.h:36
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
JetPartonCorrector::theJetFinderRadius
double theJetFinderRadius
Definition: JetPartonCorrector.h:37
JetPartonNamespace::JetPartonCalibrationParameterSet
Definition: JetPartonCorrector.cc:100
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27