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 "AliRawReader.h"
28 #include "AliITSDetTypeRec.h"
29 #include "AliITSgeom.h"
30 #include "AliITSLoader.h"
31 #include "AliITStrackerMI.h"
32 #include "AliITStrackerV2.h"
33 #include "AliITStrackerSA.h"
34 #include "AliITSVertexerIons.h"
35 #include "AliITSVertexerFast.h"
36 #include "AliITSVertexerFixed.h"
37 #include "AliITSVertexer3D.h"
38 #include "AliITSVertexerZ.h"
39 #include "AliITSVertexerCosmics.h"
40 #include "AliESDEvent.h"
41 #include "AliITSpidESD.h"
42 #include "AliITSpidESD1.h"
43 #include "AliITSpidESD2.h"
44 #include "AliITSInitGeometry.h"
47 ClassImp(AliITSReconstructor)
49 //___________________________________________________________________________
50 AliITSReconstructor::AliITSReconstructor() : AliReconstructor(),
54 // Default constructor
56 //___________________________________________________________________________
57 AliITSReconstructor::~AliITSReconstructor(){
60 if(fDetTypeRec) delete fDetTypeRec;
62 //______________________________________________________________________
63 AliITSReconstructor::AliITSReconstructor(const AliITSReconstructor &ob) :AliReconstructor(ob),
65 fDetTypeRec(ob.fDetTypeRec)
71 //______________________________________________________________________
72 AliITSReconstructor& AliITSReconstructor::operator=(const AliITSReconstructor& ob ){
73 // Assignment operator
74 this->~AliITSReconstructor();
75 new(this) AliITSReconstructor(ob);
79 //______________________________________________________________________
80 void AliITSReconstructor::Init() {
81 // Initalize this constructor bet getting/creating the objects
82 // nesseary for a proper ITS reconstruction.
90 AliITSInitGeometry initgeom;
91 AliITSgeom *geom = initgeom.CreateAliITSgeom();
92 AliInfo(Form("Geometry name: %s",(initgeom.GetGeometryName()).Data()));
94 fDetTypeRec = new AliITSDetTypeRec();
95 fDetTypeRec->SetITSgeom(geom);
96 fDetTypeRec->SetDefaults();
101 //_____________________________________________________________________________
102 void AliITSReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const
104 // reconstruct clusters
106 Int_t cluFindOpt = GetRecoParam()->GetClusterFinder();
107 Bool_t useV2=kTRUE; // Default: V2 cluster finder
108 if(cluFindOpt==1) useV2=kFALSE;
110 fDetTypeRec->SetTreeAddressD(digitsTree);
111 fDetTypeRec->MakeBranch(clustersTree,"R");
112 fDetTypeRec->SetTreeAddressR(clustersTree);
113 fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,"All",useV2);
116 //_________________________________________________________________
117 void AliITSReconstructor::Reconstruct(AliRawReader* rawReader, TTree *clustersTree) const
119 // reconstruct clusters from raw data
121 fDetTypeRec->SetDefaultClusterFindersV2(kTRUE);
122 fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree);
125 //_____________________________________________________________________________
126 AliTracker* AliITSReconstructor::CreateTracker() const
128 // create a ITS tracker
130 Int_t trackerOpt = GetRecoParam()->GetTracker();
133 tracker = new AliITStrackerMI(0);
134 AliITStrackerMI *mit=(AliITStrackerMI*)tracker;
135 mit->SetDetTypeRec(fDetTypeRec);
137 else if (trackerOpt==2) {
138 tracker = new AliITStrackerV2(0);
141 tracker = new AliITStrackerSA(0); // inherits from AliITStrackerMI
142 AliITStrackerSA *sat=(AliITStrackerSA*)tracker;
143 sat->SetDetTypeRec(fDetTypeRec);
144 if(GetRecoParam()->GetTrackerSAOnly()) sat->SetSAFlag(kTRUE);
145 if(sat->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n");
146 sat->SetOuterStartLayer(GetRecoParam()->GetOuterStartLayerSA());
149 Int_t pidOpt = GetRecoParam()->GetPID();
151 AliITSReconstructor* nc = const_cast<AliITSReconstructor*>(this);
153 Info("FillESD","ITS LandauFitPID option has been selected\n");
154 nc->fItsPID = new AliITSpidESD2((AliITStrackerMI*)tracker);
157 Info("FillESD","ITS default PID\n");
158 Double_t parITS[] = {79.,0.13, 5.}; //IB: this is "pp tuning"
159 nc->fItsPID = new AliITSpidESD1(parITS);
166 //_____________________________________________________________________________
167 AliVertexer* AliITSReconstructor::CreateVertexer() const
169 // create a ITS vertexer
171 Int_t vtxOpt = GetRecoParam()->GetVertexer();
173 Info("CreateVertexer","a AliITSVertexerIons object has been selected\n");
174 return new AliITSVertexerIons();
177 Double_t smear[3]={0.005,0.005,0.01};
178 Info("CreateVertexer","a AliITSVertexerFast object has been selected\n");
179 return new AliITSVertexerFast(smear);
182 Info("CreateVertexer","a AliITSVertexerZ object has been selected\n");
183 return new AliITSVertexerZ();
186 Info("CreateVertexer","a AliITSVertexerCosmics object has been selected\n");
187 return new AliITSVertexerCosmics();
190 Info("CreateVertexer","vertex is fixed in the position of the TDI\n");
191 return new AliITSVertexerFixed("TDI");
194 Info("CreateVertexer","vertex is fixed in the position of the TED\n");
195 return new AliITSVertexerFixed("TED");
197 // by default an AliITSVertexer3D object is instatiated
198 Info("CreateVertexer","a AliITSVertexer3D object has been selected\n");
199 AliITSVertexer3D* vtxr = new AliITSVertexer3D();
200 Float_t dzw=GetRecoParam()->GetVertexer3DWideFiducialRegionZ();
201 Float_t drw=GetRecoParam()->GetVertexer3DWideFiducialRegionR();
202 vtxr->SetWideFiducialRegion(dzw,drw);
203 Float_t dzn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionZ();
204 Float_t drn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionR();
205 vtxr->SetNarrowFiducialRegion(dzn,drn);
206 Float_t dphil=GetRecoParam()->GetVertexer3DLooseDeltaPhiCut();
207 Float_t dphit=GetRecoParam()->GetVertexer3DTightDeltaPhiCut();
208 vtxr->SetDeltaPhiCuts(dphil,dphit);
209 Float_t dcacut=GetRecoParam()->GetVertexer3DDCACut();
210 vtxr->SetDCACut(dcacut);
214 //_____________________________________________________________________________
215 void AliITSReconstructor::FillESD(TTree * /*digitsTree*/, TTree *clustersTree,
216 AliESDEvent* esd) const
218 // make PID, find V0s and cascade
220 Int_t pidOpt = GetRecoParam()->GetPID();
222 fItsPID->MakePID(clustersTree,esd);
224 fItsPID->MakePID(esd);
228 Error("FillESD","!! cannot do the PID !!\n");