1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // class for ITS reconstruction //
22 ///////////////////////////////////////////////////////////////////////////////
24 #include "Riostream.h"
25 #include "AliITSReconstructor.h"
27 #include "AliRawReader.h"
28 #include "AliITSDetTypeRec.h"
29 #include "AliITSgeom.h"
30 #include "AliITSLoader.h"
31 #include "AliITStrackerMI.h"
32 #include "AliITStrackerV2.h"
33 #include "AliITStrackerSA.h"
34 #include "AliITSVertexerIons.h"
35 #include "AliITSVertexerFast.h"
36 #include "AliITSVertexer3D.h"
37 #include "AliITSVertexerZ.h"
38 #include "AliITSVertexerCosmics.h"
39 #include "AliESDEvent.h"
40 #include "AliITSpidESD.h"
41 #include "AliITSpidESD1.h"
42 #include "AliITSpidESD2.h"
43 #include "AliITSInitGeometry.h"
46 ClassImp(AliITSReconstructor)
47 AliITSRecoParam *AliITSReconstructor::fgRecoParam =0; // reconstruction parameters
49 //___________________________________________________________________________
50 AliITSReconstructor::AliITSReconstructor() : AliReconstructor(),
54 // Default constructor
56 //___________________________________________________________________________
57 AliITSReconstructor::~AliITSReconstructor(){
60 // if(!fgRecoParam) delete fgRecoParam;
61 if(fDetTypeRec) delete fDetTypeRec;
63 //______________________________________________________________________
64 AliITSReconstructor::AliITSReconstructor(const AliITSReconstructor &ob) :AliReconstructor(ob),
66 fDetTypeRec(ob.fDetTypeRec)
72 //______________________________________________________________________
73 AliITSReconstructor& AliITSReconstructor::operator=(const AliITSReconstructor& ob ){
74 // Assignment operator
75 this->~AliITSReconstructor();
76 new(this) AliITSReconstructor(ob);
80 //______________________________________________________________________
81 void AliITSReconstructor::Init() {
82 // Initalize this constructor bet getting/creating the objects
83 // nesseary for a proper ITS reconstruction.
91 AliITSInitGeometry initgeom;
92 AliITSgeom *geom = initgeom.CreateAliITSgeom();
93 AliInfo(Form("Geometry name: %s",(initgeom.GetGeometryName()).Data()));
95 fDetTypeRec = new AliITSDetTypeRec();
96 fDetTypeRec->SetITSgeom(geom);
97 fDetTypeRec->SetDefaults();
100 fgRecoParam->PrintParameters();
102 AliWarning("AliITSRecoParam has not been set");
108 //_____________________________________________________________________________
109 void AliITSReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const
111 // reconstruct clusters
113 TString option = GetOption();
114 Bool_t clusfinder=kTRUE; // Default: V2 cluster finder
115 if(option.Contains("OrigCF"))clusfinder=kFALSE;
117 fDetTypeRec->SetTreeAddressD(digitsTree);
118 fDetTypeRec->MakeBranch(clustersTree,"R");
119 fDetTypeRec->SetTreeAddressR(clustersTree);
120 fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,"All",clusfinder);
123 //_________________________________________________________________
124 void AliITSReconstructor::Reconstruct(AliRawReader* rawReader, TTree *clustersTree) const
126 // reconstruct clusters from raw data
128 fDetTypeRec->SetDefaultClusterFindersV2(kTRUE);
129 fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree);
132 //_____________________________________________________________________________
133 AliTracker* AliITSReconstructor::CreateTracker() const
135 // create a ITS tracker
138 TString selectedTracker = GetOption();
140 if (selectedTracker.Contains("MI")) {
141 tracker = new AliITStrackerMI(0);
142 AliITStrackerMI *mit=(AliITStrackerMI*)tracker;
143 mit->SetDetTypeRec(fDetTypeRec);
145 else if (selectedTracker.Contains("V2")) {
146 tracker = new AliITStrackerV2(0);
149 tracker = new AliITStrackerSA(0); // inherits from AliITStrackerMI
150 AliITStrackerSA *sat=(AliITStrackerSA*)tracker;
151 sat->SetDetTypeRec(fDetTypeRec);
152 if(selectedTracker.Contains("onlyITS"))sat->SetSAFlag(kTRUE);
153 if(sat->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n");
154 if(selectedTracker.Contains("cosmics")||selectedTracker.Contains("COSMICS"))
155 sat->SetOuterStartLayer(AliITSgeomTGeo::GetNLayers()-2);
158 TString selectedPIDmethod = GetOption();
159 AliITSReconstructor* nc = const_cast<AliITSReconstructor*>(this);
160 if(selectedPIDmethod.Contains("LandauFitPID")){
161 Info("FillESD","ITS LandauFitPID option has been selected\n");
162 nc->fItsPID = new AliITSpidESD2((AliITStrackerMI*)tracker);
165 Info("FillESD","ITS default PID\n");
166 Double_t parITS[] = {79.,0.13, 5.}; //IB: this is "pp tuning"
167 nc->fItsPID = new AliITSpidESD1(parITS);
174 //_____________________________________________________________________________
175 AliVertexer* AliITSReconstructor::CreateVertexer() const
177 // create a ITS vertexer
179 TString selectedVertexer = GetOption();
180 if(selectedVertexer.Contains("ions") || selectedVertexer.Contains("IONS")){
181 Info("CreateVertexer","a AliITSVertexerIons object has been selected\n");
182 return new AliITSVertexerIons();
184 if(selectedVertexer.Contains("smear") || selectedVertexer.Contains("SMEAR")){
185 Double_t smear[3]={0.005,0.005,0.01};
186 Info("CreateVertexer","a AliITSVertexerFast object has been selected\n");
187 return new AliITSVertexerFast(smear);
189 if(selectedVertexer.Contains("vertexerz") || selectedVertexer.Contains("VERTEXERZ")){
190 Info("CreateVertexer","a AliITSVertexerZ object has been selected\n");
191 return new AliITSVertexerZ();
193 if(selectedVertexer.Contains("cosmics") || selectedVertexer.Contains("COSMICS")){
194 Info("CreateVertexer","a AliITSVertexerCosmics object has been selected\n");
195 return new AliITSVertexerCosmics();
197 // by default an AliITSVertexer3D object is instatiated
198 Info("CreateVertexer","a AliITSVertexer3D object has been selected\n");
199 return new AliITSVertexer3D();
202 //_____________________________________________________________________________
203 void AliITSReconstructor::FillESD(TTree * /*digitsTree*/, TTree *clustersTree,
204 AliESDEvent* esd) const
206 // make PID, find V0s and cascade
208 TString selectedPIDmethod = GetOption();
209 if(selectedPIDmethod.Contains("LandauFitPID")){
210 fItsPID->MakePID(clustersTree,esd);
213 fItsPID->MakePID(esd);
217 Error("FillESD","!! cannot do the PID !!\n");