29 m_rctInputLabel(iConfig.getParameter<edm::
InputTag>(
"RctInputLabel")),
30 m_textFileName(iConfig.getParameter<std::string>(
"TextFileName")),
39 <<
"RctDigiToSourceCardText::RctDigiToSourceCardText : "
40 <<
" couldn't open the file " <<
m_textFileName <<
" for writing" << std::endl;
66 unsigned short logicalCardID;
67 std::string dataString;
70 unsigned short eIsoRank[18][4]={{0}};
71 unsigned short eIsoCardId[18][4]={{0}};
72 unsigned short eIsoRegionId[18][4]={{0}};
73 unsigned short eNonIsoRank[18][4]={{0}};
74 unsigned short eNonIsoCardId[18][4]={{0}};
75 unsigned short eNonIsoRegionId[18][4]={{0}};
78 unsigned numIsoEM[18]={0};
79 unsigned numNonIsoEM[18]={0};
81 for (L1CaloEmCollection::const_iterator iem=em->begin(); iem!=em->end(); iem++){
83 eIsoRank[iem->rctCrate()][numIsoEM[iem->rctCrate()]]=iem->rank();
84 eIsoCardId[iem->rctCrate()][numIsoEM[iem->rctCrate()]]=iem->rctCard();
85 eIsoRegionId[iem->rctCrate()][numIsoEM[iem->rctCrate()]]=iem->rctRegion();
86 numIsoEM[iem->rctCrate()]++;
88 eNonIsoRank[iem->rctCrate()][numNonIsoEM[iem->rctCrate()]]=iem->rank();
89 eNonIsoCardId[iem->rctCrate()][numNonIsoEM[iem->rctCrate()]]=iem->rctCard();
90 eNonIsoRegionId[iem->rctCrate()][numNonIsoEM[iem->rctCrate()]]=iem->rctRegion();
91 numNonIsoEM[iem->rctCrate()]++;
94 LogDebug(
"Electrons") <<
"Rank=" << iem->rank()
95 <<
" Card=" << iem->rctCard()
96 <<
" Region=" << iem->rctRegion()
97 <<
" Crate=" << iem->rctCrate()
98 <<
" Isolated=" << iem->isolated();
102 unsigned short RC[18][7][2]={{{0}}};
103 unsigned short RCof[18][7][2]={{{0}}};
104 unsigned short RCtau[18][7][2]={{{0}}};
105 unsigned short HF[18][4][2]={{{0}}};
106 unsigned short HFQ[18][4][2]={{{0}}};
107 unsigned short MIPbits[18][7][2]={{{0}}};
108 unsigned short Qbits[18][7][2]={{{0}}};
111 for (L1CaloRegionCollection::const_iterator irgn=rgn->begin(); irgn!=rgn->end(); irgn++){
112 if (irgn->id().isHf()){
113 HF[irgn->rctCrate()][irgn->id().rctEta()-7][irgn->id().rctPhi()]=irgn->et();
114 HFQ[irgn->rctCrate()][irgn->id().rctEta()-7][irgn->id().rctPhi()]=irgn->fineGrain();
116 LogDebug(
"HFRegions") <<
"Et=" << irgn->et()
117 <<
" FineGrain=" << irgn->fineGrain()
118 <<
" Eta=" << irgn->id().rctEta()
119 <<
" Phi=" << irgn->id().rctPhi()
120 <<
" Crate=" << irgn->rctCrate();
122 RC[irgn->rctCrate()][irgn->rctCard()][irgn->rctRegionIndex()]=irgn->et();
123 RCof[irgn->rctCrate()][irgn->rctCard()][irgn->rctRegionIndex()]=irgn->overFlow();
124 RCtau[irgn->rctCrate()][irgn->rctCard()][irgn->rctRegionIndex()]=irgn->tauVeto();
125 MIPbits[irgn->rctCrate()][irgn->rctCard()][irgn->rctRegionIndex()]=irgn->mip();
126 Qbits[irgn->rctCrate()][irgn->rctCard()][irgn->rctRegionIndex()]=irgn->quiet();
128 LogDebug(
"Regions") <<
"Et=" << irgn->et()
129 <<
" OverFlow=" << irgn->overFlow()
130 <<
" tauVeto=" << irgn->tauVeto()
131 <<
" mip=" << irgn->mip()
132 <<
" quiet=" << irgn->quiet()
133 <<
" Card=" << irgn->rctCard()
134 <<
" Region=" << irgn->rctRegionIndex()
135 <<
" Crate=" << irgn->rctCrate();
152 eNonIsoCardId[crate],
153 eNonIsoRegionId[crate],
void RC012toSTRING(unsigned short &logicalCardID, unsigned short &eventNumber, unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], std::string &dataString) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::ofstream m_file
file handle
edm::InputTag m_rctInputLabel
Label for RCT digis.
void RC234toSTRING(unsigned short &logicalCardID, unsigned short &eventNumber, 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], std::string &dataString) const
void RoutingModetoLogicalCardID(unsigned short &logicalCardID, int &RoutingMode, int &RCTCrateNumber) const
std::string m_textFileName
Name out output file.
void EMUtoSTRING(unsigned short &logicalCardID, unsigned short &eventNumber, 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], std::string &dataString) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
RctDigiToSourceCardText(const edm::ParameterSet &)
unsigned short m_nevt
event counter
void RC56HFtoSTRING(unsigned short &logicalCardID, unsigned short &eventNumber, 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], std::string &dataString) const
SourceCardRouting m_scRouting
source card router
static const int NUM_RCT_CRATES
~RctDigiToSourceCardText()