X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TPC%2FAliTPCmapper.cxx;h=0b33888e1306f6ad7d0b135808c7b9a7e18ef0aa;hb=849102f9ff0bac3c810a30643290d9db9cf7f045;hp=7798c641345ade939807b0f03dab13f7eb5ae109;hpb=8d95c9e18dc98ee06a224dc89a87b707ba367e4b;p=u%2Fmrichter%2FAliRoot.git diff --git a/TPC/AliTPCmapper.cxx b/TPC/AliTPCmapper.cxx index 7798c641345..0b33888e130 100644 --- a/TPC/AliTPCmapper.cxx +++ b/TPC/AliTPCmapper.cxx @@ -113,6 +113,7 @@ AliTPCmapper::AliTPCmapper(const AliTPCmapper& mapper) : fTpcDdlOffset(mapper.fTpcDdlOffset) { // Copy Constructor + for ( Int_t i = 0; i < 6; i++ ) fMapping[i]=0; for ( Int_t i = 0; i < fNrcu; i++ ) fMapping[i] = mapper.fMapping[i]; } @@ -149,7 +150,7 @@ void AliTPCmapper::Init(const char *dirname) fNrcu = 6; fNbranch = 2; fNaltro = 8; - fNchannel = 15; + fNchannel = 16; // Load and read mapping files. AliTPCAltroMapping contains the mapping for // each patch (rcu). @@ -170,7 +171,7 @@ void AliTPCmapper::Init(const char *dirname) fMapping[i] = new AliTPCAltroMapping(path2.Data()); } - // Create instance of AliTPCROC object + // Get instance of AliTPCROC object AliTPCROC *fROC = AliTPCROC::Instance(); fNpadrowIROC = fROC->GetNRows(0); fNpadrowOROC = fROC->GetNRows(36); @@ -197,17 +198,20 @@ Int_t AliTPCmapper::GetHWAddressSector(Int_t globalpadrow, Int_t pad) const { // Get the hardware address from pad coordinates Int_t patch = 0; + Int_t hwAddress=-1; if ( globalpadrow < fNpadrowIROC ) { patch = GetPatch(0, globalpadrow, pad); - return fMapping[patch]->GetHWAddress(globalpadrow, pad, 0); + if (patch>-1) + hwAddress = fMapping[patch]->GetHWAddress(globalpadrow, pad, 0); } else if ( globalpadrow < fNpadrow ) { patch = GetPatch(36, globalpadrow - fNpadrowIROC, pad); - return fMapping[patch]->GetHWAddress(globalpadrow - fNpadrowIROC, - pad, 36); + if (patch>-1) + hwAddress = fMapping[patch]->GetHWAddress(globalpadrow - fNpadrowIROC, pad, 36); } else { AliWarning(Form("Padrow outside range (globalpadrow %d) !", globalpadrow)); - return -1; + hwAddress = -1; } + return hwAddress; } @@ -232,7 +236,7 @@ Int_t AliTPCmapper::GetPatch(Int_t roc, Int_t padrow, Int_t pad) const } if ( roc < 36 ) { - // IROC (0 ... 35) + // IROC (ROCs 0 ... 35) Int_t padsInRow = GetNpads(padrow); if ( (padsInRow < 0) || (pad >= padsInRow) ) { AliWarning(Form("Pad index outside range (padrow %d, pad %d, roc %d) !", padrow, pad, roc)); @@ -248,7 +252,7 @@ Int_t AliTPCmapper::GetPatch(Int_t roc, Int_t padrow, Int_t pad) const return -1; } } else if ( roc < 72 ) { - // OROC (36 ... 71) + // OROC (ROCs 36 ... 71) Int_t padsInRow = GetNpads(fNpadrowIROC+padrow); if ( (padsInRow < 0) || (pad >= padsInRow) ) { AliWarning(Form("Pad index outside range (padrow %d, pad %d, roc %d) !", padrow, pad, roc)); @@ -898,13 +902,20 @@ Int_t AliTPCmapper::GetSectorFromEquipmentID(Int_t equipmentID) const { // Get sector index (0 ... 17) from equipment ID Int_t retval = 0; - - if ( (equipmentID < fTpcDdlOffset) || (equipmentID > 983) ) { + if ( (equipmentID < fTpcDdlOffset) || (equipmentID >= fTpcDdlOffset+216) ) { AliWarning(Form("Equipment ID (%d) outside range !", equipmentID)); return -1; } - if ( (equipmentID - 840) < 0 ) retval = (equipmentID-768)/2; - else retval = (equipmentID-840)/4; + Int_t side = GetSideFromEquipmentID(equipmentID); + if ( side < 0 ) return -1; + + if ( (equipmentID - 840) < 0 ) { // IROC + if ( side == 0 ) retval = (equipmentID-fTpcDdlOffset)/2; + else retval = (equipmentID-fTpcDdlOffset-18*2)/2; + } else { // OROC + if ( side == 0 ) retval = (equipmentID-840)/4; + else retval = (equipmentID-840-18*4)/4; + } return retval; } @@ -992,8 +1003,8 @@ Int_t AliTPCmapper::GetRocFromPatch(Int_t side, Int_t sector, Int_t patch) const if ( patch < 2 ) return sector; // IROC else return 36+sector; // OROC } else { // C side - if ( patch < 2 ) return 18+(17-sector); // IROC - else return 54+(17-sector); // OROC + if ( patch < 2 ) return 18+sector; // IROC + else return 54+sector; // OROC } }