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 ///////////////////////////////////////////////////////////////////////////////
24 #include "Riostream.h"
25 #include "AliITSReconstructor.h"
27 #include "AliRunLoader.h"
28 #include "AliRawReader.h"
29 #include "AliITSDetTypeRec.h"
30 #include "AliITSLoader.h"
31 #include "AliITStrackerMI.h"
32 #include "AliITStrackerSA.h"
33 #include "AliITSVertexerIons.h"
34 #include "AliITSVertexerFast.h"
35 #include "AliITSVertexerPPZ.h"
36 #include "AliITSVertexerZ.h"
38 #include "AliITSpidESD.h"
39 #include "AliITSpidESD1.h"
40 #include "AliITSpidESD2.h"
41 #include "AliV0vertexer.h"
42 #include "AliCascadeVertexer.h"
44 ClassImp(AliITSReconstructor)
46 //___________________________________________________________________________
47 AliITSReconstructor::AliITSReconstructor() : AliReconstructor(){
48 // Default constructor
51 //___________________________________________________________________________
52 AliITSReconstructor::~AliITSReconstructor(){
56 //______________________________________________________________________
57 AliITSReconstructor::AliITSReconstructor(const AliITSReconstructor &ob) :AliReconstructor(ob) {
59 // Copies are not allowed. The method is protected to avoid misuse.
60 Error("AliITSpidESD2","Copy constructor not allowed\n");
63 //______________________________________________________________________
64 AliITSReconstructor& AliITSReconstructor::operator=(const AliITSReconstructor& /* ob */){
65 // Assignment operator
66 // Assignment is not allowed. The method is protected to avoid misuse.
67 Error("= operator","Assignment operator not allowed\n");
71 //_____________________________________________________________________________
72 void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const
74 // reconstruct clusters
77 AliITSLoader* loader = static_cast<AliITSLoader*>(runLoader->GetLoader("ITSLoader"));
79 Error("Reconstruct", "ITS loader not found");
82 AliITSDetTypeRec* rec = new AliITSDetTypeRec(loader);
85 loader->LoadRecPoints("recreate");
86 loader->LoadDigits("read");
87 runLoader->LoadKinematics();
88 TString option = GetOption();
89 Bool_t clusfinder=kTRUE; // Default: V2 cluster finder
90 if(option.Contains("OrigCF"))clusfinder=kFALSE;
92 Int_t nEvents = runLoader->GetNumberOfEvents();
94 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
95 runLoader->GetEvent(iEvent);
96 if(loader->TreeR()==0x0) loader->MakeTree("R");
98 rec->SetTreeAddress();
99 rec->DigitsToRecPoints(iEvent,0,"All",clusfinder);
102 loader->UnloadRecPoints();
103 loader->UnloadDigits();
104 runLoader->UnloadKinematics();
107 //_________________________________________________________________
108 void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader,
109 AliRawReader* rawReader) const
111 // reconstruct clusters
114 AliITSLoader* loader = static_cast<AliITSLoader*>(runLoader->GetLoader("ITSLoader"));
116 Error("Reconstruct", "ITS loader not found");
120 AliITSDetTypeRec* rec = new AliITSDetTypeRec(loader);
122 rec->SetDefaultClusterFindersV2(kTRUE);
124 loader->LoadRecPoints("recreate");
128 while(rawReader->NextEvent()) {
129 runLoader->GetEvent(iEvent++);
130 if(loader->TreeR()==0x0) loader->MakeTree("R");
131 rec->DigitsToRecPoints(rawReader);
134 loader->UnloadRecPoints();
137 //_____________________________________________________________________________
138 AliTracker* AliITSReconstructor::CreateTracker(AliRunLoader* runLoader)const
140 // create a ITS tracker
143 AliITSgeom* geom = GetITSgeom(runLoader);
144 TString selectedTracker = GetOption();
146 if (selectedTracker.Contains("MI")) {
147 tracker = new AliITStrackerMI(geom);
150 tracker = new AliITStrackerSA(geom); // inherits from AliITStrackerMI
153 TString selectedPIDmethod = GetOption();
154 AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader");
156 Error("CreateTracker", "ITS loader not found");
158 if(selectedPIDmethod.Contains("LandauFitPID")){
159 loader->AdoptITSpid(new AliITSpidESD2((AliITStrackerMI*)tracker,loader));
162 Double_t parITS[] = {34., 0.15, 10.};
163 loader->AdoptITSpid(new AliITSpidESD1(parITS));
169 //_____________________________________________________________________________
170 AliVertexer* AliITSReconstructor::CreateVertexer(AliRunLoader* /*runLoader*/) const
172 // create a ITS vertexer
174 TString selectedVertexer = GetOption();
175 if(selectedVertexer.Contains("ions") || selectedVertexer.Contains("IONS")){
176 Info("CreateVertexer","a AliITSVertexerIons object has been selected\n");
177 return new AliITSVertexerIons("null");
179 if(selectedVertexer.Contains("smear") || selectedVertexer.Contains("SMEAR")){
180 Double_t smear[3]={0.005,0.005,0.01};
181 Info("CreateVertexer","a AliITSVertexerFast object has been selected\n");
182 return new AliITSVertexerFast(smear);
184 if(selectedVertexer.Contains("ppz") || selectedVertexer.Contains("PPZ")){
185 Info("CreateVertexer","a AliITSVertexerPPZ object has been selected\n");
186 return new AliITSVertexerPPZ("null");
188 // by default an AliITSVertexerZ object is instatiated
189 Info("CreateVertexer","a AliITSVertexerZ object has been selected\n");
190 return new AliITSVertexerZ("null");
193 //_____________________________________________________________________________
194 void AliITSReconstructor::FillESD(AliRunLoader* runLoader,
197 // make PID, find V0s and cascade
198 AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader");
199 AliITSpidESD *pidESD = 0;
200 TString selectedPIDmethod = GetOption();
201 if(selectedPIDmethod.Contains("LandauFitPID")){
202 Info("FillESD","ITS LandauFitPID option has been selected\n");
203 pidESD=loader->GetITSpid();
206 Info("FillESD","ITS default PID\n");
207 pidESD=loader->GetITSpid();
210 pidESD->MakePID(esd);
213 Error("FillESD","!! cannot do the PID !!\n");
216 Double_t cuts[]={33, // max. allowed chi2
217 0.16,// min. allowed negative daughter's impact parameter
218 0.05,// min. allowed positive daughter's impact parameter
219 0.08,// max. allowed DCA between the daughter tracks
220 0.99,// max. allowed cosine of V0's pointing angle
221 0.9, // min. radius of the fiducial volume
222 2.9 // max. radius of the fiducial volume
224 AliV0vertexer vtxer(cuts);
225 Double_t vtx[3], cvtx[6];
226 esd->GetVertex()->GetXYZ(vtx);
227 esd->GetVertex()->GetSigmaXYZ(cvtx);
228 vtxer.SetVertex(vtx);
229 vtxer.Tracks2V0vertices(esd);
232 Double_t cts[]={33., // max. allowed chi2
233 0.05, // min. allowed V0 impact parameter
234 0.008, // window around the Lambda mass
235 0.035, // min. allowed bachelor's impact parameter
236 0.10, // max. allowed DCA between a V0 and a track
237 0.9985, //max. allowed cosine of the cascade pointing angle
238 0.9, // min. radius of the fiducial volume
239 2.9 // max. radius of the fiducial volume
241 AliCascadeVertexer cvtxer=AliCascadeVertexer(cts);
242 cvtxer.SetVertex(vtx);
243 cvtxer.V0sTracks2CascadeVertices(esd);
247 //_____________________________________________________________________________
248 AliITSgeom* AliITSReconstructor::GetITSgeom(AliRunLoader* runLoader) const
250 // get the ITS geometry
252 if (!runLoader->GetAliRun()) runLoader->LoadgAlice();
253 if (!runLoader->GetAliRun()) {
254 Error("GetITSgeom", "couldn't get AliRun object");
257 AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader");
258 AliITSgeom* geom = (AliITSgeom*)loader->GetITSgeom();
260 Error("GetITSgeom","no ITS geometry available");