CMS 3D CMS Logo

Public Member Functions | Private Attributes

JetCorrectionService< Corrector > Class Template Reference

#include <JetCorrectionService.h>

Inheritance diagram for JetCorrectionService< Corrector >:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Member Functions

 JetCorrectionService (const edm::ParameterSet &fConfig)
boost::shared_ptr< JetCorrectorproduce (const JetCorrectionsRecord &iRecord)
void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &fIOV)
 ~JetCorrectionService ()

Private Attributes

std::string mAlgo
bool mDebug
std::string mEra
std::string mLevel
edm::ParameterSet mParameterSet
std::string mPayloadName
std::string mSection
bool mUseCondDB

Detailed Description

template<class Corrector>
class JetCorrectionService< Corrector >

Definition at line 36 of file JetCorrectionService.h.


Constructor & Destructor Documentation

template<class Corrector >
JetCorrectionService< Corrector >::JetCorrectionService ( const edm::ParameterSet fConfig) [inline]
template<class Corrector >
JetCorrectionService< Corrector >::~JetCorrectionService ( ) [inline]

Definition at line 68 of file JetCorrectionService.h.

{}

Member Function Documentation

template<class Corrector >
boost::shared_ptr<JetCorrector> JetCorrectionService< Corrector >::produce ( const JetCorrectionsRecord iRecord) [inline]

Definition at line 70 of file JetCorrectionService.h.

References gather_cfg::cout, convertXMLtoSQLite_cfg::fileName, edm::FileInPath::fullPath(), edm::eventsetup::EventSetupRecord::get(), JetCorrectionService< Corrector >::mAlgo, JetCorrectionService< Corrector >::mDebug, JetCorrectionService< Corrector >::mEra, JetCorrectionService< Corrector >::mLevel, JetCorrectionService< Corrector >::mParameterSet, JetCorrectionService< Corrector >::mPayloadName, JetCorrectionService< Corrector >::mSection, and JetCorrectionService< Corrector >::mUseCondDB.

      {
        if (mUseCondDB)
          {
            edm::ESHandle<JetCorrectorParametersCollection> JetCorParColl;
            iRecord.get(mPayloadName,JetCorParColl); 
            JetCorrectorParameters const & JetCorPar = (*JetCorParColl)[ mLevel ];
            boost::shared_ptr<JetCorrector> mCorrector(new Corrector(JetCorPar,mParameterSet));
            return mCorrector;
          }
        else
          {
            std::string fileName("CondFormats/JetMETObjects/data/");
            if (!mEra.empty())
              fileName += mEra;
            if (!mLevel.empty())
              fileName += "_"+mLevel;
            if (!mAlgo.empty())
              fileName += "_"+mAlgo;
            fileName += ".txt";
            if (mDebug)
              std::cout<<"Parameter File: "<<fileName<<std::endl;
            edm::FileInPath fip(fileName);
            JetCorrectorParameters *tmpJetCorPar = new JetCorrectorParameters(fip.fullPath(),mSection);
            boost::shared_ptr<JetCorrector> mCorrector(new Corrector(*tmpJetCorPar,mParameterSet));
            return mCorrector;
          }
      }
template<class Corrector >
void JetCorrectionService< Corrector >::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue ,
edm::ValidityInterval fIOV 
) [inline, virtual]

Member Data Documentation

template<class Corrector >
std::string JetCorrectionService< Corrector >::mAlgo [private]
template<class Corrector >
bool JetCorrectionService< Corrector >::mDebug [private]
template<class Corrector >
std::string JetCorrectionService< Corrector >::mEra [private]
template<class Corrector >
std::string JetCorrectionService< Corrector >::mLevel [private]
template<class Corrector >
edm::ParameterSet JetCorrectionService< Corrector >::mParameterSet [private]

Definition at line 41 of file JetCorrectionService.h.

Referenced by JetCorrectionService< Corrector >::produce().

template<class Corrector >
std::string JetCorrectionService< Corrector >::mPayloadName [private]
template<class Corrector >
std::string JetCorrectionService< Corrector >::mSection [private]
template<class Corrector >
bool JetCorrectionService< Corrector >::mUseCondDB [private]