Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:23

0001 #include "L1TriggerConfig/L1ScalesProducers/interface/L1ScalesTrivialProducer.h"
0002 
0003 //
0004 // constants, enums and typedefs
0005 //
0006 
0007 //
0008 // static data member definitions
0009 //
0010 
0011 //
0012 // constructors and destructor
0013 //
0014 L1ScalesTrivialProducer::L1ScalesTrivialProducer(const edm::ParameterSet& ps) {
0015   //the following line is needed to tell the framework what
0016   // data is being produced
0017   setWhatProduced(this, &L1ScalesTrivialProducer::produceEmScale);
0018   setWhatProduced(this, &L1ScalesTrivialProducer::produceJetScale);
0019   setWhatProduced(this, &L1ScalesTrivialProducer::produceHtMissScale);
0020   setWhatProduced(this, &L1ScalesTrivialProducer::produceHfRingScale);
0021 
0022   //now do what ever other initialization is needed
0023 
0024   // get numbers from the config file -  all units are GeV
0025   m_emEtScaleInputLsb = ps.getParameter<double>("L1CaloEmEtScaleLSB");
0026   m_emEtThresholds = ps.getParameter<std::vector<double> >("L1CaloEmThresholds");
0027 
0028   m_jetEtScaleInputLsb = ps.getParameter<double>("L1CaloRegionEtScaleLSB");
0029   m_jetEtThresholds = ps.getParameter<std::vector<double> >("L1CaloJetThresholds");
0030 
0031   m_htMissThresholds = ps.getParameter<std::vector<double> >("L1HtMissThresholds");
0032   m_hfRingThresholds = ps.getParameter<std::vector<double> >("L1HfRingThresholds");
0033 }
0034 
0035 L1ScalesTrivialProducer::~L1ScalesTrivialProducer() {
0036   // do anything here that needs to be done at destruction time
0037   // (e.g. close files, deallocate resources etc.)
0038 }
0039 
0040 //
0041 // member functions
0042 //
0043 
0044 // ------------ method called to produce the data  ------------
0045 std::unique_ptr<L1CaloEtScale> L1ScalesTrivialProducer::produceEmScale(const L1EmEtScaleRcd& iRecord) {
0046   return std::make_unique<L1CaloEtScale>(m_emEtScaleInputLsb, m_emEtThresholds);
0047 }
0048 
0049 std::unique_ptr<L1CaloEtScale> L1ScalesTrivialProducer::produceJetScale(const L1JetEtScaleRcd& iRecord) {
0050   return std::make_unique<L1CaloEtScale>(m_jetEtScaleInputLsb, m_jetEtThresholds);
0051 }
0052 
0053 std::unique_ptr<L1CaloEtScale> L1ScalesTrivialProducer::produceHtMissScale(const L1HtMissScaleRcd& iRecord) {
0054   return std::make_unique<L1CaloEtScale>(0, 0x7f, m_jetEtScaleInputLsb, m_htMissThresholds);
0055 }
0056 
0057 std::unique_ptr<L1CaloEtScale> L1ScalesTrivialProducer::produceHfRingScale(const L1HfRingEtScaleRcd& iRecord) {
0058   return std::make_unique<L1CaloEtScale>(0xff, 0x7, m_jetEtScaleInputLsb, m_hfRingThresholds);
0059 }