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 AliLoader* loader = runLoader->GetLoader("ITSLoader");
79 Error("Reconstruct", "ITS loader not found");
82 gAlice=runLoader->GetAliRun();
83 TDirectory* olddir = gDirectory;
84 runLoader->CdGAFile();
85 AliITSgeom* geom = (AliITSgeom*)gDirectory->Get("AliITSgeom");
87 AliITSDetTypeRec* rec = new AliITSDetTypeRec();
88 rec->SetLoader((AliITSLoader*)loader);
89 rec->SetITSgeom(geom);
92 loader->LoadRecPoints("recreate");
93 loader->LoadDigits("read");
94 runLoader->LoadKinematics();
95 TString option = GetOption();
96 Bool_t clusfinder=kTRUE; // Default: V2 cluster finder
97 if(option.Contains("OrigCF"))clusfinder=kFALSE;
99 Int_t nEvents = runLoader->GetNumberOfEvents();
101 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
102 runLoader->GetEvent(iEvent);
103 if(loader->TreeR()==0x0) loader->MakeTree("R");
104 rec->MakeBranch("R");
105 rec->SetTreeAddress();
106 rec->DigitsToRecPoints(iEvent,0,"All",clusfinder);
109 loader->UnloadRecPoints();
110 loader->UnloadDigits();
111 runLoader->UnloadKinematics();
114 //_________________________________________________________________
115 void AliITSReconstructor::Reconstruct(AliRunLoader* runLoader,
116 AliRawReader* rawReader) const
118 // reconstruct clusters
121 AliLoader* loader = runLoader->GetLoader("ITSLoader");
123 Error("Reconstruct", "ITS loader not found");
126 gAlice=runLoader->GetAliRun();
127 TDirectory* olddir = gDirectory;
128 runLoader->CdGAFile();
129 AliITSgeom* geom = (AliITSgeom*)gDirectory->Get("AliITSgeom");
132 AliITSDetTypeRec* rec = new AliITSDetTypeRec();
133 rec->SetLoader((AliITSLoader*)loader);
134 rec->SetITSgeom(geom);
136 rec->SetDefaultClusterFindersV2(kTRUE);
138 loader->LoadRecPoints("recreate");
142 while(rawReader->NextEvent()) {
143 runLoader->GetEvent(iEvent++);
144 if(loader->TreeR()==0x0) loader->MakeTree("R");
145 rec->DigitsToRecPoints(rawReader);
148 loader->UnloadRecPoints();
151 //_____________________________________________________________________________
152 AliTracker* AliITSReconstructor::CreateTracker(AliRunLoader* runLoader)const
154 // create a ITS tracker
157 AliITSgeom* geom = GetITSgeom(runLoader);
158 TString selectedTracker = GetOption();
160 if (selectedTracker.Contains("MI")) {
161 tracker = new AliITStrackerMI(geom);
164 tracker = new AliITStrackerSA(geom); // inherits from AliITStrackerMI
167 TString selectedPIDmethod = GetOption();
168 AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader");
170 Error("CreateTracker", "ITS loader not found");
172 if(selectedPIDmethod.Contains("LandauFitPID")){
173 loader->AdoptITSpid(new AliITSpidESD2((AliITStrackerMI*)tracker,loader));
176 Double_t parITS[] = {34., 0.15, 10.};
177 loader->AdoptITSpid(new AliITSpidESD1(parITS));
183 //_____________________________________________________________________________
184 AliVertexer* AliITSReconstructor::CreateVertexer(AliRunLoader* /*runLoader*/) const
186 // create a ITS vertexer
188 TString selectedVertexer = GetOption();
189 if(selectedVertexer.Contains("ions") || selectedVertexer.Contains("IONS")){
190 Info("CreateVertexer","a AliITSVertexerIons object has been selected\n");
191 return new AliITSVertexerIons("null");
193 if(selectedVertexer.Contains("smear") || selectedVertexer.Contains("SMEAR")){
194 Double_t smear[3]={0.005,0.005,0.01};
195 Info("CreateVertexer","a AliITSVertexerFast object has been selected\n");
196 return new AliITSVertexerFast(smear);
198 if(selectedVertexer.Contains("ppz") || selectedVertexer.Contains("PPZ")){
199 Info("CreateVertexer","a AliITSVertexerPPZ object has been selected\n");
200 return new AliITSVertexerPPZ("null");
202 // by default an AliITSVertexerZ object is instatiated
203 Info("CreateVertexer","a AliITSVertexerZ object has been selected\n");
204 return new AliITSVertexerZ("null");
207 //_____________________________________________________________________________
208 void AliITSReconstructor::FillESD(AliRunLoader* runLoader,
211 // make PID, find V0s and cascade
212 AliITSLoader *loader = (AliITSLoader*)runLoader->GetLoader("ITSLoader");
213 AliITSpidESD *pidESD = 0;
214 TString selectedPIDmethod = GetOption();
215 if(selectedPIDmethod.Contains("LandauFitPID")){
216 Info("FillESD","ITS LandauFitPID option has been selected\n");
217 pidESD=loader->GetITSpid();
220 Info("FillESD","ITS default PID\n");
221 pidESD=loader->GetITSpid();
224 pidESD->MakePID(esd);
227 Error("FillESD","!! cannot do the PID !!\n");
230 Double_t cuts[]={33, // max. allowed chi2
231 0.16,// min. allowed negative daughter's impact parameter
232 0.05,// min. allowed positive daughter's impact parameter
233 0.08,// max. allowed DCA between the daughter tracks
234 0.99,// max. allowed cosine of V0's pointing angle
235 0.9, // min. radius of the fiducial volume
236 2.9 // max. radius of the fiducial volume
238 AliV0vertexer vtxer(cuts);
239 Double_t vtx[3], cvtx[6];
240 esd->GetVertex()->GetXYZ(vtx);
241 esd->GetVertex()->GetSigmaXYZ(cvtx);
242 vtxer.SetVertex(vtx);
243 vtxer.Tracks2V0vertices(esd);
246 Double_t cts[]={33., // max. allowed chi2
247 0.05, // min. allowed V0 impact parameter
248 0.008, // window around the Lambda mass
249 0.035, // min. allowed bachelor's impact parameter
250 0.10, // max. allowed DCA between a V0 and a track
251 0.9985, //max. allowed cosine of the cascade pointing angle
252 0.9, // min. radius of the fiducial volume
253 2.9 // max. radius of the fiducial volume
255 AliCascadeVertexer cvtxer=AliCascadeVertexer(cts);
256 cvtxer.SetVertex(vtx);
257 cvtxer.V0sTracks2CascadeVertices(esd);
261 //_____________________________________________________________________________
262 AliITSgeom* AliITSReconstructor::GetITSgeom(AliRunLoader* runLoader) const
264 // get the ITS geometry
266 if (!runLoader->GetAliRun()) runLoader->LoadgAlice();
267 if (!runLoader->GetAliRun()) {
268 Error("GetITSgeom", "couldn't get AliRun object");
272 TDirectory * olddir = gDirectory;
273 runLoader->CdGAFile();
274 AliITSgeom* geom = (AliITSgeom*)gDirectory->Get("AliITSgeom");
277 Error("GetITSgeom","no ITS geometry available");