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 ///////////////////////////////////////////////////////////////////////////////
27 #include "AliRawReader.h"
29 #include "AliTOFClusterFinder.h"
30 #include "AliTOFcalib.h"
31 #include "AliTOFtrackerMI.h"
32 #include "AliTOFtracker.h"
33 #include "AliTOFtrackerV1.h"
34 #include "AliTOFReconstructor.h"
40 extern TDirectory *gDirectory;
43 ClassImp(AliTOFReconstructor)
45 //____________________________________________________________________
46 AliTOFReconstructor::AliTOFReconstructor()
53 //Retrieving the TOF calibration info
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);}
60 //------------------------------------------------------------------------
61 AliTOFReconstructor::AliTOFReconstructor(const AliTOFReconstructor &source)
68 this->fTOFcalib=source.fTOFcalib;
71 //------------------------------------------------------------------------
72 AliTOFReconstructor & AliTOFReconstructor::operator=(const AliTOFReconstructor &source)
77 this->fTOFcalib=source.fTOFcalib;
80 //_____________________________________________________________________________
81 AliTOFReconstructor::~AliTOFReconstructor()
89 //_____________________________________________________________________________
90 void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader,
91 TTree *clustersTree) const
93 // reconstruct clusters from Raw Data
95 AliTOFClusterFinder tofClus(fTOFcalib);
96 tofClus.Digits2RecPoints(rawReader, clustersTree);
100 //_____________________________________________________________________________
101 void AliTOFReconstructor::Reconstruct(TTree *digitsTree,
102 TTree *clustersTree) const
104 // reconstruct clusters from Raw Data
106 AliDebug(2,Form("Global Event loop mode: Creating Recpoints from Digits Tree"));
107 AliTOFClusterFinder tofClus(fTOFcalib);
108 tofClus.Digits2RecPoints(digitsTree, clustersTree);
111 //_____________________________________________________________________________
112 void AliTOFReconstructor::ConvertDigits(AliRawReader* reader, TTree* digitsTree) const
114 // reconstruct clusters from digits
116 AliDebug(2,Form("Global Event loop mode: Converting Raw Data to a Digits Tree"));
117 AliTOFClusterFinder tofClus(fTOFcalib);
118 tofClus.Raw2Digits(reader, digitsTree);
122 //_____________________________________________________________________________
123 AliTracker* AliTOFReconstructor::CreateTracker() const
125 // create a TOF tracker
127 TString selectedTracker = GetOption();
128 // use MI tracker if selected
129 if (selectedTracker.Contains("MI")) return new AliTOFtrackerMI();
130 if (selectedTracker.Contains("V1")) return new AliTOFtrackerV1();
131 return new AliTOFtracker();