]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSReconstructor.cxx
Updated version of ITS QA Checker and related modifications (Melinda)
[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"
00a7cc50 28#include "AliITSDetTypeRec.h"
6cae184e 29#include "AliITSgeom.h"
7d62fb64 30#include "AliITSLoader.h"
e43c066c 31#include "AliITStrackerMI.h"
c0342e67 32#include "AliITStrackerV2.h"
121a60bd 33#include "AliITStrackerSA.h"
34#include "AliITSVertexerIons.h"
35#include "AliITSVertexerFast.h"
c8735dd3 36#include "AliITSVertexerFixed.h"
3acc14d5 37#include "AliITSVertexer3D.h"
121a60bd 38#include "AliITSVertexerZ.h"
3acc14d5 39#include "AliITSVertexerCosmics.h"
af885e0f 40#include "AliESDEvent.h"
121a60bd 41#include "AliITSpidESD.h"
e62c1aea 42#include "AliITSpidESD1.h"
43#include "AliITSpidESD2.h"
023ae34b 44#include "AliITSInitGeometry.h"
58e8dc31 45#include "AliITSTrackleterSPDEff.h"
121a60bd 46
44347160 47
121a60bd 48ClassImp(AliITSReconstructor)
44347160 49
e62c1aea 50//___________________________________________________________________________
94631b2f 51AliITSReconstructor::AliITSReconstructor() : AliReconstructor(),
6cae184e 52fItsPID(0),
53fDetTypeRec(0)
94631b2f 54{
e62c1aea 55 // Default constructor
e62c1aea 56}
57 //___________________________________________________________________________
58AliITSReconstructor::~AliITSReconstructor(){
59// destructor
60 delete fItsPID;
6cae184e 61 if(fDetTypeRec) delete fDetTypeRec;
e62c1aea 62}
6cae184e 63
023ae34b 64//______________________________________________________________________
d76c31f4 65void AliITSReconstructor::Init() {
023ae34b 66 // Initalize this constructor bet getting/creating the objects
67 // nesseary for a proper ITS reconstruction.
68 // Inputs:
d76c31f4 69 // none.
023ae34b 70 // Output:
71 // none.
72 // Return:
73 // none.
00a7cc50 74
108bd0fe 75 AliITSInitGeometry initgeom;
76 AliITSgeom *geom = initgeom.CreateAliITSgeom();
77 AliInfo(Form("Geometry name: %s",(initgeom.GetGeometryName()).Data()));
6cae184e 78
79 fDetTypeRec = new AliITSDetTypeRec();
80 fDetTypeRec->SetITSgeom(geom);
81 fDetTypeRec->SetDefaults();
ed446fa3 82
023ae34b 83 return;
84}
6cae184e 85
121a60bd 86//_____________________________________________________________________________
6cae184e 87void AliITSReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const
121a60bd 88{
89// reconstruct clusters
90
9f9cae94 91 Int_t cluFindOpt = GetRecoParam()->GetClusterFinder();
121a60bd 92
6cae184e 93 fDetTypeRec->SetTreeAddressD(digitsTree);
94 fDetTypeRec->MakeBranch(clustersTree,"R");
95 fDetTypeRec->SetTreeAddressR(clustersTree);
5d2c2f86 96 fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,"All",cluFindOpt);
121a60bd 97}
98
00a7cc50 99//_________________________________________________________________
6cae184e 100void AliITSReconstructor::Reconstruct(AliRawReader* rawReader, TTree *clustersTree) const
113c12f1 101{
6cae184e 102 // reconstruct clusters from raw data
00a7cc50 103
6cae184e 104 fDetTypeRec->SetDefaultClusterFindersV2(kTRUE);
105 fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree);
113c12f1 106}
58e8dc31 107//_____________________________________________________________________________
108AliTracker* AliITSReconstructor::CreateTrackleter() const
109{
110// create the SPD trackeleter (for SPD PlaneEfficiency evaluation)
1a64bda6 111 if(!GetRecoParam()->GetComputePlaneEff() || !GetRecoParam()->GetUseTrackletsPlaneEff()) return NULL;
58e8dc31 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();
7284b2b2 120 spdtrackleter->SetPhiWindowL2(GetRecoParam()->GetTrackleterPhiWindowL2());
121 spdtrackleter->SetZetaWindowL2(GetRecoParam()->GetTrackleterZetaWindowL2());
58e8dc31 122 spdtrackleter->SetPhiWindowL1(GetRecoParam()->GetTrackleterPhiWindowL1());
123 spdtrackleter->SetZetaWindowL1(GetRecoParam()->GetTrackleterZetaWindowL1());
124 if(GetRecoParam()->GetUpdateOncePerEventPlaneEff()) spdtrackleter->SetUpdateOncePerEventPlaneEff();
125 //spdtrackleter->(GetRecoParam()->GetMinContVtxPlaneEff()); // to be implemented
126 return trackleter;
127}
113c12f1 128
121a60bd 129//_____________________________________________________________________________
d76c31f4 130AliTracker* AliITSReconstructor::CreateTracker() const
121a60bd 131{
132// create a ITS tracker
133
9f9cae94 134 Int_t trackerOpt = GetRecoParam()->GetTracker();
e62c1aea 135 AliTracker* tracker;
9f9cae94 136 if (trackerOpt==1) {
e341247d 137 tracker = new AliITStrackerMI(0);
23197852 138 AliITStrackerMI *mit=(AliITStrackerMI*)tracker;
139 mit->SetDetTypeRec(fDetTypeRec);
c0342e67 140 }
9f9cae94 141 else if (trackerOpt==2) {
c0342e67 142 tracker = new AliITStrackerV2(0);
e62c1aea 143 }
144 else {
cc088660 145 tracker = new AliITStrackerSA(0); // inherits from AliITStrackerMI
1966f03c 146 AliITStrackerSA *sat=(AliITStrackerSA*)tracker;
23197852 147 sat->SetDetTypeRec(fDetTypeRec);
9f9cae94 148 if(GetRecoParam()->GetTrackerSAOnly()) sat->SetSAFlag(kTRUE);
1966f03c 149 if(sat->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n");
58e8dc31 150 if(GetRecoParam()->GetInwardFindingSA()){
151 sat->SetInwardFinding();
152 sat->SetInnerStartLayer(GetRecoParam()->GetInnerStartLayerSA());
153 }else{
12b1afb7 154 sat->SetOutwardFinding();
155 sat->SetOuterStartLayer(GetRecoParam()->GetOuterStartLayerSA());
58e8dc31 156 }
12b1afb7 157 sat->SetMinNPoints(GetRecoParam()->GetMinNPointsSA());
e62c1aea 158 }
7d62fb64 159
9f9cae94 160 Int_t pidOpt = GetRecoParam()->GetPID();
161
d76c31f4 162 AliITSReconstructor* nc = const_cast<AliITSReconstructor*>(this);
9f9cae94 163 if(pidOpt==1){
d76c31f4 164 Info("FillESD","ITS LandauFitPID option has been selected\n");
1919a678 165 nc->fItsPID = new AliITSpidESD2();
e62c1aea 166 }
167 else{
d76c31f4 168 Info("FillESD","ITS default PID\n");
7a8614f3 169 Double_t parITS[] = {79.,0.13, 5.}; //IB: this is "pp tuning"
d76c31f4 170 nc->fItsPID = new AliITSpidESD1(parITS);
e62c1aea 171 }
38013a1a 172
e62c1aea 173 return tracker;
7d62fb64 174
121a60bd 175}
176
177//_____________________________________________________________________________
d76c31f4 178AliVertexer* AliITSReconstructor::CreateVertexer() const
121a60bd 179{
180// create a ITS vertexer
181
ff44c37c 182 AliITSVertexer *vptr;
9f9cae94 183 Int_t vtxOpt = GetRecoParam()->GetVertexer();
184 if(vtxOpt==3){
8b78365f 185 AliInfo("AliITSVertexerIons has been selected");
ff44c37c 186 vptr = new AliITSVertexerIons();
121a60bd 187 }
ff44c37c 188 else if(vtxOpt==4){
9364069b 189 Double_t smear[3]={GetRecoParam()->GetVertexerFastSmearX(),
190 GetRecoParam()->GetVertexerFastSmearY(),
191 GetRecoParam()->GetVertexerFastSmearZ()};
8b78365f 192 AliInfo("AliITSVertexerFast has been selected");
ff44c37c 193 vptr = new AliITSVertexerFast(smear);
121a60bd 194 }
ff44c37c 195 else if(vtxOpt==1){
8b78365f 196 AliInfo("AliITSVertexerZ has been selected");
ff44c37c 197 vptr = new AliITSVertexerZ();
3acc14d5 198 }
ff44c37c 199 else if(vtxOpt==2){
8b78365f 200 AliInfo("AliITSVertexerCosmics has been selected");
ff44c37c 201 vptr = new AliITSVertexerCosmics();
121a60bd 202 }
ff44c37c 203 else if(vtxOpt==5){
8b78365f 204 AliInfo("Vertex is fixed in the position of the TDI\n");
ff44c37c 205 vptr = new AliITSVertexerFixed("TDI");
c8735dd3 206 }
ff44c37c 207 else if(vtxOpt==6){
8b78365f 208 AliInfo("Vertex is fixed in the position of the TED\n");
ff44c37c 209 vptr = new AliITSVertexerFixed("TED");
c8735dd3 210 }
ff44c37c 211 else {
99f38bf6 212 // by default an AliITSVertexer3D object is instatiated
ff44c37c 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);
8b78365f 225 Int_t pileupAlgo=GetRecoParam()->GetSPDVertexerPileupAlgo();
226 vtxr->SetPileupAlgo(pileupAlgo);
227 AliInfo(Form("AliITSVertexer3D with pileup algo %d has been selected",pileupAlgo));
ff44c37c 228 vptr = vtxr;
229 }
230 vptr->SetDetTypeRec(fDetTypeRec);
231 return vptr;
121a60bd 232}
233
234//_____________________________________________________________________________
1919a678 235void AliITSReconstructor::FillESD(TTree * /*digitsTree*/, TTree * /*clustersTree*/,
af885e0f 236 AliESDEvent* esd) const
121a60bd 237{
e62c1aea 238// make PID, find V0s and cascade
1919a678 239 if(fItsPID!=0) fItsPID->MakePID(esd);
240 else AliError("!! cannot do the PID !!");
121a60bd 241}