CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Types | Private Attributes
TauJetCorrector Class Reference

#include <TauJetCorrector.h>

Inheritance diagram for TauJetCorrector:
JetCorrector

Classes

class  ParametrizationTauJet
 

Public Member Functions

double correction (const LorentzVector &fJet) const override
 get correction using Jet information only More...
 
double correction (const reco::Jet &) const override
 apply correction using Jet information only More...
 
bool eventRequired () const override
 if correction needs event information More...
 
void setParameters (std::string, int)
 
 TauJetCorrector (const edm::ParameterSet &fParameters)
 
 ~TauJetCorrector () override
 
- Public Member Functions inherited from JetCorrector
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, ParametrizationTauJet * > ParametersMap
 

Private Attributes

ParametersMap parametrization
 
int type
 

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

jet energy corrections from Taujet calibration

Definition at line 13 of file TauJetCorrector.h.

Member Typedef Documentation

◆ ParametersMap

typedef std::map<double, ParametrizationTauJet*> TauJetCorrector::ParametersMap
private

Definition at line 42 of file TauJetCorrector.h.

Constructor & Destructor Documentation

◆ TauJetCorrector()

TauJetCorrector::TauJetCorrector ( const edm::ParameterSet fParameters)

Definition at line 95 of file TauJetCorrector.cc.

95  {
96  type = fConfig.getParameter<int>("TauTriggerType");
97  setParameters(fConfig.getParameter<std::string>("tagName"), type);
98 }

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

◆ ~TauJetCorrector()

TauJetCorrector::~TauJetCorrector ( )
override

Definition at line 100 of file TauJetCorrector.cc.

100  {
101  for (ParametersMap::iterator ip = parametrization.begin(); ip != parametrization.end(); ip++)
102  delete ip->second;
103 }

References stringResolutionProvider_cfi::parametrization.

Member Function Documentation

◆ correction() [1/2]

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

get correction using Jet information only

Implements JetCorrector.

Definition at line 182 of file TauJetCorrector.cc.

182  {
183  //cout<<" Start Apply Corrections "<<endl;
184  if (parametrization.empty()) {
185  return 1.;
186  }
187 
188  double et = fJet.Et();
189  double eta = fabs(fJet.Eta());
190 
191  //cout<<" Et and eta of jet "<<et<<" "<<eta<<endl;
192 
193  double etnew;
194  std::map<double, ParametrizationTauJet*>::const_iterator ip = parametrization.upper_bound(eta);
195  etnew = (--ip)->second->value(et, eta);
196 
197  //cout<<" The new energy found "<<etnew<<" "<<et<<endl;
198 
199  float mScale = etnew / et;
200 
201  return mScale;
202 }

References EgHLTOffHistBins_cfi::et, PVValHelper::eta, stringResolutionProvider_cfi::parametrization, and edm::second().

◆ correction() [2/2]

double TauJetCorrector::correction ( const reco::Jet fJet) const
overridevirtual

apply correction using Jet information only

Implements JetCorrector.

Definition at line 204 of file TauJetCorrector.cc.

204 { return correction(fJet.p4()); }

References pfMETCorrectionType0_cfi::correction, and reco::LeafCandidate::p4().

◆ eventRequired()

bool TauJetCorrector::eventRequired ( ) const
inlineoverridevirtual

if correction needs event information

Implements JetCorrector.

Definition at line 22 of file TauJetCorrector.h.

22 { return false; }

◆ setParameters()

void TauJetCorrector::setParameters ( std::string  aCalibrationType,
int  itype 
)

Definition at line 105 of file TauJetCorrector.cc.

105  {
106  //cout<< " Start to set parameters "<<endl;
107  type = itype;
108  JetCalibrationParameterSetTauJet pset(aCalibrationType);
109 
110  if ((!pset.valid()) && (aCalibrationType != "no")) {
111  edm::LogError("TauJetCorrector:Jet Corrections not found ")
112  << aCalibrationType
113  << " not found! Cannot apply any correction ... For JetPlusTrack calibration only radii 0.5 and 0.7 are "
114  "included for JetParton"
115  << endl;
116  return;
117  }
118  if (aCalibrationType == "no")
119  return;
120 
121  map<int, vector<double> > pq;
122  map<int, vector<double> > pg;
123  map<int, vector<double> > pqcd;
124  map<int, double> etaboundx;
125  int iq = 0;
126  int ig = 0;
127  int iqcd = 0;
128  int mtype = 0;
129  for (int ieta = 0; ieta < pset.neta(); ieta++) {
130  if (pset.type(ieta) == 1) {
131  pq[iq] = pset.parameters(ieta);
132  iq++;
133  mtype = (int)(pset.type(ieta));
134  }
135  if (pset.type(ieta) == 2) {
136  pg[ig] = pset.parameters(ieta);
137  ig++;
138  mtype = (int)(pset.type(ieta));
139  }
140  if (pset.type(ieta) == 3) {
141  pqcd[iqcd] = pset.parameters(ieta);
142  iqcd++;
143  mtype = (int)(pset.type(ieta));
144  }
145  if (pset.type(ieta) == -1) {
146  etaboundx[mtype - 1] = pset.eta(ieta);
147  }
148  }
149 
150  //cout<<" Number of parameters "<<iq<<" "<<ig<<" "<<iqcd<<endl;
151  int mynum = 0;
152  for (int ieta = 0; ieta < pset.neta(); ieta++) {
153  //cout<<" New parmetrization "<<ieta<<" "<<pset.type(ieta)<<endl;
154 
155  if (pset.type(ieta) == -1)
156  continue;
157  if (ieta < iq + 1) {
158  parametrization[pset.eta(ieta)] =
159  new ParametrizationTauJet(pset.type(ieta), (*pq.find(ieta)).second, (*etaboundx.find(0)).second);
160  //cout<<" ALL "<<ieta<<" "<<((*pq.find(ieta)).second)[0]<<" "<<((*pq.find(ieta)).second)[1]<<" "<<
161  //((*pq.find(ieta)).second)[2]<<endl;
162  }
163  if (ieta > iq && ieta < iq + ig + 2) {
164  mynum = ieta - iq - 1;
165  parametrization[pset.eta(ieta)] =
166  new ParametrizationTauJet(pset.type(ieta), (*pg.find(mynum)).second, (*etaboundx.find(1)).second);
167  //cout<<" One prong "<<((*pg.find(mynum)).second)[0]<<" "<<((*pg.find(mynum)).second)[1]<<" "<<
168  //((*pg.find(mynum)).second)[2]<<endl;
169  }
170  if (ieta > iq + ig + 1) {
171  mynum = ieta - iq - ig - 2;
172  //cout<<" Mynum "<<mynum<<" "<<ieta<<" "<<pset.type(ieta)<<endl;
173  parametrization[pset.eta(ieta)] =
174  new ParametrizationTauJet(pset.type(ieta), (*pqcd.find(mynum)).second, (*etaboundx.find(2)).second);
175  //cout<<" Two prongs "<<((*pqcd.find(mynum)).second)[0]<<" "<<((*pqcd.find(mynum)).second)[1]<<" "<<
176  //((*pqcd.find(mynum)).second)[2]<<endl;
177  }
178  }
179  //cout<<" Parameters inserted into mAlgorithm "<<endl;
180 }

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

Member Data Documentation

◆ parametrization

ParametersMap TauJetCorrector::parametrization
private

Definition at line 43 of file TauJetCorrector.h.

◆ type

int TauJetCorrector::type
private
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
PVValHelper::eta
Definition: PVValidationHelpers.h:69
TauJetCorrector::setParameters
void setParameters(std::string, int)
Definition: TauJetCorrector.cc:105
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
createfilelist.int
int
Definition: createfilelist.py:10
reco::LeafCandidate::p4
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:114
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
TauJetCorrector::parametrization
ParametersMap parametrization
Definition: TauJetCorrector.h:43
TauJetCorrector::correction
double correction(const LorentzVector &fJet) const override
get correction using Jet information only
Definition: TauJetCorrector.cc:182
JetCalibrationParameterSetTauJet
Definition: TauJetCorrector.cc:50
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27