]>
Commit | Line | Data |
---|---|---|
cc80f89e | 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 | /* | |
17 | $Log$ | |
27f30e03 | 18 | Revision 1.3 2000/06/30 12:07:49 kowal2 |
19 | Updated from the TPC-PreRelease branch | |
20 | ||
73042f01 | 21 | Revision 1.2.4.1 2000/06/09 07:09:29 kowal2 |
22 | ||
23 | Clustering and tracking classes are splitted from the simulation ones | |
24 | ||
25 | Revision 1.2 2000/04/17 09:37:33 kowal2 | |
26 | removed obsolete AliTPCDigitsDisplay.C | |
27 | ||
cc80f89e | 28 | Revision 1.1.4.2 2000/04/10 11:34:02 kowal2 |
29 | ||
30 | Clusters handling in a new data structure | |
31 | ||
32 | */ | |
33 | ||
34 | /////////////////////////////////////////////////////////////////////////////// | |
35 | // // | |
36 | // Time Projection Chamber clusters objects // | |
37 | // | |
38 | // Origin: Marian Ivanov , GSI Darmstadt | |
39 | // // | |
40 | // // | |
41 | // // | |
42 | /////////////////////////////////////////////////////////////////////////////// | |
43 | #include "AliTPC.h" | |
44 | #include "AliTPCParam.h" | |
45 | #include "AliSegmentArray.h" | |
27f30e03 | 46 | #include "AliComplexCluster.h" |
cc80f89e | 47 | #include "AliClusters.h" |
48 | #include "AliClustersArray.h" | |
49 | #include "AliTPCClustersRow.h" | |
50 | ||
51 | #include "AliTPCClustersArray.h" | |
52 | #include "TClonesArray.h" | |
53 | #include "TDirectory.h" | |
27f30e03 | 54 | #include <TClass.h> |
cc80f89e | 55 | |
56 | ||
57 | ||
58 | //_____________________________________________________________________________ | |
59 | ||
60 | ClassImp(AliTPCClustersArray) | |
61 | ||
62 | AliTPCClustersArray::AliTPCClustersArray() | |
63 | { | |
64 | fParam = 0; | |
65 | SetClass("AliTPCClustersRow"); | |
66 | } | |
67 | ||
68 | AliTPCClustersArray::~AliTPCClustersArray() | |
69 | { | |
70 | // | |
cc80f89e | 71 | } |
72 | ||
73 | ||
74 | ||
75 | AliTPCClustersRow * AliTPCClustersArray::GetRow(Int_t sector,Int_t row) | |
76 | { | |
77 | // | |
78 | //return clusters ((AliTPCClustersRow *) per given sector and padrow | |
79 | // | |
80 | if (fParam==0) return 0; | |
81 | Int_t index = ((AliTPCParam*)fParam)->GetIndex(sector,row); | |
82 | return (AliTPCClustersRow *)(*this)[index]; | |
83 | } | |
84 | ||
85 | AliTPCClustersRow * AliTPCClustersArray::CreateRow(Int_t sector, Int_t row) | |
86 | { | |
87 | // | |
88 | //create digits row | |
89 | // | |
90 | //if row just exist - delete it | |
91 | AliTPCParam * param = (AliTPCParam*)fParam; | |
92 | Int_t index = param->GetIndex(sector,row); | |
93 | AliTPCClustersRow * clusters = (AliTPCClustersRow *)(*this)[index]; | |
94 | if (clusters !=0) delete clusters; | |
95 | ||
96 | clusters = (AliTPCClustersRow *) AddSegment(index); | |
97 | if (clusters == 0) return 0; | |
98 | return clusters; | |
99 | } | |
100 | ||
101 | AliTPCClustersRow * AliTPCClustersArray::LoadRow(Int_t sector,Int_t row) | |
102 | { | |
103 | // | |
104 | //return clusters ((AliTPCClustersRow *) per given sector and padrow | |
105 | // | |
106 | if (fParam==0) return 0; | |
107 | Int_t index = ((AliTPCParam*)fParam)->GetIndex(sector,row); | |
108 | return ( AliTPCClustersRow *) LoadSegment(index); | |
109 | } | |
110 | ||
111 | Bool_t AliTPCClustersArray::StoreRow(Int_t sector,Int_t row) | |
112 | { | |
113 | // | |
114 | //return clusters ((AliTPCClustersRow *) per given sector and padrow | |
115 | // | |
116 | if (fParam==0) return 0; | |
117 | Int_t index = ((AliTPCParam*)fParam)->GetIndex(sector,row); | |
118 | StoreSegment(index); | |
119 | return kTRUE; | |
120 | } | |
121 | ||
122 | Bool_t AliTPCClustersArray::ClearRow(Int_t sector,Int_t row) | |
123 | { | |
124 | // | |
125 | //return clusters ((AliTPCDigitsRow *) per given sector and padrow | |
126 | // | |
127 | if (fParam==0) return 0; | |
128 | Int_t index = ((AliTPCParam*)fParam)->GetIndex(sector,row); | |
129 | ClearSegment(index); | |
130 | return kTRUE; | |
131 | } | |
132 | ||
133 | ||
134 | ||
73042f01 | 135 | Bool_t AliTPCClustersArray::Setup(const AliDetectorParam *param) |
cc80f89e | 136 | { |
137 | // | |
138 | //setup function to adjust array parameters | |
139 | // | |
140 | if (param==0) return kFALSE; | |
73042f01 | 141 | fParam = (AliDetectorParam *)param; |
cc80f89e | 142 | return MakeArray(((AliTPCParam*)fParam)->GetNRowsTotal()); |
143 | ||
144 | } | |
145 | Bool_t AliTPCClustersArray::Update() | |
146 | { | |
147 | // | |
148 | //setup function to adjust array parameters | |
149 | // | |
150 | if (fParam ==0 ) return kFALSE; | |
151 | if (fTree!=0) return MakeDictionary( ((AliTPCParam*)fParam)->GetNRowsTotal()) ; | |
152 | ((AliTPCParam*)fParam)->Update(); | |
153 | return MakeArray(((AliTPCParam*)fParam)->GetNRowsTotal()); | |
154 | } | |
155 | ||
156 | ||
cc80f89e | 157 | AliSegmentID * AliTPCClustersArray::NewSegment() |
158 | { | |
159 | // | |
160 | //create object according class information | |
161 | if (fClusterType==0) { | |
162 | Error("AliTPCCLustersArray", "cluster type isn't adjusted"); | |
163 | return 0; | |
164 | } | |
165 | AliSegmentID *segment=AliSegmentArray::NewSegment(); | |
166 | ((AliTPCClustersRow*)segment)->SetClass(fClusterType->GetName()); | |
167 | ((AliTPCClustersRow*)segment)->SetArray(100); | |
168 | return segment; | |
169 | } |