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