]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/STEER/AliReconstructor.cxx
Possibility to alias some params to others
[u/mrichter/AliRoot.git] / STEER / STEER / AliReconstructor.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 // base class for reconstruction algorithms                                  //
21 //                                                                           //
22 // Derived classes should implement a default constructor and                //
23 // the virtual methods                                                       //
24 // - Reconstruct : to perform the local reconstruction for all events        //
25 // - FillESD     : to fill the ESD for the current event                     //
26 //                                                                           //
27 // The reconstructor classes for the barrel detectors should in addition     //
28 // implement the method                                                      //
29 // - CreateTracker : to create a tracker object for the barrel detector      //
30 //                                                                           //
31 // The ITS reconstructor should in addition implement the method             //
32 // - CreateVertexer : to create an object for the vertex finding             //
33 //                                                                           //
34 ///////////////////////////////////////////////////////////////////////////////
35
36
37 #include "AliLog.h"
38 #include "AliReconstructor.h"
39 #include <TClass.h>
40 #include <TString.h>
41
42
43 ClassImp(AliReconstructor)
44
45 const AliDetectorRecoParam* AliReconstructor::fgRecoParam[AliReconstruction::kNDetectors] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL
46 // #ifdef MFT_UPGRADE
47 //                                                                                           ,NULL
48 // #endif       
49                                                                                              ,NULL    // AU
50 };
51
52 //_____________________________________________________________________________
53 void AliReconstructor::ConvertDigits(AliRawReader* /*rawReader*/, 
54                                      TTree* /*digitsTree*/) const
55 {
56 // convert raw data digits into digit objects in a root tree
57
58   AliError("conversion of raw data digits into digit objects not implemented");
59 }
60
61
62 //_____________________________________________________________________________
63 void AliReconstructor::Reconstruct(TTree* /*digitsTree*/,
64                                    TTree* /*clustersTree*/) const
65 {
66 // run the local reconstruction
67
68   AliError("local event reconstruction not implemented");
69 }
70
71 //_____________________________________________________________________________
72 void AliReconstructor::Reconstruct(AliRawReader* /*rawReader*/, 
73                                    TTree* /*clustersTree*/) const
74 {
75 // run the local reconstruction with raw data input
76
77   AliError("local event reconstruction not implemented for raw data input");
78 }
79
80 //_____________________________________________________________________________
81 void AliReconstructor::FillESD(TTree* /*digitsTree*/, TTree* /*clustersTree*/,
82                                AliESDEvent* /*esd*/) const
83 {
84 // fill the ESD.
85 // by default nothing is done
86
87 }
88
89 //_____________________________________________________________________________
90 void AliReconstructor::FillESD(AliRawReader* /*rawReader*/, 
91                                TTree* clustersTree, AliESDEvent* esd) const
92 {
93 // fill the ESD in case of raw data input.
94 // by default the FillESD method for MC is called
95
96   FillESD((TTree*)NULL, clustersTree, esd);
97 }
98
99 //_____________________________________________________________________________
100 const char* AliReconstructor::GetDetectorName() const
101 {
102 // get the name of the detector
103
104   static TString detName;
105   detName = GetName();
106   detName.Remove(0, 3);
107   detName.Remove(detName.Index("Reconstructor"));
108   detName.ReplaceAll("Upgrade","");
109   return detName.Data();
110 }
111
112 //_____________________________________________________________________________
113 void AliReconstructor::SetRecoParam(const AliDetectorRecoParam *par)
114 {
115   // To be implemented by the detectors.
116   // As soon as we manage to remove the static members
117   // and method in the detector reconstructors, we will
118   // implemented this method in the base class and remove
119   // the detectors implementations.
120   Int_t iDet = AliReconstruction::GetDetIndex(GetDetectorName());
121
122   if (iDet >= 0)
123     fgRecoParam[iDet] = par;
124   else
125     AliError(Form("Invalid detector index for (%s)",GetDetectorName()));
126
127   return;
128 }
129
130 //_____________________________________________________________________________
131 const AliDetectorRecoParam* AliReconstructor::GetRecoParam(Int_t iDet)
132 {
133   // Get the current reconstruciton parameters
134   // for a given detector 
135   if (iDet >= 0 && iDet < AliReconstruction::kNDetectors)
136     return fgRecoParam[iDet];
137   else {
138     AliErrorClass(Form("Invalid detector index (%d)",iDet));
139     return NULL;
140   }
141 }
142
143 //_____________________________________________________________________________
144 void AliReconstructor::GetPidSettings(AliESDpid */*esdPID*/) {
145   //
146   // Function to set Pid settings in esdPID
147   // based on detector-specific AliRecoParams
148   // to be implemented by detectors separately (e.g TOF)
149   // 
150   return;
151 }