8 : inputFile_(iConfig.getParameter<
edm::FileInPath>(
"inputFile")),
9 inputStream_(inputFile_.
fullPath().c_str()),
22 produces<EcalTrigPrimDigiCollection>();
23 produces<HcalTrigPrimDigiCollection>();
29 std::cerr <<
"Input file didn't open!!" << std::endl;
61 ecalTPs->reserve(56 * 72);
62 hcalTPs->reserve(56 * 72 + 18 * 8);
63 const int nEcalSamples = 1;
64 const int nHcalSamples = 1;
75 unsigned short junk_counter = 0;
87 if ((junk_counter == 11) && (junk ==
"1-32")) {
91 }
while (junk !=
"LUTOut");
92 std::cout <<
"Skipped file header" << std::endl;
94 std::cout <<
"oldVersion_ TRUE (tower 1-32)" << std::endl;
96 std::cout <<
"oldVersion_ FALSE (tower 0-31)" << std::endl;
102 for (
int i = 0;
i < 72;
i++) {
104 for (
int j = 0;
j < 56;
j++) {
109 unsigned short crate;
111 unsigned short tower;
120 int encodedEtEcal = (
int)(eAddr >> 1);
121 bool fineGrainEcal = (
bool)(eAddr & 1);
122 int encodedEtHcal = (
int)(hAddr >> 1);
123 bool fineGrainHcal = (
bool)(hAddr & 1);
133 iPhi = ((72 + 18 - iPhi) % 72);
138 int zSide = (
iEta / absIeta);
149 ecalDigi.
setSize(nEcalSamples);
155 ecalTPs->push_back(ecalDigi);
159 hcalDigi.
setSize(nHcalSamples);
164 hcalTPs->push_back(hcalDigi);
169 for (
int i = 0;
i < 18;
i++) {
170 for (
int j = 0;
j < 8;
j++) {
172 int hfIEta = (
j % 4) + 29;
174 hfIEta = hfIEta * (-1);
178 int hfIPhi = (
i % 9) * 8 + (
j / 4) * 4 + 1;
183 hcalTPs->push_back(hfDigi);
void setSample(int i, const HcalTriggerPrimitiveSample &sam)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
edm::SortedCollection< HcalTriggerPrimitiveDigi > HcalTrigPrimDigiCollection
~RctInputTextToDigi() override
edm::ESGetToken< L1RCTParameters, L1RCTParametersRcd > paramsToken_
void setSample(int i, const EcalTriggerPrimitiveSample &sam)
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
void produce(edm::Event &, const edm::EventSetup &) override
const L1RCTParameters * rctParameters() const
RctInputTextToDigi(const edm::ParameterSet &)
edm::SortedCollection< EcalTriggerPrimitiveDigi > EcalTrigPrimDigiCollection
L1RCTLookupTables * lookupTables_
std::ifstream inputStream_
void setRCTParameters(const L1RCTParameters *rctParameters)
short calcIEta(unsigned short iCrate, unsigned short iCard, unsigned short iTower) const
unsigned short calcIPhi(unsigned short iCrate, unsigned short iCard, unsigned short iTower) const