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 ///////////////////////////////////////////////////////////////////////////////
20 // class for ITS reconstruction //
22 ///////////////////////////////////////////////////////////////////////////////
25 #include "AliITSReconstructor.h"
26 #include "AliRunLoader.h"
27 #include "AliRawReader.h"
28 #include "AliITSclustererV2.h"
29 #include "AliITStrackerMI.h"
30 #include "AliITStrackerSA.h"
31 #include "AliITSVertexerIons.h"
32 #include "AliITSVertexerFast.h"
33 #include "AliITSVertexerPPZ.h"
34 #include "AliITSVertexerZ.h"
36 #include "AliITSpidESD.h"
37 #include "AliV0vertexer.h"
38 #include "AliCascadeVertexer.h"
43 ClassImp(AliITSReconstructor)
46 //_____________________________________________________________________________
47 void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const
49 // reconstruct clusters
51 AliLoader* loader = runLoader->GetLoader("ITSLoader");
53 Error("Reconstruct", "ITS loader not found");
56 loader->LoadRecPoints("recreate");
57 loader->LoadDigits("read");
58 runLoader->LoadKinematics();
60 AliITSgeom* geom = GetITSgeom(runLoader);
62 AliITSclustererV2 clusterer(geom);
63 Int_t nEvents = runLoader->GetNumberOfEvents();
65 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
66 runLoader->GetEvent(iEvent);
68 TTree* treeClusters = loader->TreeR();
70 loader->MakeTree("R");
71 treeClusters = loader->TreeR();
73 TTree* treeDigits = loader->TreeD();
75 Error("Reconstruct", "Can't get digits tree !");
79 clusterer.Digits2Clusters(treeDigits, treeClusters);
81 loader->WriteRecPoints("OVERWRITE");
84 loader->UnloadRecPoints();
85 loader->UnloadDigits();
86 runLoader->UnloadKinematics();
89 //_____________________________________________________________________________
90 void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader,
91 AliRawReader* rawReader) const
93 // reconstruct clusters from raw data
95 AliLoader* loader = runLoader->GetLoader("ITSLoader");
97 Error("Reconstruct", "ITS loader not found");
100 loader->LoadRecPoints("recreate");
102 AliITSgeom* geom = GetITSgeom(runLoader);
104 AliITSclustererV2 clusterer(geom);
107 while (rawReader->NextEvent()) {
108 runLoader->GetEvent(iEvent++);
110 TTree* treeClusters = loader->TreeR();
112 loader->MakeTree("R");
113 treeClusters = loader->TreeR();
116 clusterer.Digits2Clusters(rawReader);
118 loader->WriteRecPoints("OVERWRITE");
121 loader->UnloadRecPoints();
124 //_____________________________________________________________________________
125 AliTracker* AliITSReconstructor::CreateTracker(AliRunLoader* runLoader) const
127 // create a ITS tracker
129 AliITSgeom* geom = GetITSgeom(runLoader);
130 if (!geom) return NULL;
131 TString selectedTracker = GetOption();
132 if (selectedTracker.Contains("MI")) return new AliITStrackerMI(geom);
133 return new AliITStrackerSA(geom);
136 //_____________________________________________________________________________
137 AliVertexer* AliITSReconstructor::CreateVertexer(AliRunLoader* /*runLoader*/) const
139 // create a ITS vertexer
141 TString selectedVertexer = GetOption();
142 if(selectedVertexer.Contains("ions") || selectedVertexer.Contains("IONS")){
143 Info("CreateVertexer","a AliITSVertexerIons object has been selected\n");
144 return new AliITSVertexerIons("null");
146 if(selectedVertexer.Contains("smear") || selectedVertexer.Contains("SMEAR")){
147 Double_t smear[3]={0.005,0.005,0.01};
148 Info("CreateVertexer","a AliITSVertexerFast object has been selected\n");
149 return new AliITSVertexerFast(smear);
151 if(selectedVertexer.Contains("ppz") || selectedVertexer.Contains("PPZ")){
152 Info("CreateVertexer","a AliITSVertexerPPZ object has been selected\n");
153 return new AliITSVertexerPPZ("null");
155 // by default an AliITSVertexerZ object is instatiated
156 Info("CreateVertexer","a AliITSVertexerZ object has been selected\n");
157 return new AliITSVertexerZ("null");
160 //_____________________________________________________________________________
161 void AliITSReconstructor::FillESD(AliRunLoader* /*runLoader*/,
164 // make PID, find V0s and cascades
166 Double_t parITS[] = {34., 0.15, 10.};
167 AliITSpidESD itsPID(parITS);
171 Double_t cuts[]={33, // max. allowed chi2
172 0.16,// min. allowed negative daughter's impact parameter
173 0.05,// min. allowed positive daughter's impact parameter
174 0.08,// max. allowed DCA between the daughter tracks
175 0.99,// max. allowed cosine of V0's pointing angle
176 0.9, // min. radius of the fiducial volume
177 2.9 // max. radius of the fiducial volume
179 AliV0vertexer vtxer(cuts);
180 Double_t vtx[3], cvtx[6];
181 esd->GetVertex()->GetXYZ(vtx);
182 esd->GetVertex()->GetSigmaXYZ(cvtx);
183 vtxer.SetVertex(vtx);
184 vtxer.Tracks2V0vertices(esd);
187 Double_t cts[]={33., // max. allowed chi2
188 0.05, // min. allowed V0 impact parameter
189 0.008, // window around the Lambda mass
190 0.035, // min. allowed bachelor's impact parameter
191 0.10, // max. allowed DCA between a V0 and a track
192 0.9985, //max. allowed cosine of the cascade pointing angle
193 0.9, // min. radius of the fiducial volume
194 2.9 // max. radius of the fiducial volume
196 AliCascadeVertexer cvtxer=AliCascadeVertexer(cts);
197 cvtxer.SetVertex(vtx);
198 cvtxer.V0sTracks2CascadeVertices(esd);
202 //_____________________________________________________________________________
203 AliITSgeom* AliITSReconstructor::GetITSgeom(AliRunLoader* runLoader) const
205 // get the ITS geometry
207 if (!runLoader->GetAliRun()) runLoader->LoadgAlice();
208 if (!runLoader->GetAliRun()) {
209 Error("GetITSgeom", "couldn't get AliRun object");
212 AliITS* its = (AliITS*) runLoader->GetAliRun()->GetDetector("ITS");
214 Error("GetITSgeom", "couldn't get ITS detector");
217 if (!its->GetITSgeom()) {
218 Error("GetITSgeom", "no ITS geometry available");
221 return its->GetITSgeom();