CMS 3D CMS Logo

List of all members | Classes | Public Member Functions
SourceCardRouting Class Reference

#include <SourceCardRouting.h>

Classes

struct  EmuToSfpData
 

Public Member Functions

void EMUtoSFP (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 short(&SFP)[2][4]) const
 
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
 
void EMUtoVHDCI (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 LogicalCardIDtoRoutingMode (unsigned short &logicalCardID, int &RoutingMode, int &RCTCrateNumber) const
 
void RC012toSFP (unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned short(&SFP)[2][4]) const
 
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
 
void RC012toVHDCI (unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned long(&VHDCI)[2][2]) const
 
void RC234toSFP (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 short(&SFP)[2][4]) const
 
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 RC234toVHDCI (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
 
void RC56HFtoSFP (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 short(&SFP)[2][4]) const
 
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
 
void RC56HFtoVHDCI (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
 
void RoutingModetoLogicalCardID (unsigned short &logicalCardID, int &RoutingMode, int &RCTCrateNumber) const
 
void SFPtoEMU (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 short(&SFP)[2][4]) const
 
void SFPtoRC012 (unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned short(&SFP)[2][4]) const
 
void SFPtoRC234 (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 short(&SFP)[2][4]) const
 
void SFPtoRC56HF (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 short(&SFP)[2][4]) const
 
void SFPtoSTRING (unsigned short &logicalCardID, unsigned short &eventNumber, int RoutingMode, unsigned short(&SFP)[2][4], std::string &dataString) const
 
void SFPtoVHDCI (int RoutingMode, unsigned short(&SFP)[2][4], unsigned long(&VHDCI)[2][2]) const
 
 SourceCardRouting ()
 
void STRINGtoVHDCI (unsigned short &logicalCardID, unsigned short &eventNumber, std::string &dataString, unsigned long(&VHDCI)[2][2]) const
 
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
 
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
 
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
 
void VHDCItoSFP (int RoutingMode, unsigned short(&SFP)[2][4], unsigned long(&VHDCI)[2][2]) const
 
void VHDCItoSTRING (unsigned short &logicalCardID, unsigned short &eventNumber, std::string &dataString, unsigned long(&VHDCI)[2][2]) const
 
 ~SourceCardRouting ()
 

Detailed Description

Definition at line 13 of file SourceCardRouting.h.

Constructor & Destructor Documentation

SourceCardRouting::SourceCardRouting ( )

Definition at line 17 of file SourceCardRouting.cc.

17  {
18  // std::cout<<"Constructor"<<std::endl;
19 }
SourceCardRouting::~SourceCardRouting ( )

Definition at line 21 of file SourceCardRouting.cc.

21  {
22  // std::cout<<"Destructor"<<std::endl;
23 }

Member Function Documentation

void SourceCardRouting::EMUtoSFP ( 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 short(&)  SFP[2][4] 
) const

Definition at line 30 of file SourceCardRouting.cc.

References mps_fire::i.

Referenced by GctFormatTranslateMCLegacy::writeRctEmCandBlocks().

35  {
36 
37  SFP[0][0] = 0;
38  SFP[1][0] = 0x8000;
39 
40  for (int i = 0; i < 7; i++) {
41  for (int j = 0; j < 2; j++) {
42  SFP[0][0] = SFP[0][0] | ((MIPbits[i][j] & 0x01) << ((2 * i) + j));
43  SFP[1][0] = SFP[1][0] | ((Qbits[i][j] & 0x01) << ((2 * i) + j));
44  }
45  }
46 
47  SFP[0][1] = (eIsoRank[0] & 0x3f) | ((eIsoRegionId[0] & 0x01) << 6) |
48  ((eIsoCardId[0] & 0x07) << 7) | ((eIsoRank[1] & 0x7) << 10);
49  SFP[1][1] = 0x8000 | (eIsoRank[2] & 0x3f) | ((eIsoRegionId[2] & 0x01) << 6) |
50  ((eIsoCardId[2] & 0x07) << 7) | ((eIsoRank[3] & 0x7) << 10);
51  SFP[0][2] = (eNonIsoRank[0] & 0x3f) | ((eNonIsoRegionId[0] & 0x01) << 6) |
52  ((eNonIsoCardId[0] & 0x07) << 7) | ((eIsoRank[1] & 0x38) << 7) |
53  ((eIsoRegionId[1] & 0x01) << 13);
54  SFP[1][2] = 0x8000 | (eNonIsoRank[2] & 0x3f) |
55  ((eNonIsoRegionId[2] & 0x01) << 6) |
56  ((eNonIsoCardId[2] & 0x07) << 7) | ((eIsoRank[3] & 0x38) << 7) |
57  ((eIsoRegionId[3] & 0x01) << 13);
58  SFP[0][3] = (eNonIsoRank[1] & 0x3f) | ((eNonIsoRegionId[1] & 0x01) << 6) |
59  ((eNonIsoCardId[1] & 0x07) << 7) | ((eIsoCardId[1] & 0x07) << 10);
60  SFP[1][3] = 0x8000 | (eNonIsoRank[3] & 0x3f) |
61  ((eNonIsoRegionId[3] & 0x01) << 6) |
62  ((eNonIsoCardId[3] & 0x07) << 7) | ((eIsoCardId[3] & 0x07) << 10);
63 }
void SourceCardRouting::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

Definition at line 699 of file SourceCardRouting.cc.

Referenced by RctDigiToSourceCardText::analyze().

705  {
706 
707  unsigned long VHDCI[2][2] = {{0}};
708  EMUtoVHDCI(eIsoRank, eIsoCardId, eIsoRegionId, eNonIsoRank, eNonIsoCardId,
709  eNonIsoRegionId, MIPbits, Qbits, VHDCI);
710  VHDCItoSTRING(logicalCardID, eventNumber, dataString, VHDCI);
711 }
void EMUtoVHDCI(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 VHDCItoSTRING(unsigned short &logicalCardID, unsigned short &eventNumber, std::string &dataString, unsigned long(&VHDCI)[2][2]) const
void SourceCardRouting::EMUtoVHDCI ( 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

Definition at line 567 of file SourceCardRouting.cc.

572  {
573 
574  unsigned short SFP[2][4] = {{0}};
575  EMUtoSFP(eIsoRank, eIsoCardId, eIsoRegionId, eNonIsoRank, eNonIsoCardId,
576  eNonIsoRegionId, MIPbits, Qbits, SFP);
577  SFPtoVHDCI(0, SFP, VHDCI);
578 }
void EMUtoSFP(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 short(&SFP)[2][4]) const
void SFPtoVHDCI(int RoutingMode, unsigned short(&SFP)[2][4], unsigned long(&VHDCI)[2][2]) const
void SourceCardRouting::LogicalCardIDtoRoutingMode ( unsigned short &  logicalCardID,
int &  RoutingMode,
int &  RCTCrateNumber 
) const

Definition at line 821 of file SourceCardRouting.cc.

Referenced by SourceCardTextToRctDigi::produce().

823  {
824 
825  RCTCrateNumber = (logicalCardID >> 3);
826  if ((logicalCardID & 0x4) != 0)
827  RCTCrateNumber += 9;
828  RoutingMode = (logicalCardID & 0x3);
829 }
void SourceCardRouting::RC012toSFP ( unsigned short(&)  RC[7][2],
unsigned short(&)  RCof[7][2],
unsigned short(&)  RCtau[7][2],
unsigned short(&)  SFP[2][4] 
) const

Definition at line 197 of file SourceCardRouting.cc.

References globals_cff::x1.

200  {
201 
202  SFP[0][0] = (RC[0][0] & 0x3ff) | ((RCof[0][0] & 0x1) << 10) |
203  ((RCtau[0][0] & 0x1) << 11) | ((RC[2][0] & 0x7) << 12);
204  SFP[1][0] = 0x8000 | (RC[0][1] & 0x3ff) | ((RCof[0][1] & 0x1) << 10) |
205  ((RCtau[0][1] & 0x1) << 11) | ((RC[2][1] & 0x7) << 12);
206 
207  SFP[0][1] = (RC[1][0] & 0x3ff) | ((RCof[1][0] & 0x1) << 10) |
208  ((RCtau[1][0] & 0x1) << 11) | ((RC[2][0] & 0x38) << 9);
209  SFP[1][1] = 0x8000 | (RC[1][1] & 0x3ff) | ((RCof[1][1] & 0x1) << 10) |
210  ((RCtau[1][1] & 0x1) << 11) | ((RC[2][1] & 0x38) << 9);
211 
212  SFP[0][2] = (RC[0][0] & 0x3ff) | ((RCof[0][0] & 0x1) << 10) |
213  ((RCtau[0][0] & 0x1) << 11);
214  SFP[1][2] = 0x8000 | (RC[0][1] & 0x3ff) | ((RCof[0][1] & 0x1) << 10) |
215  ((RCtau[0][1] & 0x1) << 11);
216 
217  SFP[0][3] = (RC[1][0] & 0x3ff) | ((RCof[1][0] & 0x1) << 10) |
218  ((RCtau[1][0] & 0x1) << 11);
219  SFP[1][3] = 0x8000 | (RC[1][1] & 0x3ff) | ((RCof[1][1] & 0x1) << 10) |
220  ((RCtau[1][1] & 0x1) << 11);
221 }
void SourceCardRouting::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

Definition at line 731 of file SourceCardRouting.cc.

Referenced by RctDigiToSourceCardText::analyze().

736  {
737 
738  unsigned long VHDCI[2][2] = {{0}};
739  RC012toVHDCI(RC, RCof, RCtau, VHDCI);
740  VHDCItoSTRING(logicalCardID, eventNumber, dataString, VHDCI);
741 }
void VHDCItoSTRING(unsigned short &logicalCardID, unsigned short &eventNumber, std::string &dataString, unsigned long(&VHDCI)[2][2]) const
void RC012toVHDCI(unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned long(&VHDCI)[2][2]) const
void SourceCardRouting::RC012toVHDCI ( unsigned short(&)  RC[7][2],
unsigned short(&)  RCof[7][2],
unsigned short(&)  RCtau[7][2],
unsigned long(&)  VHDCI[2][2] 
) const

Definition at line 636 of file SourceCardRouting.cc.

639  {
640 
641  unsigned short SFP[2][4] = {{0}};
642  RC012toSFP(RC, RCof, RCtau, SFP);
643  SFPtoVHDCI(2, SFP, VHDCI);
644 }
void SFPtoVHDCI(int RoutingMode, unsigned short(&SFP)[2][4], unsigned long(&VHDCI)[2][2]) const
void RC012toSFP(unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned short(&SFP)[2][4]) const
void SourceCardRouting::RC234toSFP ( 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 short(&)  SFP[2][4] 
) const

Definition at line 256 of file SourceCardRouting.cc.

References globals_cff::x1.

262  {
263 
264  SFP[0][0] = (RC[3][0] & 0x3ff) | ((RCof[3][0] & 0x1) << 10) |
265  ((RCtau[3][0] & 0x1) << 11) | ((RC[2][0] & 0x1c0) << 6);
266  SFP[1][0] = 0x8000 | (RC[3][1] & 0x3ff) | ((RCof[3][1] & 0x1) << 10) |
267  ((RCtau[3][1] & 0x1) << 11) | ((RC[2][1] & 0x1c0) << 6);
268 
269  SFP[0][1] = (RC[4][0] & 0x3ff) | ((RCof[4][0] & 0x1) << 10) |
270  ((RCtau[4][0] & 0x1) << 11) | ((RC[2][0] & 0x200) << 3) |
271  ((RCof[2][0] & 0x1) << 13) | ((RCtau[2][0] & 0x1) << 14);
272  SFP[1][1] = 0x8000 | (RC[4][1] & 0x3ff) | ((RCof[4][1] & 0x1) << 10) |
273  ((RCtau[4][1] & 0x1) << 11) | ((RC[2][1] & 0x200) << 3) |
274  ((RCof[2][1] & 0x1) << 13) | ((RCtau[2][1] & 0x1) << 14);
275 
276  SFP[0][2] = (sisterRC[3][0] & 0x3ff) | ((sisterRCof[3][0] & 0x1) << 10) |
277  ((sisterRCtau[3][0] & 0x1) << 11) |
278  ((sisterRC[2][0] & 0x1c0) << 6);
279  SFP[1][2] =
280  0x8000 | (sisterRC[3][1] & 0x3ff) | ((sisterRCof[3][1] & 0x1) << 10) |
281  ((sisterRCtau[3][1] & 0x1) << 11) | ((sisterRC[2][1] & 0x1c0) << 6);
282 
283  SFP[0][3] =
284  (sisterRC[4][0] & 0x3ff) | ((sisterRCof[4][0] & 0x1) << 10) |
285  ((sisterRCtau[4][0] & 0x1) << 11) | ((sisterRC[2][0] & 0x200) << 3) |
286  ((sisterRCof[2][0] & 0x1) << 13) | ((sisterRCtau[2][0] & 0x1) << 14);
287  SFP[1][3] =
288  0x8000 | (sisterRC[4][1] & 0x3ff) | ((sisterRCof[4][1] & 0x1) << 10) |
289  ((sisterRCtau[4][1] & 0x1) << 11) | ((sisterRC[2][1] & 0x200) << 3) |
290  ((sisterRCof[2][1] & 0x1) << 13) | ((sisterRCtau[2][1] & 0x1) << 14);
291 }
void SourceCardRouting::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

Definition at line 746 of file SourceCardRouting.cc.

Referenced by RctDigiToSourceCardText::analyze().

751  {
752 
753  unsigned long VHDCI[2][2] = {{0}};
754  RC234toVHDCI(RC, RCof, RCtau, sisterRC, sisterRCof, sisterRCtau, VHDCI);
755  VHDCItoSTRING(logicalCardID, eventNumber, dataString, VHDCI);
756 }
void VHDCItoSTRING(unsigned short &logicalCardID, unsigned short &eventNumber, std::string &dataString, unsigned long(&VHDCI)[2][2]) const
void RC234toVHDCI(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
void SourceCardRouting::RC234toVHDCI ( 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

Definition at line 664 of file SourceCardRouting.cc.

670  {
671 
672  unsigned short SFP[2][4] = {{0}};
673  RC234toSFP(RC, RCof, RCtau, sisterRC, sisterRCof, sisterRCtau, SFP);
674  SFPtoVHDCI(3, SFP, VHDCI);
675 }
void RC234toSFP(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 short(&SFP)[2][4]) const
void SFPtoVHDCI(int RoutingMode, unsigned short(&SFP)[2][4], unsigned long(&VHDCI)[2][2]) const
void SourceCardRouting::RC56HFtoSFP ( 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 short(&)  SFP[2][4] 
) const

Definition at line 120 of file SourceCardRouting.cc.

References CaloTPGTranscoder_cfi::HF, and globals_cff::x1.

125  {
126 
127  SFP[0][0] = (RC[5][0] & 0x3ff) | ((RCof[5][0] & 0x1) << 10) |
128  ((RCtau[5][0] & 0x1) << 11) | ((HFQ[0][0] & 0x1) << 12) |
129  ((HFQ[1][0] & 0x01) << 13) | ((HF[0][0] & 0x01) << 14);
130  SFP[1][0] = 0x8000 | (RC[5][1] & 0x3ff) | ((RCof[5][1] & 0x1) << 10) |
131  ((RCtau[5][1] & 0x1) << 11) | ((HFQ[2][0] & 0x1) << 12) |
132  ((HFQ[3][0] & 0x01) << 13) | ((HF[2][0] & 0x01) << 14);
133  SFP[0][1] = (RC[6][0] & 0x3ff) | ((RCof[6][0] & 0x1) << 10) |
134  ((RCtau[6][0] & 0x1) << 11) | ((HFQ[0][1] & 0x1) << 12) |
135  ((HFQ[1][1] & 0x01) << 13) | ((HF[0][1] & 0x01) << 14);
136  SFP[1][1] = 0x8000 | (RC[6][1] & 0x3ff) | ((RCof[6][1] & 0x1) << 10) |
137  ((RCtau[6][1] & 0x1) << 11) | ((HFQ[2][1] & 0x1) << 12) |
138  ((HFQ[3][1] & 0x01) << 13) | ((HF[2][1] & 0x01) << 14);
139  SFP[0][2] = ((HF[0][0] >> 1) & 0x7f) | ((HF[1][0] & 0xff) << 7);
140  SFP[1][2] = 0x8000 | ((HF[2][0] >> 1) & 0x7f) | ((HF[3][0] & 0xff) << 7);
141  SFP[0][3] = ((HF[0][1] >> 1) & 0x7f) | ((HF[1][1] & 0xff) << 7);
142  SFP[1][3] = 0x8000 | ((HF[2][1] >> 1) & 0x7f) | ((HF[3][1] & 0xff) << 7);
143 }
void SourceCardRouting::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

Definition at line 717 of file SourceCardRouting.cc.

References CaloTPGTranscoder_cfi::HF.

Referenced by RctDigiToSourceCardText::analyze().

721  {
722 
723  unsigned long VHDCI[2][2] = {{0}};
724  RC56HFtoVHDCI(RC, RCof, RCtau, HF, HFQ, VHDCI);
725  VHDCItoSTRING(logicalCardID, eventNumber, dataString, VHDCI);
726 }
void VHDCItoSTRING(unsigned short &logicalCardID, unsigned short &eventNumber, std::string &dataString, unsigned long(&VHDCI)[2][2]) const
void RC56HFtoVHDCI(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
void SourceCardRouting::RC56HFtoVHDCI ( 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

Definition at line 603 of file SourceCardRouting.cc.

References CaloTPGTranscoder_cfi::HF.

608  {
609 
610  unsigned short SFP[2][4] = {{0}};
611  RC56HFtoSFP(RC, RCof, RCtau, HF, HFQ, SFP);
612  SFPtoVHDCI(1, SFP, VHDCI);
613 }
void SFPtoVHDCI(int RoutingMode, unsigned short(&SFP)[2][4], unsigned long(&VHDCI)[2][2]) const
void RC56HFtoSFP(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 short(&SFP)[2][4]) const
void SourceCardRouting::RoutingModetoLogicalCardID ( unsigned short &  logicalCardID,
int &  RoutingMode,
int &  RCTCrateNumber 
) const

Definition at line 833 of file SourceCardRouting.cc.

Referenced by RctDigiToSourceCardText::analyze().

835  {
836 
837  logicalCardID = ((RCTCrateNumber % 9) << 3) |
838  (RCTCrateNumber > 8 ? 0x4 : 0x0) | (RoutingMode & 0x3);
839 }
void SourceCardRouting::SFPtoEMU ( 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 short(&)  SFP[2][4] 
) const

Definition at line 70 of file SourceCardRouting.cc.

References mps_fire::i, and globals_cff::x1.

Referenced by GctFormatTranslateV35::blockToRctEmCand(), GctFormatTranslateV38::blockToRctEmCand(), and GctFormatTranslateMCLegacy::blockToRctEmCand().

75  {
76 
77  for (int i = 0; i < 7; i++) {
78  for (int j = 0; j < 2; j++) {
79  MIPbits[i][j] = (SFP[0][0] >> ((2 * i) + j)) & 0x1;
80  Qbits[i][j] = (SFP[1][0] >> ((2 * i) + j)) & 0x1;
81  }
82  }
83 
84  eIsoRank[0] = SFP[0][1] & 0x3f;
85  eIsoRank[1] = ((SFP[0][1] >> 10) & 0x7) | ((SFP[0][2] >> 7) & 0x38);
86  eIsoRank[2] = SFP[1][1] & 0x3f;
87  eIsoRank[3] = ((SFP[1][1] >> 10) & 0x7) | ((SFP[1][2] >> 7) & 0x38);
88 
89  eNonIsoRank[0] = SFP[0][2] & 0x3f;
90  eNonIsoRank[1] = SFP[0][3] & 0x3f;
91  eNonIsoRank[2] = SFP[1][2] & 0x3f;
92  eNonIsoRank[3] = SFP[1][3] & 0x3f;
93 
94  eIsoRegionId[0] = (SFP[0][1] >> 6) & 0x1;
95  eIsoRegionId[1] = (SFP[0][2] >> 13) & 0x1;
96  eIsoRegionId[2] = (SFP[1][1] >> 6) & 0x1;
97  eIsoRegionId[3] = (SFP[1][2] >> 13) & 0x1;
98 
99  eNonIsoRegionId[0] = (SFP[0][2] >> 6) & 0x1;
100  eNonIsoRegionId[1] = (SFP[0][3] >> 6) & 0x1;
101  eNonIsoRegionId[2] = (SFP[1][2] >> 6) & 0x1;
102  eNonIsoRegionId[3] = (SFP[1][3] >> 6) & 0x1;
103 
104  eIsoCardId[0] = (SFP[0][1] >> 7) & 0x7;
105  eIsoCardId[1] = (SFP[0][3] >> 10) & 0x7;
106  eIsoCardId[2] = (SFP[1][1] >> 7) & 0x7;
107  eIsoCardId[3] = (SFP[1][3] >> 10) & 0x7;
108 
109  eNonIsoCardId[0] = (SFP[0][2] >> 7) & 0x7;
110  eNonIsoCardId[1] = (SFP[0][3] >> 7) & 0x7;
111  eNonIsoCardId[2] = (SFP[1][2] >> 7) & 0x7;
112  eNonIsoCardId[3] = (SFP[1][3] >> 7) & 0x7;
113 }
void SourceCardRouting::SFPtoRC012 ( unsigned short(&)  RC[7][2],
unsigned short(&)  RCof[7][2],
unsigned short(&)  RCtau[7][2],
unsigned short(&)  SFP[2][4] 
) const

Definition at line 227 of file SourceCardRouting.cc.

References globals_cff::x1.

230  {
231 
232  RC[0][0] = SFP[0][0] & 0x3ff;
233  RC[0][1] = SFP[1][0] & 0x3ff;
234  RC[1][0] = SFP[0][1] & 0x3ff;
235  RC[1][1] = SFP[1][1] & 0x3ff;
236  RC[2][0] = (RC[2][0] & 0x3c0) | ((SFP[0][0] & 0x7000) >> 12) |
237  ((SFP[0][1] & 0x7000) >> 9);
238  RC[2][1] = (RC[2][1] & 0x3c0) | ((SFP[1][0] & 0x7000) >> 12) |
239  ((SFP[1][1] & 0x7000) >> 9);
240 
241  RCof[0][0] = (SFP[0][0] >> 10) & 0x1;
242  RCof[0][1] = (SFP[1][0] >> 10) & 0x1;
243  RCof[1][0] = (SFP[0][1] >> 10) & 0x1;
244  RCof[1][1] = (SFP[1][1] >> 10) & 0x1;
245 
246  RCtau[0][0] = (SFP[0][0] >> 11) & 0x1;
247  RCtau[0][1] = (SFP[1][0] >> 11) & 0x1;
248  RCtau[1][0] = (SFP[0][1] >> 11) & 0x1;
249  RCtau[1][1] = (SFP[1][1] >> 11) & 0x1;
250 }
void SourceCardRouting::SFPtoRC234 ( 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 short(&)  SFP[2][4] 
) const

Definition at line 297 of file SourceCardRouting.cc.

References globals_cff::x1.

303  {
304 
305  RC[2][0] = (RC[2][0] & 0x3f) | ((SFP[0][0] & 0x7000) >> 6) |
306  ((SFP[0][1] & 0x1000) >> 3);
307  RC[3][0] = SFP[0][0] & 0x3ff;
308  RC[4][0] = SFP[0][1] & 0x3ff;
309  RC[2][1] = (RC[2][1] & 0x3f) | ((SFP[1][0] & 0x7000) >> 6) |
310  ((SFP[1][1] & 0x1000) >> 3);
311  RC[3][1] = SFP[1][0] & 0x3ff;
312  RC[4][1] = SFP[1][1] & 0x3ff;
313 
314  RCof[2][0] = (SFP[0][1] >> 13) & 0x1;
315  RCof[3][0] = (SFP[0][0] >> 10) & 0x1;
316  RCof[4][0] = (SFP[0][1] >> 10) & 0x1;
317  RCof[2][1] = (SFP[1][1] >> 13) & 0x1;
318  RCof[3][1] = (SFP[1][0] >> 10) & 0x1;
319  RCof[4][1] = (SFP[1][1] >> 10) & 0x1;
320 
321  RCtau[2][0] = (SFP[0][1] >> 14) & 0x1;
322  RCtau[3][0] = (SFP[0][0] >> 11) & 0x1;
323  RCtau[4][0] = (SFP[0][1] >> 11) & 0x1;
324  RCtau[2][1] = (SFP[1][1] >> 14) & 0x1;
325  RCtau[3][1] = (SFP[1][0] >> 11) & 0x1;
326  RCtau[4][1] = (SFP[1][1] >> 11) & 0x1;
327 
328  sisterRC[2][0] = (sisterRC[2][0] & ~0x3C0) | ((SFP[0][2] & 0x7000) >> 6) |
329  ((SFP[0][3] & 0x1000) >> 3);
330  sisterRC[3][0] = SFP[0][2] & 0x3ff;
331  sisterRC[4][0] = SFP[0][3] & 0x3ff;
332  sisterRC[2][1] = (sisterRC[2][1] & ~0x3C0) | ((SFP[1][2] & 0x7000) >> 6) |
333  ((SFP[1][3] & 0x1000) >> 3);
334  sisterRC[3][1] = SFP[1][2] & 0x3ff;
335  sisterRC[4][1] = SFP[1][3] & 0x3ff;
336 
337  sisterRCof[2][0] = (SFP[0][3] >> 13) & 0x1;
338  sisterRCof[3][0] = (SFP[0][2] >> 10) & 0x1;
339  sisterRCof[4][0] = (SFP[0][3] >> 10) & 0x1;
340  sisterRCof[2][1] = (SFP[1][3] >> 13) & 0x1;
341  sisterRCof[3][1] = (SFP[1][2] >> 10) & 0x1;
342  sisterRCof[4][1] = (SFP[1][3] >> 10) & 0x1;
343 
344  sisterRCtau[2][0] = (SFP[0][3] >> 14) & 0x1;
345  sisterRCtau[3][0] = (SFP[0][2] >> 11) & 0x1;
346  sisterRCtau[4][0] = (SFP[0][3] >> 11) & 0x1;
347  sisterRCtau[2][1] = (SFP[1][3] >> 14) & 0x1;
348  sisterRCtau[3][1] = (SFP[1][2] >> 11) & 0x1;
349  sisterRCtau[4][1] = (SFP[1][3] >> 11) & 0x1;
350 }
void SourceCardRouting::SFPtoRC56HF ( 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 short(&)  SFP[2][4] 
) const

Definition at line 150 of file SourceCardRouting.cc.

References CaloTPGTranscoder_cfi::HF, and globals_cff::x1.

155  {
156 
157  RC[5][0] = SFP[0][0] & 0x3ff;
158  RC[5][1] = SFP[1][0] & 0x3ff;
159  RC[6][0] = SFP[0][1] & 0x3ff;
160  RC[6][1] = SFP[1][1] & 0x3ff;
161 
162  RCof[5][0] = (SFP[0][0] >> 10) & 0x1;
163  RCof[5][1] = (SFP[1][0] >> 10) & 0x1;
164  RCof[6][0] = (SFP[0][1] >> 10) & 0x1;
165  RCof[6][1] = (SFP[1][1] >> 10) & 0x1;
166 
167  RCtau[5][0] = (SFP[0][0] >> 11) & 0x1;
168  RCtau[5][1] = (SFP[1][0] >> 11) & 0x1;
169  RCtau[6][0] = (SFP[0][1] >> 11) & 0x1;
170  RCtau[6][1] = (SFP[1][1] >> 11) & 0x1;
171 
172  HFQ[0][0] = (SFP[0][0] >> 12) & 0x1;
173  HFQ[1][0] = (SFP[0][0] >> 13) & 0x1;
174  HFQ[2][0] = (SFP[1][0] >> 12) & 0x1;
175  HFQ[3][0] = (SFP[1][0] >> 13) & 0x1;
176 
177  HFQ[0][1] = (SFP[0][1] >> 12) & 0x1;
178  HFQ[1][1] = (SFP[0][1] >> 13) & 0x1;
179  HFQ[2][1] = (SFP[1][1] >> 12) & 0x1;
180  HFQ[3][1] = (SFP[1][1] >> 13) & 0x1;
181 
182  HF[0][0] = ((SFP[0][2] & 0x7f) << 1) | ((SFP[0][0] >> 14) & 0x01);
183  HF[1][0] = (SFP[0][2] >> 7) & 0xff;
184  HF[2][0] = ((SFP[1][2] & 0x7f) << 1) | ((SFP[1][0] >> 14) & 0x01);
185  HF[3][0] = (SFP[1][2] >> 7) & 0xff;
186 
187  HF[0][1] = ((SFP[0][3] & 0x7f) << 1) | ((SFP[0][1] >> 14) & 0x01);
188  HF[1][1] = (SFP[0][3] >> 7) & 0xff;
189  HF[2][1] = ((SFP[1][3] & 0x7f) << 1) | ((SFP[1][1] >> 14) & 0x01);
190  HF[3][1] = (SFP[1][3] >> 7) & 0xff;
191 }
void SourceCardRouting::SFPtoSTRING ( unsigned short &  logicalCardID,
unsigned short &  eventNumber,
int  RoutingMode,
unsigned short(&)  SFP[2][4],
std::string &  dataString 
) const

Definition at line 761 of file SourceCardRouting.cc.

765  {
766 
767  unsigned long VHDCI[2][2] = {{0}};
768  SFPtoVHDCI(RoutingMode, SFP, VHDCI);
769  VHDCItoSTRING(logicalCardID, eventNumber, dataString, VHDCI);
770 }
void VHDCItoSTRING(unsigned short &logicalCardID, unsigned short &eventNumber, std::string &dataString, unsigned long(&VHDCI)[2][2]) const
void SFPtoVHDCI(int RoutingMode, unsigned short(&SFP)[2][4], unsigned long(&VHDCI)[2][2]) const
void SourceCardRouting::SFPtoVHDCI ( int  RoutingMode,
unsigned short(&)  SFP[2][4],
unsigned long(&)  VHDCI[2][2] 
) const

Definition at line 357 of file SourceCardRouting.cc.

References mps_fire::i, gen::k, and globals_cff::x1.

358  {
359 
360  unsigned short sfp_reverse[2][4] = {{0}};
361 
362  for (int i = 0; i < 2; i++) {
363  for (int j = 0; j < 4; j++) {
364  for (int k = 0; k < 16; k++) {
365  sfp_reverse[i][j] =
366  sfp_reverse[i][j] | (((SFP[i][j] >> k) & 0x01) << (15 - k));
367  }
368  // std::cout <<hex<< SFP[i][j]<<'\t'<<sfp_reverse[i][j]<<std::endl;
369  }
370  }
371 
372  switch (RoutingMode) {
373  case 0:
374  VHDCI[0][0] = (SFP[0][1] & 0x3ff) | ((SFP[0][1] & 0x1c00) << 1) |
375  ((SFP[0][2] & 0x3c00) << 4) | ((SFP[0][3] & 0x1c00) << 8) |
376  ((SFP[0][0] & 0xff) << 22);
377  VHDCI[0][1] = (SFP[1][1] & 0x3ff) | ((SFP[1][1] & 0x1c00) << 1) |
378  ((SFP[1][2] & 0x3c00) << 4) | ((SFP[1][3] & 0x1c00) << 8) |
379  ((SFP[1][0] & 0xff) << 22);
380  VHDCI[1][0] = (SFP[0][2] & 0x3ff) | ((SFP[0][3] & 0x3ff) << 11) |
381  ((SFP[0][0] & 0x3f00) << 14);
382  VHDCI[1][1] = (SFP[1][2] & 0x3ff) | ((SFP[1][3] & 0x3ff) << 11) |
383  ((SFP[1][0] & 0x3f00) << 14);
384  break;
385  case 1:
386  VHDCI[0][0] = (SFP[0][0] & 0xfff) | ((SFP[0][1] & 0x7) << 12) |
387  ((SFP[0][2] & 0x80) << 10) | ((SFP[0][0] & 0x4000) << 4) |
388  ((sfp_reverse[0][1] & 0xc) << 17) |
389  ((sfp_reverse[0][0] & 0xc) << 19) |
390  ((sfp_reverse[0][1] & 0x1ff0) << 19);
391  VHDCI[0][1] = (SFP[1][0] & 0xfff) | ((SFP[1][1] & 0x7) << 12) |
392  ((SFP[1][2] & 0x80) << 10) | ((SFP[1][0] & 0x4000) << 4) |
393  ((sfp_reverse[1][1] & 0xc) << 17) |
394  ((sfp_reverse[1][0] & 0xc) << 19) |
395  ((sfp_reverse[1][1] & 0x1ff0) << 19);
396 
397  VHDCI[1][0] = (SFP[0][1] & 0x4000) | ((SFP[0][3] & 0x80) << 24);
398  VHDCI[1][1] = (SFP[1][1] & 0x4000) | ((SFP[1][3] & 0x80) << 24);
399 
400  for (int i = 0; i < 7; i++) {
401  VHDCI[1][0] = VHDCI[1][0] | (((SFP[0][2] >> i) & 0x1) << (2 * i)) |
402  (((SFP[0][2] >> (i + 8)) & 0x1) << ((2 * i) + 1)) |
403  (((sfp_reverse[0][3] >> (i + 1)) & 0x1) << ((2 * i) + 17)) |
404  (((sfp_reverse[0][3] >> (i + 9)) & 0x1) << ((2 * i) + 18));
405  VHDCI[1][1] = VHDCI[1][1] | (((SFP[1][2] >> i) & 0x1) << (2 * i)) |
406  (((SFP[1][2] >> (i + 8)) & 0x1) << ((2 * i) + 1)) |
407  (((sfp_reverse[1][3] >> (i + 1)) & 0x1) << ((2 * i) + 17)) |
408  (((sfp_reverse[1][3] >> (i + 9)) & 0x1) << ((2 * i) + 18));
409  }
410  break;
411  case 2:
412  VHDCI[0][0] = (SFP[0][0] & 0xfff) | ((SFP[0][1] & 0x7) << 12) |
413  ((sfp_reverse[0][1] & 0xe) << 16) |
414  ((sfp_reverse[0][0] & 0xe) << 19) |
415  ((sfp_reverse[0][1] & 0x1ff0) << 19);
416  VHDCI[0][1] = (SFP[1][0] & 0xfff) | ((SFP[1][1] & 0x7) << 12) |
417  ((sfp_reverse[1][1] & 0xe) << 16) |
418  ((sfp_reverse[1][0] & 0xe) << 19) |
419  ((sfp_reverse[1][1] & 0x1ff0) << 19);
420  VHDCI[1][0] = 0;
421  VHDCI[1][1] = 0;
422  break;
423  case 3:
424  VHDCI[0][0] = ((SFP[0][0] >> 12) & 0x7) | ((SFP[0][1] >> 9) & 0x38) |
425  ((SFP[0][0] & 0x1ff) << 6) |
426  ((sfp_reverse[0][1] & 0xfff0) << 13) |
427  ((sfp_reverse[0][0] & 0x70) << 25);
428  VHDCI[0][1] = ((SFP[1][0] >> 12) & 0x7) | ((SFP[1][1] >> 9) & 0x38) |
429  ((SFP[1][0] & 0x1ff) << 6) |
430  ((sfp_reverse[1][1] & 0xfff0) << 13) |
431  ((sfp_reverse[1][0] & 0x70) << 25);
432 
433  VHDCI[1][0] = ((SFP[0][2] >> 12) & 0x7) | ((SFP[0][3] >> 9) & 0x38) |
434  ((SFP[0][2] & 0x1ff) << 6) |
435  ((sfp_reverse[0][3] & 0xfff0) << 13) |
436  ((sfp_reverse[0][2] & 0x70) << 25);
437  VHDCI[1][1] = ((SFP[1][2] >> 12) & 0x7) | ((SFP[1][3] >> 9) & 0x38) |
438  ((SFP[1][2] & 0x1ff) << 6) |
439  ((sfp_reverse[1][3] & 0xfff0) << 13) |
440  ((sfp_reverse[1][2] & 0x70) << 25);
441  break;
442  default:
443  VHDCI[0][0] = 0;
444  VHDCI[0][1] = 0;
445  VHDCI[1][0] = 0;
446  VHDCI[1][1] = 0;
447  }
448 }
int k[5][pyjets_maxn]
void SourceCardRouting::STRINGtoVHDCI ( unsigned short &  logicalCardID,
unsigned short &  eventNumber,
std::string &  dataString,
unsigned long(&)  VHDCI[2][2] 
) const

Definition at line 775 of file SourceCardRouting.cc.

References TauDecayModes::dec, and groupFilesInBlocks::temp.

Referenced by SourceCardTextToRctDigi::produce().

778  {
779 
780  stringstream temp;
781 
782  if (!dataString.empty()) {
783  temp << dataString << std::endl;
784  temp >> dec >> eventNumber;
785  temp >> dec >> logicalCardID;
786  temp >> hex >> VHDCI[0][0];
787  temp >> hex >> VHDCI[0][1];
788  temp >> hex >> VHDCI[1][0];
789  temp >> hex >> VHDCI[1][1];
790  } else {
791  eventNumber = 65535;
792  logicalCardID = 65535;
793  VHDCI[0][0] = 0;
794  VHDCI[0][1] = 0;
795  VHDCI[1][0] = 0;
796  VHDCI[1][1] = 0;
797  }
798 }
void SourceCardRouting::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

Definition at line 585 of file SourceCardRouting.cc.

Referenced by SourceCardTextToRctDigi::produce().

590  {
591 
592  unsigned short SFP[2][4] = {{0}};
593  VHDCItoSFP(0, SFP, VHDCI);
594  SFPtoEMU(eIsoRank, eIsoCardId, eIsoRegionId, eNonIsoRank, eNonIsoCardId,
595  eNonIsoRegionId, MIPbits, Qbits, SFP);
596 }
void SFPtoEMU(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 short(&SFP)[2][4]) const
void VHDCItoSFP(int RoutingMode, unsigned short(&SFP)[2][4], unsigned long(&VHDCI)[2][2]) const
void SourceCardRouting::VHDCItoRC012 ( unsigned short(&)  RC[7][2],
unsigned short(&)  RCof[7][2],
unsigned short(&)  RCtau[7][2],
unsigned long(&)  VHDCI[2][2] 
) const

Definition at line 650 of file SourceCardRouting.cc.

Referenced by SourceCardTextToRctDigi::produce().

653  {
654 
655  unsigned short SFP[2][4] = {{0}};
656  VHDCItoSFP(2, SFP, VHDCI);
657  SFPtoRC012(RC, RCof, RCtau, SFP);
658 }
void SFPtoRC012(unsigned short(&RC)[7][2], unsigned short(&RCof)[7][2], unsigned short(&RCtau)[7][2], unsigned short(&SFP)[2][4]) const
void VHDCItoSFP(int RoutingMode, unsigned short(&SFP)[2][4], unsigned long(&VHDCI)[2][2]) const
void SourceCardRouting::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

Definition at line 681 of file SourceCardRouting.cc.

Referenced by SourceCardTextToRctDigi::produce().

687  {
688 
689  unsigned short SFP[2][4] = {{0}};
690  VHDCItoSFP(3, SFP, VHDCI);
691  SFPtoRC234(RC, RCof, RCtau, sisterRC, sisterRCof, sisterRCtau, SFP);
692 }
void SFPtoRC234(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 short(&SFP)[2][4]) const
void VHDCItoSFP(int RoutingMode, unsigned short(&SFP)[2][4], unsigned long(&VHDCI)[2][2]) const
void SourceCardRouting::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

Definition at line 620 of file SourceCardRouting.cc.

References CaloTPGTranscoder_cfi::HF.

Referenced by SourceCardTextToRctDigi::produce().

625  {
626 
627  unsigned short SFP[2][4] = {{0}};
628  VHDCItoSFP(1, SFP, VHDCI);
629  SFPtoRC56HF(RC, RCof, RCtau, HF, HFQ, SFP);
630 }
void SFPtoRC56HF(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 short(&SFP)[2][4]) const
void VHDCItoSFP(int RoutingMode, unsigned short(&SFP)[2][4], unsigned long(&VHDCI)[2][2]) const
void SourceCardRouting::VHDCItoSFP ( int  RoutingMode,
unsigned short(&)  SFP[2][4],
unsigned long(&)  VHDCI[2][2] 
) const

Definition at line 453 of file SourceCardRouting.cc.

References mps_fire::i, gen::k, and globals_cff::x1.

454  {
455 
456  unsigned short VHDCI_reverse[2][4] = {{0}};
457 
458  for (int i = 0; i < 2; i++) {
459  for (int j = 0; j < 2; j++) {
460  for (int k = 0; k < 32; k++) {
461  VHDCI_reverse[i][j] =
462  VHDCI_reverse[i][j] | (((VHDCI[i][j] >> k) & 0x01) << (31 - k));
463  }
464  }
465  }
466 
467  switch (RoutingMode) {
468  case 0:
469  SFP[0][0] = ((VHDCI[0][0] >> 22) & 0xff) | ((VHDCI[1][0] >> 14) & 0x3f00);
470  SFP[1][0] =
471  0x8000 | ((VHDCI[0][1] >> 22) & 0xff) | ((VHDCI[1][1] >> 14) & 0x3f00);
472  SFP[0][1] = (VHDCI[0][0] & 0x3ff) | ((VHDCI[0][0] >> 1) & 0x1c00);
473  SFP[1][1] = 0x8000 | (VHDCI[0][1] & 0x3ff) | ((VHDCI[0][1] >> 1) & 0x1c00);
474  SFP[0][2] = (VHDCI[1][0] & 0x3ff) | ((VHDCI[0][0] >> 4) & 0x3c00);
475  SFP[1][2] = 0x8000 | (VHDCI[1][1] & 0x3ff) | ((VHDCI[0][1] >> 4) & 0x3c00);
476  SFP[0][3] = ((VHDCI[1][0] >> 11) & 0x3ff) | ((VHDCI[0][0] >> 8) & 0x1c00);
477  SFP[1][3] =
478  0x8000 | ((VHDCI[1][1] >> 11) & 0x3ff) | ((VHDCI[0][1] >> 8) & 0x1c00);
479  break;
480  case 1:
481  SFP[0][0] = (VHDCI[0][0] & 0xfff) | ((VHDCI_reverse[0][0] & 0x600) << 3) |
482  ((VHDCI_reverse[0][0] & 0x2000) << 1);
483  SFP[1][0] = 0x8000 | (VHDCI[0][1] & 0xfff) |
484  ((VHDCI_reverse[0][1] & 0x600) << 3) |
485  ((VHDCI_reverse[0][1] & 0x2000) << 1);
486  SFP[0][1] = ((VHDCI[0][0] & 0x7000) >> 12) |
487  ((VHDCI_reverse[0][0] & 0x1ff) << 3) |
488  ((VHDCI_reverse[0][0] & 0x1800) << 1) | (VHDCI[1][0] & 0x4000);
489  SFP[1][1] = 0x8000 | ((VHDCI[0][1] & 0x7000) >> 12) |
490  ((VHDCI_reverse[0][1] & 0x1ff) << 3) |
491  ((VHDCI_reverse[0][1] & 0x1800) << 1) | (VHDCI[1][1] & 0x4000);
492 
493  SFP[0][2] = ((VHDCI[0][0] & 0x20000) >> 10);
494  SFP[1][2] = 0x8000 | ((VHDCI[0][1] & 0x20000) >> 10);
495  SFP[0][3] = ((VHDCI[1][0] & 0x20000) >> 3);
496  SFP[1][3] = 0x8000 | ((VHDCI[1][1] & 0x20000) >> 3);
497  for (int i = 0; i < 7; i++) {
498  SFP[0][2] = SFP[0][2] | (((VHDCI[1][0] >> (2 * i)) & 0x1) << i) |
499  (((VHDCI[1][0] >> ((2 * i) + 1)) & 0x1) << (i + 8));
500  SFP[1][2] = SFP[1][2] | (((VHDCI[1][1] >> (2 * i)) & 0x1) << i) |
501  (((VHDCI[1][1] >> ((2 * i) + 1)) & 0x1) << (i + 8));
502  SFP[0][3] = SFP[0][3] |
503  (((VHDCI_reverse[1][0] >> ((2 * i) + 1)) & 0x1) << i) |
504  (((VHDCI_reverse[1][0] >> (2 * i)) & 0x1) << (i + 7));
505  SFP[1][3] = SFP[1][3] |
506  (((VHDCI_reverse[1][1] >> ((2 * i) + 1)) & 0x1) << i) |
507  (((VHDCI_reverse[1][1] >> (2 * i)) & 0x1) << (i + 7));
508  }
509  break;
510  case 2:
511  SFP[0][0] = (VHDCI[0][0] & 0xfff) | ((VHDCI_reverse[0][0] & 0xe00) << 3);
512  SFP[1][0] =
513  0x8000 | (VHDCI[0][1] & 0xfff) | ((VHDCI_reverse[0][1] & 0xe00) << 3);
514  SFP[0][1] = ((VHDCI[0][0] & 0x7000) >> 12) |
515  ((VHDCI_reverse[0][0] & 0x1ff) << 3) |
516  (VHDCI_reverse[0][0] & 0x7000);
517  SFP[1][1] = 0x8000 | ((VHDCI[0][1] & 0x7000) >> 12) |
518  ((VHDCI_reverse[0][1] & 0x1ff) << 3) |
519  (VHDCI_reverse[0][1] & 0x7000);
520  SFP[0][2] = (VHDCI[0][0] & 0xfff);
521  SFP[1][2] = 0x8000 | (VHDCI[0][1] & 0xfff);
522  SFP[0][3] =
523  ((VHDCI[0][0] & 0x7000) >> 12) | ((VHDCI_reverse[0][0] & 0x1ff) << 3);
524  SFP[1][3] = 0x8000 | ((VHDCI[0][1] & 0x7000) >> 12) |
525  ((VHDCI_reverse[0][1] & 0x1ff) << 3);
526  break;
527  case 3:
528  SFP[0][0] = ((VHDCI[0][0] & 0x7fc0) >> 6) |
529  ((VHDCI_reverse[0][0] & 0x7) << 9) |
530  ((VHDCI[0][0] & 0x7) << 12);
531  SFP[1][0] = 0x8000 | ((VHDCI[0][1] & 0x7fc0) >> 6) |
532  ((VHDCI_reverse[0][1] & 0x7) << 9) |
533  ((VHDCI[0][1] & 0x7) << 12);
534  SFP[0][1] =
535  ((VHDCI_reverse[0][0] & 0x7ff8) >> 3) | ((VHDCI[0][0] & 0x38) << 9);
536  SFP[1][1] = 0x8000 | ((VHDCI_reverse[0][1] & 0x7ff8) >> 3) |
537  ((VHDCI[0][1] & 0x38) << 9);
538  SFP[0][2] = ((VHDCI[1][0] & 0x7fc0) >> 6) |
539  ((VHDCI_reverse[1][0] & 0x7) << 9) |
540  ((VHDCI[1][0] & 0x7) << 12);
541  SFP[1][2] = 0x8000 | ((VHDCI[1][1] & 0x7fc0) >> 6) |
542  ((VHDCI_reverse[1][1] & 0x7) << 9) |
543  ((VHDCI[1][1] & 0x7) << 12);
544  SFP[0][3] =
545  ((VHDCI_reverse[1][0] & 0x7ff8) >> 3) | ((VHDCI[1][0] & 0x38) << 9);
546  SFP[1][3] = 0x8000 | ((VHDCI_reverse[1][1] & 0x7ff8) >> 3) |
547  ((VHDCI[1][1] & 0x38) << 9);
548  break;
549  default:
550  SFP[0][0] = 0;
551  SFP[1][0] = 0x8000;
552  SFP[0][1] = 0;
553  SFP[1][1] = 0x8000;
554  SFP[0][2] = 0;
555  SFP[1][2] = 0x8000;
556  SFP[0][3] = 0;
557  SFP[1][3] = 0x8000;
558  }
559 }
int k[5][pyjets_maxn]
void SourceCardRouting::VHDCItoSTRING ( unsigned short &  logicalCardID,
unsigned short &  eventNumber,
std::string &  dataString,
unsigned long(&)  VHDCI[2][2] 
) const

Definition at line 802 of file SourceCardRouting.cc.

References TauDecayModes::dec, and groupFilesInBlocks::temp.

805  {
806 
807  stringstream temp;
808 
809  temp << dec << eventNumber << '\t';
810  temp << dec << logicalCardID << '\t';
811  temp << hex << setw(8) << setfill('0') << VHDCI[0][0] << '\t';
812  temp << hex << setw(8) << setfill('0') << VHDCI[0][1] << '\t';
813  temp << hex << setw(8) << setfill('0') << VHDCI[1][0] << '\t';
814  temp << hex << setw(8) << setfill('0') << VHDCI[1][1] << std::endl;
815  dataString = temp.str();
816 }