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"
45 #include "AliITSTrackleterSPDEff.h"
48 ClassImp(AliITSReconstructor)
50 //___________________________________________________________________________
51 AliITSReconstructor::AliITSReconstructor() : AliReconstructor(),
55 // Default constructor
57 //___________________________________________________________________________
58 AliITSReconstructor::~AliITSReconstructor(){
61 if(fDetTypeRec) delete fDetTypeRec;
64 //______________________________________________________________________
65 void AliITSReconstructor::Init() {
66 // Initalize this constructor bet getting/creating the objects
67 // nesseary for a proper ITS reconstruction.
75 AliITSInitGeometry initgeom;
76 AliITSgeom *geom = initgeom.CreateAliITSgeom();
77 AliInfo(Form("Geometry name: %s",(initgeom.GetGeometryName()).Data()));
79 fDetTypeRec = new AliITSDetTypeRec();
80 fDetTypeRec->SetITSgeom(geom);
81 fDetTypeRec->SetDefaults();
86 //_____________________________________________________________________________
87 void AliITSReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const
89 // reconstruct clusters
91 Int_t cluFindOpt = GetRecoParam()->GetClusterFinder();
93 fDetTypeRec->SetTreeAddressD(digitsTree);
94 fDetTypeRec->MakeBranch(clustersTree,"R");
95 fDetTypeRec->SetTreeAddressR(clustersTree);
96 fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,"All",cluFindOpt);
99 //_________________________________________________________________
100 void AliITSReconstructor::Reconstruct(AliRawReader* rawReader, TTree *clustersTree) const
102 // reconstruct clusters from raw data
104 fDetTypeRec->SetDefaultClusterFindersV2(kTRUE);
105 fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree);
107 //_____________________________________________________________________________
108 AliTracker* AliITSReconstructor::CreateTrackleter() const
110 // create the SPD trackeleter (for SPD PlaneEfficiency evaluation)
111 if(!GetRecoParam()->GetComputePlaneEff() || !GetRecoParam()->GetUseTrackletsPlaneEff()) return NULL;
112 //Int_t trackerOpt = GetRecoParam()->GetTracker();
113 AliTracker* trackleter;
114 trackleter = new AliITSTrackleterSPDEff();
115 AliITSTrackleterSPDEff *spdtrackleter=(AliITSTrackleterSPDEff*)trackleter;
116 // here set cuts (from RecoParam)
117 if(GetRecoParam()->GetBkgTrackletsPlaneEff()) spdtrackleter->SetReflectClusterAroundZAxisForLayer(1,kTRUE);
118 if(GetRecoParam()->GetMCTrackletsPlaneEff()) spdtrackleter->SetMC();
119 spdtrackleter->SetHistOn();
120 spdtrackleter->SetPhiWindowL2(GetRecoParam()->GetTrackleterPhiWindowL2());
121 spdtrackleter->SetZetaWindowL2(GetRecoParam()->GetTrackleterZetaWindowL2());
122 spdtrackleter->SetPhiWindowL1(GetRecoParam()->GetTrackleterPhiWindowL1());
123 spdtrackleter->SetZetaWindowL1(GetRecoParam()->GetTrackleterZetaWindowL1());
124 if(GetRecoParam()->GetUpdateOncePerEventPlaneEff()) spdtrackleter->SetUpdateOncePerEventPlaneEff();
125 //spdtrackleter->(GetRecoParam()->GetMinContVtxPlaneEff()); // to be implemented
129 //_____________________________________________________________________________
130 AliTracker* AliITSReconstructor::CreateTracker() const
132 // create a ITS tracker
134 Int_t trackerOpt = GetRecoParam()->GetTracker();
137 tracker = new AliITStrackerMI(0);
138 AliITStrackerMI *mit=(AliITStrackerMI*)tracker;
139 mit->SetDetTypeRec(fDetTypeRec);
141 else if (trackerOpt==2) {
142 tracker = new AliITStrackerV2(0);
145 tracker = new AliITStrackerSA(0); // inherits from AliITStrackerMI
146 AliITStrackerSA *sat=(AliITStrackerSA*)tracker;
147 sat->SetDetTypeRec(fDetTypeRec);
148 if(GetRecoParam()->GetTrackerSAOnly()) sat->SetSAFlag(kTRUE);
149 if(sat->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n");
150 if(GetRecoParam()->GetInwardFindingSA()){
151 sat->SetInwardFinding();
152 sat->SetInnerStartLayer(GetRecoParam()->GetInnerStartLayerSA());
154 sat->SetOutwardFinding();
155 sat->SetOuterStartLayer(GetRecoParam()->GetOuterStartLayerSA());
157 sat->SetMinNPoints(GetRecoParam()->GetMinNPointsSA());
160 Int_t pidOpt = GetRecoParam()->GetPID();
162 AliITSReconstructor* nc = const_cast<AliITSReconstructor*>(this);
164 Info("FillESD","ITS LandauFitPID option has been selected\n");
165 nc->fItsPID = new AliITSpidESD2();
168 Info("FillESD","ITS default PID\n");
169 Double_t parITS[] = {79.,0.13, 5.}; //IB: this is "pp tuning"
170 nc->fItsPID = new AliITSpidESD1(parITS);
177 //_____________________________________________________________________________
178 AliVertexer* AliITSReconstructor::CreateVertexer() const
180 // create a ITS vertexer
182 AliITSVertexer *vptr;
183 Int_t vtxOpt = GetRecoParam()->GetVertexer();
185 AliInfo("AliITSVertexerIons has been selected");
186 vptr = new AliITSVertexerIons();
189 Double_t smear[3]={GetRecoParam()->GetVertexerFastSmearX(),
190 GetRecoParam()->GetVertexerFastSmearY(),
191 GetRecoParam()->GetVertexerFastSmearZ()};
192 AliInfo("AliITSVertexerFast has been selected");
193 vptr = new AliITSVertexerFast(smear);
196 AliInfo("AliITSVertexerZ has been selected");
197 vptr = new AliITSVertexerZ();
200 AliInfo("AliITSVertexerCosmics has been selected");
201 vptr = new AliITSVertexerCosmics();
204 AliInfo("Vertex is fixed in the position of the TDI\n");
205 vptr = new AliITSVertexerFixed("TDI");
208 AliInfo("Vertex is fixed in the position of the TED\n");
209 vptr = new AliITSVertexerFixed("TED");
212 // by default an AliITSVertexer3D object is instatiated
213 AliITSVertexer3D* vtxr = new AliITSVertexer3D();
214 Float_t dzw=GetRecoParam()->GetVertexer3DWideFiducialRegionZ();
215 Float_t drw=GetRecoParam()->GetVertexer3DWideFiducialRegionR();
216 vtxr->SetWideFiducialRegion(dzw,drw);
217 Float_t dzn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionZ();
218 Float_t drn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionR();
219 vtxr->SetNarrowFiducialRegion(dzn,drn);
220 Float_t dphil=GetRecoParam()->GetVertexer3DLooseDeltaPhiCut();
221 Float_t dphit=GetRecoParam()->GetVertexer3DTightDeltaPhiCut();
222 vtxr->SetDeltaPhiCuts(dphil,dphit);
223 Float_t dcacut=GetRecoParam()->GetVertexer3DDCACut();
224 vtxr->SetDCACut(dcacut);
225 Int_t pileupAlgo=GetRecoParam()->GetSPDVertexerPileupAlgo();
226 vtxr->SetPileupAlgo(pileupAlgo);
227 AliInfo(Form("AliITSVertexer3D with pileup algo %d has been selected",pileupAlgo));
230 vptr->SetDetTypeRec(fDetTypeRec);
234 //_____________________________________________________________________________
235 void AliITSReconstructor::FillESD(TTree * /*digitsTree*/, TTree * /*clustersTree*/,
236 AliESDEvent* esd) const
238 // make PID, find V0s and cascade
239 if(fItsPID!=0) fItsPID->MakePID(esd);
240 else AliError("!! cannot do the PID !!");