CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/L1TriggerConfig/L1ScalesProducers/src/L1ScalesTrivialProducer.cc

Go to the documentation of this file.
00001 #include "L1TriggerConfig/L1ScalesProducers/interface/L1ScalesTrivialProducer.h"
00002 
00003 
00004 //
00005 // constants, enums and typedefs
00006 //
00007 
00008 //
00009 // static data member definitions
00010 //
00011 
00012 //
00013 // constructors and destructor
00014 //
00015 L1ScalesTrivialProducer::L1ScalesTrivialProducer(const edm::ParameterSet& ps)
00016 {
00017  
00018   //the following line is needed to tell the framework what
00019   // data is being produced
00020   setWhatProduced(this, &L1ScalesTrivialProducer::produceEmScale);
00021   setWhatProduced(this, &L1ScalesTrivialProducer::produceJetScale);
00022   setWhatProduced(this, &L1ScalesTrivialProducer::produceHtMissScale);
00023   setWhatProduced(this, &L1ScalesTrivialProducer::produceHfRingScale);
00024 
00025   //now do what ever other initialization is needed
00026   
00027   // get numbers from the config file -  all units are GeV
00028   m_emEtScaleInputLsb = ps.getParameter<double>("L1CaloEmEtScaleLSB"); 
00029   m_emEtThresholds = ps.getParameter< std::vector<double> >("L1CaloEmThresholds");
00030 
00031   m_jetEtScaleInputLsb = ps.getParameter<double>("L1CaloRegionEtScaleLSB"); 
00032   m_jetEtThresholds = ps.getParameter< std::vector<double> >("L1CaloJetThresholds");
00033 
00034   m_htMissThresholds = ps.getParameter< std::vector<double> >("L1HtMissThresholds");  
00035   m_hfRingThresholds = ps.getParameter< std::vector<double> >("L1HfRingThresholds");  
00036 
00037 }
00038 
00039 
00040 L1ScalesTrivialProducer::~L1ScalesTrivialProducer()
00041 {
00042  
00043    // do anything here that needs to be done at destruction time
00044    // (e.g. close files, deallocate resources etc.)
00045 
00046 }
00047 
00048 
00049 //
00050 // member functions
00051 //
00052 
00053 // ------------ method called to produce the data  ------------
00054 std::auto_ptr<L1CaloEtScale> L1ScalesTrivialProducer::produceEmScale(const L1EmEtScaleRcd& iRecord)
00055 {
00056    using namespace edm::es;
00057 
00058    std::auto_ptr<L1CaloEtScale> emScale = std::auto_ptr<L1CaloEtScale>( new L1CaloEtScale(m_emEtScaleInputLsb, m_emEtThresholds) );
00059 
00060    return emScale ;
00061 }
00062 
00063 std::auto_ptr<L1CaloEtScale> L1ScalesTrivialProducer::produceJetScale(const L1JetEtScaleRcd& iRecord)
00064 {
00065    using namespace edm::es;
00066 
00067    std::auto_ptr<L1CaloEtScale> jetEtScale = std::auto_ptr<L1CaloEtScale>( new L1CaloEtScale(m_jetEtScaleInputLsb, m_jetEtThresholds) );
00068 
00069    return jetEtScale ;
00070 }
00071 
00072 
00073 std::auto_ptr<L1CaloEtScale> L1ScalesTrivialProducer::produceHtMissScale(const L1HtMissScaleRcd& iRecord)
00074 {
00075    using namespace edm::es;
00076 
00077    std::auto_ptr<L1CaloEtScale> htMissScale = std::auto_ptr<L1CaloEtScale>( new L1CaloEtScale(0, 0x7f, m_jetEtScaleInputLsb, m_htMissThresholds) );
00078 
00079    return htMissScale ;
00080 }
00081 
00082 
00083 std::auto_ptr<L1CaloEtScale> L1ScalesTrivialProducer::produceHfRingScale(const L1HfRingEtScaleRcd& iRecord)
00084 {
00085    using namespace edm::es;
00086 
00087    std::auto_ptr<L1CaloEtScale> hfRingEtScale = std::auto_ptr<L1CaloEtScale>( new L1CaloEtScale(0xff, 0x7, m_jetEtScaleInputLsb, m_hfRingThresholds) );
00088 
00089    return hfRingEtScale ;
00090 }
00091 
00092