AliRoot Core  3dc7879 (3dc7879)
AliTPCDigitsArray.cxx
Go to the documentation of this file.
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 
22 
23 #include "AliTPCParam.h"
24 #include "AliTPCPRF2D.h"
25 
26 #include "TObjArray.h"
27 #include "AliSegmentID.h"
28 #include "AliSegmentArray.h"
29 
30 #include "AliDigits.h"
31 #include "AliSimDigits.h"
32 #include "AliDigitsArray.h"
33 #include "AliTPCDigitsArray.h"
34 #include <TDirectory.h>
35 
36 
37 
38 //_____________________________________________________________________________
39 
41 ClassImp(AliTPCDigitsArray)
43 
45  :AliDigitsArray(),
46  fBSim(kFALSE),
47  fCompression(0),
48  fTrackLevel(0)
49 {
50  //
51  //default constructor
52  fParam = 0;
53  fBSim = sim;
54  if ( sim == kTRUE) SetClass("AliSimDigits");
55  else
56  SetClass("AliDigits");
57  fParam = 0;
58  // fPRF = 0;
59  //fRF = 0;
60  fCompression = 1;
61  fTrackLevel = 3;
62 }
63 
65 {
67 
68  //
69 }
70 
71 AliDigits * AliTPCDigitsArray::CreateRow(Int_t sector, Int_t row)
72 {
76 
77  AliTPCParam * param = (AliTPCParam*)fParam;
78  Int_t index = param->GetIndex(sector,row);
79  AliDigits * dig = (AliDigits *)(*this)[index];
80  if (dig !=0) delete dig;
81 
82  dig = (AliDigits *) AddSegment(index);
83  if (dig == 0) return 0;
84  dig->Allocate(param->GetMaxTBin(),param->GetNPads(sector,row));
85  if (fBSim == kTRUE) ((AliSimDigits*) dig)->AllocateTrack(fTrackLevel);
86  return dig;
87 }
88 
89 
90 AliDigits * AliTPCDigitsArray::GetRow(Int_t sector,Int_t row)
91 {
93 
94  if (fParam==0) return 0;
95  Int_t index = ((AliTPCParam*)fParam)->GetIndex(sector,row);
96  return (AliDigits *)(*this)[index];
97 }
98 
99 AliDigits * AliTPCDigitsArray::LoadRow(Int_t sector,Int_t row)
100 {
102 
103  if (fParam==0) return 0;
104  Int_t index = ((AliTPCParam*)fParam)->GetIndex(sector,row);
105  return (AliDigits *)LoadSegment(index);
106 }
107 
108 Bool_t AliTPCDigitsArray::StoreRow(Int_t sector,Int_t row)
109 {
111 
112  AliTPCParam * param = (AliTPCParam*)fParam;
113  if (fParam==0) return 0;
114  Int_t index = param->GetIndex(sector,row);
115  ( (AliDigits *)At(index))->CompresBuffer(fCompression,param->GetZeroSup());
116  if (fBSim == kTRUE) ( (AliSimDigits *)At(index))->CompresTrackBuffer(1);
117  StoreSegment(index);
118  return kTRUE;
119 }
120 
121 Bool_t AliTPCDigitsArray::ClearRow(Int_t sector,Int_t row)
122 {
124 
125  if (fParam==0) return 0;
126  Int_t index = ((AliTPCParam*)fParam)->GetIndex(sector,row);
127  ClearSegment(index);
128  return kTRUE;
129 }
130 
131 
132 
134 {
136 
137  if (param==0) return kFALSE;
138  if (fParam !=0) delete fParam;
139  // fParam = new AliTPCParam((AliTPCParam&)(*param));
140  fParam = param;
141  return MakeArray(((AliTPCParam*)fParam)->GetNRowsTotal());
142 }
143 
145 {
147 
148  if (fParam ==0 ) return kFALSE;
149  if (fTree!=0) return MakeDictionary( ((AliTPCParam*)fParam)->GetNRowsTotal()) ;
150  ((AliTPCParam*)fParam)->Update();
151  return MakeArray(((AliTPCParam*)fParam)->GetNRowsTotal());
152 }
Int_t GetZeroSup() const
Definition: AliTPCParam.h:362
AliDetectorParam * fParam
pointer to detector parameters
Int_t fCompression
default compression for AliDigits - used in storing
Bool_t AddSegment(AliSegmentID *segment)
Bool_t fBSim
signalize if we have digits with track ID
void ClearSegment(Int_t index)
Manager class for detector parameters.
Manager and of geomety classes for set: TPC.
Definition: AliTPCParam.h:18
AliDigits * CreateRow(Int_t sector, Int_t row)
virtual AliSegmentID * LoadSegment(Int_t index)
Bool_t ClearRow(Int_t sector, Int_t row)
Time Projection Chamber clusters objects.
Bool_t MakeArray(Int_t n)
void sim(char *configPath, char *tpcDbpath, Int_t nevents)
Definition: sim.C:3
const AliSegmentID * At(Int_t i)
virtual void StoreSegment(Int_t index)
Bool_t StoreRow(Int_t sector, Int_t row)
AliDigits * LoadRow(Int_t sector, Int_t row)
virtual void Allocate(Int_t rows, Int_t columns)
Definition: AliDigits.cxx:153
Bool_t Setup(AliDetectorParam *param)
Int_t GetIndex(Int_t sector, Int_t row) const
AliDigits * GetRow(Int_t sector, Int_t row)
Int_t GetNPads(Int_t isector, Int_t irow) const
Definition: AliTPCParam.h:318
TTree * fTree
! tree with segment objects
Int_t GetMaxTBin() const
Definition: AliTPCParam.h:371
Bool_t MakeDictionary(Int_t size)