]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSReconstructor.cxx
Store number of TRD tracklets on ESD for tracking and PID. Reuse data
[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"
121a60bd 45
44347160 46
121a60bd 47ClassImp(AliITSReconstructor)
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;
6cae184e 60 if(fDetTypeRec) delete fDetTypeRec;
e62c1aea 61}
62//______________________________________________________________________
94631b2f 63AliITSReconstructor::AliITSReconstructor(const AliITSReconstructor &ob) :AliReconstructor(ob),
5c47990a 64fItsPID(ob.fItsPID),
65fDetTypeRec(ob.fDetTypeRec)
6cae184e 66
94631b2f 67{
e62c1aea 68 // Copy constructor
e62c1aea 69}
70
71//______________________________________________________________________
94631b2f 72AliITSReconstructor& AliITSReconstructor::operator=(const AliITSReconstructor& ob ){
e62c1aea 73 // Assignment operator
94631b2f 74 this->~AliITSReconstructor();
75 new(this) AliITSReconstructor(ob);
e62c1aea 76 return *this;
77}
6cae184e 78
023ae34b 79//______________________________________________________________________
d76c31f4 80void AliITSReconstructor::Init() {
023ae34b 81 // Initalize this constructor bet getting/creating the objects
82 // nesseary for a proper ITS reconstruction.
83 // Inputs:
d76c31f4 84 // none.
023ae34b 85 // Output:
86 // none.
87 // Return:
88 // none.
00a7cc50 89
108bd0fe 90 AliITSInitGeometry initgeom;
91 AliITSgeom *geom = initgeom.CreateAliITSgeom();
92 AliInfo(Form("Geometry name: %s",(initgeom.GetGeometryName()).Data()));
6cae184e 93
94 fDetTypeRec = new AliITSDetTypeRec();
95 fDetTypeRec->SetITSgeom(geom);
96 fDetTypeRec->SetDefaults();
ed446fa3 97
023ae34b 98 return;
99}
6cae184e 100
121a60bd 101//_____________________________________________________________________________
6cae184e 102void AliITSReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const
121a60bd 103{
104// reconstruct clusters
105
9f9cae94 106 Int_t cluFindOpt = GetRecoParam()->GetClusterFinder();
121a60bd 107
6cae184e 108 fDetTypeRec->SetTreeAddressD(digitsTree);
109 fDetTypeRec->MakeBranch(clustersTree,"R");
110 fDetTypeRec->SetTreeAddressR(clustersTree);
5d2c2f86 111 fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,"All",cluFindOpt);
121a60bd 112}
113
00a7cc50 114//_________________________________________________________________
6cae184e 115void AliITSReconstructor::Reconstruct(AliRawReader* rawReader, TTree *clustersTree) const
113c12f1 116{
6cae184e 117 // reconstruct clusters from raw data
00a7cc50 118
6cae184e 119 fDetTypeRec->SetDefaultClusterFindersV2(kTRUE);
120 fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree);
113c12f1 121}
122
121a60bd 123//_____________________________________________________________________________
d76c31f4 124AliTracker* AliITSReconstructor::CreateTracker() const
121a60bd 125{
126// create a ITS tracker
127
9f9cae94 128 Int_t trackerOpt = GetRecoParam()->GetTracker();
e62c1aea 129 AliTracker* tracker;
9f9cae94 130 if (trackerOpt==1) {
e341247d 131 tracker = new AliITStrackerMI(0);
23197852 132 AliITStrackerMI *mit=(AliITStrackerMI*)tracker;
133 mit->SetDetTypeRec(fDetTypeRec);
c0342e67 134 }
9f9cae94 135 else if (trackerOpt==2) {
c0342e67 136 tracker = new AliITStrackerV2(0);
e62c1aea 137 }
138 else {
cc088660 139 tracker = new AliITStrackerSA(0); // inherits from AliITStrackerMI
1966f03c 140 AliITStrackerSA *sat=(AliITStrackerSA*)tracker;
23197852 141 sat->SetDetTypeRec(fDetTypeRec);
9f9cae94 142 if(GetRecoParam()->GetTrackerSAOnly()) sat->SetSAFlag(kTRUE);
1966f03c 143 if(sat->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n");
12b1afb7 144 if(GetRecoParam()->GetInwardFindingSA()){
145 sat->SetInwardFinding();
146 sat->SetInnerStartLayer(GetRecoParam()->GetInnerStartLayerSA());
147 }else{
148 sat->SetOutwardFinding();
149 sat->SetOuterStartLayer(GetRecoParam()->GetOuterStartLayerSA());
150 }
151 sat->SetMinNPoints(GetRecoParam()->GetMinNPointsSA());
e62c1aea 152 }
7d62fb64 153
9f9cae94 154 Int_t pidOpt = GetRecoParam()->GetPID();
155
d76c31f4 156 AliITSReconstructor* nc = const_cast<AliITSReconstructor*>(this);
9f9cae94 157 if(pidOpt==1){
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
ff44c37c 176 AliITSVertexer *vptr;
9f9cae94 177 Int_t vtxOpt = GetRecoParam()->GetVertexer();
178 if(vtxOpt==3){
121a60bd 179 Info("CreateVertexer","a AliITSVertexerIons object has been selected\n");
ff44c37c 180 vptr = new AliITSVertexerIons();
121a60bd 181 }
ff44c37c 182 else if(vtxOpt==4){
121a60bd 183 Double_t smear[3]={0.005,0.005,0.01};
184 Info("CreateVertexer","a AliITSVertexerFast object has been selected\n");
ff44c37c 185 vptr = new AliITSVertexerFast(smear);
121a60bd 186 }
ff44c37c 187 else if(vtxOpt==1){
99f38bf6 188 Info("CreateVertexer","a AliITSVertexerZ object has been selected\n");
ff44c37c 189 vptr = new AliITSVertexerZ();
3acc14d5 190 }
ff44c37c 191 else if(vtxOpt==2){
3acc14d5 192 Info("CreateVertexer","a AliITSVertexerCosmics object has been selected\n");
ff44c37c 193 vptr = new AliITSVertexerCosmics();
121a60bd 194 }
ff44c37c 195 else if(vtxOpt==5){
c8735dd3 196 Info("CreateVertexer","vertex is fixed in the position of the TDI\n");
ff44c37c 197 vptr = new AliITSVertexerFixed("TDI");
c8735dd3 198 }
ff44c37c 199 else if(vtxOpt==6){
c8735dd3 200 Info("CreateVertexer","vertex is fixed in the position of the TED\n");
ff44c37c 201 vptr = new AliITSVertexerFixed("TED");
c8735dd3 202 }
ff44c37c 203 else {
99f38bf6 204 // by default an AliITSVertexer3D object is instatiated
ff44c37c 205 Info("CreateVertexer","a AliITSVertexer3D object has been selected\n");
206 AliITSVertexer3D* vtxr = new AliITSVertexer3D();
207 Float_t dzw=GetRecoParam()->GetVertexer3DWideFiducialRegionZ();
208 Float_t drw=GetRecoParam()->GetVertexer3DWideFiducialRegionR();
209 vtxr->SetWideFiducialRegion(dzw,drw);
210 Float_t dzn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionZ();
211 Float_t drn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionR();
212 vtxr->SetNarrowFiducialRegion(dzn,drn);
213 Float_t dphil=GetRecoParam()->GetVertexer3DLooseDeltaPhiCut();
214 Float_t dphit=GetRecoParam()->GetVertexer3DTightDeltaPhiCut();
215 vtxr->SetDeltaPhiCuts(dphil,dphit);
216 Float_t dcacut=GetRecoParam()->GetVertexer3DDCACut();
217 vtxr->SetDCACut(dcacut);
218 vptr = vtxr;
219 }
220 vptr->SetDetTypeRec(fDetTypeRec);
221 return vptr;
121a60bd 222}
223
224//_____________________________________________________________________________
d76c31f4 225void AliITSReconstructor::FillESD(TTree * /*digitsTree*/, TTree *clustersTree,
af885e0f 226 AliESDEvent* esd) const
121a60bd 227{
e62c1aea 228// make PID, find V0s and cascade
d76c31f4 229 if(fItsPID!=0) {
9f9cae94 230 Int_t pidOpt = GetRecoParam()->GetPID();
231 if(pidOpt==1){
d76c31f4 232 fItsPID->MakePID(clustersTree,esd);
9f9cae94 233 }else{
d76c31f4 234 fItsPID->MakePID(esd);
235 }
e62c1aea 236 }
237 else {
238 Error("FillESD","!! cannot do the PID !!\n");
239 }
121a60bd 240}