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 "AliITSInitGeometry.h"
42 #include "AliITSTrackleterSPDEff.h"
45 ClassImp(AliITSReconstructor)
47 //___________________________________________________________________________
48 AliITSReconstructor::AliITSReconstructor() : AliReconstructor(),
51 // Default constructor
53 //___________________________________________________________________________
54 AliITSReconstructor::~AliITSReconstructor(){
56 if(fDetTypeRec) delete fDetTypeRec;
59 //______________________________________________________________________
60 void AliITSReconstructor::Init() {
61 // Initalize this constructor bet getting/creating the objects
62 // nesseary for a proper ITS reconstruction.
70 AliITSInitGeometry initgeom;
71 AliITSgeom *geom = initgeom.CreateAliITSgeom();
72 AliInfo(Form("Geometry name: %s",(initgeom.GetGeometryName()).Data()));
74 fDetTypeRec = new AliITSDetTypeRec();
75 fDetTypeRec->SetITSgeom(geom);
76 fDetTypeRec->SetDefaults();
81 //_____________________________________________________________________________
82 void AliITSReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const
84 // reconstruct clusters
86 Int_t cluFindOpt = GetRecoParam()->GetClusterFinder();
88 fDetTypeRec->SetTreeAddressD(digitsTree);
89 fDetTypeRec->MakeBranch(clustersTree,"R");
90 fDetTypeRec->SetTreeAddressR(clustersTree);
91 fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,"All",cluFindOpt);
94 //_________________________________________________________________
95 void AliITSReconstructor::Reconstruct(AliRawReader* rawReader, TTree *clustersTree) const
97 // reconstruct clusters from raw data
99 fDetTypeRec->SetDefaultClusterFindersV2(kTRUE);
100 fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree);
102 //_____________________________________________________________________________
103 AliTracker* AliITSReconstructor::CreateTrackleter() const
105 // create the SPD trackeleter (for SPD PlaneEfficiency evaluation)
106 if(!GetRecoParam()->GetComputePlaneEff() || !GetRecoParam()->GetUseTrackletsPlaneEff()) return NULL;
107 //Int_t trackerOpt = GetRecoParam()->GetTracker();
108 AliTracker* trackleter;
109 trackleter = new AliITSTrackleterSPDEff();
110 AliITSTrackleterSPDEff *spdtrackleter=(AliITSTrackleterSPDEff*)trackleter;
111 // here set cuts (from RecoParam)
112 if(GetRecoParam()->GetBkgTrackletsPlaneEff()) spdtrackleter->SetReflectClusterAroundZAxisForLayer(1,kTRUE);
113 if(GetRecoParam()->GetMCTrackletsPlaneEff()) spdtrackleter->SetMC();
114 spdtrackleter->SetHistOn();
115 spdtrackleter->SetPhiWindowL2(GetRecoParam()->GetTrackleterPhiWindowL2());
116 spdtrackleter->SetZetaWindowL2(GetRecoParam()->GetTrackleterZetaWindowL2());
117 spdtrackleter->SetPhiWindowL1(GetRecoParam()->GetTrackleterPhiWindowL1());
118 spdtrackleter->SetZetaWindowL1(GetRecoParam()->GetTrackleterZetaWindowL1());
119 if(GetRecoParam()->GetUpdateOncePerEventPlaneEff()) spdtrackleter->SetUpdateOncePerEventPlaneEff();
120 spdtrackleter->SetMinContVtx(GetRecoParam()->GetMinContVtxPlaneEff());
124 //_____________________________________________________________________________
125 AliTracker* AliITSReconstructor::CreateTracker() const
127 // create a ITS tracker
129 Int_t trackerOpt = GetRecoParam()->GetTracker();
132 tracker = new AliITStrackerMI(0);
133 AliITStrackerMI *mit=(AliITStrackerMI*)tracker;
134 mit->SetDetTypeRec(fDetTypeRec);
136 else if (trackerOpt==2) {
137 tracker = new AliITStrackerV2(0);
140 tracker = new AliITStrackerSA(0); // inherits from AliITStrackerMI
141 AliITStrackerSA *sat=(AliITStrackerSA*)tracker;
142 sat->SetDetTypeRec(fDetTypeRec);
143 if(GetRecoParam()->GetTrackerSAOnly()) sat->SetSAFlag(kTRUE);
144 if(sat->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n");
145 if(GetRecoParam()->GetInwardFindingSA()){
146 sat->SetInwardFinding();
147 sat->SetInnerStartLayer(GetRecoParam()->GetInnerStartLayerSA());
149 sat->SetOutwardFinding();
150 sat->SetOuterStartLayer(GetRecoParam()->GetOuterStartLayerSA());
152 sat->SetMinNPoints(GetRecoParam()->GetMinNPointsSA());
155 Int_t pidOpt = GetRecoParam()->GetPID();
157 AliITSReconstructor* nc = const_cast<AliITSReconstructor*>(this);
160 Info("FillESD","ITS LandauFitPID option has been selected\n");
161 nc->fItsPID = new AliITSpidESD2();
164 Info("FillESD","ITS default PID\n");
165 Double_t parITS[] = {79.,0.13, 5.}; //IB: this is "pp tuning"
166 nc->fItsPID = new AliITSpidESD1(parITS);
173 //_____________________________________________________________________________
174 AliVertexer* AliITSReconstructor::CreateVertexer() const
176 // create a ITS vertexer
178 AliITSVertexer *vptr;
179 Int_t vtxOpt = GetRecoParam()->GetVertexer();
181 AliInfo("AliITSVertexerIons has been selected");
182 vptr = new AliITSVertexerIons();
185 Double_t smear[3]={GetRecoParam()->GetVertexerFastSmearX(),
186 GetRecoParam()->GetVertexerFastSmearY(),
187 GetRecoParam()->GetVertexerFastSmearZ()};
188 AliInfo("AliITSVertexerFast has been selected");
189 vptr = new AliITSVertexerFast(smear);
192 AliInfo("AliITSVertexerZ has been selected");
193 vptr = new AliITSVertexerZ();
196 AliInfo("AliITSVertexerCosmics has been selected");
197 vptr = new AliITSVertexerCosmics();
200 AliInfo("Vertex is fixed in the position of the TDI\n");
201 vptr = new AliITSVertexerFixed("TDI");
204 AliInfo("Vertex is fixed in the position of the TED\n");
205 vptr = new AliITSVertexerFixed("TED");
208 // by default an AliITSVertexer3D object is instatiated
209 AliITSVertexer3D* vtxr = new AliITSVertexer3D();
210 Float_t dzw=GetRecoParam()->GetVertexer3DWideFiducialRegionZ();
211 Float_t drw=GetRecoParam()->GetVertexer3DWideFiducialRegionR();
212 vtxr->SetWideFiducialRegion(dzw,drw);
213 Float_t dzn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionZ();
214 Float_t drn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionR();
215 vtxr->SetNarrowFiducialRegion(dzn,drn);
216 Float_t dphil=GetRecoParam()->GetVertexer3DLooseDeltaPhiCut();
217 Float_t dphit=GetRecoParam()->GetVertexer3DTightDeltaPhiCut();
218 vtxr->SetDeltaPhiCuts(dphil,dphit);
219 Float_t dcacut=GetRecoParam()->GetVertexer3DDCACut();
220 vtxr->SetDCACut(dcacut);
221 Int_t pileupAlgo=GetRecoParam()->GetSPDVertexerPileupAlgo();
222 vtxr->SetPileupAlgo(pileupAlgo);
223 AliInfo(Form("AliITSVertexer3D with pileup algo %d has been selected",pileupAlgo));
226 vptr->SetDetTypeRec(fDetTypeRec);
230 //_____________________________________________________________________________
231 void AliITSReconstructor::FillESD(TTree * /*digitsTree*/, TTree * /*clustersTree*/,
232 AliESDEvent* esd) const
234 // make PID, find V0s and cascade
235 /* Now done in AliESDpid
236 if(fItsPID!=0) fItsPID->MakePID(esd);
237 else AliError("!! cannot do the PID !!");