]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSReconstructor.cxx
Updated version (M.Ivanov)
[u/mrichter/AliRoot.git] / ITS / AliITSReconstructor.cxx
CommitLineData
121a60bd 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
25#include "AliITSReconstructor.h"
26#include "AliRunLoader.h"
113c12f1 27#include "AliRawReader.h"
121a60bd 28#include "AliITSclustererV2.h"
29#include "AliITStrackerSA.h"
30#include "AliITSVertexerIons.h"
31#include "AliITSVertexerFast.h"
32#include "AliITSVertexerPPZ.h"
33#include "AliITSVertexerZ.h"
34#include "AliESD.h"
35#include "AliITSpidESD.h"
36#include "AliV0vertexer.h"
37#include "AliCascadeVertexer.h"
38#include "AliRun.h"
39#include "AliITS.h"
40
41
42ClassImp(AliITSReconstructor)
43
44
45//_____________________________________________________________________________
46void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const
47{
48// reconstruct clusters
49
50 AliLoader* loader = runLoader->GetLoader("ITSLoader");
51 if (!loader) {
52 Error("Reconstruct", "ITS loader not found");
53 return;
54 }
55 loader->LoadRecPoints("recreate");
56 loader->LoadDigits("read");
57 runLoader->LoadKinematics();
58
59 AliITSgeom* geom = GetITSgeom(runLoader);
60 if (!geom) return;
61 AliITSclustererV2 clusterer(geom);
62 Int_t nEvents = runLoader->GetNumberOfEvents();
63
64 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
65 runLoader->GetEvent(iEvent);
66
67 TTree* treeClusters = loader->TreeR();
68 if (!treeClusters) {
69 loader->MakeTree("R");
70 treeClusters = loader->TreeR();
71 }
72 TTree* treeDigits = loader->TreeD();
73 if (!treeDigits) {
74 Error("Reconstruct", "Can't get digits tree !");
75 return;
76 }
77
78 clusterer.Digits2Clusters(treeDigits, treeClusters);
79
80 loader->WriteRecPoints("OVERWRITE");
81 }
82
83 loader->UnloadRecPoints();
84 loader->UnloadDigits();
85 runLoader->UnloadKinematics();
86}
87
113c12f1 88//_____________________________________________________________________________
89void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader,
90 AliRawReader* rawReader) const
91{
92// reconstruct clusters from raw data
93
94 AliLoader* loader = runLoader->GetLoader("ITSLoader");
95 if (!loader) {
96 Error("Reconstruct", "ITS loader not found");
97 return;
98 }
99 loader->LoadRecPoints("recreate");
100
101 AliITSgeom* geom = GetITSgeom(runLoader);
102 if (!geom) return;
103 AliITSclustererV2 clusterer(geom);
104
105 Int_t iEvent = 0;
106 while (rawReader->NextEvent()) {
107 runLoader->GetEvent(iEvent++);
108
109 TTree* treeClusters = loader->TreeR();
110 if (!treeClusters) {
111 loader->MakeTree("R");
112 treeClusters = loader->TreeR();
113 }
114
115 clusterer.Digits2Clusters(rawReader);
116
117 loader->WriteRecPoints("OVERWRITE");
118 }
119
120 loader->UnloadRecPoints();
121}
122
121a60bd 123//_____________________________________________________________________________
124AliTracker* AliITSReconstructor::CreateTracker(AliRunLoader* runLoader) const
125{
126// create a ITS tracker
127
128 AliITSgeom* geom = GetITSgeom(runLoader);
129 if (!geom) return NULL;
130 return new AliITStrackerSA(geom);
131}
132
133//_____________________________________________________________________________
134AliVertexer* AliITSReconstructor::CreateVertexer(AliRunLoader* /*runLoader*/) const
135{
136// create a ITS vertexer
137
f4d5a8d1 138 TString selectedVertexer = GetOption();
121a60bd 139 if(selectedVertexer.Contains("ions") || selectedVertexer.Contains("IONS")){
140 Info("CreateVertexer","a AliITSVertexerIons object has been selected\n");
141 return new AliITSVertexerIons("null");
142 }
143 if(selectedVertexer.Contains("smear") || selectedVertexer.Contains("SMEAR")){
144 Double_t smear[3]={0.005,0.005,0.01};
145 Info("CreateVertexer","a AliITSVertexerFast object has been selected\n");
146 return new AliITSVertexerFast(smear);
147 }
148 if(selectedVertexer.Contains("ppz") || selectedVertexer.Contains("PPZ")){
149 Info("CreateVertexer","a AliITSVertexerPPZ object has been selected\n");
150 return new AliITSVertexerPPZ("null");
151 }
152 // by default an AliITSVertexerZ object is instatiated
153 Info("CreateVertexer","a AliITSVertexerZ object has been selected\n");
154 return new AliITSVertexerZ("null");
155}
156
157//_____________________________________________________________________________
158void AliITSReconstructor::FillESD(AliRunLoader* /*runLoader*/,
159 AliESD* esd) const
160{
161// make PID, find V0s and cascades
162
163 Double_t parITS[] = {34., 0.15, 10.};
164 AliITSpidESD itsPID(parITS);
165 itsPID.MakePID(esd);
166
167 // V0 finding
168 Double_t cuts[]={33, // max. allowed chi2
169 0.16,// min. allowed negative daughter's impact parameter
170 0.05,// min. allowed positive daughter's impact parameter
171 0.08,// max. allowed DCA between the daughter tracks
172 0.99,// max. allowed cosine of V0's pointing angle
173 0.9, // min. radius of the fiducial volume
174 2.9 // max. radius of the fiducial volume
175 };
176 AliV0vertexer vtxer(cuts);
177 Double_t vtx[3], cvtx[6];
178 esd->GetVertex()->GetXYZ(vtx);
179 esd->GetVertex()->GetSigmaXYZ(cvtx);
180 vtxer.SetVertex(vtx);
181 vtxer.Tracks2V0vertices(esd);
182
183 // cascade finding
184 Double_t cts[]={33., // max. allowed chi2
185 0.05, // min. allowed V0 impact parameter
186 0.008, // window around the Lambda mass
187 0.035, // min. allowed bachelor's impact parameter
188 0.10, // max. allowed DCA between a V0 and a track
189 0.9985, //max. allowed cosine of the cascade pointing angle
190 0.9, // min. radius of the fiducial volume
191 2.9 // max. radius of the fiducial volume
192 };
193 AliCascadeVertexer cvtxer=AliCascadeVertexer(cts);
194 cvtxer.SetVertex(vtx);
195 cvtxer.V0sTracks2CascadeVertices(esd);
196}
197
198
199//_____________________________________________________________________________
200AliITSgeom* AliITSReconstructor::GetITSgeom(AliRunLoader* runLoader) const
201{
202// get the ITS geometry
203
204 if (!runLoader->GetAliRun()) runLoader->LoadgAlice();
205 if (!runLoader->GetAliRun()) {
206 Error("GetITSgeom", "couldn't get AliRun object");
207 return NULL;
208 }
209 AliITS* its = (AliITS*) runLoader->GetAliRun()->GetDetector("ITS");
210 if (!its) {
211 Error("GetITSgeom", "couldn't get ITS detector");
212 return NULL;
213 }
214 if (!its->GetITSgeom()) {
215 Error("GetITSgeom", "no ITS geometry available");
216 return NULL;
217 }
218 return its->GetITSgeom();
219}