From: decaro Date: Thu, 22 Feb 2007 09:43:45 +0000 (+0000) Subject: Added AliTOFRawStream::GetIndex method for online calibration (C.Zampolli) X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=740f0695537d334ddec67540eda05cc835fe6bf4;p=u%2Fmrichter%2FAliRoot.git Added AliTOFRawStream::GetIndex method for online calibration (C.Zampolli) --- diff --git a/TOF/AliTOFRawStream.cxx b/TOF/AliTOFRawStream.cxx index e5922f3d4f4..f66ac08ce85 100644 --- a/TOF/AliTOFRawStream.cxx +++ b/TOF/AliTOFRawStream.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.11 2007/02/20 15:57:00 decaro +Raw data update: to read the TOF raw data defined in UNPACKED mode + Revision 1.10 2006/12/15 14:01:38 cvetan Memory leak fixed @@ -1348,3 +1351,55 @@ void AliTOFRawStream::EquipmentId2VolumeId(Int_t nDDL, Int_t nTRM, Int_t iChain, volume[4] = iPadZ; } +//_____________________________________________________________________________ + +Int_t AliTOFRawStream::GetIndex(Int_t *detId) +{ + //Retrieve calibration channel index + const Int_t nSectors = fTOFGeometry->NSectors(); + const Int_t nPlates = fTOFGeometry->NPlates(); + const Int_t nStripA = fTOFGeometry->NStripA(); + const Int_t nStripB = fTOFGeometry->NStripB(); + const Int_t nStripC = fTOFGeometry->NStripC(); + const Int_t nPadX = fTOFGeometry->NpadX(); + const Int_t nPadZ = fTOFGeometry->NpadZ(); + + + Int_t isector = detId[0]; + if (isector >= nSectors) + AliError(Form("Wrong sector number in TOF (%d) !",isector)); + Int_t iplate = detId[1]; + if (iplate >= nPlates) + AliError(Form("Wrong plate number in TOF (%d) !",iplate)); + Int_t istrip = detId[2]; + Int_t ipadz = detId[3]; + Int_t ipadx = detId[4]; + Int_t stripOffset = 0; + switch (iplate) { + case 0: + stripOffset = 0; + break; + case 1: + stripOffset = nStripC; + break; + case 2: + stripOffset = nStripC+nStripB; + break; + case 3: + stripOffset = nStripC+nStripB+nStripA; + break; + case 4: + stripOffset = nStripC+nStripB+nStripA+nStripB; + break; + default: + AliError(Form("Wrong plate number in TOF (%d) !",iplate)); + break; + }; + + Int_t idet = ((2*(nStripC+nStripB)+nStripA)*nPadZ*nPadX)*isector + + (stripOffset*nPadZ*nPadX)+ + (nPadZ*nPadX)*istrip+ + (nPadX)*ipadz+ + ipadx; + return idet; +} diff --git a/TOF/AliTOFRawStream.h b/TOF/AliTOFRawStream.h index 8fb228ace7d..f96a9e9ff38 100644 --- a/TOF/AliTOFRawStream.h +++ b/TOF/AliTOFRawStream.h @@ -41,6 +41,7 @@ class AliTOFRawStream: public TObject { Int_t GetStrip() const {return fStrip;}; Int_t GetPadZ() const {return fPadZ;}; Int_t GetPadX() const {return fPadX;}; + Int_t GetIndex(Int_t *detId); // Get channel index for Online Calibration Int_t GetTofBin() const {return fTime;}; Int_t GetToTbin() const {return fToT;};