AliITSRecoParam retrieved from the OCDB
[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"
3acc14d5 36#include "AliITSVertexer3D.h"
121a60bd 37#include "AliITSVertexerZ.h"
3acc14d5 38#include "AliITSVertexerCosmics.h"
af885e0f 39#include "AliESDEvent.h"
121a60bd 40#include "AliITSpidESD.h"
e62c1aea 41#include "AliITSpidESD1.h"
42#include "AliITSpidESD2.h"
023ae34b 43#include "AliITSInitGeometry.h"
121a60bd 44
44347160 45
121a60bd 46ClassImp(AliITSReconstructor)
5c47990a 47AliITSRecoParam *AliITSReconstructor::fgRecoParam =0; // reconstruction parameters
44347160 48
e62c1aea 49//___________________________________________________________________________
94631b2f 50AliITSReconstructor::AliITSReconstructor() : AliReconstructor(),
6cae184e 51fItsPID(0),
52fDetTypeRec(0)
94631b2f 53{
e62c1aea 54 // Default constructor
e62c1aea 55}
56 //___________________________________________________________________________
57AliITSReconstructor::~AliITSReconstructor(){
58// destructor
59 delete fItsPID;
ed446fa3 60 // if(!fgRecoParam) delete fgRecoParam;
6cae184e 61 if(fDetTypeRec) delete fDetTypeRec;
e62c1aea 62}
63//______________________________________________________________________
94631b2f 64AliITSReconstructor::AliITSReconstructor(const AliITSReconstructor &ob) :AliReconstructor(ob),
5c47990a 65fItsPID(ob.fItsPID),
66fDetTypeRec(ob.fDetTypeRec)
6cae184e 67
94631b2f 68{
e62c1aea 69 // Copy constructor
e62c1aea 70}
71
72//______________________________________________________________________
94631b2f 73AliITSReconstructor& AliITSReconstructor::operator=(const AliITSReconstructor& ob ){
e62c1aea 74 // Assignment operator
94631b2f 75 this->~AliITSReconstructor();
76 new(this) AliITSReconstructor(ob);
e62c1aea 77 return *this;
78}
6cae184e 79
023ae34b 80//______________________________________________________________________
d76c31f4 81void AliITSReconstructor::Init() {
023ae34b 82 // Initalize this constructor bet getting/creating the objects
83 // nesseary for a proper ITS reconstruction.
84 // Inputs:
d76c31f4 85 // none.
023ae34b 86 // Output:
87 // none.
88 // Return:
89 // none.
00a7cc50 90
108bd0fe 91 AliITSInitGeometry initgeom;
92 AliITSgeom *geom = initgeom.CreateAliITSgeom();
93 AliInfo(Form("Geometry name: %s",(initgeom.GetGeometryName()).Data()));
6cae184e 94
95 fDetTypeRec = new AliITSDetTypeRec();
96 fDetTypeRec->SetITSgeom(geom);
97 fDetTypeRec->SetDefaults();
ed446fa3 98
99 if(fgRecoParam) {
100 fgRecoParam->PrintParameters();
101 } else {
102 AliWarning("AliITSRecoParam has not been set");
103 }
6cae184e 104
023ae34b 105 return;
106}
6cae184e 107
121a60bd 108//_____________________________________________________________________________
6cae184e 109void AliITSReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const
121a60bd 110{
111// reconstruct clusters
112
00a7cc50 113 TString option = GetOption();
114 Bool_t clusfinder=kTRUE; // Default: V2 cluster finder
115 if(option.Contains("OrigCF"))clusfinder=kFALSE;
121a60bd 116
6cae184e 117 fDetTypeRec->SetTreeAddressD(digitsTree);
118 fDetTypeRec->MakeBranch(clustersTree,"R");
119 fDetTypeRec->SetTreeAddressR(clustersTree);
120 fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,"All",clusfinder);
121a60bd 121}
122
00a7cc50 123//_________________________________________________________________
6cae184e 124void AliITSReconstructor::Reconstruct(AliRawReader* rawReader, TTree *clustersTree) const
113c12f1 125{
6cae184e 126 // reconstruct clusters from raw data
00a7cc50 127
6cae184e 128 fDetTypeRec->SetDefaultClusterFindersV2(kTRUE);
129 fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree);
113c12f1 130}
131
121a60bd 132//_____________________________________________________________________________
d76c31f4 133AliTracker* AliITSReconstructor::CreateTracker() const
121a60bd 134{
135// create a ITS tracker
136
7d62fb64 137
e43c066c 138 TString selectedTracker = GetOption();
e62c1aea 139 AliTracker* tracker;
140 if (selectedTracker.Contains("MI")) {
e341247d 141 tracker = new AliITStrackerMI(0);
c0342e67 142 }
143 else if (selectedTracker.Contains("V2")) {
144 tracker = new AliITStrackerV2(0);
e62c1aea 145 }
146 else {
cc088660 147 tracker = new AliITStrackerSA(0); // inherits from AliITStrackerMI
1966f03c 148 AliITStrackerSA *sat=(AliITStrackerSA*)tracker;
149 if(selectedTracker.Contains("onlyITS"))sat->SetSAFlag(kTRUE);
150 if(sat->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n");
b8ed1a92 151 if(selectedTracker.Contains("cosmics")||selectedTracker.Contains("COSMICS"))
152 sat->SetOuterStartLayer(AliITSgeomTGeo::GetNLayers()-2);
e62c1aea 153 }
7d62fb64 154
e62c1aea 155 TString selectedPIDmethod = GetOption();
d76c31f4 156 AliITSReconstructor* nc = const_cast<AliITSReconstructor*>(this);
e62c1aea 157 if(selectedPIDmethod.Contains("LandauFitPID")){
d76c31f4 158 Info("FillESD","ITS LandauFitPID option has been selected\n");
159 nc->fItsPID = new AliITSpidESD2((AliITStrackerMI*)tracker);
e62c1aea 160 }
161 else{
d76c31f4 162 Info("FillESD","ITS default PID\n");
7a8614f3 163 Double_t parITS[] = {79.,0.13, 5.}; //IB: this is "pp tuning"
d76c31f4 164 nc->fItsPID = new AliITSpidESD1(parITS);
e62c1aea 165 }
38013a1a 166
e62c1aea 167 return tracker;
7d62fb64 168
121a60bd 169}
170
171//_____________________________________________________________________________
d76c31f4 172AliVertexer* AliITSReconstructor::CreateVertexer() const
121a60bd 173{
174// create a ITS vertexer
175
f4d5a8d1 176 TString selectedVertexer = GetOption();
121a60bd 177 if(selectedVertexer.Contains("ions") || selectedVertexer.Contains("IONS")){
178 Info("CreateVertexer","a AliITSVertexerIons object has been selected\n");
179 return new AliITSVertexerIons("null");
180 }
181 if(selectedVertexer.Contains("smear") || selectedVertexer.Contains("SMEAR")){
182 Double_t smear[3]={0.005,0.005,0.01};
183 Info("CreateVertexer","a AliITSVertexerFast object has been selected\n");
184 return new AliITSVertexerFast(smear);
185 }
3acc14d5 186 if(selectedVertexer.Contains("3d") || selectedVertexer.Contains("3D")){
187 Info("CreateVertexer","a AliITSVertexer3D object has been selected\n");
188 return new AliITSVertexer3D("null");
189 }
190 if(selectedVertexer.Contains("cosmics") || selectedVertexer.Contains("COSMICS")){
191 Info("CreateVertexer","a AliITSVertexerCosmics object has been selected\n");
192 return new AliITSVertexerCosmics();
121a60bd 193 }
194 // by default an AliITSVertexerZ object is instatiated
195 Info("CreateVertexer","a AliITSVertexerZ object has been selected\n");
196 return new AliITSVertexerZ("null");
197}
198
199//_____________________________________________________________________________
d76c31f4 200void AliITSReconstructor::FillESD(TTree * /*digitsTree*/, TTree *clustersTree,
af885e0f 201 AliESDEvent* esd) const
121a60bd 202{
e62c1aea 203// make PID, find V0s and cascade
d76c31f4 204 if(fItsPID!=0) {
205 TString selectedPIDmethod = GetOption();
206 if(selectedPIDmethod.Contains("LandauFitPID")){
207 fItsPID->MakePID(clustersTree,esd);
208 }
209 else{
210 fItsPID->MakePID(esd);
211 }
e62c1aea 212 }
213 else {
214 Error("FillESD","!! cannot do the PID !!\n");
215 }
121a60bd 216}