CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions
SourceCardRouting Class Reference

#include <SourceCardRouting.h>

Classes

struct  EmuToSfpData
 Struct of all data needed for running the emulator to SFP (sourcecard optical output) conversion. More...
 

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 i, and j.

Referenced by GctFormatTranslateMCLegacy::writeRctEmCandBlocks().

38  {
39 
40 SFP[0][0]=0;
41 SFP[1][0]=0x8000;
42 
43 for (int i=0;i<7;i++){
44  for (int j=0;j<2;j++){
45  SFP[0][0] = SFP[0][0]|((MIPbits[i][j]&0x01)<<((2*i)+j) );
46  SFP[1][0] = SFP[1][0]|((Qbits[i][j]&0x01)<<((2*i)+j) );
47  }
48 }
49 
50  SFP[0][1] = (eIsoRank[0]&0x3f)|((eIsoRegionId[0]&0x01)<<6)|((eIsoCardId[0]&0x07)<<7)|((eIsoRank[1]&0x7)<<10);
51  SFP[1][1] = 0x8000|(eIsoRank[2]&0x3f)|((eIsoRegionId[2]&0x01)<<6)|((eIsoCardId[2]&0x07)<<7)|((eIsoRank[3]&0x7)<<10);
52  SFP[0][2] = (eNonIsoRank[0]&0x3f)|((eNonIsoRegionId[0]&0x01)<<6)|((eNonIsoCardId[0]&0x07)<<7)|((eIsoRank[1]&0x38)<<7)|((eIsoRegionId[1]&0x01)<<13);
53  SFP[1][2] = 0x8000|(eNonIsoRank[2]&0x3f)|((eNonIsoRegionId[2]&0x01)<<6)|((eNonIsoCardId[2]&0x07)<<7)|((eIsoRank[3]&0x38)<<7)|((eIsoRegionId[3]&0x01)<<13);
54  SFP[0][3] = (eNonIsoRank[1]&0x3f)|((eNonIsoRegionId[1]&0x01)<<6)|((eNonIsoCardId[1]&0x07)<<7)|((eIsoCardId[1]&0x07)<<10);
55  SFP[1][3] = 0x8000|(eNonIsoRank[3]&0x3f)|((eNonIsoRegionId[3]&0x01)<<6)|((eNonIsoCardId[3]&0x07)<<7)|((eIsoCardId[3]&0x07)<<10);
56 }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
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 612 of file SourceCardRouting.cc.

Referenced by RctDigiToSourceCardText::analyze().

622  {
623 
624  unsigned long VHDCI[2][2]={{0}};
625  EMUtoVHDCI(eIsoRank,eIsoCardId,eIsoRegionId,eNonIsoRank,eNonIsoCardId,eNonIsoRegionId,MIPbits,Qbits,VHDCI);
626  VHDCItoSTRING (logicalCardID, eventNumber, dataString, VHDCI);
627 
628 }
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 465 of file SourceCardRouting.cc.

473  {
474 
475  unsigned short SFP[2][4]={{0}};
476  EMUtoSFP(eIsoRank,eIsoCardId,eIsoRegionId,eNonIsoRank,eNonIsoCardId,eNonIsoRegionId,MIPbits,Qbits,SFP);
477  SFPtoVHDCI(0,SFP,VHDCI);
478 
479 }
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 754 of file SourceCardRouting.cc.

Referenced by SourceCardTextToRctDigi::produce().

756  {
757 
758  RCTCrateNumber = (logicalCardID>>3);
759  if ( (logicalCardID&0x4) != 0)RCTCrateNumber+=9;
760  RoutingMode = (logicalCardID&0x3);
761 
762 }
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 190 of file SourceCardRouting.cc.

193  {
194 
195  SFP[0][0] = (RC[0][0]&0x3ff)|((RCof[0][0]&0x1)<<10)|((RCtau[0][0]&0x1)<<11)|((RC[2][0]&0x7)<<12);
196  SFP[1][0] = 0x8000|(RC[0][1]&0x3ff)|((RCof[0][1]&0x1)<<10)|((RCtau[0][1]&0x1)<<11)|((RC[2][1]&0x7)<<12);
197 
198  SFP[0][1] = (RC[1][0]&0x3ff)|((RCof[1][0]&0x1)<<10)|((RCtau[1][0]&0x1)<<11)|((RC[2][0]&0x38)<<9);
199  SFP[1][1] = 0x8000|(RC[1][1]&0x3ff)|((RCof[1][1]&0x1)<<10)|((RCtau[1][1]&0x1)<<11)|((RC[2][1]&0x38)<<9);
200 
201  SFP[0][2] = (RC[0][0]&0x3ff)|((RCof[0][0]&0x1)<<10)|((RCtau[0][0]&0x1)<<11);
202  SFP[1][2] = 0x8000|(RC[0][1]&0x3ff)|((RCof[0][1]&0x1)<<10)|((RCtau[0][1]&0x1)<<11);
203 
204  SFP[0][3] = (RC[1][0]&0x3ff)|((RCof[1][0]&0x1)<<10)|((RCtau[1][0]&0x1)<<11);
205  SFP[1][3] = 0x8000|(RC[1][1]&0x3ff)|((RCof[1][1]&0x1)<<10)|((RCtau[1][1]&0x1)<<11);
206 
207 }
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 654 of file SourceCardRouting.cc.

Referenced by RctDigiToSourceCardText::analyze().

659  {
660 
661  unsigned long VHDCI[2][2]={{0}};
662  RC012toVHDCI(RC,RCof,RCtau,VHDCI);
663  VHDCItoSTRING (logicalCardID, eventNumber, dataString, VHDCI);
664 
665 }
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 546 of file SourceCardRouting.cc.

549  {
550 
551  unsigned short SFP[2][4]={{0}};
552  RC012toSFP(RC,RCof,RCtau,SFP);
553  SFPtoVHDCI(2,SFP,VHDCI);
554 }
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 242 of file SourceCardRouting.cc.

248  {
249 
250  SFP[0][0] = (RC[3][0]&0x3ff)|((RCof[3][0]&0x1)<<10)|((RCtau[3][0]&0x1)<<11)|((RC[2][0]&0x1c0)<<6);
251  SFP[1][0] = 0x8000|(RC[3][1]&0x3ff)|((RCof[3][1]&0x1)<<10)|((RCtau[3][1]&0x1)<<11)|((RC[2][1]&0x1c0)<<6);
252 
253  SFP[0][1] = (RC[4][0]&0x3ff)|((RCof[4][0]&0x1)<<10)|((RCtau[4][0]&0x1)<<11)|((RC[2][0]&0x200)<<3)|((RCof[2][0]&0x1)<<13)|((RCtau[2][0]&0x1)<<14);
254  SFP[1][1] = 0x8000|(RC[4][1]&0x3ff)|((RCof[4][1]&0x1)<<10)|((RCtau[4][1]&0x1)<<11)|((RC[2][1]&0x200)<<3)|((RCof[2][1]&0x1)<<13)|((RCtau[2][1]&0x1)<<14);
255 
256  SFP[0][2] = (sisterRC[3][0]&0x3ff)|((sisterRCof[3][0]&0x1)<<10)|((sisterRCtau[3][0]&0x1)<<11)|((sisterRC[2][0]&0x1c0)<<6);
257  SFP[1][2] = 0x8000|(sisterRC[3][1]&0x3ff)|((sisterRCof[3][1]&0x1)<<10)|((sisterRCtau[3][1]&0x1)<<11)|((sisterRC[2][1]&0x1c0)<<6);
258 
259  SFP[0][3] = (sisterRC[4][0]&0x3ff)|((sisterRCof[4][0]&0x1)<<10)|((sisterRCtau[4][0]&0x1)<<11)|((sisterRC[2][0]&0x200)<<3)|((sisterRCof[2][0]&0x1)<<13)|((sisterRCtau[2][0]&0x1)<<14);
260  SFP[1][3] = 0x8000|(sisterRC[4][1]&0x3ff)|((sisterRCof[4][1]&0x1)<<10)|((sisterRCtau[4][1]&0x1)<<11)|((sisterRC[2][1]&0x200)<<3)|((sisterRCof[2][1]&0x1)<<13)|((sisterRCtau[2][1]&0x1)<<14);
261 
262 }
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 671 of file SourceCardRouting.cc.

Referenced by RctDigiToSourceCardText::analyze().

679  {
680 
681  unsigned long VHDCI[2][2]={{0}};
682  RC234toVHDCI(RC,RCof,RCtau,sisterRC,sisterRCof,sisterRCtau,VHDCI);
683  VHDCItoSTRING (logicalCardID, eventNumber, dataString, VHDCI);
684 
685 }
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 575 of file SourceCardRouting.cc.

581  {
582 
583  unsigned short SFP[2][4]={{0}};
584  RC234toSFP(RC,RCof,RCtau,sisterRC,sisterRCof,sisterRCtau,SFP);
585  SFPtoVHDCI(3,SFP,VHDCI);
586 
587 }
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 118 of file SourceCardRouting.cc.

References hi::HF.

123  {
124 
125  SFP[0][0] = (RC[5][0]&0x3ff)|((RCof[5][0]&0x1)<<10)|((RCtau[5][0]&0x1)<<11)|((HFQ[0][0]&0x1)<<12)|((HFQ[1][0]&0x01)<<13)|((HF[0][0]&0x01)<<14);
126  SFP[1][0] = 0x8000|(RC[5][1]&0x3ff)|((RCof[5][1]&0x1)<<10)|((RCtau[5][1]&0x1)<<11)|((HFQ[2][0]&0x1)<<12)|((HFQ[3][0]&0x01)<<13)|((HF[2][0]&0x01)<<14);
127  SFP[0][1] = (RC[6][0]&0x3ff)|((RCof[6][0]&0x1)<<10)|((RCtau[6][0]&0x1)<<11)|((HFQ[0][1]&0x1)<<12)|((HFQ[1][1]&0x01)<<13)|((HF[0][1]&0x01)<<14);
128  SFP[1][1] = 0x8000|(RC[6][1]&0x3ff)|((RCof[6][1]&0x1)<<10)|((RCtau[6][1]&0x1)<<11)|((HFQ[2][1]&0x1)<<12)|((HFQ[3][1]&0x01)<<13)|((HF[2][1]&0x01)<<14);
129  SFP[0][2] = ((HF[0][0]>>1)&0x7f)|((HF[1][0]&0xff)<<7);
130  SFP[1][2] = 0x8000|((HF[2][0]>>1)&0x7f)|((HF[3][0]&0xff)<<7);
131  SFP[0][3] = ((HF[0][1]>>1)&0x7f)|((HF[1][1]&0xff)<<7);
132  SFP[1][3] = 0x8000|((HF[2][1]>>1)&0x7f)|((HF[3][1]&0xff)<<7);
133 
134 
135 }
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 635 of file SourceCardRouting.cc.

References hi::HF.

Referenced by RctDigiToSourceCardText::analyze().

642  {
643 
644  unsigned long VHDCI[2][2]={{0}};
645  RC56HFtoVHDCI(RC,RCof,RCtau,HF,HFQ,VHDCI);
646  VHDCItoSTRING (logicalCardID, eventNumber, dataString, VHDCI);
647 
648 }
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 511 of file SourceCardRouting.cc.

References hi::HF.

516  {
517 
518  unsigned short SFP[2][4]={{0}};
519  RC56HFtoSFP(RC,RCof,RCtau,HF,HFQ,SFP);
520  SFPtoVHDCI(1,SFP,VHDCI);
521 
522 }
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 766 of file SourceCardRouting.cc.

Referenced by RctDigiToSourceCardText::analyze().

768  {
769 
770  logicalCardID = ((RCTCrateNumber%9)<<3)|(RCTCrateNumber>8?0x4:0x0)|(RoutingMode&0x3);
771 
772 }
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 63 of file SourceCardRouting.cc.

References i, and j.

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

71  {
72 
73 
74  for (int i=0; i<7;i++){
75  for (int j=0; j<2;j++){
76  MIPbits[i][j] = (SFP[0][0]>>((2*i)+j) )&0x1;
77  Qbits[i][j] = (SFP[1][0]>>((2*i)+j) )&0x1;
78  }
79  }
80 
81  eIsoRank[0] = SFP[0][1]&0x3f;
82  eIsoRank[1] = ((SFP[0][1]>>10)&0x7)|((SFP[0][2]>>7)&0x38);
83  eIsoRank[2] = SFP[1][1]&0x3f;
84  eIsoRank[3] = ((SFP[1][1]>>10)&0x7)|((SFP[1][2]>>7)&0x38);
85 
86  eNonIsoRank[0] = SFP[0][2]&0x3f;
87  eNonIsoRank[1] = SFP[0][3]&0x3f;
88  eNonIsoRank[2] = SFP[1][2]&0x3f;
89  eNonIsoRank[3] = SFP[1][3]&0x3f;
90 
91  eIsoRegionId[0] = (SFP[0][1]>>6)&0x1;
92  eIsoRegionId[1] = (SFP[0][2]>>13)&0x1;
93  eIsoRegionId[2] = (SFP[1][1]>>6)&0x1;
94  eIsoRegionId[3] = (SFP[1][2]>>13)&0x1;
95 
96  eNonIsoRegionId[0] = (SFP[0][2]>>6)&0x1;
97  eNonIsoRegionId[1] = (SFP[0][3]>>6)&0x1;
98  eNonIsoRegionId[2] = (SFP[1][2]>>6)&0x1;
99  eNonIsoRegionId[3] = (SFP[1][3]>>6)&0x1;
100 
101  eIsoCardId[0] = (SFP[0][1]>>7)&0x7;
102  eIsoCardId[1] = (SFP[0][3]>>10)&0x7;
103  eIsoCardId[2] = (SFP[1][1]>>7)&0x7;
104  eIsoCardId[3] = (SFP[1][3]>>10)&0x7;
105 
106  eNonIsoCardId[0] = (SFP[0][2]>>7)&0x7;
107  eNonIsoCardId[1] = (SFP[0][3]>>7)&0x7;
108  eNonIsoCardId[2] = (SFP[1][2]>>7)&0x7;
109  eNonIsoCardId[3] = (SFP[1][3]>>7)&0x7;
110 
111 }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
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 213 of file SourceCardRouting.cc.

216  {
217 
218  RC[0][0]=SFP[0][0]&0x3ff;
219  RC[0][1]=SFP[1][0]&0x3ff;
220  RC[1][0]=SFP[0][1]&0x3ff;
221  RC[1][1]=SFP[1][1]&0x3ff;
222  RC[2][0]=(RC[2][0]&0x3c0)|((SFP[0][0]&0x7000)>>12)|((SFP[0][1]&0x7000)>>9);
223  RC[2][1]=(RC[2][1]&0x3c0)|((SFP[1][0]&0x7000)>>12)|((SFP[1][1]&0x7000)>>9);
224 
225  RCof[0][0]=(SFP[0][0]>>10)&0x1;
226  RCof[0][1]=(SFP[1][0]>>10)&0x1;
227  RCof[1][0]=(SFP[0][1]>>10)&0x1;
228  RCof[1][1]=(SFP[1][1]>>10)&0x1;
229 
230  RCtau[0][0]=(SFP[0][0]>>11)&0x1;
231  RCtau[0][1]=(SFP[1][0]>>11)&0x1;
232  RCtau[1][0]=(SFP[0][1]>>11)&0x1;
233  RCtau[1][1]=(SFP[1][1]>>11)&0x1;
234 
235 
236 }
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 268 of file SourceCardRouting.cc.

274  {
275 
276  RC[2][0]=(RC[2][0]&0x3f)|((SFP[0][0]&0x7000)>>6)|((SFP[0][1]&0x1000)>>3);
277  RC[3][0]=SFP[0][0]&0x3ff;
278  RC[4][0]=SFP[0][1]&0x3ff;
279  RC[2][1]=(RC[2][1]&0x3f)|((SFP[1][0]&0x7000)>>6)|((SFP[1][1]&0x1000)>>3);
280  RC[3][1]=SFP[1][0]&0x3ff;
281  RC[4][1]=SFP[1][1]&0x3ff;
282 
283  RCof[2][0]=(SFP[0][1]>>13)&0x1;
284  RCof[3][0]=(SFP[0][0]>>10)&0x1;
285  RCof[4][0]=(SFP[0][1]>>10)&0x1;
286  RCof[2][1]=(SFP[1][1]>>13)&0x1;
287  RCof[3][1]=(SFP[1][0]>>10)&0x1;
288  RCof[4][1]=(SFP[1][1]>>10)&0x1;
289 
290  RCtau[2][0]=(SFP[0][1]>>14)&0x1;
291  RCtau[3][0]=(SFP[0][0]>>11)&0x1;
292  RCtau[4][0]=(SFP[0][1]>>11)&0x1;
293  RCtau[2][1]=(SFP[1][1]>>14)&0x1;
294  RCtau[3][1]=(SFP[1][0]>>11)&0x1;
295  RCtau[4][1]=(SFP[1][1]>>11)&0x1;
296 
297  sisterRC[2][0]=(sisterRC[2][0]&~0x3C0)|((SFP[0][2]&0x7000)>>6)|((SFP[0][3]&0x1000)>>3);
298  sisterRC[3][0]=SFP[0][2]&0x3ff;
299  sisterRC[4][0]=SFP[0][3]&0x3ff;
300  sisterRC[2][1]=(sisterRC[2][1]&~0x3C0)|((SFP[1][2]&0x7000)>>6)|((SFP[1][3]&0x1000)>>3);
301  sisterRC[3][1]=SFP[1][2]&0x3ff;
302  sisterRC[4][1]=SFP[1][3]&0x3ff;
303 
304  sisterRCof[2][0]=(SFP[0][3]>>13)&0x1;
305  sisterRCof[3][0]=(SFP[0][2]>>10)&0x1;
306  sisterRCof[4][0]=(SFP[0][3]>>10)&0x1;
307  sisterRCof[2][1]=(SFP[1][3]>>13)&0x1;
308  sisterRCof[3][1]=(SFP[1][2]>>10)&0x1;
309  sisterRCof[4][1]=(SFP[1][3]>>10)&0x1;
310 
311  sisterRCtau[2][0]=(SFP[0][3]>>14)&0x1;
312  sisterRCtau[3][0]=(SFP[0][2]>>11)&0x1;
313  sisterRCtau[4][0]=(SFP[0][3]>>11)&0x1;
314  sisterRCtau[2][1]=(SFP[1][3]>>14)&0x1;
315  sisterRCtau[3][1]=(SFP[1][2]>>11)&0x1;
316  sisterRCtau[4][1]=(SFP[1][3]>>11)&0x1;
317 
318 }
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 142 of file SourceCardRouting.cc.

References hi::HF.

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

Definition at line 691 of file SourceCardRouting.cc.

695  {
696 
697  unsigned long VHDCI[2][2]={{0}};
698  SFPtoVHDCI(RoutingMode,SFP,VHDCI);
699  VHDCItoSTRING (logicalCardID, eventNumber, dataString, VHDCI);
700 
701 }
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 326 of file SourceCardRouting.cc.

References i, j, and relval_steps::k.

328  {
329 
330 unsigned short sfp_reverse[2][4]={{0}};
331 
332 for (int i=0; i<2;i++){
333  for(int j=0; j<4;j++){
334  for (int k=0; k<16;k++){
335  sfp_reverse[i][j]=sfp_reverse[i][j]|(((SFP[i][j]>>k)&0x01)<<(15-k));
336  }
337  //std::cout <<hex<< SFP[i][j]<<'\t'<<sfp_reverse[i][j]<<std::endl;
338  }
339 }
340 
341  switch (RoutingMode){
342  case 0:
343  VHDCI[0][0]=(SFP[0][1]&0x3ff)|((SFP[0][1]&0x1c00)<<1)|((SFP[0][2]&0x3c00)<<4)|((SFP[0][3]&0x1c00)<<8)|((SFP[0][0]&0xff)<<22);
344  VHDCI[0][1]=(SFP[1][1]&0x3ff)|((SFP[1][1]&0x1c00)<<1)|((SFP[1][2]&0x3c00)<<4)|((SFP[1][3]&0x1c00)<<8)|((SFP[1][0]&0xff)<<22);
345  VHDCI[1][0]=(SFP[0][2]&0x3ff)|((SFP[0][3]&0x3ff)<<11)|((SFP[0][0]&0x3f00)<<14);
346  VHDCI[1][1]=(SFP[1][2]&0x3ff)|((SFP[1][3]&0x3ff)<<11)|((SFP[1][0]&0x3f00)<<14);
347  break;
348  case 1:
349  VHDCI[0][0]=(SFP[0][0]&0xfff)|((SFP[0][1]&0x7)<<12)|((SFP[0][2]&0x80)<<10)|((SFP[0][0]&0x4000)<<4)|((sfp_reverse[0][1]&0xc)<<17)|((sfp_reverse[0][0]&0xc)<<19)|((sfp_reverse[0][1]&0x1ff0)<<19);
350  VHDCI[0][1]=(SFP[1][0]&0xfff)|((SFP[1][1]&0x7)<<12)|((SFP[1][2]&0x80)<<10)|((SFP[1][0]&0x4000)<<4)|((sfp_reverse[1][1]&0xc)<<17)|((sfp_reverse[1][0]&0xc)<<19)|((sfp_reverse[1][1]&0x1ff0)<<19);
351 
352  VHDCI[1][0]=(SFP[0][1]&0x4000)|((SFP[0][3]&0x80)<<24);
353  VHDCI[1][1]=(SFP[1][1]&0x4000)|((SFP[1][3]&0x80)<<24);
354 
355  for (int i=0; i<7;i++){
356  VHDCI[1][0]=VHDCI[1][0]|(((SFP[0][2]>>i)&0x1)<<(2*i))|(((SFP[0][2]>>(i+8))&0x1)<<((2*i)+1))|(((sfp_reverse[0][3]>>(i+1))&0x1)<<((2*i)+17))|(((sfp_reverse[0][3]>>(i+9))&0x1)<<((2*i)+18));
357  VHDCI[1][1]=VHDCI[1][1]|(((SFP[1][2]>>i)&0x1)<<(2*i))|(((SFP[1][2]>>(i+8))&0x1)<<((2*i)+1))|(((sfp_reverse[1][3]>>(i+1))&0x1)<<((2*i)+17))|(((sfp_reverse[1][3]>>(i+9))&0x1)<<((2*i)+18));
358  }
359  break;
360  case 2:
361  VHDCI[0][0]=(SFP[0][0]&0xfff)|((SFP[0][1]&0x7)<<12)|((sfp_reverse[0][1]&0xe)<<16)|((sfp_reverse[0][0]&0xe)<<19)|((sfp_reverse[0][1]&0x1ff0)<<19);
362  VHDCI[0][1]=(SFP[1][0]&0xfff)|((SFP[1][1]&0x7)<<12)|((sfp_reverse[1][1]&0xe)<<16)|((sfp_reverse[1][0]&0xe)<<19)|((sfp_reverse[1][1]&0x1ff0)<<19);
363  VHDCI[1][0]=0;
364  VHDCI[1][1]=0;
365  break;
366  case 3:
367  VHDCI[0][0]=((SFP[0][0]>>12)&0x7)|((SFP[0][1]>>9)&0x38)|((SFP[0][0]&0x1ff)<<6)|((sfp_reverse[0][1]&0xfff0)<<13)|((sfp_reverse[0][0]&0x70)<<25);
368  VHDCI[0][1]=((SFP[1][0]>>12)&0x7)|((SFP[1][1]>>9)&0x38)|((SFP[1][0]&0x1ff)<<6)|((sfp_reverse[1][1]&0xfff0)<<13)|((sfp_reverse[1][0]&0x70)<<25);
369 
370  VHDCI[1][0]=((SFP[0][2]>>12)&0x7)|((SFP[0][3]>>9)&0x38)|((SFP[0][2]&0x1ff)<<6)|((sfp_reverse[0][3]&0xfff0)<<13)|((sfp_reverse[0][2]&0x70)<<25);
371  VHDCI[1][1]=((SFP[1][2]>>12)&0x7)|((SFP[1][3]>>9)&0x38)|((SFP[1][2]&0x1ff)<<6)|((sfp_reverse[1][3]&0xfff0)<<13)|((sfp_reverse[1][2]&0x70)<<25);
372  break;
373  default:
374  VHDCI[0][0]=0;
375  VHDCI[0][1]=0;
376  VHDCI[1][0]=0;
377  VHDCI[1][1]=0;
378  }
379 
380 }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
void SourceCardRouting::STRINGtoVHDCI ( unsigned short &  logicalCardID,
unsigned short &  eventNumber,
std::string &  dataString,
unsigned long(&)  VHDCI[2][2] 
) const

Definition at line 707 of file SourceCardRouting.cc.

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

Referenced by SourceCardTextToRctDigi::produce().

710  {
711 
712  stringstream temp;
713 
714  if (dataString!=""){
715  temp << dataString << std::endl;
716  temp >> dec >> eventNumber;
717  temp >> dec >> logicalCardID;
718  temp >> hex >> VHDCI[0][0];
719  temp >> hex >> VHDCI[0][1];
720  temp >> hex >> VHDCI[1][0];
721  temp >> hex >> VHDCI[1][1];
722  }else{
723  eventNumber=65535;
724  logicalCardID=65535;
725  VHDCI[0][0]=0;
726  VHDCI[0][1]=0;
727  VHDCI[1][0]=0;
728  VHDCI[1][1]=0;
729  }
730 
731 }
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 486 of file SourceCardRouting.cc.

Referenced by SourceCardTextToRctDigi::produce().

494  {
495 
496  unsigned short SFP[2][4]={{0}};
497  VHDCItoSFP(0,SFP,VHDCI);
498  SFPtoEMU(eIsoRank,eIsoCardId,eIsoRegionId,eNonIsoRank,eNonIsoCardId,eNonIsoRegionId,MIPbits,Qbits,SFP);
499 
500 }
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 560 of file SourceCardRouting.cc.

Referenced by SourceCardTextToRctDigi::produce().

563  {
564 
565  unsigned short SFP[2][4]={{0}};
566  VHDCItoSFP(2,SFP,VHDCI);
567  SFPtoRC012(RC,RCof,RCtau,SFP);
568 
569 }
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 593 of file SourceCardRouting.cc.

Referenced by SourceCardTextToRctDigi::produce().

599  {
600 
601  unsigned short SFP[2][4]={{0}};
602  VHDCItoSFP(3,SFP,VHDCI);
603  SFPtoRC234(RC,RCof,RCtau,sisterRC,sisterRCof,sisterRCtau,SFP);
604 
605 }
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 529 of file SourceCardRouting.cc.

References hi::HF.

Referenced by SourceCardTextToRctDigi::produce().

534  {
535 
536  unsigned short SFP[2][4]={{0}};
537  VHDCItoSFP(1,SFP,VHDCI);
538  SFPtoRC56HF(RC,RCof,RCtau,HF,HFQ,SFP);
539 
540 }
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 385 of file SourceCardRouting.cc.

References i, j, and relval_steps::k.

387  {
388 
389 unsigned short VHDCI_reverse[2][4]={{0}};
390 
391 for (int i=0; i<2;i++){
392  for(int j=0; j<2;j++){
393  for (int k=0; k<32;k++){
394  VHDCI_reverse[i][j]=VHDCI_reverse[i][j]|(((VHDCI[i][j]>>k)&0x01)<<(31-k));
395  }
396  }
397 }
398 
399  switch (RoutingMode){
400  case 0:
401  SFP[0][0]=((VHDCI[0][0]>>22)&0xff)|((VHDCI[1][0]>>14)&0x3f00);
402  SFP[1][0]=0x8000|((VHDCI[0][1]>>22)&0xff)|((VHDCI[1][1]>>14)&0x3f00);
403  SFP[0][1]=(VHDCI[0][0]&0x3ff)|((VHDCI[0][0]>>1)&0x1c00);
404  SFP[1][1]=0x8000|(VHDCI[0][1]&0x3ff)|((VHDCI[0][1]>>1)&0x1c00);
405  SFP[0][2]=(VHDCI[1][0]&0x3ff)|((VHDCI[0][0]>>4)&0x3c00);
406  SFP[1][2]=0x8000|(VHDCI[1][1]&0x3ff)|((VHDCI[0][1]>>4)&0x3c00);
407  SFP[0][3]=((VHDCI[1][0]>>11)&0x3ff)|((VHDCI[0][0]>>8)&0x1c00);
408  SFP[1][3]=0x8000|((VHDCI[1][1]>>11)&0x3ff)|((VHDCI[0][1]>>8)&0x1c00);
409  break;
410  case 1:
411  SFP[0][0]=(VHDCI[0][0]&0xfff)|((VHDCI_reverse[0][0]&0x600)<<3)|((VHDCI_reverse[0][0]&0x2000)<<1);
412  SFP[1][0]=0x8000|(VHDCI[0][1]&0xfff)|((VHDCI_reverse[0][1]&0x600)<<3)|((VHDCI_reverse[0][1]&0x2000)<<1);
413  SFP[0][1]=((VHDCI[0][0]&0x7000)>>12)|((VHDCI_reverse[0][0]&0x1ff)<<3)|((VHDCI_reverse[0][0]&0x1800)<<1)|(VHDCI[1][0]&0x4000);
414  SFP[1][1]=0x8000|((VHDCI[0][1]&0x7000)>>12)|((VHDCI_reverse[0][1]&0x1ff)<<3)|((VHDCI_reverse[0][1]&0x1800)<<1)|(VHDCI[1][1]&0x4000);
415 
416  SFP[0][2]=((VHDCI[0][0]&0x20000)>>10);
417  SFP[1][2]=0x8000|((VHDCI[0][1]&0x20000)>>10);
418  SFP[0][3]=((VHDCI[1][0]&0x20000)>>3);
419  SFP[1][3]=0x8000|((VHDCI[1][1]&0x20000)>>3);
420  for (int i=0; i<7;i++){
421  SFP[0][2]=SFP[0][2]|(((VHDCI[1][0]>>(2*i))&0x1)<<i)|(((VHDCI[1][0]>>((2*i)+1))&0x1)<<(i+8));
422  SFP[1][2]=SFP[1][2]|(((VHDCI[1][1]>>(2*i))&0x1)<<i)|(((VHDCI[1][1]>>((2*i)+1))&0x1)<<(i+8));
423  SFP[0][3]=SFP[0][3]|(((VHDCI_reverse[1][0]>>((2*i)+1))&0x1)<<i)|(((VHDCI_reverse[1][0]>>(2*i))&0x1)<<(i+7));
424  SFP[1][3]=SFP[1][3]|(((VHDCI_reverse[1][1]>>((2*i)+1))&0x1)<<i)|(((VHDCI_reverse[1][1]>>(2*i))&0x1)<<(i+7));
425  }
426  break;
427  case 2:
428  SFP[0][0]=(VHDCI[0][0]&0xfff)|((VHDCI_reverse[0][0]&0xe00)<<3);
429  SFP[1][0]=0x8000|(VHDCI[0][1]&0xfff)|((VHDCI_reverse[0][1]&0xe00)<<3);
430  SFP[0][1]=((VHDCI[0][0]&0x7000)>>12)|((VHDCI_reverse[0][0]&0x1ff)<<3)|(VHDCI_reverse[0][0]&0x7000);
431  SFP[1][1]=0x8000|((VHDCI[0][1]&0x7000)>>12)|((VHDCI_reverse[0][1]&0x1ff)<<3)|(VHDCI_reverse[0][1]&0x7000);
432  SFP[0][2]=(VHDCI[0][0]&0xfff);
433  SFP[1][2]=0x8000|(VHDCI[0][1]&0xfff);
434  SFP[0][3]=((VHDCI[0][0]&0x7000)>>12)|((VHDCI_reverse[0][0]&0x1ff)<<3);
435  SFP[1][3]=0x8000|((VHDCI[0][1]&0x7000)>>12)|((VHDCI_reverse[0][1]&0x1ff)<<3);
436  break;
437  case 3:
438  SFP[0][0]=((VHDCI[0][0]&0x7fc0)>>6)|((VHDCI_reverse[0][0]&0x7)<<9)|((VHDCI[0][0]&0x7)<<12);
439  SFP[1][0]=0x8000|((VHDCI[0][1]&0x7fc0)>>6)|((VHDCI_reverse[0][1]&0x7)<<9)|((VHDCI[0][1]&0x7)<<12);
440  SFP[0][1]=((VHDCI_reverse[0][0]&0x7ff8)>>3)|((VHDCI[0][0]&0x38)<<9);
441  SFP[1][1]=0x8000|((VHDCI_reverse[0][1]&0x7ff8)>>3)|((VHDCI[0][1]&0x38)<<9);
442  SFP[0][2]=((VHDCI[1][0]&0x7fc0)>>6)|((VHDCI_reverse[1][0]&0x7)<<9)|((VHDCI[1][0]&0x7)<<12);
443  SFP[1][2]=0x8000|((VHDCI[1][1]&0x7fc0)>>6)|((VHDCI_reverse[1][1]&0x7)<<9)|((VHDCI[1][1]&0x7)<<12);
444  SFP[0][3]=((VHDCI_reverse[1][0]&0x7ff8)>>3)|((VHDCI[1][0]&0x38)<<9);
445  SFP[1][3]=0x8000|((VHDCI_reverse[1][1]&0x7ff8)>>3)|((VHDCI[1][1]&0x38)<<9);
446  break;
447  default:
448  SFP[0][0]=0;
449  SFP[1][0]=0x8000;
450  SFP[0][1]=0;
451  SFP[1][1]=0x8000;
452  SFP[0][2]=0;
453  SFP[1][2]=0x8000;
454  SFP[0][3]=0;
455  SFP[1][3]=0x8000;
456  }
457 }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
void SourceCardRouting::VHDCItoSTRING ( unsigned short &  logicalCardID,
unsigned short &  eventNumber,
std::string &  dataString,
unsigned long(&)  VHDCI[2][2] 
) const

Definition at line 735 of file SourceCardRouting.cc.

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

738  {
739 
740  stringstream temp;
741 
742  temp << dec << eventNumber << '\t';
743  temp << dec << logicalCardID << '\t';
744  temp << hex << setw(8) << setfill('0') << VHDCI[0][0] << '\t';
745  temp << hex << setw(8) << setfill('0') << VHDCI[0][1] << '\t';
746  temp << hex << setw(8) << setfill('0') << VHDCI[1][0] << '\t';
747  temp << hex << setw(8) << setfill('0') << VHDCI[1][1] << std::endl;
748  dataString = temp.str();
749 }