L1Trigger/TextToDigi/plugins/RctInputTextToDigi.h
Description: Creates an EcalTrigPrimDigiCollection and an HcalTrigPrimDigiCollection from a text file (formatted as read out from saveRCTInput module), for input to the L1Trigger/RegionalCaloTrigger module.
Definition at line 50 of file RctInputTextToDigi.h.
Definition at line 45 of file RctInputTextToDigi.cc.
References funct::abs(), electrons_cff::bool, L1RCTParameters::calcIEta(), L1RCTParameters::calcIPhi(), gather_cfg::cout, TauDecayModes::dec, EcalTriggerTower, edm::EventSetup::get(), mps_fire::i, inputStream_, createfilelist::int, dqmiolumiharvest::j, lookupTables_, eostools::move(), nEvent_, oldVersion_, edm::ESHandle< T >::product(), edm::Event::put(), alignCSCRings::r, L1RCTLookupTables::rctParameters(), L1RCTLookupTables::setRCTParameters(), EcalTriggerPrimitiveDigi::setSample(), HcalTriggerPrimitiveDigi::setSample(), EcalTriggerPrimitiveDigi::setSize(), HcalTriggerPrimitiveDigi::setSize(), AlCaHLTBitMon_QueryRunRegistry::string, and hgcalTowerProducer_cfi::tower.
62 ecalTPs->reserve(56 * 72);
63 hcalTPs->reserve(56 * 72 + 18 * 8);
64 const int nEcalSamples = 1;
65 const int nHcalSamples = 1;
76 unsigned short junk_counter = 0;
88 if ((junk_counter == 11) && (junk ==
"1-32")) {
92 }
while (junk !=
"LUTOut");
93 std::cout <<
"Skipped file header" << std::endl;
95 std::cout <<
"oldVersion_ TRUE (tower 1-32)" << std::endl;
97 std::cout <<
"oldVersion_ FALSE (tower 0-31)" << std::endl;
103 for (
int i = 0;
i < 72;
i++) {
105 for (
int j = 0;
j < 56;
j++) {
110 unsigned short crate;
112 unsigned short tower;
116 inputStream_ >> std::hex >> fileEventNumber >> crate >> card >> tower >> eAddr >> hAddr >> junk >>
std::dec;
121 int encodedEtEcal = (
int)(eAddr >> 1);
122 bool fineGrainEcal = (
bool)(eAddr & 1);
123 int encodedEtHcal = (
int)(hAddr >> 1);
124 bool fineGrainHcal = (
bool)(hAddr & 1);
134 iPhi = ((72 + 18 - iPhi) % 72);
138 unsigned absIeta =
abs(iEta);
139 int zSide = (iEta / absIeta);
150 ecalDigi.setSize(nEcalSamples);
156 ecalTPs->push_back(ecalDigi);
160 hcalDigi.setSize(nHcalSamples);
165 hcalTPs->push_back(hcalDigi);
170 for (
int i = 0;
i < 18;
i++) {
171 for (
int j = 0;
j < 8;
j++) {
173 int hfIEta = (
j % 4) + 29;
175 hfIEta = hfIEta * (-1);
179 int hfIPhi = (
i % 9) * 8 + (
j / 4) * 4 + 1;
184 hcalTPs->push_back(hfDigi);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::SortedCollection< HcalTriggerPrimitiveDigi > HcalTrigPrimDigiCollection
short calcIEta(unsigned short iCrate, unsigned short iCard, unsigned short iTower) const
Abs< T >::type abs(const T &t)
unsigned short calcIPhi(unsigned short iCrate, unsigned short iCard, unsigned short iTower) const
edm::SortedCollection< EcalTriggerPrimitiveDigi > EcalTrigPrimDigiCollection
L1RCTLookupTables * lookupTables_
std::ifstream inputStream_
const L1RCTParameters * rctParameters() const
void setRCTParameters(const L1RCTParameters *rctParameters)
T const * product() const