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 "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"
37 #include "AliITSpidESD.h"
38 #include "AliV0vertexer.h"
39 #include "AliCascadeVertexer.h"
41 ClassImp(AliITSReconstructor)
45 //_____________________________________________________________________________
46 void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const
48 // 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);
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();
89 //_____________________________________________________________________________
90 void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader,
91 AliRawReader* rawReader) const
93 // reconstruct clusters from raw data
95 AliITSLoader* loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader");
97 Error("Reconstruct", "ITS loader not found");
100 loader->LoadRecPoints("recreate");
102 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();
124 //_____________________________________________________________________________
125 AliTracker* AliITSReconstructor::CreateTracker(AliRunLoader* runLoader) const
127 // create a ITS tracker
130 AliITSgeom* geom = GetITSgeom(runLoader);
131 TString selectedTracker = GetOption();
132 if (selectedTracker.Contains("MI")) return new AliITStrackerMI(geom);
133 return new AliITStrackerSA(geom);
139 //_____________________________________________________________________________
140 AliVertexer* AliITSReconstructor::CreateVertexer(AliRunLoader* /*runLoader*/) const
142 // create a ITS vertexer
144 TString selectedVertexer = GetOption();
145 if(selectedVertexer.Contains("ions") || selectedVertexer.Contains("IONS")){
146 Info("CreateVertexer","a AliITSVertexerIons object has been selected\n");
147 return new AliITSVertexerIons("null");
149 if(selectedVertexer.Contains("smear") || selectedVertexer.Contains("SMEAR")){
150 Double_t smear[3]={0.005,0.005,0.01};
151 Info("CreateVertexer","a AliITSVertexerFast object has been selected\n");
152 return new AliITSVertexerFast(smear);
154 if(selectedVertexer.Contains("ppz") || selectedVertexer.Contains("PPZ")){
155 Info("CreateVertexer","a AliITSVertexerPPZ object has been selected\n");
156 return new AliITSVertexerPPZ("null");
158 // by default an AliITSVertexerZ object is instatiated
159 Info("CreateVertexer","a AliITSVertexerZ object has been selected\n");
160 return new AliITSVertexerZ("null");
163 //_____________________________________________________________________________
164 void AliITSReconstructor::FillESD(AliRunLoader* /*runLoader*/,
167 // make PID, find V0s and cascades
169 Double_t parITS[] = {34., 0.15, 10.};
170 AliITSpidESD itsPID(parITS);
174 Double_t cuts[]={33, // max. allowed chi2
175 0.16,// min. allowed negative daughter's impact parameter
176 0.05,// min. allowed positive daughter's impact parameter
177 0.08,// max. allowed DCA between the daughter tracks
178 0.99,// max. allowed cosine of V0's pointing angle
179 0.9, // min. radius of the fiducial volume
180 2.9 // max. radius of the fiducial volume
182 AliV0vertexer vtxer(cuts);
183 Double_t vtx[3], cvtx[6];
184 esd->GetVertex()->GetXYZ(vtx);
185 esd->GetVertex()->GetSigmaXYZ(cvtx);
186 vtxer.SetVertex(vtx);
187 vtxer.Tracks2V0vertices(esd);
190 Double_t cts[]={33., // max. allowed chi2
191 0.05, // min. allowed V0 impact parameter
192 0.008, // window around the Lambda mass
193 0.035, // min. allowed bachelor's impact parameter
194 0.10, // max. allowed DCA between a V0 and a track
195 0.9985, //max. allowed cosine of the cascade pointing angle
196 0.9, // min. radius of the fiducial volume
197 2.9 // max. radius of the fiducial volume
199 AliCascadeVertexer cvtxer=AliCascadeVertexer(cts);
200 cvtxer.SetVertex(vtx);
201 cvtxer.V0sTracks2CascadeVertices(esd);
205 //_____________________________________________________________________________
206 AliITSgeom* AliITSReconstructor::GetITSgeom(AliRunLoader* runLoader) const
208 // get the ITS geometry
210 if (!runLoader->GetAliRun()) runLoader->LoadgAlice();
211 if (!runLoader->GetAliRun()) {
212 Error("GetITSgeom", "couldn't get AliRun object");
216 TDirectory * olddir = gDirectory;
217 runLoader->CdGAFile();
218 AliITSgeom* geom = (AliITSgeom*)gDirectory->Get("AliITSgeom");
221 Error("GetITSgeom","no ITS geometry available");