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"
43 #include "AliITSInitGeometry.h"
45 ClassImp(AliITSReconstructor)
47 //___________________________________________________________________________
48 AliITSReconstructor::AliITSReconstructor() : AliReconstructor(),
51 // Default constructor
53 //___________________________________________________________________________
54 AliITSReconstructor::~AliITSReconstructor(){
58 //______________________________________________________________________
59 AliITSReconstructor::AliITSReconstructor(const AliITSReconstructor &ob) :AliReconstructor(ob),
65 //______________________________________________________________________
66 AliITSReconstructor& AliITSReconstructor::operator=(const AliITSReconstructor& ob ){
67 // Assignment operator
68 this->~AliITSReconstructor();
69 new(this) AliITSReconstructor(ob);
72 //______________________________________________________________________
73 void AliITSReconstructor::Init(AliRunLoader *runLoader) const{
74 // Initalize this constructor bet getting/creating the objects
75 // nesseary for a proper ITS reconstruction.
77 // AliRunLoader *runLoader Pointer to the run loader to allow
78 // the getting of files/folders data
79 // needed to do reconstruction
85 AliITSInitGeometry *initgeom = new AliITSInitGeometry("AliITSvPPRasymmFMD",
87 AliITSgeom *geom = initgeom->CreateAliITSgeom();
88 delete initgeom; // once created, do not need initgeom any more.
89 AliITSLoader* loader = static_cast<AliITSLoader*>
90 (runLoader->GetLoader("ITSLoader"));
92 Error("Init", "ITS loader not found");
95 loader->SetITSgeom(geom);
98 //_____________________________________________________________________________
99 void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader) const
101 // reconstruct clusters
104 AliITSLoader* loader = static_cast<AliITSLoader*>(runLoader->GetLoader("ITSLoader"));
106 Error("Reconstruct", "ITS loader not found");
109 AliITSDetTypeRec* rec = new AliITSDetTypeRec(loader);
112 loader->LoadRecPoints("recreate");
113 loader->LoadDigits("read");
114 runLoader->LoadKinematics();
115 TString option = GetOption();
116 Bool_t clusfinder=kTRUE; // Default: V2 cluster finder
117 if(option.Contains("OrigCF"))clusfinder=kFALSE;
119 Int_t nEvents = runLoader->GetNumberOfEvents();
121 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
122 runLoader->GetEvent(iEvent);
123 if(loader->TreeR()==0x0) loader->MakeTree("R");
124 rec->MakeBranch("R");
125 rec->SetTreeAddress();
126 rec->DigitsToRecPoints(iEvent,0,"All",clusfinder);
129 loader->UnloadRecPoints();
130 loader->UnloadDigits();
131 runLoader->UnloadKinematics();
134 //_________________________________________________________________
135 void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader,
136 AliRawReader* rawReader) const
138 // reconstruct clusters
141 AliITSLoader* loader = static_cast<AliITSLoader*>(runLoader->GetLoader("ITSLoader"));
143 Error("Reconstruct", "ITS loader not found");
147 AliITSDetTypeRec* rec = new AliITSDetTypeRec(loader);
149 rec->SetDefaultClusterFindersV2(kTRUE);
151 loader->LoadRecPoints("recreate");
155 while(rawReader->NextEvent()) {
156 runLoader->GetEvent(iEvent++);
157 if(loader->TreeR()==0x0) loader->MakeTree("R");
158 rec->DigitsToRecPoints(rawReader);
161 loader->UnloadRecPoints();
164 //_____________________________________________________________________________
165 AliTracker* AliITSReconstructor::CreateTracker(AliRunLoader* runLoader)const
167 // create a ITS tracker
170 AliITSgeom* geom = GetITSgeom(runLoader);
171 TString selectedTracker = GetOption();
173 if (selectedTracker.Contains("MI")) {
174 tracker = new AliITStrackerMI(geom);
177 tracker = new AliITStrackerSA(geom); // inherits from AliITStrackerMI
180 TString selectedPIDmethod = GetOption();
181 AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader");
183 Error("CreateTracker", "ITS loader not found");
185 if(selectedPIDmethod.Contains("LandauFitPID")){
186 loader->AdoptITSpid(new AliITSpidESD2((AliITStrackerMI*)tracker,loader));
189 Double_t parITS[] = {34., 0.15, 10.};
190 loader->AdoptITSpid(new AliITSpidESD1(parITS));
196 //_____________________________________________________________________________
197 AliVertexer* AliITSReconstructor::CreateVertexer(AliRunLoader* /*runLoader*/) const
199 // create a ITS vertexer
201 TString selectedVertexer = GetOption();
202 if(selectedVertexer.Contains("ions") || selectedVertexer.Contains("IONS")){
203 Info("CreateVertexer","a AliITSVertexerIons object has been selected\n");
204 return new AliITSVertexerIons("null");
206 if(selectedVertexer.Contains("smear") || selectedVertexer.Contains("SMEAR")){
207 Double_t smear[3]={0.005,0.005,0.01};
208 Info("CreateVertexer","a AliITSVertexerFast object has been selected\n");
209 return new AliITSVertexerFast(smear);
211 if(selectedVertexer.Contains("ppz") || selectedVertexer.Contains("PPZ")){
212 Info("CreateVertexer","a AliITSVertexerPPZ object has been selected\n");
213 return new AliITSVertexerPPZ("null");
215 // by default an AliITSVertexerZ object is instatiated
216 Info("CreateVertexer","a AliITSVertexerZ object has been selected\n");
217 return new AliITSVertexerZ("null");
220 //_____________________________________________________________________________
221 void AliITSReconstructor::FillESD(AliRunLoader* runLoader,
224 // make PID, find V0s and cascade
225 AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader");
226 AliITSpidESD *pidESD = 0;
227 TString selectedPIDmethod = GetOption();
228 if(selectedPIDmethod.Contains("LandauFitPID")){
229 Info("FillESD","ITS LandauFitPID option has been selected\n");
230 pidESD=loader->GetITSpid();
233 Info("FillESD","ITS default PID\n");
234 pidESD=loader->GetITSpid();
237 pidESD->MakePID(esd);
240 Error("FillESD","!! cannot do the PID !!\n");
243 Double_t cuts[]={33, // max. allowed chi2
244 0.16,// min. allowed negative daughter's impact parameter
245 0.05,// min. allowed positive daughter's impact parameter
246 0.08,// max. allowed DCA between the daughter tracks
247 0.99,// max. allowed cosine of V0's pointing angle
248 0.9, // min. radius of the fiducial volume
249 2.9 // max. radius of the fiducial volume
251 AliV0vertexer vtxer(cuts);
252 Double_t vtx[3], cvtx[6];
253 esd->GetVertex()->GetXYZ(vtx);
254 esd->GetVertex()->GetSigmaXYZ(cvtx);
255 vtxer.SetVertex(vtx);
256 vtxer.Tracks2V0vertices(esd);
259 Double_t cts[]={33., // max. allowed chi2
260 0.05, // min. allowed V0 impact parameter
261 0.008, // window around the Lambda mass
262 0.035, // min. allowed bachelor's impact parameter
263 0.10, // max. allowed DCA between a V0 and a track
264 0.9985, //max. allowed cosine of the cascade pointing angle
265 0.9, // min. radius of the fiducial volume
266 2.9 // max. radius of the fiducial volume
268 AliCascadeVertexer cvtxer=AliCascadeVertexer(cts);
269 cvtxer.SetVertex(vtx);
270 cvtxer.V0sTracks2CascadeVertices(esd);
274 //_____________________________________________________________________________
275 AliITSgeom* AliITSReconstructor::GetITSgeom(AliRunLoader* runLoader) const
277 // get the ITS geometry
279 if (!runLoader->GetAliRun()) runLoader->LoadgAlice();
280 if (!runLoader->GetAliRun()) {
281 Error("GetITSgeom", "couldn't get AliRun object");
284 AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader");
285 AliITSgeom* geom = (AliITSgeom*)loader->GetITSgeom();
287 Error("GetITSgeom","no ITS geometry available");