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 "AliITSclustererV2.h"
28 #include "AliITStrackerSA.h"
29 #include "AliITSVertexerIons.h"
30 #include "AliITSVertexerFast.h"
31 #include "AliITSVertexerPPZ.h"
32 #include "AliITSVertexerZ.h"
34 #include "AliITSpidESD.h"
35 #include "AliV0vertexer.h"
36 #include "AliCascadeVertexer.h"
41 ClassImp(AliITSReconstructor)
44 //_____________________________________________________________________________
45 void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const
47 // reconstruct clusters
49 AliLoader* loader = runLoader->GetLoader("ITSLoader");
51 Error("Reconstruct", "ITS loader not found");
54 loader->LoadRecPoints("recreate");
55 loader->LoadDigits("read");
56 runLoader->LoadKinematics();
58 AliITSgeom* geom = GetITSgeom(runLoader);
60 AliITSclustererV2 clusterer(geom);
61 Int_t nEvents = runLoader->GetNumberOfEvents();
63 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
64 runLoader->GetEvent(iEvent);
66 TTree* treeClusters = loader->TreeR();
68 loader->MakeTree("R");
69 treeClusters = loader->TreeR();
71 TTree* treeDigits = loader->TreeD();
73 Error("Reconstruct", "Can't get digits tree !");
77 clusterer.Digits2Clusters(treeDigits, treeClusters);
79 loader->WriteRecPoints("OVERWRITE");
82 loader->UnloadRecPoints();
83 loader->UnloadDigits();
84 runLoader->UnloadKinematics();
87 //_____________________________________________________________________________
88 AliTracker* AliITSReconstructor::CreateTracker(AliRunLoader* runLoader) const
90 // create a ITS tracker
92 AliITSgeom* geom = GetITSgeom(runLoader);
93 if (!geom) return NULL;
94 return new AliITStrackerSA(geom);
97 //_____________________________________________________________________________
98 AliVertexer* AliITSReconstructor::CreateVertexer(AliRunLoader* /*runLoader*/) const
100 // create a ITS vertexer
102 TString selectedVertexer(" ");
103 if(selectedVertexer.Contains("ions") || selectedVertexer.Contains("IONS")){
104 Info("CreateVertexer","a AliITSVertexerIons object has been selected\n");
105 return new AliITSVertexerIons("null");
107 if(selectedVertexer.Contains("smear") || selectedVertexer.Contains("SMEAR")){
108 Double_t smear[3]={0.005,0.005,0.01};
109 Info("CreateVertexer","a AliITSVertexerFast object has been selected\n");
110 return new AliITSVertexerFast(smear);
112 if(selectedVertexer.Contains("ppz") || selectedVertexer.Contains("PPZ")){
113 Info("CreateVertexer","a AliITSVertexerPPZ object has been selected\n");
114 return new AliITSVertexerPPZ("null");
116 // by default an AliITSVertexerZ object is instatiated
117 Info("CreateVertexer","a AliITSVertexerZ object has been selected\n");
118 return new AliITSVertexerZ("null");
121 //_____________________________________________________________________________
122 void AliITSReconstructor::FillESD(AliRunLoader* /*runLoader*/,
125 // make PID, find V0s and cascades
127 Double_t parITS[] = {34., 0.15, 10.};
128 AliITSpidESD itsPID(parITS);
132 Double_t cuts[]={33, // max. allowed chi2
133 0.16,// min. allowed negative daughter's impact parameter
134 0.05,// min. allowed positive daughter's impact parameter
135 0.08,// max. allowed DCA between the daughter tracks
136 0.99,// max. allowed cosine of V0's pointing angle
137 0.9, // min. radius of the fiducial volume
138 2.9 // max. radius of the fiducial volume
140 AliV0vertexer vtxer(cuts);
141 Double_t vtx[3], cvtx[6];
142 esd->GetVertex()->GetXYZ(vtx);
143 esd->GetVertex()->GetSigmaXYZ(cvtx);
144 vtxer.SetVertex(vtx);
145 vtxer.Tracks2V0vertices(esd);
148 Double_t cts[]={33., // max. allowed chi2
149 0.05, // min. allowed V0 impact parameter
150 0.008, // window around the Lambda mass
151 0.035, // min. allowed bachelor's impact parameter
152 0.10, // max. allowed DCA between a V0 and a track
153 0.9985, //max. allowed cosine of the cascade pointing angle
154 0.9, // min. radius of the fiducial volume
155 2.9 // max. radius of the fiducial volume
157 AliCascadeVertexer cvtxer=AliCascadeVertexer(cts);
158 cvtxer.SetVertex(vtx);
159 cvtxer.V0sTracks2CascadeVertices(esd);
163 //_____________________________________________________________________________
164 AliITSgeom* AliITSReconstructor::GetITSgeom(AliRunLoader* runLoader) const
166 // get the ITS geometry
168 if (!runLoader->GetAliRun()) runLoader->LoadgAlice();
169 if (!runLoader->GetAliRun()) {
170 Error("GetITSgeom", "couldn't get AliRun object");
173 AliITS* its = (AliITS*) runLoader->GetAliRun()->GetDetector("ITS");
175 Error("GetITSgeom", "couldn't get ITS detector");
178 if (!its->GetITSgeom()) {
179 Error("GetITSgeom", "no ITS geometry available");
182 return its->GetITSgeom();