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