#include <L1TriggerConfig/L1ScalesProducers/src/L1CaloInputScalesGenerator.cc>
Public Member Functions | |
L1CaloInputScalesGenerator (const edm::ParameterSet &) | |
~L1CaloInputScalesGenerator () | |
Private Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob (const edm::EventSetup &) |
virtual void | endJob () |
Implementation: <Notes on="" implementation>="">
Definition at line 28 of file L1CaloInputScalesGenerator.h.
L1CaloInputScalesGenerator::L1CaloInputScalesGenerator | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
L1CaloInputScalesGenerator::~L1CaloInputScalesGenerator | ( | ) |
Definition at line 48 of file L1CaloInputScalesGenerator.cc.
00049 { 00050 00051 // do anything here that needs to be done at desctruction time 00052 // (e.g. close files, deallocate resources etc.) 00053 00054 }
void L1CaloInputScalesGenerator::analyze | ( | const edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [private, virtual] |
Implements edm::EDAnalyzer.
Definition at line 63 of file L1CaloInputScalesGenerator.cc.
References EcalBarrel, EcalEndcap, lat::endl(), edm::EventSetup::get(), edm::Event::getByLabel(), EcalTPGScale::getTPGInGeV(), iggi_31X_cfg::input, output(), and EcalTPGScale::setEventSetup().
00064 { 00065 using namespace edm; 00066 00067 #ifdef THIS_IS_AN_EVENT_EXAMPLE 00068 Handle<ExampleData> pIn; 00069 iEvent.getByLabel("example",pIn); 00070 #endif 00071 00072 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE 00073 ESHandle<SetupData> pSetup; 00074 iSetup.get<SetupRecord>().get(pSetup); 00075 #endif 00076 00077 ESHandle<CaloTPGTranscoder> caloTPGTranscoder; 00078 iSetup.get<CaloTPGRecord>().get(caloTPGTranscoder); 00079 00080 EcalTPGScale* ecalTPGScale = new EcalTPGScale(); 00081 ecalTPGScale->setEventSetup(iSetup); 00082 00083 double output; 00084 ofstream scalesFile("L1CaloInputScales.cfi"); 00085 00086 00087 // Write the ecal scales, positive eta 00088 00089 scalesFile << "es_module L1CaloInputScalesProducer = " 00090 << "L1CaloInputScalesProducer {\n\tvdouble " 00091 << "L1EcalEtThresholdsPositiveEta = {" << endl; 00092 00093 // loop over ietas, barrel 00094 for (unsigned short absIeta = 1; absIeta <= 28; absIeta++) 00095 { 00096 EcalSubdetector subdet = ( absIeta <= 17 ) ? EcalBarrel : EcalEndcap ; 00097 // 8 bits of input energy 00098 for (unsigned short input = 0; input <= 0xFF; input++) 00099 { 00100 output = ecalTPGScale->getTPGInGeV( (uint) input, 00101 EcalTrigTowerDetId(1, subdet, 00102 absIeta, 1)); 00103 scalesFile << setprecision (8) << output; 00104 if (absIeta == 28 && input == 0xFF) 00105 { 00106 scalesFile << "}"; 00107 } 00108 else 00109 { 00110 scalesFile << ", "; 00111 } 00112 } 00113 scalesFile << endl; 00114 } 00115 00116 // Write the ecal scales, negative eta 00117 00118 scalesFile << endl << "\tvdouble L1EcalEtThresholdsNegativeEta = {" << endl; 00119 00120 // loop over ietas, barrel first 00121 for (unsigned short absIeta = 1; absIeta <= 28; absIeta++) 00122 { 00123 EcalSubdetector subdet = ( absIeta <= 17 ) ? EcalBarrel : EcalEndcap ; 00124 // 8 bits of input energy 00125 for (unsigned short input = 0; input <= 0xFF; input++) 00126 { 00127 // negative eta 00128 output = ecalTPGScale-> 00129 getTPGInGeV( (uint) input, EcalTrigTowerDetId(-1, subdet, 00130 absIeta, 2)); 00131 scalesFile << setprecision (8) << output; 00132 if (absIeta == 28 && input == 0xFF) 00133 { 00134 scalesFile << "}"; 00135 } 00136 else 00137 { 00138 scalesFile << ", "; 00139 } 00140 } 00141 scalesFile << endl; 00142 } 00143 00144 // Write the hcal scales 00145 00146 scalesFile << endl << "\tvdouble L1HcalEtThresholds = {" << endl; 00147 00148 // loop over ietas 00149 for (unsigned short absIeta = 1; absIeta <= 32; absIeta++) 00150 { 00151 for (unsigned short input = 0; input <= 0xFF; input++) 00152 { 00153 output = caloTPGTranscoder->hcaletValue(absIeta, input); 00154 scalesFile << setprecision (8) << output ; 00155 if (absIeta == 32 && input == 0xFF) 00156 { 00157 scalesFile << "}"; 00158 } 00159 else 00160 { 00161 scalesFile << ", "; 00162 } 00163 } 00164 scalesFile << endl; 00165 } 00166 scalesFile << "}" << endl; 00167 00168 scalesFile.close(); 00169 }
void L1CaloInputScalesGenerator::beginJob | ( | const edm::EventSetup & | ) | [private, virtual] |