]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/ITSbase/AliITSReconstructor.cxx
remove obsolete class
[u/mrichter/AliRoot.git] / ITS / ITSbase / 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 "AliITSVertexerFast.h"
36 #include "AliITSVertexerFixed.h"
37 #include "AliITSVertexer3D.h"
38 #include "AliITSVertexerZ.h"
39 #include "AliITSVertexerZD.h"
40 #include "AliITSVertexerCosmics.h"
41 #include "AliITSInitGeometry.h"
42 #include "AliITSMultReconstructor.h"
43
44 ClassImp(AliITSReconstructor)
45
46 //___________________________________________________________________________
47 AliITSReconstructor::AliITSReconstructor() : AliReconstructor(),
48 fDetTypeRec(0)
49 {
50   // Default constructor
51 }
52  //___________________________________________________________________________
53 AliITSReconstructor::~AliITSReconstructor(){
54 // destructor
55   if(fDetTypeRec) delete fDetTypeRec;
56
57 //____________________________________________________________________________
58 void AliITSReconstructor::GetPidSettings(AliESDpid *ESDpid) {
59   //
60   // pass PID settings from AliITSRecoParam to AliESDpid
61   //
62   Int_t pidOpt = GetRecoParam()->GetPID();
63
64   if(pidOpt==1){
65     AliDebug(1,"ITS LandauFitPID option has been selected\n");
66     ESDpid->SetITSPIDmethod(AliESDpid::kITSLikelihood);
67   }
68   else{
69     AliDebug(1,"ITS default PID\n");
70     ESDpid->SetITSPIDmethod(AliESDpid::kITSTruncMean);
71   }
72 }
73 //______________________________________________________________________
74 void AliITSReconstructor::Init() {
75     // Initalize this constructor bet getting/creating the objects
76     // nesseary for a proper ITS reconstruction.
77     // Inputs:
78     //   none.
79     // Output:
80     //   none.
81     // Return:
82     //   none.
83
84     AliITSInitGeometry initgeom;
85     AliITSgeom *geom = initgeom.CreateAliITSgeom();
86     AliInfo(Form("Geometry name: %s",(initgeom.GetGeometryName()).Data()));
87
88     fDetTypeRec = new AliITSDetTypeRec();
89     fDetTypeRec->SetITSgeom(geom);
90     fDetTypeRec->SetDefaults();
91
92     return;
93 }
94
95 //_____________________________________________________________________________
96 void AliITSReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const
97 {
98 // reconstruct clusters
99
100   TString recopt = GetRecoParam()->GetOptReco();
101   fDetTypeRec->SetTreeAddressD(digitsTree);
102   fDetTypeRec->MakeBranch(clustersTree,"R");
103   fDetTypeRec->SetTreeAddressR(clustersTree);
104   fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,recopt.Data(),1);    
105 }
106
107 //_________________________________________________________________
108 void AliITSReconstructor::Reconstruct(AliRawReader* rawReader, TTree *clustersTree) const
109 {
110   // reconstruct clusters from raw data
111   TString recopt = GetRecoParam()->GetOptReco();
112   fDetTypeRec->SetDefaultClusterFindersV2(kTRUE,kTRUE);
113   fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree,recopt.Data());
114 }
115
116 //_____________________________________________________________________________
117 AliTrackleter* AliITSReconstructor::CreateMultFinder() const
118 {
119   // create the SPD trackeleter for mult. reconstruction
120   AliITSMultReconstructor* multReco = new AliITSMultReconstructor();
121   multReco->SetHistOn(kFALSE);
122   multReco->SetDetTypeRec(fDetTypeRec);
123   return multReco;
124 }
125
126 //_____________________________________________________________________________
127 AliTracker* AliITSReconstructor::CreateTracker() const
128 {
129 // create a ITS tracker
130
131   Int_t trackerOpt = GetRecoParam()->GetTracker();
132   AliTracker* tracker;    
133   if (trackerOpt==1) {
134     tracker = new AliITStrackerMI(0);
135     AliITStrackerMI *mit=(AliITStrackerMI*)tracker;
136     mit->SetDetTypeRec(fDetTypeRec);
137   }  
138   else if (trackerOpt==2) {
139     tracker = new AliITStrackerV2(0);
140   }
141   else {
142     tracker =  new AliITStrackerSA(0);  // inherits from AliITStrackerMI
143     AliITStrackerSA *sat=(AliITStrackerSA*)tracker;
144     sat->SetDetTypeRec(fDetTypeRec);
145     if(GetRecoParam()->GetTrackerSAOnly()) sat->SetSAFlag(kTRUE);
146     if(sat->GetSAFlag())AliDebug(1,"Tracking Performed in ITS only\n");
147         if(GetRecoParam()->GetInwardFindingSA()){
148        sat->SetInwardFinding();
149        sat->SetInnerStartLayer(GetRecoParam()->GetInnerStartLayerSA());
150         }else{
151       sat->SetOutwardFinding();
152       sat->SetOuterStartLayer(GetRecoParam()->GetOuterStartLayerSA());
153         }
154     sat->SetMinNPoints(GetRecoParam()->GetMinNPointsSA());
155   }
156
157   return tracker;
158   
159 }
160
161 //_____________________________________________________________________________
162 AliVertexer* AliITSReconstructor::CreateVertexer() const
163 {
164 // create a ITS vertexer
165
166   AliITSVertexer *vptr = NULL;
167   Int_t vtxOpt = GetRecoParam()->GetVertexer();
168   if(vtxOpt==3){
169     AliFatal("Option AliITSVertexerIons is no longer supported");
170     return vptr;
171   }
172   else if(vtxOpt==4){
173     Double_t smear[3]={GetRecoParam()->GetVertexerFastSmearX(),
174                        GetRecoParam()->GetVertexerFastSmearY(),
175                        GetRecoParam()->GetVertexerFastSmearZ()};
176     AliDebug(1,"AliITSVertexerFast has been selected"); 
177     vptr = new AliITSVertexerFast(smear);
178   }
179   else if(vtxOpt==1){
180     AliDebug(1,"AliITSVertexerZ has been selected");
181     AliITSVertexerZ* vtxrz =  new AliITSVertexerZ();
182     Int_t pileupAlgo=GetRecoParam()->GetSPDVertexerPileupAlgo();
183     if(pileupAlgo==3) vtxrz->SetSearchForPileup(kFALSE);
184     vptr = vtxrz;
185   }
186   else if(vtxOpt==2){
187     AliDebug(1,"AliITSVertexerCosmics has been selected");
188     vptr = new AliITSVertexerCosmics();
189   }
190   else if(vtxOpt==5){ 
191     AliDebug(1,"Vertex is fixed in the position of the TDI\n");
192     vptr = new AliITSVertexerFixed("TDI");
193   }
194   else if(vtxOpt==6){ 
195     AliDebug(1,"Vertex is fixed in the position of the TED\n");
196     vptr = new AliITSVertexerFixed("TED");
197   }
198   else if(vtxOpt==7){
199     AliDebug(1,"VertexerZD:  reconstruction of the Z coordinate with SDD \n");
200     AliITSVertexerZD*vtxrz = new AliITSVertexerZD();
201     vtxrz->SetSearchForPileup(kFALSE);
202     vptr = vtxrz;
203   }
204   else {
205   // by default an AliITSVertexer3D object is instatiated
206     AliITSVertexer3D*  vtxr = 
207        new AliITSVertexer3D(GetRecoParam()->GetVertexer3DWideFiducialRegionZ());
208     Float_t dzw=GetRecoParam()->GetVertexer3DWideFiducialRegionZ();
209     Float_t drw=GetRecoParam()->GetVertexer3DWideFiducialRegionR();
210     vtxr->SetWideFiducialRegion(dzw,drw);
211     Float_t dzn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionZ();
212     Float_t drn=GetRecoParam()->GetVertexer3DNarrowFiducialRegionR();
213     vtxr->SetNarrowFiducialRegion(dzn,drn);
214     Float_t dphil=GetRecoParam()->GetVertexer3DLooseDeltaPhiCut();
215     Float_t dphit=GetRecoParam()->GetVertexer3DTightDeltaPhiCut();
216     vtxr->SetDeltaPhiCuts(dphil,dphit);
217     Float_t dcacut=GetRecoParam()->GetVertexer3DDCACut();
218     vtxr->SetDCACut(dcacut);
219     Int_t pileupAlgo=GetRecoParam()->GetSPDVertexerPileupAlgo();
220     vtxr->SetPileupAlgo(pileupAlgo);
221     UChar_t highmultAlgo=GetRecoParam()->GetSPDVertexerHighMultAlgo();
222     vtxr->SetHighMultAlgo(highmultAlgo);
223     AliDebug(1,Form("AliITSVertexer3D with pileup algo %d has been selected",pileupAlgo));
224     vtxr->SetFallBack(500); // fall back to vertexerZ is SPD-0 clusters>500
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 }