1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 /// This class provides access to PMD digits in raw data.
22 /// It loops over all PMD digits in the raw data given by the AliRawReader.
23 /// The Next method goes to the next digit. If there are no digits left
24 /// it returns kFALSE.
25 /// Several getters provide information about the current digit.
27 ///////////////////////////////////////////////////////////////////////////////
29 #include "AliPMDRawStream.h"
30 #include "AliRawReader.h"
32 ClassImp(AliPMDRawStream)
35 //_____________________________________________________________________________
36 AliPMDRawStream::AliPMDRawStream(AliRawReader* rawReader) :
37 fRawReader(rawReader),
48 // create an object to read PMD raw digits
50 fRawReader->Select(12);
53 //_____________________________________________________________________________
54 AliPMDRawStream::AliPMDRawStream(const AliPMDRawStream& stream) :
69 Fatal("AliPMDRawStream", "copy constructor not implemented");
72 //_____________________________________________________________________________
73 AliPMDRawStream& AliPMDRawStream::operator = (const AliPMDRawStream&
76 // assignment operator
78 Fatal("operator =", "assignment operator not implemented");
82 //_____________________________________________________________________________
83 AliPMDRawStream::~AliPMDRawStream()
90 //_____________________________________________________________________________
91 Bool_t AliPMDRawStream::Next()
93 // read the next raw digit
94 // returns kFALSE if there is no digit left
96 fPrevModule = fModule;
99 if (!fRawReader->ReadNextInt(data)) return kFALSE;
101 fSignal = data & 0x0FFF;
102 fChannel = (data >> 12) & 0x003F;
103 fMCM = (data >> 18) & 0x07FF;
105 Int_t iddl = fRawReader->GetDDLID();
107 GetRowCol(iddl, fMCM, fChannel, ium, fRow, fColumn);
111 fModule = iddl*6 + ium;
150 //_____________________________________________________________________________
151 void AliPMDRawStream::GetRowCol(Int_t ddlno, UInt_t mcmno, UInt_t chno,
152 Int_t &um, Int_t &row, Int_t &col) const
154 // decode: ddlno, mcmno, chno -> um, row, col
160 static const UInt_t kCh[64] = { 21, 25, 29, 28, 17, 24, 20, 16,
161 12, 13, 8, 4, 0, 1, 9, 5,
162 10, 6, 2, 3, 14, 7, 11, 15,
163 19, 18, 23, 27, 31, 30, 22, 26,
164 53, 57, 61, 60, 49, 56, 52, 48,
165 44, 45, 40, 36, 32, 33, 41, 37,
166 42, 38, 34, 35, 46, 39, 43, 47,
167 51, 50, 55, 59, 63, 62, 54, 58 };
169 if (ddlno == 0 || ddlno == 1)
172 Int_t mcmnonew = mcmno - 72*um;
173 Int_t rowcol = kCh[chno];
174 Int_t irownew = rowcol/4;
175 Int_t icolnew = rowcol%4;
177 remmcm = mcmnonew%12;
178 divmcm = mcmnonew/12;
180 row = 16*divmcm + irownew;
181 col = 4*remmcm + icolnew;
182 // This obtatined row and col (0,0) are the top left corner.
183 // Needs transformation to get the Geant (0,0)
186 else if (ddlno == 2 || ddlno == 3)
189 Int_t mcmnonew = mcmno - 72*um;
190 Int_t rowcol = kCh[chno];
191 Int_t irownew = rowcol/4;
192 Int_t icolnew = rowcol%4;
194 remmcm = mcmnonew%24;
195 divmcm = mcmnonew/24;
197 row = 16*divmcm + irownew;
198 col = 4*remmcm + icolnew;
199 // This obtatined row and col (0,0) are the top left corner.
200 // Needs transformation to get the Geant (0,0)
203 else if (ddlno == 4 || ddlno == 5)
206 Int_t mcmnonew = mcmno - 72*um;
207 Int_t rowcol = kCh[chno];
208 Int_t irownew = rowcol/4;
209 Int_t icolnew = rowcol%4;
213 remmcm = mcmnonew%12;
214 divmcm = mcmnonew/12;
218 remmcm = mcmnonew%24;
219 divmcm = mcmnonew/24;
222 row = 16*divmcm + irownew;
223 col = 4*remmcm + icolnew;
224 // This obtatined row and col (0,0) are the top left corner.
225 // Needs transformation to get the Geant (0,0)