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

virtual double correction (const LorentzVector &fJet) const
 get correction using Jet information only More...
 
virtual double correction (const reco::Jet &) const
 apply correction using Jet information only More...
 
virtual bool eventRequired () const
 if correction needs event information More...
 
void setParameters (std::string, int)
 
 TauJetCorrector (const edm::ParameterSet &fParameters)
 
virtual ~TauJetCorrector ()
 
- 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

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

Definition at line 45 of file TauJetCorrector.h.

Constructor & Destructor Documentation

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

Definition at line 99 of file TauJetCorrector.cc.

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

100 {
101  type = fConfig.getParameter<int>("TauTriggerType");
102  setParameters (fConfig.getParameter <std::string> ("tagName"),type);
103 }
type
Definition: HCALResponse.h:21
void setParameters(std::string, int)
TauJetCorrector::~TauJetCorrector ( )
virtual

Definition at line 106 of file TauJetCorrector.cc.

References stringResolutionProvider_cfi::parametrization.

107 {
108  for(ParametersMap::iterator ip=parametrization.begin();ip!=parametrization.end();ip++) delete ip->second;
109 }
ParametersMap parametrization

Member Function Documentation

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

get correction using Jet information only

Implements JetCorrector.

Definition at line 178 of file TauJetCorrector.cc.

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

179 {
180  //cout<<" Start Apply Corrections "<<endl;
181  if(parametrization.empty()) { return 1.; }
182 
183  double et=fJet.Et();
184  double eta=fabs(fJet.Eta());
185 
186  //cout<<" Et and eta of jet "<<et<<" "<<eta<<endl;
187 
188  double etnew;
189  std::map<double,ParametrizationTauJet*>::const_iterator ip=parametrization.upper_bound(eta);
190  etnew=(--ip)->second->value(et,eta);
191 
192  //cout<<" The new energy found "<<etnew<<" "<<et<<endl;
193 
194  float mScale = etnew/et;
195 
196  return mScale;
197 }
ParametersMap parametrization
U second(std::pair< T, U > const &p)
et
define resolution functions of each parameter
double TauJetCorrector::correction ( const reco::Jet fJet) const
virtual

apply correction using Jet information only

Implements JetCorrector.

Definition at line 199 of file TauJetCorrector.cc.

References reco::LeafCandidate::p4().

199  {
200  return correction(fJet.p4());
201 }
virtual double correction(const LorentzVector &fJet) const
get correction using Jet information only
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
virtual bool TauJetCorrector::eventRequired ( ) const
inlinevirtual

if correction needs event information

Implements JetCorrector.

Definition at line 24 of file TauJetCorrector.h.

24 {return false;}
void TauJetCorrector::setParameters ( std::string  aCalibrationType,
int  itype 
)

Definition at line 111 of file TauJetCorrector.cc.

References JetCalibrationParameterSetTauJet::eta(), createfilelist::int, JetCalibrationParameterSetTauJet::neta(), JetCalibrationParameterSetTauJet::parameters(), stringResolutionProvider_cfi::parametrization, muonDTDigis_cfi::pset, edm::second(), JetCalibrationParameterSetTauJet::type(), and JetCalibrationParameterSetTauJet::valid().

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

Member Data Documentation

ParametersMap TauJetCorrector::parametrization
private

Definition at line 46 of file TauJetCorrector.h.

int TauJetCorrector::type
private