]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFReconstructor.cxx
Update of the class ESDMuonFilter. New marcros for creating AOD with muon information...
[u/mrichter/AliRoot.git] / TOF / AliTOFReconstructor.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 TOF reconstruction                                              //
21 //                                                                           //
22 ///////////////////////////////////////////////////////////////////////////////
23
24 //#include "TFile.h"
25 #include "TObjArray.h"
26 #include "TString.h"
27
28 #include "AliLog.h"
29 #include "AliRawReader.h"
30
31 #include "AliTOFClusterFinder.h"
32 #include "AliTOFcalib.h"
33 #include "AliTOFtrackerMI.h"
34 #include "AliTOFtracker.h"
35 #include "AliTOFtrackerV1.h"
36 #include "AliTOFReconstructor.h"
37
38 class TTree;
39 //class TFile;
40 //class TDirectory;
41
42 class AliESDEvent;
43
44 //extern TDirectory *gDirectory;
45 //extern TFile *gFile;
46
47 ClassImp(AliTOFReconstructor)
48
49  //____________________________________________________________________
50 AliTOFReconstructor::AliTOFReconstructor() 
51   : AliReconstructor(),
52     fTOFcalib(0)
53 {
54 //
55 // ctor
56 //
57   
58   //Retrieving the TOF calibration info  
59   fTOFcalib    = new AliTOFcalib();
60   fTOFcalib->CreateCalArrays();
61   if(!fTOFcalib->ReadParOnlineFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}  
62   if(!fTOFcalib->ReadParOfflineFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}  
63 }
64
65 //------------------------------------------------------------------------
66 AliTOFReconstructor::AliTOFReconstructor(const AliTOFReconstructor &source)
67   : AliReconstructor(),
68     fTOFcalib(0)
69 {
70 //
71 // copy ctor
72 //
73   this->fTOFcalib=source.fTOFcalib;
74 }
75
76 //------------------------------------------------------------------------
77 AliTOFReconstructor & AliTOFReconstructor::operator=(const AliTOFReconstructor &source)
78 {
79 //
80 // assignment op.
81 //
82   this->fTOFcalib=source.fTOFcalib;
83   return *this;
84 }
85 //_____________________________________________________________________________
86 AliTOFReconstructor::~AliTOFReconstructor() 
87 {
88 //
89 // dtor
90 //
91   delete fTOFcalib;
92 }
93
94 //_____________________________________________________________________________
95 void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader,
96                                       TTree *clustersTree) const
97 {
98 // reconstruct clusters from Raw Data
99
100   static AliTOFClusterFinder tofClus(fTOFcalib);
101   tofClus.Digits2RecPoints(rawReader, clustersTree);
102
103 }
104
105 //_____________________________________________________________________________
106 void AliTOFReconstructor::Reconstruct(TTree *digitsTree,
107                                       TTree *clustersTree) const
108 {
109 // reconstruct clusters from Raw Data
110
111   AliDebug(2,Form("Global Event loop mode: Creating Recpoints from Digits Tree")); 
112   static AliTOFClusterFinder tofClus(fTOFcalib);
113   tofClus.Digits2RecPoints(digitsTree, clustersTree);
114
115 }
116 //_____________________________________________________________________________
117   void AliTOFReconstructor::ConvertDigits(AliRawReader* reader, TTree* digitsTree) const
118 {
119 // reconstruct clusters from digits
120
121   AliDebug(2,Form("Global Event loop mode: Converting Raw Data to a Digits Tree")); 
122   AliTOFClusterFinder tofClus(fTOFcalib);
123   tofClus.Raw2Digits(reader, digitsTree);
124
125 }
126
127 //_____________________________________________________________________________
128 AliTracker* AliTOFReconstructor::CreateTracker() const
129 {
130 // create a TOF tracker
131
132   TString selectedTracker = GetOption();
133   // use MI tracker if selected
134   if (selectedTracker.Contains("MI")) return new AliTOFtrackerMI();
135   if (selectedTracker.Contains("V1")) return new AliTOFtrackerV1();
136   return new AliTOFtracker();
137 }
138