CMS 3D CMS Logo

Public Member Functions | Private Types | Private Attributes

JetPartonCorrector Class Reference

#include <JetPartonCorrector.h>

Inheritance diagram for JetPartonCorrector:
JetCorrector

List of all members.

Public Member Functions

virtual double correction (const LorentzVector &fJet) const
 get correction using Jet information only
virtual bool eventRequired () const
 if correction needs event information
 JetPartonCorrector (const edm::ParameterSet &fConfig)
void setParameters (std::string aCalibrationType, double aJetFinderRadius, int aPartonMixture)
virtual ~JetPartonCorrector ()

Private Types

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

Private Attributes

ParametersMap parametrization
double theJetFinderRadius
int thePartonMixture

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().

{
  thePartonMixture = fConfig.getParameter<int>("MixtureType");
  theJetFinderRadius = fConfig.getParameter<double>("Radius");
  setParameters (fConfig.getParameter <std::string> ("tagName"),theJetFinderRadius,thePartonMixture );
}
JetPartonCorrector::~JetPartonCorrector ( ) [virtual]

Definition at line 153 of file JetPartonCorrector.cc.

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

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().

{
  if(parametrization.empty()) { return 1.; }
  
  double et=fJet.Et();
  double eta=fabs(fJet.Eta());
  
  //if(eta<10) { eta=abs(fJet.getY()); }

  double etnew;
  std::map<double,JetPartonNamespace::ParametrizationJetParton*>::const_iterator ip=parametrization.upper_bound(eta);
  if(ip==parametrization.begin()) 
    { 
      etnew=ip->second->value(et,eta); 
    }
  else if(ip==parametrization.end()) 
    {
      etnew=(--ip)->second->value(et,eta);
    }
  else
    {
      double eta2=ip->first;
      double et2=ip->second->value(et,eta);
      ip--;
      double eta1=ip->first;
      double et1=ip->second->value(et,eta);
      
      etnew=(eta2*et1 - eta1*et2 + eta*et2 - eta*et1)/(eta2-eta1); 
    }
   cout<<" JetParton::The new energy found "<<etnew<<" "<<et<<endl;    
  float mScale = 1000.;
   
  if( et > 0.001) mScale = etnew/et;

  return mScale;
  
  
}
virtual bool JetPartonCorrector::eventRequired ( ) const [inline, virtual]

if correction needs event information

Implements JetCorrector.

Definition at line 32 of file JetPartonCorrector.h.

{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(), MultipleCompare::pset, edm::second(), JetPartonNamespace::JetPartonCalibrationParameterSet::type(), and JetPartonNamespace::JetPartonCalibrationParameterSet::valid().

{
     
     theJetFinderRadius = aJetFinderRadius;
     thePartonMixture = aPartonMixture;
    
     JetPartonNamespace::JetPartonCalibrationParameterSet pset(aCalibrationType);
      
     if((!pset.valid()) && (aCalibrationType != "no"))
       {
         edm::LogError ("JetPartonCorrector: Jet Corrections not found ") << aCalibrationType << 
           " not found! Cannot apply any correction ... For JetPlusTrack calibration only radii 0.5 and 0.7 are included for JetParton" << endl;
          return;
       }
     if (aCalibrationType=="no") return;
       
       
     map<int,vector<double> > pq;
     map<int,vector<double> > pg;
     map<int,vector<double> > pqcd;
     int iq = 0;
     int ig = 0;
     int iqcd = 0;
    for(int ieta=0; ieta<pset.neta();ieta++)
    {
     if( pset.type(ieta) == 1 ) {pq[iq] = pset.parameters(ieta); iq++;};
     if( pset.type(ieta) == 2 ) {pg[ig] = pset.parameters(ieta);ig++;};
     if( pset.type(ieta) == 3 ) {pqcd[iqcd] = pset.parameters(ieta);iqcd++;};
    }
    
    for(int ieta=0; ieta<iq;ieta++){
      parametrization[pset.eta(ieta)]=new JetPartonNamespace::ParametrizationJetParton(thePartonMixture,(*pq.find(ieta)).second,(*pg.find(ieta)).second,(*pqcd.find(ieta)).second);    
    }
}

Member Data Documentation

Definition at line 37 of file JetPartonCorrector.h.

Definition at line 39 of file JetPartonCorrector.h.

Definition at line 38 of file JetPartonCorrector.h.