32 : m_textFileName(iConfig.getParameter<
std::
string>(
"TextFileName")),
33 m_fileEventOffset(iConfig.getParameter<
int>(
"fileEventOffset")),
36 produces<L1CaloEmCollection>();
37 produces<L1CaloRegionCollection>();
44 <<
"SourceCardTextToRctDigi::SourceCardTextToRctDigi : " 63 for (
int j = 0; j < 4; j++) {
67 for (
int j = 0; j < 14; j++)
69 L1CaloRegion(0,
false,
false,
false,
false,
i, j / 2, j % 2));
70 for (
unsigned j = 0; j < 8; j++)
94 if (!getline(
m_file, tmp)) {
96 <<
"SourceCardTextToRctDigi::produce() : " 106 unsigned long VHDCI[2][2];
110 unsigned short eventNumber;
111 unsigned short logicalCardID;
114 unsigned short eIsoRank[18][4];
115 unsigned short eIsoCardId[18][4];
116 unsigned short eIsoRegionId[18][4];
117 unsigned short eNonIsoRank[18][4];
118 unsigned short eNonIsoCardId[18][4];
119 unsigned short eNonIsoRegionId[18][4];
122 unsigned short RC[18][7][2];
123 unsigned short RCof[18][7][2];
124 unsigned short RCtau[18][7][2];
125 unsigned short MIPbits[18][7][2];
126 unsigned short Qbits[18][7][2];
127 unsigned short HF[18][4][2];
128 unsigned short HFQ[18][4][2];
133 <<
"SourceCardTextToRctDigi::produce : " 137 int thisEventNumber = -1;
141 if (!getline(
m_file, dataString)) {
143 <<
"SourceCardTextToRctDigi::SourceCardTextToRctDigi : " 144 <<
" couldn't read from the file " <<
m_textFileName << std::endl;
152 assert(eventNumber == thisEventNumber);
153 thisEventNumber = eventNumber;
158 if (routingMode == 0) {
162 eIsoRegionId[crate], eNonIsoRank[crate],
163 eNonIsoCardId[crate], eNonIsoRegionId[crate],
164 MIPbits[crate], Qbits[crate], VHDCI);
166 }
else if (routingMode == 1) {
172 }
else if (routingMode == 2) {
177 }
else if (routingMode == 3) {
181 RC[crate + 9], RCof[crate + 9], RCtau[crate + 9],
187 <<
"SourceCardTextToRctDigi::produce : " 188 <<
" unknown routing mode=" << routingMode << std::endl;
196 for (
int i = 0;
i < 4;
i++) {
197 em->push_back(
L1CaloEmCand(eIsoRank[crate][
i], eIsoRegionId[crate][i],
198 eIsoCardId[crate][i], crate,
true, i, 0));
200 eNonIsoRegionId[crate][i],
201 eNonIsoCardId[crate][i], crate,
false, i, 0));
205 for (
int i = 0;
i < 7;
i++) {
206 for (
int j = 0; j < 2; j++) {
208 RC[crate][
i][j], RCof[crate][
i][j], RCtau[crate][
i][j],
209 MIPbits[crate][
i][j], Qbits[crate][
i][j], crate,
i, j));
214 for (
int i = 0;
i < 4;
i++) {
215 for (
int j = 0; j < 2; j++) {
217 HF[crate][
i][j], HFQ[crate][
i][j], crate,
224 for (L1CaloEmCollection::const_iterator iem = em->begin(); iem != em->end();
229 for (L1CaloRegionCollection::const_iterator irgn = rgn->begin();
230 irgn != rgn->end(); irgn++) {
std::vector< L1CaloEmCand > L1CaloEmCollection
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void putEmptyDigi(edm::Event &)
Create empty digi collection.
void VHDCItoEMU(unsigned short(&eIsoRank)[4], unsigned short(&eIsoCardId)[4], unsigned short(&eIsoRegionId)[4], unsigned short(&eNonIsoRank)[4], unsigned short(&eNonIsoCardId)[4], unsigned short(&eNonIsoRegionId)[4], unsigned short(&MIPbits)[7][2], unsigned short(&Qbits)[7][2], unsigned long(&VHDCI)[2][2]) const
void VHDCItoRC012(unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned long(&VHDCI)[2][2]) const
SourceCardTextToRctDigi(const edm::ParameterSet &)
std::string m_textFileName
Name out input file.
static L1CaloRegion makeHBHERegion(const unsigned et, const bool overFlow, const bool tauVeto, const bool mip, const bool quiet, const unsigned crate, const unsigned card, const unsigned rgn)
constructor HB/HE region from components
Level-1 Region Calorimeter Trigger EM candidate.
~SourceCardTextToRctDigi() override
std::ifstream m_file
file handle
void VHDCItoRC56HF(unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned short(&HF)[4][2], unsigned short(&HFQ)[4][2], unsigned long(&VHDCI)[2][2]) const
Abs< T >::type abs(const T &t)
void VHDCItoRC234(unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned short(&sisterRC)[7][2], unsigned short(&sisterRCof)[7][2], unsigned short(&sisterRCtau)[7][2], unsigned long(&VHDCI)[2][2]) const
int m_fileEventOffset
Number of events to skip at the start of the file.
std::vector< std::vector< double > > tmp
static const int NUM_RCT_CRATES
SourceCardRouting m_scRouting
source card router
static L1CaloRegion makeHFRegion(const unsigned et, const bool fineGrain, const unsigned crate, const unsigned rgn)
construct HF region from components
A calorimeter trigger region (sum of 4x4 trigger towers)
static const unsigned NUM_LINES_PER_EVENT
void STRINGtoVHDCI(unsigned short &logicalCardID, unsigned short &eventNumber, std::string &dataString, unsigned long(&VHDCI)[2][2]) const
std::vector< L1CaloRegion > L1CaloRegionCollection
void produce(edm::Event &, const edm::EventSetup &) override
void LogicalCardIDtoRoutingMode(unsigned short &logicalCardID, int &RoutingMode, int &RCTCrateNumber) const