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 ///////////////////////////////////////////////////////////////////////////////
26 #include "TObjArray.h"
30 #include "AliRawReader.h"
32 #include "AliTOFClusterFinder.h"
33 #include "AliTOFcalib.h"
34 #include "AliTOFtrackerMI.h"
35 #include "AliTOFtracker.h"
36 #include "AliTOFtrackerV1.h"
37 #include "AliTOFReconstructor.h"
45 //extern TDirectory *gDirectory;
46 //extern TFile *gFile;
48 ClassImp(AliTOFReconstructor)
50 //____________________________________________________________________
51 AliTOFReconstructor::AliTOFReconstructor()
59 //Retrieving the TOF calibration info
60 fTOFcalib = new AliTOFcalib();
61 fTOFcalib->CreateCalArrays();
62 if(!fTOFcalib->ReadParOnlineFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}
63 if(!fTOFcalib->ReadParOfflineFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}
66 //------------------------------------------------------------------------
67 AliTOFReconstructor::AliTOFReconstructor(const AliTOFReconstructor &source)
74 this->fTOFcalib=source.fTOFcalib;
77 //------------------------------------------------------------------------
78 AliTOFReconstructor & AliTOFReconstructor::operator=(const AliTOFReconstructor &source)
83 this->fTOFcalib=source.fTOFcalib;
86 //_____________________________________________________________________________
87 AliTOFReconstructor::~AliTOFReconstructor()
95 //_____________________________________________________________________________
96 void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader,
97 TTree *clustersTree) const
99 // reconstruct clusters from Raw Data
101 static AliTOFClusterFinder tofClus(fTOFcalib);
102 tofClus.Digits2RecPoints(rawReader, clustersTree);
106 //_____________________________________________________________________________
107 void AliTOFReconstructor::Reconstruct(TTree *digitsTree,
108 TTree *clustersTree) const
110 // reconstruct clusters from Raw Data
112 AliDebug(2,Form("Global Event loop mode: Creating Recpoints from Digits Tree"));
113 static AliTOFClusterFinder tofClus(fTOFcalib);
114 tofClus.Digits2RecPoints(digitsTree, clustersTree);
117 //_____________________________________________________________________________
118 void AliTOFReconstructor::ConvertDigits(AliRawReader* reader, TTree* digitsTree) const
120 // reconstruct clusters from digits
122 AliDebug(2,Form("Global Event loop mode: Converting Raw Data to a Digits Tree"));
123 AliTOFClusterFinder tofClus(fTOFcalib);
124 tofClus.Raw2Digits(reader, digitsTree);
128 //_____________________________________________________________________________
129 AliTracker* AliTOFReconstructor::CreateTracker() const
131 // create a TOF tracker
133 TString selectedTracker = GetOption();
134 // use MI tracker if selected
135 if (selectedTracker.Contains("MI")) return new AliTOFtrackerMI();
136 if (selectedTracker.Contains("V1")) return new AliTOFtrackerV1();
137 return new AliTOFtracker();