Go to the documentation of this file.00001
00002
00003
00004
00005
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "FWCore/Framework/interface/ESHandle.h"
00024 #include "L1TriggerConfig/L1ScalesProducers/interface/L1CaloInputScalesProducer.h"
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 L1CaloInputScalesProducer::L1CaloInputScalesProducer(const edm::ParameterSet& iConfig)
00042 {
00043
00044
00045 setWhatProduced(this, &L1CaloInputScalesProducer::produceEcalScale);
00046 setWhatProduced(this, &L1CaloInputScalesProducer::produceHcalScale);
00047
00048
00049
00050
00051 m_ecalEtThresholdsPosEta =
00052 iConfig.getParameter< std::vector<double> >("L1EcalEtThresholdsPositiveEta");
00053 m_ecalEtThresholdsNegEta =
00054 iConfig.getParameter< std::vector<double> >("L1EcalEtThresholdsNegativeEta");
00055 m_hcalEtThresholdsPosEta =
00056 iConfig.getParameter< std::vector<double> >("L1HcalEtThresholdsPositiveEta");
00057 m_hcalEtThresholdsNegEta =
00058 iConfig.getParameter< std::vector<double> >("L1HcalEtThresholdsNegativeEta");
00059 }
00060
00061
00062 L1CaloInputScalesProducer::~L1CaloInputScalesProducer()
00063 {
00064
00065
00066
00067
00068 }
00069
00070
00071
00072
00073
00074
00075
00076 boost::shared_ptr<L1CaloEcalScale>
00077 L1CaloInputScalesProducer::produceEcalScale(const L1CaloEcalScaleRcd& iRecord)
00078 {
00079 using namespace edm::es;
00080 boost::shared_ptr<L1CaloEcalScale> pL1CaloEcalScale =
00081 boost::shared_ptr<L1CaloEcalScale>( new L1CaloEcalScale ) ;
00082
00083 std::vector< double >::const_iterator posItr =
00084 m_ecalEtThresholdsPosEta.begin() ;
00085 std::vector< double >::const_iterator negItr =
00086 m_ecalEtThresholdsNegEta.begin() ;
00087
00088 for( unsigned short ieta = 1 ;
00089 ieta <= L1CaloEcalScale::nBinEta ;
00090 ++ieta )
00091 {
00092 for( unsigned short irank = 0 ;
00093 irank < L1CaloEcalScale::nBinRank;
00094 ++irank )
00095 {
00096 pL1CaloEcalScale->setBin( irank, ieta, 1, *posItr ) ;
00097 pL1CaloEcalScale->setBin( irank, ieta, -1, *negItr ) ;
00098
00099 ++posItr ;
00100 ++negItr ;
00101 }
00102 }
00103
00104 return pL1CaloEcalScale ;
00105 }
00106
00107
00108 boost::shared_ptr<L1CaloHcalScale>
00109 L1CaloInputScalesProducer::produceHcalScale(const L1CaloHcalScaleRcd& iRecord)
00110 {
00111 using namespace edm::es;
00112 boost::shared_ptr<L1CaloHcalScale> pL1CaloHcalScale =
00113 boost::shared_ptr<L1CaloHcalScale>( new L1CaloHcalScale ) ;
00114
00115 std::vector< double >::const_iterator posItr =
00116 m_hcalEtThresholdsPosEta.begin() ;
00117
00118 std::vector< double >::const_iterator negItr =
00119 m_hcalEtThresholdsNegEta.begin() ;
00120
00121
00122 for( unsigned short ieta = 1 ;
00123 ieta <= L1CaloHcalScale::nBinEta ;
00124 ++ieta )
00125 {
00126 for( unsigned short irank = 0 ;
00127 irank < L1CaloHcalScale::nBinRank;
00128 ++irank )
00129 {
00130 pL1CaloHcalScale->setBin( irank, ieta, 1, *posItr ) ;
00131 pL1CaloHcalScale->setBin( irank, ieta, -1, *negItr ) ;
00132
00133 ++posItr ;
00134 ++negItr ;
00135 }
00136 }
00137
00138 return pL1CaloHcalScale ;
00139 }
00140
00141
00142