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 **************************************************************************/
16 ///////////////////////////////////////////////////////////////////////////////
18 /// This class provides access to TPC digits in raw data.
20 /// It loops over all TPC digits in the raw data given by the AliRawReader.
21 /// The Next method goes to the next digit. If there are no digits left
22 /// it returns kFALSE.
23 /// Several getters provide information about the current digit.
25 ///////////////////////////////////////////////////////////////////////////////
29 #include "AliTPCRawStreamOld.h"
30 #include "AliRawReader.h"
32 #include "AliTPCAltroMapping.h"
34 ClassImp(AliTPCRawStreamOld)
36 //_____________________________________________________________________________
37 AliTPCRawStreamOld::AliTPCRawStreamOld(AliRawReader* rawReader) :
38 AliAltroRawStreamOld(rawReader),
46 // create an object to read TPC raw digits
48 // Do not select on the equipment Id, since the Id
49 // is wrong (it starts from 228 or so...)
51 // Skip the Common Data Header, since it is only 7
53 rawReader->RequireHeader(kFALSE);
55 TString path = gSystem->Getenv("ALICE_ROOT");
56 path += "/TPC/mapping/Patch";
58 for(Int_t i = 0; i < 6; i++) {
62 fMapping[i] = new AliTPCAltroMapping(path2.Data());
65 fNoAltroMapping = kFALSE;
68 //_____________________________________________________________________________
69 AliTPCRawStreamOld::AliTPCRawStreamOld(const AliTPCRawStreamOld& stream) :
70 AliAltroRawStreamOld(stream),
78 Fatal("AliTPCRawStreamOld", "copy constructor not implemented");
81 //_____________________________________________________________________________
82 AliTPCRawStreamOld& AliTPCRawStreamOld::operator = (const AliTPCRawStreamOld&
85 Fatal("operator =", "assignment operator not implemented");
89 //_____________________________________________________________________________
90 AliTPCRawStreamOld::~AliTPCRawStreamOld()
94 for(Int_t i = 0; i < 6; i++) delete fMapping[i];
97 //_____________________________________________________________________________
98 void AliTPCRawStreamOld::Reset()
100 // reset tpc raw stream params
101 AliAltroRawStreamOld::Reset();
102 fSector = fPrevSector = fRow = fPrevRow = fPad = fPrevPad = -1;
105 //_____________________________________________________________________________
106 Bool_t AliTPCRawStreamOld::Next()
108 // Read next TPC signal
109 // Apply the TPC altro mapping to get
110 // the sector,pad-row and pad indeces
111 fPrevSector = fSector;
114 if (AliAltroRawStreamOld::Next()) {
115 if (IsNewHWAddress())
123 //_____________________________________________________________________________
124 void AliTPCRawStreamOld::ApplyAltroMapping()
126 // Take the DDL index, load
127 // the corresponding altro mapping
128 // object and fill the sector,row and pad indeces
129 Int_t ddlNumber = GetDDLNumber()-228;
131 if (ddlNumber < 72) {
132 fSector = ddlNumber / 2;
133 patchIndex = ddlNumber % 2;
136 fSector = (ddlNumber - 72) / 4 + 36;
137 patchIndex = (ddlNumber - 72) % 4 + 2;
140 Short_t hwAddress = GetHWAddress();
141 fRow = fMapping[patchIndex]->GetPadRow(hwAddress);
142 fPad = fMapping[patchIndex]->GetPad(hwAddress);