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 "AliESDEvent.h"
29 #include "AliESDpid.h"
30 #include "AliITSDetTypeRec.h"
31 #include "AliITSgeom.h"
32 #include "AliITSLoader.h"
33 #include "AliITStrackerMI.h"
34 #include "AliITStrackerV2.h"
35 #include "AliITStrackerSA.h"
36 #include "AliITSVertexerIons.h"
37 #include "AliITSVertexerFast.h"
38 #include "AliITSVertexerFixed.h"
39 #include "AliITSVertexer3D.h"
40 #include "AliITSVertexerZ.h"
41 #include "AliITSVertexerCosmics.h"
42 #include "AliITSInitGeometry.h"
43 #include "AliITSTrackleterSPDEff.h"
46 ClassImp(AliITSReconstructor)
48 //___________________________________________________________________________
49 AliITSReconstructor::AliITSReconstructor() : AliReconstructor(),
52 // Default constructor
54 //___________________________________________________________________________
55 AliITSReconstructor::~AliITSReconstructor(){
57 if(fDetTypeRec) delete fDetTypeRec;
59 //____________________________________________________________________________
60 void AliITSReconstructor::GetPidSettings(AliESDpid *ESDpid) {
62 // pass PID settings from AliITSRecoParam to AliESDpid
64 Int_t pidOpt = GetRecoParam()->GetPID();
67 AliInfo("ITS LandauFitPID option has been selected\n");
68 ESDpid->SetITSPIDmethod(AliESDpid::kITSLikelihood);
71 AliInfo("ITS default PID\n");
72 ESDpid->SetITSPIDmethod(AliESDpid::kITSTruncMean);
75 //______________________________________________________________________
76 void AliITSReconstructor::Init() {
77 // Initalize this constructor bet getting/creating the objects
78 // nesseary for a proper ITS reconstruction.
86 AliITSInitGeometry initgeom;
87 AliITSgeom *geom = initgeom.CreateAliITSgeom();
88 AliInfo(Form("Geometry name: %s",(initgeom.GetGeometryName()).Data()));
90 fDetTypeRec = new AliITSDetTypeRec();
91 fDetTypeRec->SetITSgeom(geom);
92 fDetTypeRec->SetDefaults();
97 //_____________________________________________________________________________
98 void AliITSReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const
100 // reconstruct clusters
102 Int_t cluFindOpt = GetRecoParam()->GetClusterFinder();
104 fDetTypeRec->SetTreeAddressD(digitsTree);
105 fDetTypeRec->MakeBranch(clustersTree,"R");
106 fDetTypeRec->SetTreeAddressR(clustersTree);
107 fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,"All",cluFindOpt);
110 //_________________________________________________________________
111 void AliITSReconstructor::Reconstruct(AliRawReader* rawReader, TTree *clustersTree) const
113 // reconstruct clusters from raw data
115 fDetTypeRec->SetDefaultClusterFindersV2(kTRUE);
116 fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree);
118 //_____________________________________________________________________________
119 AliTracker* AliITSReconstructor::CreateTrackleter() const
121 // create the SPD trackeleter (for SPD PlaneEfficiency evaluation)
122 if(!GetRecoParam()->GetComputePlaneEff() || !GetRecoParam()->GetUseTrackletsPlaneEff()) return NULL;
123 //Int_t trackerOpt = GetRecoParam()->GetTracker();
124 AliTracker* trackleter;
125 trackleter = new AliITSTrackleterSPDEff();
126 AliITSTrackleterSPDEff *spdtrackleter=(AliITSTrackleterSPDEff*)trackleter;
127 // here set cuts (from RecoParam)
128 if(GetRecoParam()->GetBkgTrackletsPlaneEff()) spdtrackleter->SetReflectClusterAroundZAxisForLayer(1,kTRUE);
129 if(GetRecoParam()->GetMCTrackletsPlaneEff()) spdtrackleter->SetMC();
130 spdtrackleter->SetHistOn();
131 spdtrackleter->SetPhiWindowL2(GetRecoParam()->GetTrackleterPhiWindowL2());
132 spdtrackleter->SetZetaWindowL2(GetRecoParam()->GetTrackleterZetaWindowL2());
133 spdtrackleter->SetPhiWindowL1(GetRecoParam()->GetTrackleterPhiWindowL1());
134 spdtrackleter->SetZetaWindowL1(GetRecoParam()->GetTrackleterZetaWindowL1());
135 if(GetRecoParam()->GetUpdateOncePerEventPlaneEff()) spdtrackleter->SetUpdateOncePerEventPlaneEff();
136 spdtrackleter->SetMinContVtx(GetRecoParam()->GetMinContVtxPlaneEff());
140 //_____________________________________________________________________________
141 AliTracker* AliITSReconstructor::CreateTracker() const
143 // create a ITS tracker
145 Int_t trackerOpt = GetRecoParam()->GetTracker();
148 tracker = new AliITStrackerMI(0);
149 AliITStrackerMI *mit=(AliITStrackerMI*)tracker;
150 mit->SetDetTypeRec(fDetTypeRec);
152 else if (trackerOpt==2) {
153 tracker = new AliITStrackerV2(0);
156 tracker = new AliITStrackerSA(0); // inherits from AliITStrackerMI
157 AliITStrackerSA *sat=(AliITStrackerSA*)tracker;
158 sat->SetDetTypeRec(fDetTypeRec);
159 if(GetRecoParam()->GetTrackerSAOnly()) sat->SetSAFlag(kTRUE);
160 if(sat->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n");
161 if(GetRecoParam()->GetInwardFindingSA()){
162 sat->SetInwardFinding();
163 sat->SetInnerStartLayer(GetRecoParam()->GetInnerStartLayerSA());
165 sat->SetOutwardFinding();
166 sat->SetOuterStartLayer(GetRecoParam()->GetOuterStartLayerSA());
168 sat->SetMinNPoints(GetRecoParam()->GetMinNPointsSA());
175 //_____________________________________________________________________________
176 AliVertexer* AliITSReconstructor::CreateVertexer() const
178 // create a ITS vertexer
180 AliITSVertexer *vptr;
181 Int_t vtxOpt = GetRecoParam()->GetVertexer();
183 AliInfo("AliITSVertexerIons has been selected");
184 vptr = new AliITSVertexerIons();
187 Double_t smear[3]={GetRecoParam()->GetVertexerFastSmearX(),
188 GetRecoParam()->GetVertexerFastSmearY(),
189 GetRecoParam()->GetVertexerFastSmearZ()};
190 AliInfo("AliITSVertexerFast has been selected");
191 vptr = new AliITSVertexerFast(smear);
194 AliInfo("AliITSVertexerZ has been selected");
195 vptr = new AliITSVertexerZ();
198 AliInfo("AliITSVertexerCosmics has been selected");
199 vptr = new AliITSVertexerCosmics();
202 AliInfo("Vertex is fixed in the position of the TDI\n");
203 vptr = new AliITSVertexerFixed("TDI");
206 AliInfo("Vertex is fixed in the position of the TED\n");
207 vptr = new AliITSVertexerFixed("TED");
210 // by default an AliITSVertexer3D object is instatiated
211 AliITSVertexer3D* vtxr = new AliITSVertexer3D();
212 Float_t dzw=GetRecoParam()->GetVertexer3DWideFiducialRegionZ();
213 Float_t drw=GetRecoParam()->GetVertexer3DWideFiducialRegionR();
214 vtxr->SetWideFiducialRegion(dzw,drw);
215 Float_t dzn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionZ();
216 Float_t drn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionR();
217 vtxr->SetNarrowFiducialRegion(dzn,drn);
218 Float_t dphil=GetRecoParam()->GetVertexer3DLooseDeltaPhiCut();
219 Float_t dphit=GetRecoParam()->GetVertexer3DTightDeltaPhiCut();
220 vtxr->SetDeltaPhiCuts(dphil,dphit);
221 Float_t dcacut=GetRecoParam()->GetVertexer3DDCACut();
222 vtxr->SetDCACut(dcacut);
223 Int_t pileupAlgo=GetRecoParam()->GetSPDVertexerPileupAlgo();
224 vtxr->SetPileupAlgo(pileupAlgo);
225 AliInfo(Form("AliITSVertexer3D with pileup algo %d has been selected",pileupAlgo));
228 vptr->SetDetTypeRec(fDetTypeRec);
232 //_____________________________________________________________________________
233 void AliITSReconstructor::FillESD(TTree * /*digitsTree*/, TTree * /*clustersTree*/,
234 AliESDEvent* /* esd */) const
236 // make PID, find V0s and cascade
237 /* Now done in AliESDpid
238 if(fItsPID!=0) fItsPID->MakePID(esd);
239 else AliError("!! cannot do the PID !!");