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