CMS 3D CMS Logo

SourceCardRouting.h

Go to the documentation of this file.
00001 /*
00002   SourceCardRouting library
00003   Copyright Andrew Rose 2007
00004 */
00005 
00006 #ifndef SOURCECARDROUTING_H
00007 #define SOURCECARDROUTING_H
00008 
00009 // The string and stream definitions
00010 #include <iostream>
00011 #include <string>
00012 
00013 class SourceCardRouting {
00014 
00015  public:
00016 
00017   SourceCardRouting();
00018   ~SourceCardRouting();
00019 
00020 //SFP arrays are SFP[cycle<2][sfp number<4]
00021 //electron arrays are eIsoRank[candidate number<4]
00022 //muon arrays are MIPbits[rec card number<7][region<2]
00023     void EMUtoSFP(      unsigned short (&eIsoRank)[4],
00024                         unsigned short (&eIsoCardId)[4],
00025                         unsigned short (&eIsoRegionId)[4],
00026                         unsigned short (&eNonIsoRank)[4],
00027                         unsigned short (&eNonIsoCardId)[4],
00028                         unsigned short (&eNonIsoRegionId)[4],
00029                         unsigned short (&MIPbits)[7][2],
00030                         unsigned short (&Qbits)[7][2],
00031                         unsigned short (&SFP)[2][4]     );
00032 
00033 //SFP arrays are SFP[cycle<2][sfp number<4]
00034 //electron arrays are eIsoRank[candidate number<4]
00035 //muon arrays are MIPbits[rec card number<7][region<2]
00036     void SFPtoEMU(      unsigned short (&eIsoRank)[4],
00037                         unsigned short (&eIsoCardId)[4],
00038                         unsigned short (&eIsoRegionId)[4],
00039                         unsigned short (&eNonIsoRank)[4],
00040                         unsigned short (&eNonIsoCardId)[4],
00041                         unsigned short (&eNonIsoRegionId)[4],
00042                         unsigned short (&MIPbits)[7][2],
00043                         unsigned short (&Qbits)[7][2],
00044                         unsigned short (&SFP)[2][4]     );
00045 
00046 /***********************************************************************************************************************/
00047 //RC arrays are RC[receiver card number<7][region<2]
00048 //HF arrays are HF[eta<4][HF region<2]
00049 //SFP arrays are SFP[cycle<2][sfp number<4]
00050     void RC56HFtoSFP(   unsigned short (&RC)[7][2],
00051                         unsigned short (&RCof)[7][2],
00052                         unsigned short (&RCtau)[7][2],
00053                         unsigned short (&HF)[4][2],
00054                         unsigned short (&HFQ)[4][2],
00055                         unsigned short (&SFP)[2][4]     );
00056 
00057 //RC arrays are RC[receiver card number<7][region<2]
00058 //HF arrays are HF[eta<4][HF region<2]
00059 //SFP arrays are SFP[cycle<2][sfp number<4]
00060     void SFPtoRC56HF(   unsigned short (&RC)[7][2],
00061                         unsigned short (&RCof)[7][2],
00062                         unsigned short (&RCtau)[7][2],
00063                         unsigned short (&HF)[4][2],
00064                         unsigned short (&HFQ)[4][2],
00065                         unsigned short (&SFP)[2][4]     );
00066 
00067 //RC arrays are RC[receiver card number<7][region<2]
00068 //SFP arrays are SFP[cycle<2][sfp number<4]
00069     void RC012toSFP(    unsigned short (&RC)[7][2],
00070                         unsigned short (&RCof)[7][2],
00071                         unsigned short (&RCtau)[7][2],
00072                         unsigned short (&SFP)[2][4]     );
00073 
00074 //RC arrays are RC[receiver card number<7][region<2]
00075 //SFP arrays are SFP[cycle<2][sfp number<4]
00076     void SFPtoRC012(    unsigned short (&RC)[7][2],
00077                         unsigned short (&RCof)[7][2],
00078                         unsigned short (&RCtau)[7][2],
00079                         unsigned short (&SFP)[2][4]     );
00080 
00081 //RC arrays are RC[receiver card number<7][region<2]
00082 //SFP arrays are SFP[cycle<2][sfp number<4]
00083     void RC234toSFP(    unsigned short (&RC)[7][2],
00084                         unsigned short (&RCof)[7][2],
00085                         unsigned short (&RCtau)[7][2],
00086                         unsigned short (&sisterRC)[7][2],
00087                         unsigned short (&sisterRCof)[7][2],
00088                         unsigned short (&sisterRCtau)[7][2],
00089                         unsigned short (&SFP)[2][4]     );
00090 
00091 //RC arrays are RC[receiver card number<7][region<2]
00092 //SFP arrays are SFP[cycle<2][sfp number<4]
00093     void SFPtoRC234(    unsigned short (&RC)[7][2],
00094                         unsigned short (&RCof)[7][2],
00095                         unsigned short (&RCtau)[7][2],
00096                         unsigned short (&sisterRC)[7][2],
00097                         unsigned short (&sisterRCof)[7][2],
00098                         unsigned short (&sisterRCtau)[7][2],
00099                         unsigned short (&SFP)[2][4]     );
00100 
00101 /***********************************************************************************************************************/
00102 
00103 //VHDCI arrays are VHDCI[VHDCI<2][cycle<2]
00104 //SFP arrays are SFP[cycle<2][sfp number<4]
00105 
00106     void SFPtoVHDCI(    int RoutingMode,
00107                         unsigned short (&SFP)[2][4],
00108                         unsigned long (&VHDCI)[2][2] );
00109 
00110 
00111 //VHDCI arrays are VHDCI[VHDCI<2][cycle<2]
00112 //SFP arrays are SFP[cycle<2][sfp number<4]
00113     void VHDCItoSFP(    int RoutingMode,
00114                         unsigned short (&SFP)[2][4],
00115                         unsigned long (&VHDCI)[2][2]    );
00116 
00117 /***********************************************************************************************************************/
00118 
00119 //VHDCI arrays are VHDCI[VHDCI<2][cycle<2]
00120 //electron arrays are eIsoRank[candidate number<4]
00121 //muon arrays are MIPbits[rec card number<7][region<2]
00122 
00123     void EMUtoVHDCI(    unsigned short (&eIsoRank)[4],
00124                         unsigned short (&eIsoCardId)[4],
00125                         unsigned short (&eIsoRegionId)[4],
00126                         unsigned short (&eNonIsoRank)[4],
00127                         unsigned short (&eNonIsoCardId)[4],
00128                         unsigned short (&eNonIsoRegionId)[4],
00129                         unsigned short (&MIPbits)[7][2],
00130                         unsigned short (&Qbits)[7][2],
00131                         unsigned long (&VHDCI)[2][2]    );
00132 
00133 
00134 //VHDCI arrays are VHDCI[VHDCI<2][cycle<2]
00135 //electron arrays are eIsoRank[candidate number<4]
00136 //muon arrays are MIPbits[rec card number<7][region<2]
00137     void VHDCItoEMU(    unsigned short (&eIsoRank)[4],
00138                         unsigned short (&eIsoCardId)[4],
00139                         unsigned short (&eIsoRegionId)[4],
00140                         unsigned short (&eNonIsoRank)[4],
00141                         unsigned short (&eNonIsoCardId)[4],
00142                         unsigned short (&eNonIsoRegionId)[4],
00143                         unsigned short (&MIPbits)[7][2],
00144                         unsigned short (&Qbits)[7][2],
00145                         unsigned long (&VHDCI)[2][2]    );
00146 
00147 
00148 
00149 /***********************************************************************************************************************/
00150 
00151 //RC arrays are RC[receiver card number<7][region<2]
00152 //HF arrays are HF[eta<4][HF region<2]
00153 //VHDCI arrays are VHDCI[VHDCI<2][cycle<2]
00154     void RC56HFtoVHDCI( unsigned short (&RC)[7][2],
00155                         unsigned short (&RCof)[7][2],
00156                         unsigned short (&RCtau)[7][2],
00157                         unsigned short (&HF)[4][2],
00158                         unsigned short (&HFQ)[4][2],
00159                         unsigned long (&VHDCI)[2][2]    );
00160 
00161 //RC arrays are RC[receiver card number<7][region<2]
00162 //HF arrays are HF[eta<4][HF region<2]
00163 //VHDCI arrays are VHDCI[VHDCI<2][cycle<2]
00164     void VHDCItoRC56HF( unsigned short (&RC)[7][2],
00165                         unsigned short (&RCof)[7][2],
00166                         unsigned short (&RCtau)[7][2],
00167                         unsigned short (&HF)[4][2],
00168                         unsigned short (&HFQ)[4][2],
00169                         unsigned long (&VHDCI)[2][2]    );
00170 
00171 //RC arrays are RC[receiver card number<7][region<2]
00172 //VHDCI arrays are VHDCI[VHDCI<2][cycle<2]
00173     void RC012toVHDCI(  unsigned short (&RC)[7][2],
00174                         unsigned short (&RCof)[7][2],
00175                         unsigned short (&RCtau)[7][2],
00176                         unsigned long (&VHDCI)[2][2]);
00177 
00178 //RC arrays are RC[receiver card number<7][region<2]
00179 //VHDCI arrays are VHDCI[VHDCI<2][cycle<2]
00180     void VHDCItoRC012(  unsigned short (&RC)[7][2],
00181                         unsigned short (&RCof)[7][2],
00182                         unsigned short (&RCtau)[7][2],
00183                         unsigned long (&VHDCI)[2][2]    );
00184 
00185 //RC arrays are RC[receiver card number<7][region<2]
00186 //VHDCI arrays are VHDCI[VHDCI<2][cycle<2]
00187     void RC234toVHDCI(  unsigned short (&RC)[7][2],
00188                         unsigned short (&RCof)[7][2],
00189                         unsigned short (&RCtau)[7][2],
00190                         unsigned short (&sisterRC)[7][2],
00191                         unsigned short (&sisterRCof)[7][2],
00192                         unsigned short (&sisterRCtau)[7][2],
00193                         unsigned long (&VHDCI)[2][2]    );
00194 
00195 //RC arrays are RC[receiver card number<7][region<2]
00196 //VHDCI arrays are VHDCI[VHDCI<2][cycle<2]
00197     void VHDCItoRC234(  unsigned short (&RC)[7][2],
00198                         unsigned short (&RCof)[7][2],
00199                         unsigned short (&RCtau)[7][2],
00200                         unsigned short (&sisterRC)[7][2],
00201                         unsigned short (&sisterRCof)[7][2],
00202                         unsigned short (&sisterRCtau)[7][2],
00203                         unsigned long (&VHDCI)[2][2]    );
00204 
00205 /***********************************************************************************************************************/
00206 
00207 //electron arrays are eIsoRank[candidate number<4]
00208 //muon arrays are MIPbits[rec card number<7][region<2]
00209 
00210     void EMUtoSTRING(   unsigned short &logicalCardID,
00211                         unsigned short &eventNumber,
00212                         unsigned short (&eIsoRank)[4],
00213                         unsigned short (&eIsoCardId)[4],
00214                         unsigned short (&eIsoRegionId)[4],
00215                         unsigned short (&eNonIsoRank)[4],
00216                         unsigned short (&eNonIsoCardId)[4],
00217                         unsigned short (&eNonIsoRegionId)[4],
00218                         unsigned short (&MIPbits)[7][2],
00219                         unsigned short (&Qbits)[7][2],
00220                         std::string &dataString );
00221 
00222 //RC arrays are RC[receiver card number<7][region<2]
00223 //HF arrays are HF[eta<4][HF region<2]
00224     void RC56HFtoSTRING(        unsigned short &logicalCardID,
00225                         unsigned short &eventNumber,
00226                         unsigned short (&RC)[7][2],
00227                         unsigned short (&RCof)[7][2],
00228                         unsigned short (&RCtau)[7][2],
00229                         unsigned short (&HF)[4][2],
00230                         unsigned short (&HFQ)[4][2],
00231                         std::string &dataString );
00232 
00233 //RC arrays are RC[receiver card number<7][region<2]
00234     void RC012toSTRING( unsigned short &logicalCardID,
00235                         unsigned short &eventNumber,
00236                         unsigned short (&RC)[7][2],
00237                         unsigned short (&RCof)[7][2],
00238                         unsigned short (&RCtau)[7][2],
00239                         std::string &dataString );
00240 
00241 //RC arrays are RC[receiver card number<7][region<2]
00242     void RC234toSTRING( unsigned short &logicalCardID,
00243                         unsigned short &eventNumber,
00244                         unsigned short (&RC)[7][2],
00245                         unsigned short (&RCof)[7][2],
00246                         unsigned short (&RCtau)[7][2],
00247                         unsigned short (&sisterRC)[7][2],
00248                         unsigned short (&sisterRCof)[7][2],
00249                         unsigned short (&sisterRCtau)[7][2],
00250                         std::string &dataString );
00251 
00252 /***********************************************************************************************************************/
00253 
00254 //SFP arrays are SFP[cycle<2][sfp number<4]
00255     void SFPtoSTRING(   unsigned short &logicalCardID,
00256                         unsigned short &eventNumber,
00257                         int RoutingMode,
00258                         unsigned short (&SFP)[2][4],
00259                         std::string &dataString );
00260 
00261 /***********************************************************************************************************************/
00262 
00263 //VHDCI arrays are VHDCI[VHDCI<2][cycle<2]
00264     void STRINGtoVHDCI( unsigned short &logicalCardID,
00265                         unsigned short &eventNumber,
00266                         std::string &dataString,
00267                         unsigned long (&VHDCI)[2][2]    );
00268 
00269 
00270 //VHDCI arrays are VHDCI[VHDCI<2][cycle<2]
00271     void VHDCItoSTRING( unsigned short &logicalCardID,
00272                         unsigned short &eventNumber,
00273                         std::string &dataString,
00274                         unsigned long (&VHDCI)[2][2]    );
00275 
00276 /***********************************************************************************************************************/
00277 
00278     void LogicalCardIDtoRoutingMode( unsigned short &logicalCardID,
00279                                      int &RoutingMode,
00280                                      int &RCTCrateNumber        );
00281 
00282    void RoutingModetoLogicalCardID( unsigned short &logicalCardID,
00283                                      int &RoutingMode,
00284                                      int &RCTCrateNumber        );
00285 
00286 
00287 
00288 }; //class SourceCardRouting
00289 
00290 #endif //~SOURCECARDMANAGER_H
00291 
00292 
00293 
00294 
00295 
00296 
00297 
00298 
00299 
00300 
00301 
00302 
00303 
00305 //These were going to be implimented but made things a lot more complicated than necessary
00306 /*
00307 //RC arrays are RC[receiver card number<7][region<2]
00308 //HF arrays are HF[eta<4][HF region<2]
00309 //SFP arrays are SFP[cycle<2][sfp number<4]
00310     void RCtoSFP(       int &RoutingMode,
00311                         unsigned short (&RC)[7][2],
00312                         unsigned short (&RCof)[7][2],
00313                         unsigned short (&RCtau)[7][2],
00314                         unsigned short (&sisterRC)[7][2],
00315                         unsigned short (&sisterRCof)[7][2],
00316                         unsigned short (&sisterRCtau)[7][2],
00317                         unsigned short (&HF)[4][2],
00318                         unsigned short (&HFQ)[4][2],
00319                         unsigned short (&SFP)[2][4] );
00320 
00321 
00322 //RC arrays are RC[receiver card number<7][region<2]
00323 //HF arrays are HF[eta<4][HF region<2]
00324 //SFP arrays are SFP[cycle<2][sfp number<4]
00325     void SFPtoRC(       int &RoutingMode,
00326                         unsigned short (&RC)[7][2],
00327                         unsigned short (&RCof)[7][2],
00328                         unsigned short (&RCtau)[7][2],
00329                         unsigned short (&sisterRC)[7][2],
00330                         unsigned short (&sisterRCof)[7][2],
00331                         unsigned short (&sisterRCtau)[7][2],
00332                         unsigned short (&HF)[4][2],
00333                         unsigned short (&HFQ)[4][2],
00334                         unsigned short (&SFP)[2][4] );*/
00335 
00336 /*
00337 //RC arrays are RC[receiver card number<7][region<2]
00338 //VHDCI arrays are VHDCI[VHDCI<2][cycle<2]
00339     void RCtoSTRING(    unsigned short &logicalCardID,
00340                         unsigned short &eventNumber,
00341                         unsigned short (&RC)[7][2],
00342                         unsigned short (&RCof)[7][2],
00343                         unsigned short (&RCtau)[7][2],
00344                         unsigned short (&sisterRC)[7][2],
00345                         unsigned short (&sisterRCof)[7][2],
00346                         unsigned short (&sisterRCtau)[7][2],
00347                         unsigned short (&HF)[4][2],
00348                         unsigned short (&HFQ)[4][2],
00349                         std::string &dataString );
00350 */      
00351 
00352 /*
00353 //RC arrays are RC[receiver card number<7][region<2]
00354 //VHDCI arrays are VHDCI[VHDCI<2][cycle<2]
00355     void RCtoVHDCI(     int &RoutingMode,
00356                         unsigned short (&RC)[7][2],
00357                         unsigned short (&RCof)[7][2],
00358                         unsigned short (&RCtau)[7][2],
00359                         unsigned short (&sisterRC)[7][2],
00360                         unsigned short (&sisterRCof)[7][2],
00361                         unsigned short (&sisterRCtau)[7][2],
00362                         unsigned short (&HF)[4][2],
00363                         unsigned short (&HFQ)[4][2],
00364                         unsigned long (&VHDCI)[2][2]    );
00365 
00366 //RC arrays are RC[receiver card number<7][region<2]
00367 //VHDCI arrays are VHDCI[VHDCI<2][cycle<2]
00368     void VHDCItoRC(     int &RoutingMode,
00369                         unsigned short (&RC)[7][2],
00370                         unsigned short (&RCof)[7][2],
00371                         unsigned short (&RCtau)[7][2],
00372                         unsigned short (&sisterRC)[7][2],
00373                         unsigned short (&sisterRCof)[7][2],
00374                         unsigned short (&sisterRCtau)[7][2],
00375                         unsigned short (&HF)[4][2],
00376                         unsigned short (&HFQ)[4][2],
00377                         unsigned long (&VHDCI)[2][2]    );
00378 */
00379 
00380 
00381 
00382 
00383 
00384 
00385 
00386 
00387 
00388 
00389 
00390 
00391 

Generated on Tue Jun 9 17:40:26 2009 for CMSSW by  doxygen 1.5.4