For Pythia with tune don't switch off MI in ConfigHeavyFlavor
[u/mrichter/AliRoot.git] / ITS / AliITSReconstructor.cxx
CommitLineData
121a60bd 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/* $Id$ */
17
18///////////////////////////////////////////////////////////////////////////////
19// //
20// class for ITS reconstruction //
21// //
22///////////////////////////////////////////////////////////////////////////////
23
e62c1aea 24#include "Riostream.h"
121a60bd 25#include "AliITSReconstructor.h"
00a7cc50 26#include "AliRun.h"
113c12f1 27#include "AliRawReader.h"
7ef60110 28#include "AliESDEvent.h"
29#include "AliESDpid.h"
00a7cc50 30#include "AliITSDetTypeRec.h"
6cae184e 31#include "AliITSgeom.h"
7d62fb64 32#include "AliITSLoader.h"
e43c066c 33#include "AliITStrackerMI.h"
c0342e67 34#include "AliITStrackerV2.h"
121a60bd 35#include "AliITStrackerSA.h"
36#include "AliITSVertexerIons.h"
37#include "AliITSVertexerFast.h"
c8735dd3 38#include "AliITSVertexerFixed.h"
3acc14d5 39#include "AliITSVertexer3D.h"
121a60bd 40#include "AliITSVertexerZ.h"
3acc14d5 41#include "AliITSVertexerCosmics.h"
023ae34b 42#include "AliITSInitGeometry.h"
58e8dc31 43#include "AliITSTrackleterSPDEff.h"
121a60bd 44
44347160 45
121a60bd 46ClassImp(AliITSReconstructor)
44347160 47
e62c1aea 48//___________________________________________________________________________
94631b2f 49AliITSReconstructor::AliITSReconstructor() : AliReconstructor(),
6cae184e 50fDetTypeRec(0)
94631b2f 51{
e62c1aea 52 // Default constructor
e62c1aea 53}
54 //___________________________________________________________________________
55AliITSReconstructor::~AliITSReconstructor(){
56// destructor
6cae184e 57 if(fDetTypeRec) delete fDetTypeRec;
e62c1aea 58}
7ef60110 59//____________________________________________________________________________
60void AliITSReconstructor::GetPidSettings(AliESDpid *ESDpid) {
61 //
62 // pass PID settings from AliITSRecoParam to AliESDpid
63 //
64 Int_t pidOpt = GetRecoParam()->GetPID();
6cae184e 65
7ef60110 66 if(pidOpt==1){
67 AliInfo("ITS LandauFitPID option has been selected\n");
68 ESDpid->SetITSPIDmethod(AliESDpid::kITSLikelihood);
69 }
70 else{
71 AliInfo("ITS default PID\n");
72 ESDpid->SetITSPIDmethod(AliESDpid::kITSTruncMean);
73 }
74}
023ae34b 75//______________________________________________________________________
d76c31f4 76void AliITSReconstructor::Init() {
023ae34b 77 // Initalize this constructor bet getting/creating the objects
78 // nesseary for a proper ITS reconstruction.
79 // Inputs:
d76c31f4 80 // none.
023ae34b 81 // Output:
82 // none.
83 // Return:
84 // none.
00a7cc50 85
108bd0fe 86 AliITSInitGeometry initgeom;
87 AliITSgeom *geom = initgeom.CreateAliITSgeom();
88 AliInfo(Form("Geometry name: %s",(initgeom.GetGeometryName()).Data()));
6cae184e 89
90 fDetTypeRec = new AliITSDetTypeRec();
91 fDetTypeRec->SetITSgeom(geom);
92 fDetTypeRec->SetDefaults();
ed446fa3 93
023ae34b 94 return;
95}
6cae184e 96
121a60bd 97//_____________________________________________________________________________
6cae184e 98void AliITSReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const
121a60bd 99{
100// reconstruct clusters
101
9f9cae94 102 Int_t cluFindOpt = GetRecoParam()->GetClusterFinder();
121a60bd 103
6cae184e 104 fDetTypeRec->SetTreeAddressD(digitsTree);
105 fDetTypeRec->MakeBranch(clustersTree,"R");
106 fDetTypeRec->SetTreeAddressR(clustersTree);
5d2c2f86 107 fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,"All",cluFindOpt);
121a60bd 108}
109
00a7cc50 110//_________________________________________________________________
6cae184e 111void AliITSReconstructor::Reconstruct(AliRawReader* rawReader, TTree *clustersTree) const
113c12f1 112{
6cae184e 113 // reconstruct clusters from raw data
00a7cc50 114
6cae184e 115 fDetTypeRec->SetDefaultClusterFindersV2(kTRUE);
116 fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree);
113c12f1 117}
58e8dc31 118//_____________________________________________________________________________
119AliTracker* AliITSReconstructor::CreateTrackleter() const
120{
121// create the SPD trackeleter (for SPD PlaneEfficiency evaluation)
1a64bda6 122 if(!GetRecoParam()->GetComputePlaneEff() || !GetRecoParam()->GetUseTrackletsPlaneEff()) return NULL;
58e8dc31 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();
7284b2b2 131 spdtrackleter->SetPhiWindowL2(GetRecoParam()->GetTrackleterPhiWindowL2());
132 spdtrackleter->SetZetaWindowL2(GetRecoParam()->GetTrackleterZetaWindowL2());
58e8dc31 133 spdtrackleter->SetPhiWindowL1(GetRecoParam()->GetTrackleterPhiWindowL1());
134 spdtrackleter->SetZetaWindowL1(GetRecoParam()->GetTrackleterZetaWindowL1());
135 if(GetRecoParam()->GetUpdateOncePerEventPlaneEff()) spdtrackleter->SetUpdateOncePerEventPlaneEff();
0ea92079 136 spdtrackleter->SetMinContVtx(GetRecoParam()->GetMinContVtxPlaneEff());
58e8dc31 137 return trackleter;
138}
113c12f1 139
140//_____________________________________________________________________________
d76c31f4 141AliTracker* AliITSReconstructor::CreateTracker() const
121a60bd 142{
143// create a ITS tracker
144
9f9cae94 145 Int_t trackerOpt = GetRecoParam()->GetTracker();
e62c1aea 146 AliTracker* tracker;
9f9cae94 147 if (trackerOpt==1) {
e341247d 148 tracker = new AliITStrackerMI(0);
23197852 149 AliITStrackerMI *mit=(AliITStrackerMI*)tracker;
150 mit->SetDetTypeRec(fDetTypeRec);
c0342e67 151 }
9f9cae94 152 else if (trackerOpt==2) {
c0342e67 153 tracker = new AliITStrackerV2(0);
e62c1aea 154 }
155 else {
cc088660 156 tracker = new AliITStrackerSA(0); // inherits from AliITStrackerMI
1966f03c 157 AliITStrackerSA *sat=(AliITStrackerSA*)tracker;
23197852 158 sat->SetDetTypeRec(fDetTypeRec);
9f9cae94 159 if(GetRecoParam()->GetTrackerSAOnly()) sat->SetSAFlag(kTRUE);
1966f03c 160 if(sat->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n");
58e8dc31 161 if(GetRecoParam()->GetInwardFindingSA()){
162 sat->SetInwardFinding();
163 sat->SetInnerStartLayer(GetRecoParam()->GetInnerStartLayerSA());
164 }else{
12b1afb7 165 sat->SetOutwardFinding();
166 sat->SetOuterStartLayer(GetRecoParam()->GetOuterStartLayerSA());
58e8dc31 167 }
12b1afb7 168 sat->SetMinNPoints(GetRecoParam()->GetMinNPointsSA());
e62c1aea 169 }
7d62fb64 170
e62c1aea 171 return tracker;
7d62fb64 172
121a60bd 173}
174
175//_____________________________________________________________________________
d76c31f4 176AliVertexer* AliITSReconstructor::CreateVertexer() const
121a60bd 177{
178// create a ITS vertexer
179
ff44c37c 180 AliITSVertexer *vptr;
9f9cae94 181 Int_t vtxOpt = GetRecoParam()->GetVertexer();
182 if(vtxOpt==3){
8b78365f 183 AliInfo("AliITSVertexerIons has been selected");
ff44c37c 184 vptr = new AliITSVertexerIons();
121a60bd 185 }
ff44c37c 186 else if(vtxOpt==4){
9364069b 187 Double_t smear[3]={GetRecoParam()->GetVertexerFastSmearX(),
188 GetRecoParam()->GetVertexerFastSmearY(),
189 GetRecoParam()->GetVertexerFastSmearZ()};
8b78365f 190 AliInfo("AliITSVertexerFast has been selected");
ff44c37c 191 vptr = new AliITSVertexerFast(smear);
121a60bd 192 }
ff44c37c 193 else if(vtxOpt==1){
8b78365f 194 AliInfo("AliITSVertexerZ has been selected");
ff44c37c 195 vptr = new AliITSVertexerZ();
3acc14d5 196 }
ff44c37c 197 else if(vtxOpt==2){
8b78365f 198 AliInfo("AliITSVertexerCosmics has been selected");
ff44c37c 199 vptr = new AliITSVertexerCosmics();
121a60bd 200 }
ff44c37c 201 else if(vtxOpt==5){
8b78365f 202 AliInfo("Vertex is fixed in the position of the TDI\n");
ff44c37c 203 vptr = new AliITSVertexerFixed("TDI");
c8735dd3 204 }
ff44c37c 205 else if(vtxOpt==6){
8b78365f 206 AliInfo("Vertex is fixed in the position of the TED\n");
ff44c37c 207 vptr = new AliITSVertexerFixed("TED");
c8735dd3 208 }
ff44c37c 209 else {
99f38bf6 210 // by default an AliITSVertexer3D object is instatiated
ff44c37c 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);
8b78365f 223 Int_t pileupAlgo=GetRecoParam()->GetSPDVertexerPileupAlgo();
224 vtxr->SetPileupAlgo(pileupAlgo);
225 AliInfo(Form("AliITSVertexer3D with pileup algo %d has been selected",pileupAlgo));
ff44c37c 226 vptr = vtxr;
227 }
228 vptr->SetDetTypeRec(fDetTypeRec);
229 return vptr;
121a60bd 230}
231
232//_____________________________________________________________________________
1919a678 233void AliITSReconstructor::FillESD(TTree * /*digitsTree*/, TTree * /*clustersTree*/,
7ef60110 234 AliESDEvent* /* esd */) const
121a60bd 235{
e62c1aea 236// make PID, find V0s and cascade
10d100d4 237/* Now done in AliESDpid
1919a678 238 if(fItsPID!=0) fItsPID->MakePID(esd);
239 else AliError("!! cannot do the PID !!");
10d100d4 240*/
6922a70f 241}