]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSReconstructor.cxx
Fix warnings
[u/mrichter/AliRoot.git] / ITS / AliITSReconstructor.cxx
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
24 #include "Riostream.h"
25 #include "AliITSReconstructor.h"
26 #include "AliRun.h"
27 #include "AliRawReader.h"
28 #include "AliESDEvent.h"
29 #include "AliESDpid.h"
30 #include "AliITSgeom.h"
31 #include "AliITSLoader.h"
32 #include "AliITStrackerMI.h"
33 #include "AliITStrackerV2.h"
34 #include "AliITStrackerSA.h"
35 #include "AliITSVertexerIons.h"
36 #include "AliITSVertexerFast.h"
37 #include "AliITSVertexerFixed.h"
38 #include "AliITSVertexer3D.h"
39 #include "AliITSVertexerZ.h"
40 #include "AliITSVertexerCosmics.h"
41 #include "AliITSInitGeometry.h"
42 #include "AliITSTrackleterSPDEff.h"
43
44
45 ClassImp(AliITSReconstructor)
46
47 //___________________________________________________________________________
48 AliITSReconstructor::AliITSReconstructor() : AliReconstructor(),
49 fDetTypeRec(0)
50 {
51   // Default constructor
52 }
53  //___________________________________________________________________________
54 AliITSReconstructor::~AliITSReconstructor(){
55 // destructor
56   if(fDetTypeRec) delete fDetTypeRec;
57
58 //____________________________________________________________________________
59 void AliITSReconstructor::GetPidSettings(AliESDpid *ESDpid) {
60   //
61   // pass PID settings from AliITSRecoParam to AliESDpid
62   //
63   Int_t pidOpt = GetRecoParam()->GetPID();
64
65   if(pidOpt==1){
66     AliDebug(1,"ITS LandauFitPID option has been selected\n");
67     ESDpid->SetITSPIDmethod(AliESDpid::kITSLikelihood);
68   }
69   else{
70     AliDebug(1,"ITS default PID\n");
71     ESDpid->SetITSPIDmethod(AliESDpid::kITSTruncMean);
72   }
73 }
74 //______________________________________________________________________
75 void AliITSReconstructor::Init() {
76     // Initalize this constructor bet getting/creating the objects
77     // nesseary for a proper ITS reconstruction.
78     // Inputs:
79     //   none.
80     // Output:
81     //   none.
82     // Return:
83     //   none.
84
85     AliITSInitGeometry initgeom;
86     AliITSgeom *geom = initgeom.CreateAliITSgeom();
87     AliInfo(Form("Geometry name: %s",(initgeom.GetGeometryName()).Data()));
88
89     fDetTypeRec = new AliITSDetTypeRec();
90     fDetTypeRec->SetITSgeom(geom);
91     fDetTypeRec->SetDefaults();
92
93     return;
94 }
95
96 //_____________________________________________________________________________
97 void AliITSReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const
98 {
99 // reconstruct clusters
100
101   Int_t cluFindOpt = GetRecoParam()->GetClusterFinder();
102
103   fDetTypeRec->SetTreeAddressD(digitsTree);
104   fDetTypeRec->MakeBranch(clustersTree,"R");
105   fDetTypeRec->SetTreeAddressR(clustersTree);
106   fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,"All",cluFindOpt);    
107 }
108
109 //_________________________________________________________________
110 void AliITSReconstructor::Reconstruct(AliRawReader* rawReader, TTree *clustersTree) const
111 {
112   // reconstruct clusters from raw data
113  
114   fDetTypeRec->SetDefaultClusterFindersV2(kTRUE);
115   fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree);
116 }
117 //_____________________________________________________________________________
118 AliTracker* AliITSReconstructor::CreateTrackleter() const
119 {
120 // create the SPD trackeleter (for SPD PlaneEfficiency evaluation)
121   if(!GetRecoParam()->GetComputePlaneEff() || !GetRecoParam()->GetUseTrackletsPlaneEff()) return NULL;
122   //Int_t trackerOpt = GetRecoParam()->GetTracker();
123   AliTracker* trackleter;
124   trackleter = new AliITSTrackleterSPDEff();
125   AliITSTrackleterSPDEff *spdtrackleter=(AliITSTrackleterSPDEff*)trackleter;
126   // here set cuts (from RecoParam)
127   if(GetRecoParam()->GetBkgTrackletsPlaneEff()) spdtrackleter->SetReflectClusterAroundZAxisForLayer(1,kTRUE);
128   if(GetRecoParam()->GetMCTrackletsPlaneEff()) spdtrackleter->SetMC();
129   spdtrackleter->SetHistOn();
130   spdtrackleter->SetPhiWindowL2(GetRecoParam()->GetTrackleterPhiWindowL2());
131   spdtrackleter->SetZetaWindowL2(GetRecoParam()->GetTrackleterZetaWindowL2());
132   spdtrackleter->SetPhiWindowL1(GetRecoParam()->GetTrackleterPhiWindowL1());
133   spdtrackleter->SetZetaWindowL1(GetRecoParam()->GetTrackleterZetaWindowL1());
134   if(GetRecoParam()->GetUpdateOncePerEventPlaneEff()) spdtrackleter->SetUpdateOncePerEventPlaneEff();
135   spdtrackleter->SetMinContVtx(GetRecoParam()->GetMinContVtxPlaneEff());
136   return trackleter;
137 }
138
139 //_____________________________________________________________________________
140 AliTracker* AliITSReconstructor::CreateTracker() const
141 {
142 // create a ITS tracker
143
144   Int_t trackerOpt = GetRecoParam()->GetTracker();
145   AliTracker* tracker;    
146   if (trackerOpt==1) {
147     tracker = new AliITStrackerMI(0);
148     AliITStrackerMI *mit=(AliITStrackerMI*)tracker;
149     mit->SetDetTypeRec(fDetTypeRec);
150   }  
151   else if (trackerOpt==2) {
152     tracker = new AliITStrackerV2(0);
153   }
154   else {
155     tracker =  new AliITStrackerSA(0);  // inherits from AliITStrackerMI
156     AliITStrackerSA *sat=(AliITStrackerSA*)tracker;
157     sat->SetDetTypeRec(fDetTypeRec);
158     if(GetRecoParam()->GetTrackerSAOnly()) sat->SetSAFlag(kTRUE);
159     if(sat->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n");
160         if(GetRecoParam()->GetInwardFindingSA()){
161        sat->SetInwardFinding();
162        sat->SetInnerStartLayer(GetRecoParam()->GetInnerStartLayerSA());
163         }else{
164       sat->SetOutwardFinding();
165       sat->SetOuterStartLayer(GetRecoParam()->GetOuterStartLayerSA());
166         }
167     sat->SetMinNPoints(GetRecoParam()->GetMinNPointsSA());
168   }
169
170   return tracker;
171   
172 }
173
174 //_____________________________________________________________________________
175 AliVertexer* AliITSReconstructor::CreateVertexer() const
176 {
177 // create a ITS vertexer
178
179   AliITSVertexer *vptr;
180   Int_t vtxOpt = GetRecoParam()->GetVertexer();
181   if(vtxOpt==3){
182     AliDebug(1,"AliITSVertexerIons has been selected");
183     vptr =  new AliITSVertexerIons();
184   }
185   else if(vtxOpt==4){
186     Double_t smear[3]={GetRecoParam()->GetVertexerFastSmearX(),
187                        GetRecoParam()->GetVertexerFastSmearY(),
188                        GetRecoParam()->GetVertexerFastSmearZ()};
189     AliDebug(1,"AliITSVertexerFast has been selected"); 
190     vptr = new AliITSVertexerFast(smear);
191   }
192   else if(vtxOpt==1){
193     AliDebug(1,"AliITSVertexerZ has been selected");
194     vptr =  new AliITSVertexerZ();
195   }
196   else if(vtxOpt==2){
197     AliDebug(1,"AliITSVertexerCosmics has been selected");
198     vptr = new AliITSVertexerCosmics();
199   }
200   else if(vtxOpt==5){ 
201     AliDebug(1,"Vertex is fixed in the position of the TDI\n");
202     vptr = new AliITSVertexerFixed("TDI");
203   }
204   else if(vtxOpt==6){ 
205     AliDebug(1,"Vertex is fixed in the position of the TED\n");
206     vptr = new AliITSVertexerFixed("TED");
207   }
208   else {
209   // by default an AliITSVertexer3D object is instatiated
210     AliITSVertexer3D*  vtxr = new AliITSVertexer3D();
211     Float_t dzw=GetRecoParam()->GetVertexer3DWideFiducialRegionZ();
212     Float_t drw=GetRecoParam()->GetVertexer3DWideFiducialRegionR();
213     vtxr->SetWideFiducialRegion(dzw,drw);
214     Float_t dzn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionZ();
215     Float_t drn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionR();
216     vtxr->SetNarrowFiducialRegion(dzn,drn);
217     Float_t dphil=GetRecoParam()->GetVertexer3DLooseDeltaPhiCut();
218     Float_t dphit=GetRecoParam()->GetVertexer3DTightDeltaPhiCut();
219     vtxr->SetDeltaPhiCuts(dphil,dphit);
220     Float_t dcacut=GetRecoParam()->GetVertexer3DDCACut();
221     vtxr->SetDCACut(dcacut);
222     Int_t pileupAlgo=GetRecoParam()->GetSPDVertexerPileupAlgo();
223     vtxr->SetPileupAlgo(pileupAlgo);
224     AliDebug(1,Form("AliITSVertexer3D with pileup algo %d has been selected",pileupAlgo));
225     vptr = vtxr;
226   }
227   vptr->SetDetTypeRec(fDetTypeRec);
228   return vptr;
229 }
230
231 //_____________________________________________________________________________
232 void AliITSReconstructor::FillESD(TTree * /*digitsTree*/, TTree * /*clustersTree*/, 
233                                   AliESDEvent* /* esd */) const
234 {
235 // make PID, find V0s and cascade
236 /* Now done in AliESDpid
237   if(fItsPID!=0) fItsPID->MakePID(esd);
238   else AliError("!! cannot do the PID !!");
239 */
240 }