]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCRawStream.cxx
Initializing pad-plane for AliTPCROC + Inclined pads
[u/mrichter/AliRoot.git] / TPC / AliTPCRawStream.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15
16 /* $Id$ */
17
18 ///////////////////////////////////////////////////////////////////////////////
19 ///
20 /// This class provides access to TPC digits in raw data.
21 ///
22 /// It loops over all TPC 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.
26 ///
27 ///////////////////////////////////////////////////////////////////////////////
28
29 #include <TSystem.h>
30
31 #include "AliTPCRawStream.h"
32 #include "AliRawReader.h"
33 #include "AliLog.h"
34 #include "AliTPCAltroMapping.h"
35
36 ClassImp(AliTPCRawStream)
37
38 //_____________________________________________________________________________
39 AliTPCRawStream::AliTPCRawStream(AliRawReader* rawReader) :
40   AliAltroRawStream(rawReader)
41 {
42   // create an object to read TPC raw digits
43
44   fRawReader->Select(0);
45
46   TString path = gSystem->Getenv("ALICE_ROOT");
47   path += "/TPC/mapping/Patch";
48   TString path2;
49   for(Int_t i = 0; i < 6; i++) {
50     path2 = path;
51     path2 += i;
52     path2 += ".data";
53     fMapping[i] = new AliTPCAltroMapping(path2.Data());
54   }
55
56   fNoAltroMapping = kFALSE;
57 }
58
59 //_____________________________________________________________________________
60 AliTPCRawStream::AliTPCRawStream(const AliTPCRawStream& stream) :
61   AliAltroRawStream(stream)
62 {
63   Fatal("AliTPCRawStream", "copy constructor not implemented");
64 }
65
66 //_____________________________________________________________________________
67 AliTPCRawStream& AliTPCRawStream::operator = (const AliTPCRawStream& 
68                                               /* stream */)
69 {
70   Fatal("operator =", "assignment operator not implemented");
71   return *this;
72 }
73
74 //_____________________________________________________________________________
75 AliTPCRawStream::~AliTPCRawStream()
76 {
77 // destructor
78
79   for(Int_t i = 0; i < 6; i++) delete fMapping[i];
80 }
81
82 //_____________________________________________________________________________
83 void AliTPCRawStream::Reset()
84 {
85   // reset tpc raw stream params
86   AliAltroRawStream::Reset();
87 }
88
89 //_____________________________________________________________________________
90 void AliTPCRawStream::ApplyAltroMapping()
91 {
92   // Reads the DDL index, loads
93   // the corresponding altro mapping
94   // object and fills the sector,row and pad indeces
95   Int_t ddlNumber = fRawReader->GetDDLID();
96   Int_t patchIndex;
97   if (ddlNumber < 72) {
98     fSector = ddlNumber / 2;
99     patchIndex = ddlNumber % 2;
100   }
101   else {
102     fSector = (ddlNumber - 72) / 4 + 36;
103     patchIndex = (ddlNumber - 72) % 4 + 2;
104   }
105
106   fRow = fMapping[patchIndex]->GetPadRow(fHWAddress);
107   fPad = fMapping[patchIndex]->GetPad(fHWAddress);
108
109 }