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 TPC digits in raw data.
22 /// It loops over all TPC digits in the raw data given by the AliRawReader.
23 /// The NextChannel method loads the data for the next pad. If there is no pad left
24 /// it returns kFALSE.
26 ///////////////////////////////////////////////////////////////////////////////
30 #include "AliTPCRawStreamFast.h"
31 #include "AliRawReader.h"
33 #include "AliTPCAltroMapping.h"
35 ClassImp(AliTPCRawStreamFast)
37 //_____________________________________________________________________________
38 AliTPCRawStreamFast::AliTPCRawStreamFast(AliRawReader* rawReader, AliAltroMapping **mapping) :
39 AliAltroRawStreamFast(rawReader),
48 // create an object to read TPC raw digits
52 if (mapping == NULL) {
53 TString path = gSystem->Getenv("ALICE_ROOT");
54 path += "/TPC/mapping/Patch";
56 for(Int_t i = 0; i < 6; i++) {
60 fMapping[i] = new AliTPCAltroMapping(path2.Data());
65 for(Int_t i = 0; i < 6; i++)
66 fMapping[i] = mapping[i];
70 //fNoAltroMapping = kFALSE;
72 //_____________________________________________________________________________
73 AliTPCRawStreamFast::~AliTPCRawStreamFast()
78 for(Int_t i = 0; i < 6; i++) delete fMapping[i];
81 //_____________________________________________________________________________
82 void AliTPCRawStreamFast::Reset()
84 // reset tpc raw stream params
85 AliAltroRawStreamFast::Reset();
86 fSector = fPrevSector = fRow = fPrevRow = fPad = fPrevPad = -1;
89 //_____________________________________________________________________________
90 Bool_t AliTPCRawStreamFast::NextChannel()
92 // Read next TPC Channel
93 // Apply the TPC altro mapping to get
94 // the sector,pad-row and pad indeces
95 fPrevSector = fSector;
98 if (AliAltroRawStreamFast::NextChannel()) {
99 // if (IsNewHWAddress())
100 if ( GetHWAddress() > -1 )
108 //_____________________________________________________________________________
109 void AliTPCRawStreamFast::ApplyAltroMapping()
111 // Take the DDL index, load
112 // the corresponding altro mapping
113 // object and fill the sector,row and pad indeces
114 Int_t ddlNumber = GetDDLNumber();
116 if (ddlNumber < 72) {
117 fSector = ddlNumber / 2;
118 patchIndex = ddlNumber % 2;
121 fSector = (ddlNumber - 72) / 4 + 36;
122 patchIndex = (ddlNumber - 72) % 4 + 2;
125 Short_t hwAddress = GetHWAddress();
126 fRow = fMapping[patchIndex]->GetPadRow(hwAddress);
127 fPad = fMapping[patchIndex]->GetPad(hwAddress);
129 // if ((fRow < 0) || (fPad < 0))
130 // AddMappingErrorLog(Form("hw=%d",hwAddress));