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 "AliITSgeom.h"
31 #include "AliITSLoader.h"
32 #include "AliITStrackerMI.h"
33 #include "AliITStrackerV2.h"
34 #include "AliITStrackerSA.h"
35 #include "AliITSVertexerFast.h"
36 #include "AliITSVertexerFixed.h"
37 #include "AliITSVertexer3D.h"
38 #include "AliITSVertexerZ.h"
39 #include "AliITSVertexerZD.h"
40 #include "AliITSVertexerCosmics.h"
41 #include "AliITSInitGeometry.h"
42 #include "AliITSTrackleterSPDEff.h"
43 #include "AliITSMultReconstructor.h"
45 ClassImp(AliITSReconstructor)
47 //___________________________________________________________________________
48 AliITSReconstructor::AliITSReconstructor() : AliReconstructor(),
51 // Default constructor
53 //___________________________________________________________________________
54 AliITSReconstructor::~AliITSReconstructor(){
56 if(fDetTypeRec) delete fDetTypeRec;
58 //____________________________________________________________________________
59 void AliITSReconstructor::GetPidSettings(AliESDpid *ESDpid) {
61 // pass PID settings from AliITSRecoParam to AliESDpid
63 Int_t pidOpt = GetRecoParam()->GetPID();
66 AliDebug(1,"ITS LandauFitPID option has been selected\n");
67 ESDpid->SetITSPIDmethod(AliESDpid::kITSLikelihood);
70 AliDebug(1,"ITS default PID\n");
71 ESDpid->SetITSPIDmethod(AliESDpid::kITSTruncMean);
74 //______________________________________________________________________
75 void AliITSReconstructor::Init() {
76 // Initalize this constructor bet getting/creating the objects
77 // nesseary for a proper ITS reconstruction.
85 AliITSInitGeometry initgeom;
86 AliITSgeom *geom = initgeom.CreateAliITSgeom();
87 AliInfo(Form("Geometry name: %s",(initgeom.GetGeometryName()).Data()));
89 fDetTypeRec = new AliITSDetTypeRec();
90 fDetTypeRec->SetITSgeom(geom);
91 fDetTypeRec->SetDefaults();
96 //_____________________________________________________________________________
97 void AliITSReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const
99 // reconstruct clusters
101 Int_t cluFindOpt = GetRecoParam()->GetClusterFinder();
102 TString recopt = GetRecoParam()->GetOptReco();
103 fDetTypeRec->SetTreeAddressD(digitsTree);
104 fDetTypeRec->MakeBranch(clustersTree,"R");
105 fDetTypeRec->SetTreeAddressR(clustersTree);
106 fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,recopt.Data(),cluFindOpt);
109 //_________________________________________________________________
110 void AliITSReconstructor::Reconstruct(AliRawReader* rawReader, TTree *clustersTree) const
112 // reconstruct clusters from raw data
113 TString recopt = GetRecoParam()->GetOptReco();
114 fDetTypeRec->SetDefaultClusterFindersV2(kTRUE);
115 fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree,recopt.Data());
118 //_____________________________________________________________________________
119 AliTrackleter* AliITSReconstructor::CreateMultFinder() const
121 // create the SPD trackeleter for mult. reconstruction
122 AliITSMultReconstructor* multReco = new AliITSMultReconstructor();
123 multReco->SetHistOn(kFALSE);
124 multReco->SetDetTypeRec(fDetTypeRec);
128 //_____________________________________________________________________________
129 AliTracker* AliITSReconstructor::CreateTrackleter() const
131 // create the SPD trackeleter (for SPD PlaneEfficiency evaluation)
132 if(!GetRecoParam()->GetComputePlaneEff() || !GetRecoParam()->GetUseTrackletsPlaneEff()) return NULL;
133 //Int_t trackerOpt = GetRecoParam()->GetTracker();
134 AliTracker* trackleter;
135 trackleter = new AliITSTrackleterSPDEff();
136 AliITSTrackleterSPDEff *spdtrackleter=(AliITSTrackleterSPDEff*)trackleter;
137 // here set cuts (from RecoParam)
138 if(GetRecoParam()->GetBkgTrackletsPlaneEff()) spdtrackleter->SetReflectClusterAroundZAxisForLayer(1,kTRUE);
139 if(GetRecoParam()->GetMCTrackletsPlaneEff()) spdtrackleter->SetMC();
140 spdtrackleter->SetHistOn();
141 spdtrackleter->SetPhiWindowL2(GetRecoParam()->GetTrackleterPhiWindowL2());
142 spdtrackleter->SetZetaWindowL2(GetRecoParam()->GetTrackleterZetaWindowL2());
143 spdtrackleter->SetPhiWindowL1(GetRecoParam()->GetTrackleterPhiWindowL1());
144 spdtrackleter->SetZetaWindowL1(GetRecoParam()->GetTrackleterZetaWindowL1());
145 if(GetRecoParam()->GetUpdateOncePerEventPlaneEff()) spdtrackleter->SetUpdateOncePerEventPlaneEff();
146 spdtrackleter->SetMinContVtx(GetRecoParam()->GetMinContVtxPlaneEff());
150 //_____________________________________________________________________________
151 AliTracker* AliITSReconstructor::CreateTracker() const
153 // create a ITS tracker
155 Int_t trackerOpt = GetRecoParam()->GetTracker();
158 tracker = new AliITStrackerMI(0);
159 AliITStrackerMI *mit=(AliITStrackerMI*)tracker;
160 mit->SetDetTypeRec(fDetTypeRec);
162 else if (trackerOpt==2) {
163 tracker = new AliITStrackerV2(0);
166 tracker = new AliITStrackerSA(0); // inherits from AliITStrackerMI
167 AliITStrackerSA *sat=(AliITStrackerSA*)tracker;
168 sat->SetDetTypeRec(fDetTypeRec);
169 if(GetRecoParam()->GetTrackerSAOnly()) sat->SetSAFlag(kTRUE);
170 if(sat->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n");
171 if(GetRecoParam()->GetInwardFindingSA()){
172 sat->SetInwardFinding();
173 sat->SetInnerStartLayer(GetRecoParam()->GetInnerStartLayerSA());
175 sat->SetOutwardFinding();
176 sat->SetOuterStartLayer(GetRecoParam()->GetOuterStartLayerSA());
178 sat->SetMinNPoints(GetRecoParam()->GetMinNPointsSA());
185 //_____________________________________________________________________________
186 AliVertexer* AliITSReconstructor::CreateVertexer() const
188 // create a ITS vertexer
190 AliITSVertexer *vptr = NULL;
191 Int_t vtxOpt = GetRecoParam()->GetVertexer();
193 AliFatal("Option AliITSVertexerIons is no longer supported");
197 Double_t smear[3]={GetRecoParam()->GetVertexerFastSmearX(),
198 GetRecoParam()->GetVertexerFastSmearY(),
199 GetRecoParam()->GetVertexerFastSmearZ()};
200 AliDebug(1,"AliITSVertexerFast has been selected");
201 vptr = new AliITSVertexerFast(smear);
204 AliDebug(1,"AliITSVertexerZ has been selected");
205 AliITSVertexerZ* vtxrz = new AliITSVertexerZ();
206 Int_t pileupAlgo=GetRecoParam()->GetSPDVertexerPileupAlgo();
207 if(pileupAlgo==3) vtxrz->SetSearchForPileup(kFALSE);
211 AliDebug(1,"AliITSVertexerCosmics has been selected");
212 vptr = new AliITSVertexerCosmics();
215 AliDebug(1,"Vertex is fixed in the position of the TDI\n");
216 vptr = new AliITSVertexerFixed("TDI");
219 AliDebug(1,"Vertex is fixed in the position of the TED\n");
220 vptr = new AliITSVertexerFixed("TED");
223 AliDebug(1,"VertexerZD: reconstruction of the Z coordinate with SDD \n");
224 AliITSVertexerZD*vtxrz = new AliITSVertexerZD();
225 vtxrz->SetSearchForPileup(kFALSE);
229 // by default an AliITSVertexer3D object is instatiated
230 AliITSVertexer3D* vtxr =
231 new AliITSVertexer3D(GetRecoParam()->GetVertexer3DWideFiducialRegionZ());
232 Float_t dzw=GetRecoParam()->GetVertexer3DWideFiducialRegionZ();
233 Float_t drw=GetRecoParam()->GetVertexer3DWideFiducialRegionR();
234 vtxr->SetWideFiducialRegion(dzw,drw);
235 Float_t dzn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionZ();
236 Float_t drn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionR();
237 vtxr->SetNarrowFiducialRegion(dzn,drn);
238 Float_t dphil=GetRecoParam()->GetVertexer3DLooseDeltaPhiCut();
239 Float_t dphit=GetRecoParam()->GetVertexer3DTightDeltaPhiCut();
240 vtxr->SetDeltaPhiCuts(dphil,dphit);
241 Float_t dcacut=GetRecoParam()->GetVertexer3DDCACut();
242 vtxr->SetDCACut(dcacut);
243 Int_t pileupAlgo=GetRecoParam()->GetSPDVertexerPileupAlgo();
244 vtxr->SetPileupAlgo(pileupAlgo);
245 UChar_t highmultAlgo=GetRecoParam()->GetSPDVertexerHighMultAlgo();
246 vtxr->SetHighMultAlgo(highmultAlgo);
247 AliDebug(1,Form("AliITSVertexer3D with pileup algo %d has been selected",pileupAlgo));
250 vptr->SetDetTypeRec(fDetTypeRec);
254 //_____________________________________________________________________________
255 void AliITSReconstructor::FillESD(TTree * /*digitsTree*/, TTree * /*clustersTree*/,
256 AliESDEvent* /* esd */) const
258 // make PID, find V0s and cascade
259 /* Now done in AliESDpid
260 if(fItsPID!=0) fItsPID->MakePID(esd);
261 else AliError("!! cannot do the PID !!");