1 // some global var/constants
2 const Int_t kNRCU = 2; // per SM
3 AliCaloAltroMapping *fMapping[4]; // 1 for each side (A/C) and each RCU (0/1), i.e. 2*2 total
5 const Bool_t kDebug = kFALSE;
6 const char *branchStr[] = {"A", "B"};
9 Int_t GetHWAddress(Int_t branch, Int_t FEC, Int_t chip, Int_t chan);
14 FEEToTower(Int_t iSM=0, Int_t iRCU=0, Int_t branch=0, Int_t FEC=1, Int_t chip=0, Int_t chan=0)
16 // Get mapping file info, and clear arrays
19 Int_t isect = iSM / 2; //
20 Int_t iside = iSM % 2; // A or C side
22 Int_t iRCUSide = iside*2 + iRCU;
23 Int_t iDDL = iRCU + iSM * kNRCU;
25 Int_t hwAddress = GetHWAddress(branch, FEC, chip, chan);
27 Int_t icol = fMapping[iRCUSide]->GetPad(hwAddress);
28 Int_t irow = fMapping[iRCUSide]->GetPadRow(hwAddress);
29 Int_t caloflag = fMapping[iRCUSide]->GetSector(hwAddress);
31 // report channel info
32 printf(" iSM %d iRCU %d (iDDL %d EqId %d) : branch %d (%s) FEC %d chip %d chan %d \n corresponds to \n iSM %d icol %d irow %d caloflag (igain) %d \n",
33 iSM, iRCU, iDDL, iDDL + 0x1200,
34 branch, branchStr[branch], FEC, chip, chan,
35 iSM, icol, irow, caloflag);
41 GetHWAddress(Int_t branch, Int_t FEC, Int_t chip, Int_t chan)
43 Int_t hwAddr = (branch << 11) | (FEC << 7) | (chip << 4) | chan;
50 TString sides[]={"A","C"};
51 // Read mapping files from $ALICE_ROOT/CALO/mapping/*.data
52 TString path = gSystem->Getenv("ALICE_ROOT");
53 path += "/EMCAL/mapping/RCU";
55 for(Int_t j = 0; j < 2; j++){ // sides
56 for(Int_t i = 0; i < 2; i++) { // RCU
61 if (kDebug) { printf("Mapping file: %s\n",path2.Data()); }
62 fMapping[j*2 + i] = new AliCaloAltroMapping(path2.Data());