CMS 3D CMS Logo

SourceCardRouting Class Reference

#include <L1Trigger/TextToDigi/src/SourceCardRouting.h>

List of all members.

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


Detailed Description

Definition at line 13 of file SourceCardRouting.h.


Constructor & Destructor Documentation

SourceCardRouting::SourceCardRouting (  ) 

Definition at line 17 of file SourceCardRouting.cc.

00017                                       {
00018         //cout<<"Constructor"<<endl;
00019         }

SourceCardRouting::~SourceCardRouting (  ) 

Definition at line 21 of file SourceCardRouting.cc.

00021                                        {
00022         //cout<<"Destructor"<<endl;
00023         }


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] 
)

Definition at line 30 of file SourceCardRouting.cc.

References i, and j.

Referenced by EMUtoVHDCI(), and GctFormatTranslateMCLegacy::writeRctEmCandBlocks().

00038                                                      {
00039 
00040 SFP[0][0]=0;
00041 SFP[1][0]=0x8000;
00042 
00043 for (int i=0;i<7;i++){
00044         for (int j=0;j<2;j++){
00045                 SFP[0][0] = SFP[0][0]|((MIPbits[i][j]&0x01)<<((2*i)+j) );
00046                 SFP[1][0] = SFP[1][0]|((Qbits[i][j]&0x01)<<((2*i)+j) );
00047         }
00048 }
00049 
00050         SFP[0][1] = (eIsoRank[0]&0x3f)|((eIsoRegionId[0]&0x01)<<6)|((eIsoCardId[0]&0x07)<<7)|((eIsoRank[1]&0x7)<<10);
00051         SFP[1][1] = 0x8000|(eIsoRank[2]&0x3f)|((eIsoRegionId[2]&0x01)<<6)|((eIsoCardId[2]&0x07)<<7)|((eIsoRank[3]&0x7)<<10);
00052         SFP[0][2] = (eNonIsoRank[0]&0x3f)|((eNonIsoRegionId[0]&0x01)<<6)|((eNonIsoCardId[0]&0x07)<<7)|((eIsoRank[1]&0x38)<<7)|((eIsoRegionId[1]&0x01)<<13);
00053         SFP[1][2] = 0x8000|(eNonIsoRank[2]&0x3f)|((eNonIsoRegionId[2]&0x01)<<6)|((eNonIsoCardId[2]&0x07)<<7)|((eIsoRank[3]&0x38)<<7)|((eIsoRegionId[3]&0x01)<<13);
00054         SFP[0][3] = (eNonIsoRank[1]&0x3f)|((eNonIsoRegionId[1]&0x01)<<6)|((eNonIsoCardId[1]&0x07)<<7)|((eIsoCardId[1]&0x07)<<10);
00055         SFP[1][3] = 0x8000|(eNonIsoRank[3]&0x3f)|((eNonIsoRegionId[3]&0x01)<<6)|((eNonIsoCardId[3]&0x07)<<7)|((eIsoCardId[3]&0x07)<<10);
00056 }

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 
)

Definition at line 612 of file SourceCardRouting.cc.

References EMUtoVHDCI(), and VHDCItoSTRING().

Referenced by RctDigiToSourceCardText::analyze().

00622                                                {
00623 
00624                 unsigned long VHDCI[2][2]={{0}};
00625                 EMUtoVHDCI(eIsoRank,eIsoCardId,eIsoRegionId,eNonIsoRank,eNonIsoCardId,eNonIsoRegionId,MIPbits,Qbits,VHDCI);
00626                 VHDCItoSTRING (logicalCardID, eventNumber, dataString, VHDCI);
00627 
00628 }

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] 
)

Definition at line 465 of file SourceCardRouting.cc.

References EMUtoSFP(), and SFPtoVHDCI().

Referenced by EMUtoSTRING().

00473                                                       {
00474 
00475         unsigned short SFP[2][4]={{0}};
00476         EMUtoSFP(eIsoRank,eIsoCardId,eIsoRegionId,eNonIsoRank,eNonIsoCardId,eNonIsoRegionId,MIPbits,Qbits,SFP);
00477         SFPtoVHDCI(0,SFP,VHDCI);
00478 
00479 }

void SourceCardRouting::LogicalCardIDtoRoutingMode ( unsigned short &  logicalCardID,
int RoutingMode,
int RCTCrateNumber 
)

Definition at line 754 of file SourceCardRouting.cc.

Referenced by SourceCardTextToRctDigi::produce().

00756                                                                  {
00757                 
00758                 RCTCrateNumber = (logicalCardID>>3);
00759                 if ( (logicalCardID&0x4) != 0)RCTCrateNumber+=9;
00760                 RoutingMode = (logicalCardID&0x3); 
00761 
00762 }

void SourceCardRouting::RC012toSFP ( unsigned short &  RC[7][2],
unsigned short &  RCof[7][2],
unsigned short &  RCtau[7][2],
unsigned short &  SFP[2][4] 
)

Definition at line 190 of file SourceCardRouting.cc.

Referenced by RC012toVHDCI().

00193                                                     {
00194 
00195         SFP[0][0] = (RC[0][0]&0x3ff)|((RCof[0][0]&0x1)<<10)|((RCtau[0][0]&0x1)<<11)|((RC[2][0]&0x7)<<12);
00196         SFP[1][0] = 0x8000|(RC[0][1]&0x3ff)|((RCof[0][1]&0x1)<<10)|((RCtau[0][1]&0x1)<<11)|((RC[2][1]&0x7)<<12);
00197 
00198         SFP[0][1] = (RC[1][0]&0x3ff)|((RCof[1][0]&0x1)<<10)|((RCtau[1][0]&0x1)<<11)|((RC[2][0]&0x38)<<9);
00199         SFP[1][1] = 0x8000|(RC[1][1]&0x3ff)|((RCof[1][1]&0x1)<<10)|((RCtau[1][1]&0x1)<<11)|((RC[2][1]&0x38)<<9);
00200 
00201         SFP[0][2] = (RC[0][0]&0x3ff)|((RCof[0][0]&0x1)<<10)|((RCtau[0][0]&0x1)<<11);
00202         SFP[1][2] = 0x8000|(RC[0][1]&0x3ff)|((RCof[0][1]&0x1)<<10)|((RCtau[0][1]&0x1)<<11);
00203 
00204         SFP[0][3] = (RC[1][0]&0x3ff)|((RCof[1][0]&0x1)<<10)|((RCtau[1][0]&0x1)<<11);
00205         SFP[1][3] = 0x8000|(RC[1][1]&0x3ff)|((RCof[1][1]&0x1)<<10)|((RCtau[1][1]&0x1)<<11);
00206 
00207 }

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 
)

Definition at line 654 of file SourceCardRouting.cc.

References RC012toVHDCI(), and VHDCItoSTRING().

Referenced by RctDigiToSourceCardText::analyze().

00659                                                {
00660 
00661                 unsigned long VHDCI[2][2]={{0}};
00662                 RC012toVHDCI(RC,RCof,RCtau,VHDCI);
00663                 VHDCItoSTRING (logicalCardID, eventNumber, dataString, VHDCI);
00664 
00665 }

void SourceCardRouting::RC012toVHDCI ( unsigned short &  RC[7][2],
unsigned short &  RCof[7][2],
unsigned short &  RCtau[7][2],
unsigned long &  VHDCI[2][2] 
)

Definition at line 546 of file SourceCardRouting.cc.

References RC012toSFP(), and SFPtoVHDCI().

Referenced by RC012toSTRING().

00549                                                       {
00550 
00551         unsigned short SFP[2][4]={{0}};
00552         RC012toSFP(RC,RCof,RCtau,SFP);
00553         SFPtoVHDCI(2,SFP,VHDCI);
00554 }

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] 
)

Definition at line 242 of file SourceCardRouting.cc.

Referenced by RC234toVHDCI().

00248                                                     {
00249 
00250         SFP[0][0] = (RC[3][0]&0x3ff)|((RCof[3][0]&0x1)<<10)|((RCtau[3][0]&0x1)<<11)|((RC[2][0]&0x1c0)<<6);
00251         SFP[1][0] = 0x8000|(RC[3][1]&0x3ff)|((RCof[3][1]&0x1)<<10)|((RCtau[3][1]&0x1)<<11)|((RC[2][1]&0x1c0)<<6);
00252 
00253         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);
00254         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);
00255 
00256         SFP[0][2] = (sisterRC[3][0]&0x3ff)|((sisterRCof[3][0]&0x1)<<10)|((sisterRCtau[3][0]&0x1)<<11)|((sisterRC[2][0]&0x1c0)<<6);
00257         SFP[1][2] = 0x8000|(sisterRC[3][1]&0x3ff)|((sisterRCof[3][1]&0x1)<<10)|((sisterRCtau[3][1]&0x1)<<11)|((sisterRC[2][1]&0x1c0)<<6);
00258 
00259         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);
00260         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);
00261 
00262 }

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 
)

Definition at line 671 of file SourceCardRouting.cc.

References RC234toVHDCI(), and VHDCItoSTRING().

Referenced by RctDigiToSourceCardText::analyze().

00679                                                {
00680 
00681                 unsigned long VHDCI[2][2]={{0}};
00682                 RC234toVHDCI(RC,RCof,RCtau,sisterRC,sisterRCof,sisterRCtau,VHDCI);
00683                 VHDCItoSTRING (logicalCardID, eventNumber, dataString, VHDCI);
00684 
00685 }

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] 
)

Definition at line 575 of file SourceCardRouting.cc.

References RC234toSFP(), and SFPtoVHDCI().

Referenced by RC234toSTRING().

00581                                                       {
00582 
00583         unsigned short SFP[2][4]={{0}};
00584         RC234toSFP(RC,RCof,RCtau,sisterRC,sisterRCof,sisterRCtau,SFP);
00585         SFPtoVHDCI(3,SFP,VHDCI);
00586 
00587 }

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] 
)

Definition at line 118 of file SourceCardRouting.cc.

Referenced by RC56HFtoVHDCI().

00123                                                     {
00124 
00125         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);
00126         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);
00127         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);
00128         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);
00129         SFP[0][2] = ((HF[0][0]>>1)&0x7f)|((HF[1][0]&0xff)<<7);
00130         SFP[1][2] = 0x8000|((HF[2][0]>>1)&0x7f)|((HF[3][0]&0xff)<<7);
00131         SFP[0][3] = ((HF[0][1]>>1)&0x7f)|((HF[1][1]&0xff)<<7);
00132         SFP[1][3] = 0x8000|((HF[2][1]>>1)&0x7f)|((HF[3][1]&0xff)<<7);
00133 
00134 
00135 }

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 
)

Definition at line 635 of file SourceCardRouting.cc.

References RC56HFtoVHDCI(), and VHDCItoSTRING().

Referenced by RctDigiToSourceCardText::analyze().

00642                                                {
00643 
00644                 unsigned long VHDCI[2][2]={{0}};
00645                 RC56HFtoVHDCI(RC,RCof,RCtau,HF,HFQ,VHDCI);
00646                 VHDCItoSTRING (logicalCardID, eventNumber, dataString, VHDCI);
00647 
00648 }

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] 
)

Definition at line 511 of file SourceCardRouting.cc.

References RC56HFtoSFP(), and SFPtoVHDCI().

Referenced by RC56HFtoSTRING().

00516                                                       {
00517 
00518         unsigned short SFP[2][4]={{0}};
00519         RC56HFtoSFP(RC,RCof,RCtau,HF,HFQ,SFP);
00520         SFPtoVHDCI(1,SFP,VHDCI);
00521 
00522 }

void SourceCardRouting::RoutingModetoLogicalCardID ( unsigned short &  logicalCardID,
int RoutingMode,
int RCTCrateNumber 
)

Definition at line 766 of file SourceCardRouting.cc.

Referenced by RctDigiToSourceCardText::analyze().

00768                                                                  {
00769 
00770                 logicalCardID = ((RCTCrateNumber%9)<<3)|(RCTCrateNumber>8?0x4:0x0)|(RoutingMode&0x3);
00771 
00772 }

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] 
)

Definition at line 63 of file SourceCardRouting.cc.

References i, and j.

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

00071                                                      {
00072 
00073 
00074           for (int i=0; i<7;i++){
00075                 for (int j=0; j<2;j++){
00076                         MIPbits[i][j] = (SFP[0][0]>>((2*i)+j) )&0x1;
00077                         Qbits[i][j] = (SFP[1][0]>>((2*i)+j) )&0x1;
00078                 }
00079           }
00080 
00081         eIsoRank[0] = SFP[0][1]&0x3f;
00082         eIsoRank[1] = ((SFP[0][1]>>10)&0x7)|((SFP[0][2]>>7)&0x38);
00083         eIsoRank[2] = SFP[1][1]&0x3f;
00084         eIsoRank[3] = ((SFP[1][1]>>10)&0x7)|((SFP[1][2]>>7)&0x38);
00085 
00086         eNonIsoRank[0] = SFP[0][2]&0x3f;
00087         eNonIsoRank[1] = SFP[0][3]&0x3f;
00088         eNonIsoRank[2] = SFP[1][2]&0x3f;
00089         eNonIsoRank[3] = SFP[1][3]&0x3f;
00090 
00091         eIsoRegionId[0] = (SFP[0][1]>>6)&0x1;
00092         eIsoRegionId[1] = (SFP[0][2]>>13)&0x1;
00093         eIsoRegionId[2] = (SFP[1][1]>>6)&0x1;
00094         eIsoRegionId[3] = (SFP[1][2]>>13)&0x1;
00095 
00096         eNonIsoRegionId[0] = (SFP[0][2]>>6)&0x1;
00097         eNonIsoRegionId[1] = (SFP[0][3]>>6)&0x1;
00098         eNonIsoRegionId[2] = (SFP[1][2]>>6)&0x1;
00099         eNonIsoRegionId[3] = (SFP[1][3]>>6)&0x1;
00100 
00101         eIsoCardId[0] = (SFP[0][1]>>7)&0x7;
00102         eIsoCardId[1] = (SFP[0][3]>>10)&0x7;
00103         eIsoCardId[2] = (SFP[1][1]>>7)&0x7;
00104         eIsoCardId[3] = (SFP[1][3]>>10)&0x7;
00105 
00106         eNonIsoCardId[0] = (SFP[0][2]>>7)&0x7;
00107         eNonIsoCardId[1] = (SFP[0][3]>>7)&0x7;
00108         eNonIsoCardId[2] = (SFP[1][2]>>7)&0x7;
00109         eNonIsoCardId[3] = (SFP[1][3]>>7)&0x7;
00110 
00111 }

void SourceCardRouting::SFPtoRC012 ( unsigned short &  RC[7][2],
unsigned short &  RCof[7][2],
unsigned short &  RCtau[7][2],
unsigned short &  SFP[2][4] 
)

Definition at line 213 of file SourceCardRouting.cc.

Referenced by VHDCItoRC012().

00216                                                     {
00217 
00218         RC[0][0]=SFP[0][0]&0x3ff;
00219         RC[0][1]=SFP[1][0]&0x3ff;
00220         RC[1][0]=SFP[0][1]&0x3ff;
00221         RC[1][1]=SFP[1][1]&0x3ff;
00222         RC[2][0]=(RC[2][0]&0x3c0)|((SFP[0][0]&0x7000)>>12)|((SFP[0][1]&0x7000)>>9);
00223         RC[2][1]=(RC[2][1]&0x3c0)|((SFP[1][0]&0x7000)>>12)|((SFP[1][1]&0x7000)>>9);
00224 
00225         RCof[0][0]=(SFP[0][0]>>10)&0x1;
00226         RCof[0][1]=(SFP[1][0]>>10)&0x1;
00227         RCof[1][0]=(SFP[0][1]>>10)&0x1;
00228         RCof[1][1]=(SFP[1][1]>>10)&0x1;
00229 
00230         RCtau[0][0]=(SFP[0][0]>>11)&0x1;
00231         RCtau[0][1]=(SFP[1][0]>>11)&0x1;
00232         RCtau[1][0]=(SFP[0][1]>>11)&0x1;
00233         RCtau[1][1]=(SFP[1][1]>>11)&0x1;
00234 
00235 
00236 }

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] 
)

Definition at line 268 of file SourceCardRouting.cc.

Referenced by VHDCItoRC234().

00274                                                     {
00275 
00276         RC[2][0]=(RC[2][0]&0x3f)|((SFP[0][0]&0x7000)>>6)|((SFP[0][1]&0x1000)>>3);
00277         RC[3][0]=SFP[0][0]&0x3ff;
00278         RC[4][0]=SFP[0][1]&0x3ff;
00279         RC[2][1]=(RC[2][1]&0x3f)|((SFP[1][0]&0x7000)>>6)|((SFP[1][1]&0x1000)>>3);
00280         RC[3][1]=SFP[1][0]&0x3ff;
00281         RC[4][1]=SFP[1][1]&0x3ff;
00282 
00283         RCof[2][0]=(SFP[0][1]>>13)&0x1;
00284         RCof[3][0]=(SFP[0][0]>>10)&0x1;
00285         RCof[4][0]=(SFP[0][1]>>10)&0x1;
00286         RCof[2][1]=(SFP[1][1]>>13)&0x1;
00287         RCof[3][1]=(SFP[1][0]>>10)&0x1;
00288         RCof[4][1]=(SFP[1][1]>>10)&0x1;
00289 
00290         RCtau[2][0]=(SFP[0][1]>>14)&0x1;
00291         RCtau[3][0]=(SFP[0][0]>>11)&0x1;
00292         RCtau[4][0]=(SFP[0][1]>>11)&0x1;
00293         RCtau[2][1]=(SFP[1][1]>>14)&0x1;
00294         RCtau[3][1]=(SFP[1][0]>>11)&0x1;
00295         RCtau[4][1]=(SFP[1][1]>>11)&0x1;
00296 
00297         sisterRC[2][0]=(sisterRC[2][0]&~0x3C0)|((SFP[0][2]&0x7000)>>6)|((SFP[0][3]&0x1000)>>3);
00298         sisterRC[3][0]=SFP[0][2]&0x3ff;
00299         sisterRC[4][0]=SFP[0][3]&0x3ff;
00300         sisterRC[2][1]=(sisterRC[2][1]&~0x3C0)|((SFP[1][2]&0x7000)>>6)|((SFP[1][3]&0x1000)>>3);
00301         sisterRC[3][1]=SFP[1][2]&0x3ff;
00302         sisterRC[4][1]=SFP[1][3]&0x3ff;
00303 
00304         sisterRCof[2][0]=(SFP[0][3]>>13)&0x1;
00305         sisterRCof[3][0]=(SFP[0][2]>>10)&0x1;
00306         sisterRCof[4][0]=(SFP[0][3]>>10)&0x1;
00307         sisterRCof[2][1]=(SFP[1][3]>>13)&0x1;
00308         sisterRCof[3][1]=(SFP[1][2]>>10)&0x1;
00309         sisterRCof[4][1]=(SFP[1][3]>>10)&0x1;
00310 
00311         sisterRCtau[2][0]=(SFP[0][3]>>14)&0x1;
00312         sisterRCtau[3][0]=(SFP[0][2]>>11)&0x1;
00313         sisterRCtau[4][0]=(SFP[0][3]>>11)&0x1;
00314         sisterRCtau[2][1]=(SFP[1][3]>>14)&0x1;
00315         sisterRCtau[3][1]=(SFP[1][2]>>11)&0x1;
00316         sisterRCtau[4][1]=(SFP[1][3]>>11)&0x1;
00317 
00318 }

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] 
)

Definition at line 142 of file SourceCardRouting.cc.

Referenced by VHDCItoRC56HF().

00147                                                     {
00148 
00149         RC[5][0]=SFP[0][0]&0x3ff;
00150         RC[5][1]=SFP[1][0]&0x3ff;
00151         RC[6][0]=SFP[0][1]&0x3ff;
00152         RC[6][1]=SFP[1][1]&0x3ff;
00153 
00154         RCof[5][0]=(SFP[0][0]>>10)&0x1;
00155         RCof[5][1]=(SFP[1][0]>>10)&0x1;
00156         RCof[6][0]=(SFP[0][1]>>10)&0x1;
00157         RCof[6][1]=(SFP[1][1]>>10)&0x1;
00158 
00159         RCtau[5][0]=(SFP[0][0]>>11)&0x1;
00160         RCtau[5][1]=(SFP[1][0]>>11)&0x1;
00161         RCtau[6][0]=(SFP[0][1]>>11)&0x1;
00162         RCtau[6][1]=(SFP[1][1]>>11)&0x1;
00163 
00164         HFQ[0][0]=(SFP[0][0]>>12)&0x1;
00165         HFQ[1][0]=(SFP[0][0]>>13)&0x1;
00166         HFQ[2][0]=(SFP[1][0]>>12)&0x1;
00167         HFQ[3][0]=(SFP[1][0]>>13)&0x1;
00168 
00169         HFQ[0][1]=(SFP[0][1]>>12)&0x1;
00170         HFQ[1][1]=(SFP[0][1]>>13)&0x1;
00171         HFQ[2][1]=(SFP[1][1]>>12)&0x1;
00172         HFQ[3][1]=(SFP[1][1]>>13)&0x1;
00173 
00174         HF[0][0]=((SFP[0][2]&0x7f)<<1)|((SFP[0][0]>>14)&0x01);
00175         HF[1][0]=(SFP[0][2]>>7)&0xff;
00176         HF[2][0]=((SFP[1][2]&0x7f)<<1)|((SFP[1][0]>>14)&0x01);
00177         HF[3][0]=(SFP[1][2]>>7)&0xff;
00178 
00179         HF[0][1]=((SFP[0][3]&0x7f)<<1)|((SFP[0][1]>>14)&0x01);
00180         HF[1][1]=(SFP[0][3]>>7)&0xff;
00181         HF[2][1]=((SFP[1][3]&0x7f)<<1)|((SFP[1][1]>>14)&0x01);
00182         HF[3][1]=(SFP[1][3]>>7)&0xff;
00183 
00184 }

void SourceCardRouting::SFPtoSTRING ( unsigned short &  logicalCardID,
unsigned short &  eventNumber,
int  RoutingMode,
unsigned short &  SFP[2][4],
std::string &  dataString 
)

Definition at line 691 of file SourceCardRouting.cc.

References SFPtoVHDCI(), and VHDCItoSTRING().

00695                                                  {
00696 
00697                 unsigned long VHDCI[2][2]={{0}};
00698                 SFPtoVHDCI(RoutingMode,SFP,VHDCI);
00699                 VHDCItoSTRING (logicalCardID, eventNumber, dataString, VHDCI);
00700 
00701 }

void SourceCardRouting::SFPtoVHDCI ( int  RoutingMode,
unsigned short &  SFP[2][4],
unsigned long &  VHDCI[2][2] 
)

Definition at line 326 of file SourceCardRouting.cc.

References i, j, and k.

Referenced by EMUtoVHDCI(), RC012toVHDCI(), RC234toVHDCI(), RC56HFtoVHDCI(), and SFPtoSTRING().

00328                                                       {
00329 
00330 unsigned short sfp_reverse[2][4]={{0}};
00331 
00332 for (int i=0; i<2;i++){
00333         for(int j=0; j<4;j++){
00334                 for (int k=0; k<16;k++){
00335                         sfp_reverse[i][j]=sfp_reverse[i][j]|(((SFP[i][j]>>k)&0x01)<<(15-k));
00336                 }
00337                 //cout <<hex<< SFP[i][j]<<'\t'<<sfp_reverse[i][j]<<endl;
00338         }
00339 }
00340 
00341         switch (RoutingMode){
00342                 case 0:
00343                         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);
00344                         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);
00345                         VHDCI[1][0]=(SFP[0][2]&0x3ff)|((SFP[0][3]&0x3ff)<<11)|((SFP[0][0]&0x3f00)<<14);
00346                         VHDCI[1][1]=(SFP[1][2]&0x3ff)|((SFP[1][3]&0x3ff)<<11)|((SFP[1][0]&0x3f00)<<14);
00347                 break;
00348                 case 1:
00349                         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);
00350                         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);
00351 
00352                         VHDCI[1][0]=(SFP[0][1]&0x4000)|((SFP[0][3]&0x80)<<24);
00353                         VHDCI[1][1]=(SFP[1][1]&0x4000)|((SFP[1][3]&0x80)<<24);
00354 
00355                         for (int i=0; i<7;i++){
00356                                 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));
00357                                 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));              
00358                         }
00359                 break;
00360                 case 2:
00361                         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);
00362                         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);
00363                         VHDCI[1][0]=0;
00364                         VHDCI[1][1]=0;
00365                 break;
00366                 case 3:
00367                         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);
00368                         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);
00369 
00370                         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);
00371                         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);
00372                 break;
00373                 default:
00374                         VHDCI[0][0]=0;
00375                         VHDCI[0][1]=0;
00376                         VHDCI[1][0]=0;
00377                         VHDCI[1][1]=0;
00378                 }
00379 
00380 }

void SourceCardRouting::STRINGtoVHDCI ( unsigned short &  logicalCardID,
unsigned short &  eventNumber,
std::string &  dataString,
unsigned long &  VHDCI[2][2] 
)

Definition at line 707 of file SourceCardRouting.cc.

References lat::endl(), and pyDBSRunClass::temp.

Referenced by SourceCardTextToRctDigi::produce().

00710                                                          {
00711 
00712                 stringstream temp;
00713                 
00714                 if (dataString!=""){
00715                         temp << dataString << endl;
00716                         temp >> dec >> eventNumber;
00717                         temp >> dec >> logicalCardID;
00718                         temp >> hex >> VHDCI[0][0];
00719                         temp >> hex >> VHDCI[0][1];
00720                         temp >> hex >> VHDCI[1][0];
00721                         temp >> hex >> VHDCI[1][1];
00722                 }else{
00723                         eventNumber=65535;
00724                         logicalCardID=65535;
00725                         VHDCI[0][0]=0;
00726                         VHDCI[0][1]=0;
00727                         VHDCI[1][0]=0;
00728                         VHDCI[1][1]=0;
00729                 }
00730 
00731 }

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] 
)

Definition at line 486 of file SourceCardRouting.cc.

References SFPtoEMU(), and VHDCItoSFP().

Referenced by SourceCardTextToRctDigi::produce().

00494                                                       {
00495 
00496         unsigned short SFP[2][4]={{0}};
00497         VHDCItoSFP(0,SFP,VHDCI);
00498         SFPtoEMU(eIsoRank,eIsoCardId,eIsoRegionId,eNonIsoRank,eNonIsoCardId,eNonIsoRegionId,MIPbits,Qbits,SFP);
00499 
00500 }

void SourceCardRouting::VHDCItoRC012 ( unsigned short &  RC[7][2],
unsigned short &  RCof[7][2],
unsigned short &  RCtau[7][2],
unsigned long &  VHDCI[2][2] 
)

Definition at line 560 of file SourceCardRouting.cc.

References SFPtoRC012(), and VHDCItoSFP().

Referenced by SourceCardTextToRctDigi::produce().

00563                                                       {
00564 
00565         unsigned short SFP[2][4]={{0}};
00566         VHDCItoSFP(2,SFP,VHDCI);
00567         SFPtoRC012(RC,RCof,RCtau,SFP);
00568 
00569 }

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] 
)

Definition at line 593 of file SourceCardRouting.cc.

References SFPtoRC234(), and VHDCItoSFP().

Referenced by SourceCardTextToRctDigi::produce().

00599                                                       {
00600 
00601         unsigned short SFP[2][4]={{0}};
00602         VHDCItoSFP(3,SFP,VHDCI);
00603         SFPtoRC234(RC,RCof,RCtau,sisterRC,sisterRCof,sisterRCtau,SFP);
00604 
00605 }

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] 
)

Definition at line 529 of file SourceCardRouting.cc.

References SFPtoRC56HF(), and VHDCItoSFP().

Referenced by SourceCardTextToRctDigi::produce().

00534                                                       {
00535 
00536         unsigned short SFP[2][4]={{0}};
00537         VHDCItoSFP(1,SFP,VHDCI);
00538         SFPtoRC56HF(RC,RCof,RCtau,HF,HFQ,SFP);
00539 
00540 }

void SourceCardRouting::VHDCItoSFP ( int  RoutingMode,
unsigned short &  SFP[2][4],
unsigned long &  VHDCI[2][2] 
)

Definition at line 385 of file SourceCardRouting.cc.

References i, j, and k.

Referenced by VHDCItoEMU(), VHDCItoRC012(), VHDCItoRC234(), and VHDCItoRC56HF().

00387                                                          {
00388 
00389 unsigned short VHDCI_reverse[2][4]={{0}};
00390 
00391 for (int i=0; i<2;i++){
00392         for(int j=0; j<2;j++){
00393                 for (int k=0; k<32;k++){
00394                         VHDCI_reverse[i][j]=VHDCI_reverse[i][j]|(((VHDCI[i][j]>>k)&0x01)<<(31-k));
00395                 }
00396         }
00397 }
00398 
00399         switch (RoutingMode){
00400                 case 0:
00401                         SFP[0][0]=((VHDCI[0][0]>>22)&0xff)|((VHDCI[1][0]>>14)&0x3f00);
00402                         SFP[1][0]=0x8000|((VHDCI[0][1]>>22)&0xff)|((VHDCI[1][1]>>14)&0x3f00);
00403                         SFP[0][1]=(VHDCI[0][0]&0x3ff)|((VHDCI[0][0]>>1)&0x1c00);
00404                         SFP[1][1]=0x8000|(VHDCI[0][1]&0x3ff)|((VHDCI[0][1]>>1)&0x1c00);
00405                         SFP[0][2]=(VHDCI[1][0]&0x3ff)|((VHDCI[0][0]>>4)&0x3c00);
00406                         SFP[1][2]=0x8000|(VHDCI[1][1]&0x3ff)|((VHDCI[0][1]>>4)&0x3c00);
00407                         SFP[0][3]=((VHDCI[1][0]>>11)&0x3ff)|((VHDCI[0][0]>>8)&0x1c00);
00408                         SFP[1][3]=0x8000|((VHDCI[1][1]>>11)&0x3ff)|((VHDCI[0][1]>>8)&0x1c00);
00409                 break;
00410                 case 1:
00411                         SFP[0][0]=(VHDCI[0][0]&0xfff)|((VHDCI_reverse[0][0]&0x600)<<3)|((VHDCI_reverse[0][0]&0x2000)<<1);
00412                         SFP[1][0]=0x8000|(VHDCI[0][1]&0xfff)|((VHDCI_reverse[0][1]&0x600)<<3)|((VHDCI_reverse[0][1]&0x2000)<<1);
00413                         SFP[0][1]=((VHDCI[0][0]&0x7000)>>12)|((VHDCI_reverse[0][0]&0x1ff)<<3)|((VHDCI_reverse[0][0]&0x1800)<<1)|(VHDCI[1][0]&0x4000);
00414                         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);
00415 
00416                         SFP[0][2]=((VHDCI[0][0]&0x20000)>>10);
00417                         SFP[1][2]=0x8000|((VHDCI[0][1]&0x20000)>>10);
00418                         SFP[0][3]=((VHDCI[1][0]&0x20000)>>3);
00419                         SFP[1][3]=0x8000|((VHDCI[1][1]&0x20000)>>3);
00420                         for (int i=0; i<7;i++){
00421                                 SFP[0][2]=SFP[0][2]|(((VHDCI[1][0]>>(2*i))&0x1)<<i)|(((VHDCI[1][0]>>((2*i)+1))&0x1)<<(i+8));
00422                                 SFP[1][2]=SFP[1][2]|(((VHDCI[1][1]>>(2*i))&0x1)<<i)|(((VHDCI[1][1]>>((2*i)+1))&0x1)<<(i+8));
00423                                 SFP[0][3]=SFP[0][3]|(((VHDCI_reverse[1][0]>>((2*i)+1))&0x1)<<i)|(((VHDCI_reverse[1][0]>>(2*i))&0x1)<<(i+7));
00424                                 SFP[1][3]=SFP[1][3]|(((VHDCI_reverse[1][1]>>((2*i)+1))&0x1)<<i)|(((VHDCI_reverse[1][1]>>(2*i))&0x1)<<(i+7));
00425                         }
00426                 break;
00427                 case 2:
00428                         SFP[0][0]=(VHDCI[0][0]&0xfff)|((VHDCI_reverse[0][0]&0xe00)<<3);
00429                         SFP[1][0]=0x8000|(VHDCI[0][1]&0xfff)|((VHDCI_reverse[0][1]&0xe00)<<3);
00430                         SFP[0][1]=((VHDCI[0][0]&0x7000)>>12)|((VHDCI_reverse[0][0]&0x1ff)<<3)|(VHDCI_reverse[0][0]&0x7000);
00431                         SFP[1][1]=0x8000|((VHDCI[0][1]&0x7000)>>12)|((VHDCI_reverse[0][1]&0x1ff)<<3)|(VHDCI_reverse[0][1]&0x7000);
00432                         SFP[0][2]=(VHDCI[0][0]&0xfff);
00433                         SFP[1][2]=0x8000|(VHDCI[0][1]&0xfff);
00434                         SFP[0][3]=((VHDCI[0][0]&0x7000)>>12)|((VHDCI_reverse[0][0]&0x1ff)<<3);
00435                         SFP[1][3]=0x8000|((VHDCI[0][1]&0x7000)>>12)|((VHDCI_reverse[0][1]&0x1ff)<<3);
00436                 break;
00437                 case 3:
00438                         SFP[0][0]=((VHDCI[0][0]&0x7fc0)>>6)|((VHDCI_reverse[0][0]&0x7)<<9)|((VHDCI[0][0]&0x7)<<12);
00439                         SFP[1][0]=0x8000|((VHDCI[0][1]&0x7fc0)>>6)|((VHDCI_reverse[0][1]&0x7)<<9)|((VHDCI[0][1]&0x7)<<12);
00440                         SFP[0][1]=((VHDCI_reverse[0][0]&0x7ff8)>>3)|((VHDCI[0][0]&0x38)<<9);
00441                         SFP[1][1]=0x8000|((VHDCI_reverse[0][1]&0x7ff8)>>3)|((VHDCI[0][1]&0x38)<<9);
00442                         SFP[0][2]=((VHDCI[1][0]&0x7fc0)>>6)|((VHDCI_reverse[1][0]&0x7)<<9)|((VHDCI[1][0]&0x7)<<12);
00443                         SFP[1][2]=0x8000|((VHDCI[1][1]&0x7fc0)>>6)|((VHDCI_reverse[1][1]&0x7)<<9)|((VHDCI[1][1]&0x7)<<12);
00444                         SFP[0][3]=((VHDCI_reverse[1][0]&0x7ff8)>>3)|((VHDCI[1][0]&0x38)<<9);
00445                         SFP[1][3]=0x8000|((VHDCI_reverse[1][1]&0x7ff8)>>3)|((VHDCI[1][1]&0x38)<<9);
00446                 break;
00447                 default:
00448                         SFP[0][0]=0;
00449                         SFP[1][0]=0x8000;
00450                         SFP[0][1]=0;
00451                         SFP[1][1]=0x8000;
00452                         SFP[0][2]=0;
00453                         SFP[1][2]=0x8000;
00454                         SFP[0][3]=0;
00455                         SFP[1][3]=0x8000;
00456                 }
00457 }

void SourceCardRouting::VHDCItoSTRING ( unsigned short &  logicalCardID,
unsigned short &  eventNumber,
std::string &  dataString,
unsigned long &  VHDCI[2][2] 
)

Definition at line 735 of file SourceCardRouting.cc.

References lat::endl(), and pyDBSRunClass::temp.

Referenced by EMUtoSTRING(), RC012toSTRING(), RC234toSTRING(), RC56HFtoSTRING(), and SFPtoSTRING().

00738                                                          {
00739 
00740                 stringstream temp;
00741 
00742                 temp << dec << eventNumber << '\t';
00743                 temp << dec << logicalCardID << '\t';
00744                 temp << hex << setw(8) << setfill('0') << VHDCI[0][0] << '\t';
00745                 temp << hex << setw(8) << setfill('0') << VHDCI[0][1] << '\t';
00746                 temp << hex << setw(8) << setfill('0') << VHDCI[1][0] << '\t';
00747                 temp << hex << setw(8) << setfill('0') << VHDCI[1][1] << endl;
00748                 dataString = temp.str();
00749 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:32:40 2009 for CMSSW by  doxygen 1.5.4