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