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