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_hcalEtThresholds =
00056 iConfig.getParameter< std::vector<double> >("L1HcalEtThresholds");
00057 }
00058
00059
00060 L1CaloInputScalesProducer::~L1CaloInputScalesProducer()
00061 {
00062
00063
00064
00065
00066 }
00067
00068
00069
00070
00071
00072
00073
00074 boost::shared_ptr<L1CaloEcalScale>
00075 L1CaloInputScalesProducer::produceEcalScale(const L1CaloEcalScaleRcd& iRecord)
00076 {
00077 using namespace edm::es;
00078 boost::shared_ptr<L1CaloEcalScale> pL1CaloEcalScale =
00079 boost::shared_ptr<L1CaloEcalScale>( new L1CaloEcalScale ) ;
00080
00081 std::vector< double >::const_iterator posItr =
00082 m_ecalEtThresholdsPosEta.begin() ;
00083 std::vector< double >::const_iterator negItr =
00084 m_ecalEtThresholdsNegEta.begin() ;
00085
00086 for( unsigned short ieta = 1 ;
00087 ieta <= L1CaloEcalScale::nBinEta ;
00088 ++ieta )
00089 {
00090 for( unsigned short irank = 0 ;
00091 irank < L1CaloEcalScale::nBinRank;
00092 ++irank )
00093 {
00094 pL1CaloEcalScale->setBin( irank, ieta, 1, *posItr ) ;
00095 pL1CaloEcalScale->setBin( irank, ieta, -1, *negItr ) ;
00096
00097 ++posItr ;
00098 ++negItr ;
00099 }
00100 }
00101
00102 return pL1CaloEcalScale ;
00103 }
00104
00105
00106 boost::shared_ptr<L1CaloHcalScale>
00107 L1CaloInputScalesProducer::produceHcalScale(const L1CaloHcalScaleRcd& iRecord)
00108 {
00109 using namespace edm::es;
00110 boost::shared_ptr<L1CaloHcalScale> pL1CaloHcalScale =
00111 boost::shared_ptr<L1CaloHcalScale>( new L1CaloHcalScale ) ;
00112
00113 std::vector< double >::const_iterator itr =
00114 m_hcalEtThresholds.begin() ;
00115
00116 for( unsigned short ieta = 1 ;
00117 ieta <= L1CaloHcalScale::nBinEta ;
00118 ++ieta )
00119 {
00120 for( unsigned short irank = 0 ;
00121 irank < L1CaloHcalScale::nBinRank;
00122 ++irank )
00123 {
00124 pL1CaloHcalScale->setBin( irank, ieta, 1, *itr ) ;
00125 pL1CaloHcalScale->setBin( irank, ieta, -1, *itr ) ;
00126
00127 ++itr ;
00128 }
00129 }
00130
00131 return pL1CaloHcalScale ;
00132 }
00133
00134
00135