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 "AliITStrackerSA.h"
30 #include "AliITSVertexerIons.h"
31 #include "AliITSVertexerFast.h"
32 #include "AliITSVertexerPPZ.h"
33 #include "AliITSVertexerZ.h"
35 #include "AliITSpidESD.h"
36 #include "AliV0vertexer.h"
37 #include "AliCascadeVertexer.h"
42 ClassImp(AliITSReconstructor)
45 //_____________________________________________________________________________
46 void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const
48 // reconstruct clusters
50 AliLoader* loader = runLoader->GetLoader("ITSLoader");
52 Error("Reconstruct", "ITS loader not found");
55 loader->LoadRecPoints("recreate");
56 loader->LoadDigits("read");
57 runLoader->LoadKinematics();
59 AliITSgeom* geom = GetITSgeom(runLoader);
61 AliITSclustererV2 clusterer(geom);
62 Int_t nEvents = runLoader->GetNumberOfEvents();
64 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
65 runLoader->GetEvent(iEvent);
67 TTree* treeClusters = loader->TreeR();
69 loader->MakeTree("R");
70 treeClusters = loader->TreeR();
72 TTree* treeDigits = loader->TreeD();
74 Error("Reconstruct", "Can't get digits tree !");
78 clusterer.Digits2Clusters(treeDigits, treeClusters);
80 loader->WriteRecPoints("OVERWRITE");
83 loader->UnloadRecPoints();
84 loader->UnloadDigits();
85 runLoader->UnloadKinematics();
88 //_____________________________________________________________________________
89 void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader,
90 AliRawReader* rawReader) const
92 // reconstruct clusters from raw data
94 AliLoader* loader = runLoader->GetLoader("ITSLoader");
96 Error("Reconstruct", "ITS loader not found");
99 loader->LoadRecPoints("recreate");
101 AliITSgeom* geom = GetITSgeom(runLoader);
103 AliITSclustererV2 clusterer(geom);
106 while (rawReader->NextEvent()) {
107 runLoader->GetEvent(iEvent++);
109 TTree* treeClusters = loader->TreeR();
111 loader->MakeTree("R");
112 treeClusters = loader->TreeR();
115 clusterer.Digits2Clusters(rawReader);
117 loader->WriteRecPoints("OVERWRITE");
120 loader->UnloadRecPoints();
123 //_____________________________________________________________________________
124 AliTracker* AliITSReconstructor::CreateTracker(AliRunLoader* runLoader) const
126 // create a ITS tracker
128 AliITSgeom* geom = GetITSgeom(runLoader);
129 if (!geom) return NULL;
130 return new AliITStrackerSA(geom);
133 //_____________________________________________________________________________
134 AliVertexer* AliITSReconstructor::CreateVertexer(AliRunLoader* /*runLoader*/) const
136 // create a ITS vertexer
138 TString selectedVertexer = GetOption();
139 if(selectedVertexer.Contains("ions") || selectedVertexer.Contains("IONS")){
140 Info("CreateVertexer","a AliITSVertexerIons object has been selected\n");
141 return new AliITSVertexerIons("null");
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);
148 if(selectedVertexer.Contains("ppz") || selectedVertexer.Contains("PPZ")){
149 Info("CreateVertexer","a AliITSVertexerPPZ object has been selected\n");
150 return new AliITSVertexerPPZ("null");
152 // by default an AliITSVertexerZ object is instatiated
153 Info("CreateVertexer","a AliITSVertexerZ object has been selected\n");
154 return new AliITSVertexerZ("null");
157 //_____________________________________________________________________________
158 void AliITSReconstructor::FillESD(AliRunLoader* /*runLoader*/,
161 // make PID, find V0s and cascades
163 Double_t parITS[] = {34., 0.15, 10.};
164 AliITSpidESD itsPID(parITS);
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
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);
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
193 AliCascadeVertexer cvtxer=AliCascadeVertexer(cts);
194 cvtxer.SetVertex(vtx);
195 cvtxer.V0sTracks2CascadeVertices(esd);
199 //_____________________________________________________________________________
200 AliITSgeom* AliITSReconstructor::GetITSgeom(AliRunLoader* runLoader) const
202 // get the ITS geometry
204 if (!runLoader->GetAliRun()) runLoader->LoadgAlice();
205 if (!runLoader->GetAliRun()) {
206 Error("GetITSgeom", "couldn't get AliRun object");
209 AliITS* its = (AliITS*) runLoader->GetAliRun()->GetDetector("ITS");
211 Error("GetITSgeom", "couldn't get ITS detector");
214 if (!its->GetITSgeom()) {
215 Error("GetITSgeom", "no ITS geometry available");
218 return its->GetITSgeom();