1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // class for TOF reconstruction //
22 ///////////////////////////////////////////////////////////////////////////////
25 #include "TObjArray.h"
29 #include "AliRawReader.h"
31 #include "AliTOFClusterFinder.h"
32 #include "AliTOFcalib.h"
33 #include "AliTOFtrackerMI.h"
34 #include "AliTOFtracker.h"
35 #include "AliTOFtrackerV1.h"
36 #include "AliTOFReconstructor.h"
44 //extern TDirectory *gDirectory;
45 //extern TFile *gFile;
47 ClassImp(AliTOFReconstructor)
49 //____________________________________________________________________
50 AliTOFReconstructor::AliTOFReconstructor()
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);}
65 //------------------------------------------------------------------------
66 AliTOFReconstructor::AliTOFReconstructor(const AliTOFReconstructor &source)
73 this->fTOFcalib=source.fTOFcalib;
76 //------------------------------------------------------------------------
77 AliTOFReconstructor & AliTOFReconstructor::operator=(const AliTOFReconstructor &source)
82 this->fTOFcalib=source.fTOFcalib;
85 //_____________________________________________________________________________
86 AliTOFReconstructor::~AliTOFReconstructor()
94 //_____________________________________________________________________________
95 void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader,
96 TTree *clustersTree) const
98 // reconstruct clusters from Raw Data
100 AliTOFClusterFinder tofClus(fTOFcalib);
101 tofClus.Digits2RecPoints(rawReader, clustersTree);
105 //_____________________________________________________________________________
106 void AliTOFReconstructor::Reconstruct(TTree *digitsTree,
107 TTree *clustersTree) const
109 // reconstruct clusters from Raw Data
111 AliDebug(2,Form("Global Event loop mode: Creating Recpoints from Digits Tree"));
112 AliTOFClusterFinder tofClus(fTOFcalib);
113 tofClus.Digits2RecPoints(digitsTree, clustersTree);
116 //_____________________________________________________________________________
117 void AliTOFReconstructor::ConvertDigits(AliRawReader* reader, TTree* digitsTree) const
119 // reconstruct clusters from digits
121 AliDebug(2,Form("Global Event loop mode: Converting Raw Data to a Digits Tree"));
122 AliTOFClusterFinder tofClus(fTOFcalib);
123 tofClus.Raw2Digits(reader, digitsTree);
127 //_____________________________________________________________________________
128 AliTracker* AliTOFReconstructor::CreateTracker() const
130 // create a TOF tracker
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();