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 Revision 1.2 2000/04/17 09:37:33 kowal2
19 removed obsolete AliTPCDigitsDisplay.C
21 Revision 1.1.4.2 2000/04/10 11:37:42 kowal2
23 Digits handling in a new data structure
27 ///////////////////////////////////////////////////////////////////////////////
29 // Time Projection Chamber clusters objects //
31 // Origin: Marian Ivanov , GSI Darmstadt
35 ///////////////////////////////////////////////////////////////////////////////
36 #include "AliTPCParam.h"
37 #include "AliTPCPRF2D.h"
39 #include "TObjArray.h"
40 #include "AliSegmentID.h"
41 #include "AliSegmentArray.h"
43 #include "AliArrayI.h"
44 #include "AliArrayS.h"
47 #include "AliDigits.h"
48 #include "AliSimDigits.h"
49 #include "AliDigitsArray.h"
50 #include "AliTPCDigitsArray.h"
51 #include <TDirectory.h>
55 //_____________________________________________________________________________
57 ClassImp(AliTPCDigitsArray)
59 AliTPCDigitsArray::AliTPCDigitsArray(Bool_t sim)
65 if ( sim == kTRUE) SetClass("AliSimDigits");
67 SetClass("AliDigits");
75 AliTPCDigitsArray::~AliTPCDigitsArray()
82 AliDigits * AliTPCDigitsArray::CreateRow(Int_t sector, Int_t row)
87 //if row just exist - delete it
88 AliTPCParam * param = (AliTPCParam*)fParam;
89 Int_t index = param->GetIndex(sector,row);
90 AliDigits * dig = (AliDigits *)(*this)[index];
91 if (dig !=0) delete dig;
93 dig = (AliDigits *) AddSegment(index);
94 if (dig == 0) return 0;
95 dig->Allocate(param->GetMaxTBin(),param->GetNPads(sector,row));
96 if (fBSim == kTRUE) ((AliSimDigits*) dig)->AllocateTrack(fTrackLevel);
101 AliDigits * AliTPCDigitsArray::GetRow(Int_t sector,Int_t row)
104 //return clusters ((AliTPCDigitsRow *) per given sector and padrow
106 if (fParam==0) return 0;
107 Int_t index = ((AliTPCParam*)fParam)->GetIndex(sector,row);
108 return (AliDigits *)(*this)[index];
111 AliDigits * AliTPCDigitsArray::LoadRow(Int_t sector,Int_t row)
114 //return clusters ((AliTPCDigitsRow *) per given sector and padrow
116 if (fParam==0) return 0;
117 Int_t index = ((AliTPCParam*)fParam)->GetIndex(sector,row);
118 return (AliDigits *)LoadSegment(index);
121 Bool_t AliTPCDigitsArray::StoreRow(Int_t sector,Int_t row)
124 //return clusters ((AliTPCDigitsRow *) per given sector and padrow
126 AliTPCParam * param = (AliTPCParam*)fParam;
127 if (fParam==0) return 0;
128 Int_t index = param->GetIndex(sector,row);
129 ( (AliDigits *)At(index))->CompresBuffer(fCompression,param->GetZeroSup());
130 if (fBSim == kTRUE) ( (AliSimDigits *)At(index))->CompresTrackBuffer(1);
135 Bool_t AliTPCDigitsArray::ClearRow(Int_t sector,Int_t row)
138 //return clusters ((AliTPCDigitsRow *) per given sector and padrow
140 if (fParam==0) return 0;
141 Int_t index = ((AliTPCParam*)fParam)->GetIndex(sector,row);
148 Bool_t AliTPCDigitsArray::Setup(AliDetectorParam *param)
151 //setup function to adjust array parameters
153 if (param==0) return kFALSE;
154 if (fParam !=0) delete fParam;
155 // fParam = new AliTPCParam((AliTPCParam&)(*param));
157 return MakeArray(((AliTPCParam*)fParam)->GetNRowsTotal());
160 Bool_t AliTPCDigitsArray::Update()
163 //setup function to adjust array parameters
165 if (fParam ==0 ) return kFALSE;
166 if (fTree!=0) return MakeDictionary( ((AliTPCParam*)fParam)->GetNRowsTotal()) ;
167 ((AliTPCParam*)fParam)->Update();
168 return MakeArray(((AliTPCParam*)fParam)->GetNRowsTotal());