]>
Commit | Line | Data |
---|---|---|
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 | ||
18 | /////////////////////////////////////////////////////////////////////////////// | |
19 | // // | |
20 | // class for ITS reconstruction // | |
21 | // // | |
22 | /////////////////////////////////////////////////////////////////////////////// | |
23 | ||
24 | #include "Riostream.h" | |
25 | #include "AliITSReconstructor.h" | |
26 | #include "AliRunLoader.h" | |
27 | #include "AliRawReader.h" | |
28 | #include "AliITSclustererV2.h" | |
29 | #include "AliITSLoader.h" | |
30 | #include "AliITStrackerMI.h" | |
31 | #include "AliITStrackerSA.h" | |
32 | #include "AliITSVertexerIons.h" | |
33 | #include "AliITSVertexerFast.h" | |
34 | #include "AliITSVertexerPPZ.h" | |
35 | #include "AliITSVertexerZ.h" | |
36 | #include "AliESD.h" | |
37 | #include "AliITSpidESD.h" | |
38 | #include "AliITSpidESD1.h" | |
39 | #include "AliITSpidESD2.h" | |
40 | #include "AliV0vertexer.h" | |
41 | #include "AliCascadeVertexer.h" | |
42 | ||
43 | ClassImp(AliITSReconstructor) | |
44 | ||
45 | //___________________________________________________________________________ | |
46 | AliITSReconstructor::AliITSReconstructor() : AliReconstructor(){ | |
47 | // Default constructor | |
48 | fItsPID=0; | |
49 | } | |
50 | //___________________________________________________________________________ | |
51 | AliITSReconstructor::~AliITSReconstructor(){ | |
52 | // destructor | |
53 | delete fItsPID; | |
54 | } | |
55 | //______________________________________________________________________ | |
56 | AliITSReconstructor::AliITSReconstructor(const AliITSReconstructor &ob) :AliReconstructor(ob) { | |
57 | // Copy constructor | |
58 | // Copies are not allowed. The method is protected to avoid misuse. | |
59 | Error("AliITSpidESD2","Copy constructor not allowed\n"); | |
60 | } | |
61 | ||
62 | //______________________________________________________________________ | |
63 | AliITSReconstructor& AliITSReconstructor::operator=(const AliITSReconstructor& /* ob */){ | |
64 | // Assignment operator | |
65 | // Assignment is not allowed. The method is protected to avoid misuse. | |
66 | Error("= operator","Assignment operator not allowed\n"); | |
67 | return *this; | |
68 | } | |
69 | //_____________________________________________________________________________ | |
70 | void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const | |
71 | { | |
72 | // reconstruct clusters | |
73 | ||
74 | ||
75 | AliITSLoader *loader = (AliITSLoader *)runLoader->GetLoader("ITSLoader"); | |
76 | if (!loader) { | |
77 | Error("Reconstruct", "ITS loader not found"); | |
78 | return; | |
79 | } | |
80 | loader->LoadRecPoints("recreate"); | |
81 | loader->LoadDigits("read"); | |
82 | runLoader->LoadKinematics(); | |
83 | ||
84 | AliITSgeom* geom = GetITSgeom(runLoader); | |
85 | ||
86 | AliITSclustererV2 clusterer(geom); | |
87 | Int_t nEvents = runLoader->GetNumberOfEvents(); | |
88 | ||
89 | for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) { | |
90 | runLoader->GetEvent(iEvent); | |
91 | TTree* treeClusters = loader->TreeR(); | |
92 | if (!treeClusters) { | |
93 | loader->MakeTree("R"); | |
94 | treeClusters = loader->TreeR(); | |
95 | } | |
96 | TTree* treeDigits = loader->TreeD(); | |
97 | if (!treeDigits) { | |
98 | Error("Reconstruct", "Can't get digits tree !"); | |
99 | return; | |
100 | } | |
101 | ||
102 | clusterer.Digits2Clusters(treeDigits, treeClusters); | |
103 | ||
104 | loader->WriteRecPoints("OVERWRITE"); | |
105 | } | |
106 | ||
107 | loader->UnloadRecPoints(); | |
108 | loader->UnloadDigits(); | |
109 | runLoader->UnloadKinematics(); | |
110 | } | |
111 | ||
112 | ||
113 | //_____________________________________________________________________________ | |
114 | void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader, | |
115 | AliRawReader* rawReader) const | |
116 | { | |
117 | // reconstruct clusters from raw data | |
118 | ||
119 | AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader"); | |
120 | if (!loader) { | |
121 | Error("Reconstruct", "ITS loader not found"); | |
122 | return; | |
123 | } | |
124 | loader->LoadRecPoints("recreate"); | |
125 | ||
126 | AliITSgeom* geom = GetITSgeom(runLoader); | |
127 | AliITSclustererV2 clusterer(geom); | |
128 | ||
129 | Int_t iEvent = 0; | |
130 | while (rawReader->NextEvent()) { | |
131 | runLoader->GetEvent(iEvent++); | |
132 | ||
133 | TTree* treeClusters = loader->TreeR(); | |
134 | if (!treeClusters) { | |
135 | loader->MakeTree("R"); | |
136 | treeClusters = loader->TreeR(); | |
137 | } | |
138 | ||
139 | clusterer.Digits2Clusters(rawReader); | |
140 | ||
141 | loader->WriteRecPoints("OVERWRITE"); | |
142 | } | |
143 | ||
144 | loader->UnloadRecPoints(); | |
145 | ||
146 | } | |
147 | ||
148 | //_____________________________________________________________________________ | |
149 | AliTracker* AliITSReconstructor::CreateTracker(AliRunLoader* runLoader)const | |
150 | { | |
151 | // create a ITS tracker | |
152 | ||
153 | ||
154 | AliITSgeom* geom = GetITSgeom(runLoader); | |
155 | TString selectedTracker = GetOption(); | |
156 | AliTracker* tracker; | |
157 | if (selectedTracker.Contains("MI")) { | |
158 | tracker = new AliITStrackerMI(geom); | |
159 | } | |
160 | else { | |
161 | tracker = new AliITStrackerSA(geom); // inherits from AliITStrackerMI | |
162 | } | |
163 | ||
164 | TString selectedPIDmethod = GetOption(); | |
165 | AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader"); | |
166 | if (!loader) { | |
167 | Error("CreateTracker", "ITS loader not found"); | |
168 | } | |
169 | if(selectedPIDmethod.Contains("LandauFitPID")){ | |
170 | loader->AdoptITSpid(new AliITSpidESD2((AliITStrackerMI*)tracker,loader)); | |
171 | } | |
172 | else{ | |
173 | Double_t parITS[] = {34., 0.15, 10.}; | |
174 | loader->AdoptITSpid(new AliITSpidESD1(parITS)); | |
175 | } | |
176 | return tracker; | |
177 | ||
178 | } | |
179 | ||
180 | //_____________________________________________________________________________ | |
181 | AliVertexer* AliITSReconstructor::CreateVertexer(AliRunLoader* /*runLoader*/) const | |
182 | { | |
183 | // create a ITS vertexer | |
184 | ||
185 | TString selectedVertexer = GetOption(); | |
186 | if(selectedVertexer.Contains("ions") || selectedVertexer.Contains("IONS")){ | |
187 | Info("CreateVertexer","a AliITSVertexerIons object has been selected\n"); | |
188 | return new AliITSVertexerIons("null"); | |
189 | } | |
190 | if(selectedVertexer.Contains("smear") || selectedVertexer.Contains("SMEAR")){ | |
191 | Double_t smear[3]={0.005,0.005,0.01}; | |
192 | Info("CreateVertexer","a AliITSVertexerFast object has been selected\n"); | |
193 | return new AliITSVertexerFast(smear); | |
194 | } | |
195 | if(selectedVertexer.Contains("ppz") || selectedVertexer.Contains("PPZ")){ | |
196 | Info("CreateVertexer","a AliITSVertexerPPZ object has been selected\n"); | |
197 | return new AliITSVertexerPPZ("null"); | |
198 | } | |
199 | // by default an AliITSVertexerZ object is instatiated | |
200 | Info("CreateVertexer","a AliITSVertexerZ object has been selected\n"); | |
201 | return new AliITSVertexerZ("null"); | |
202 | } | |
203 | ||
204 | //_____________________________________________________________________________ | |
205 | void AliITSReconstructor::FillESD(AliRunLoader* runLoader, | |
206 | AliESD* esd) const | |
207 | { | |
208 | // make PID, find V0s and cascade | |
209 | AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader"); | |
210 | AliITSpidESD *pidESD = 0; | |
211 | TString selectedPIDmethod = GetOption(); | |
212 | if(selectedPIDmethod.Contains("LandauFitPID")){ | |
213 | Info("FillESD","ITS LandauFitPID option has been selected\n"); | |
214 | pidESD=loader->GetITSpid(); | |
215 | } | |
216 | else{ | |
217 | Info("FillESD","ITS default PID\n"); | |
218 | pidESD=loader->GetITSpid(); | |
219 | } | |
220 | if(pidESD!=0){ | |
221 | pidESD->MakePID(esd); | |
222 | } | |
223 | else { | |
224 | Error("FillESD","!! cannot do the PID !!\n"); | |
225 | } | |
226 | // V0 finding | |
227 | Double_t cuts[]={33, // max. allowed chi2 | |
228 | 0.16,// min. allowed negative daughter's impact parameter | |
229 | 0.05,// min. allowed positive daughter's impact parameter | |
230 | 0.08,// max. allowed DCA between the daughter tracks | |
231 | 0.99,// max. allowed cosine of V0's pointing angle | |
232 | 0.9, // min. radius of the fiducial volume | |
233 | 2.9 // max. radius of the fiducial volume | |
234 | }; | |
235 | AliV0vertexer vtxer(cuts); | |
236 | Double_t vtx[3], cvtx[6]; | |
237 | esd->GetVertex()->GetXYZ(vtx); | |
238 | esd->GetVertex()->GetSigmaXYZ(cvtx); | |
239 | vtxer.SetVertex(vtx); | |
240 | vtxer.Tracks2V0vertices(esd); | |
241 | ||
242 | // cascade finding | |
243 | Double_t cts[]={33., // max. allowed chi2 | |
244 | 0.05, // min. allowed V0 impact parameter | |
245 | 0.008, // window around the Lambda mass | |
246 | 0.035, // min. allowed bachelor's impact parameter | |
247 | 0.10, // max. allowed DCA between a V0 and a track | |
248 | 0.9985, //max. allowed cosine of the cascade pointing angle | |
249 | 0.9, // min. radius of the fiducial volume | |
250 | 2.9 // max. radius of the fiducial volume | |
251 | }; | |
252 | AliCascadeVertexer cvtxer=AliCascadeVertexer(cts); | |
253 | cvtxer.SetVertex(vtx); | |
254 | cvtxer.V0sTracks2CascadeVertices(esd); | |
255 | } | |
256 | ||
257 | ||
258 | //_____________________________________________________________________________ | |
259 | AliITSgeom* AliITSReconstructor::GetITSgeom(AliRunLoader* runLoader) const | |
260 | { | |
261 | // get the ITS geometry | |
262 | ||
263 | if (!runLoader->GetAliRun()) runLoader->LoadgAlice(); | |
264 | if (!runLoader->GetAliRun()) { | |
265 | Error("GetITSgeom", "couldn't get AliRun object"); | |
266 | return NULL; | |
267 | } | |
268 | ||
269 | TDirectory * olddir = gDirectory; | |
270 | runLoader->CdGAFile(); | |
271 | AliITSgeom* geom = (AliITSgeom*)gDirectory->Get("AliITSgeom"); | |
272 | olddir->cd(); | |
273 | if(!geom){ | |
274 | Error("GetITSgeom","no ITS geometry available"); | |
275 | return NULL; | |
276 | } | |
277 | ||
278 | return geom; | |
279 | } | |
280 |