]>
Commit | Line | Data |
---|---|---|
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" |
6b025efd | 30 | #include "AliCDBManager.h" |
31 | #include "AliCDBEntry.h" | |
d08a92dd | 32 | |
0e46b9ae | 33 | #include "AliTOFClusterFinder.h" |
a98acac1 | 34 | #include "AliTOFcalib.h" |
d88fbf15 | 35 | #include "AliTOFtrackerMI.h" |
0e46b9ae | 36 | #include "AliTOFtracker.h" |
eeef0c5d | 37 | #include "AliTOFtrackerV1.h" |
d08a92dd | 38 | #include "AliTOFReconstructor.h" |
6b025efd | 39 | #include "AliTOFFormatDCS.h" |
121a60bd | 40 | |
0e46b9ae | 41 | class TTree; |
42 | ||
af885e0f | 43 | class AliESDEvent; |
0e46b9ae | 44 | |
45 | extern TDirectory *gDirectory; | |
46 | extern TFile *gFile; | |
47 | ||
121a60bd | 48 | ClassImp(AliTOFReconstructor) |
49 | ||
a98acac1 | 50 | //____________________________________________________________________ |
51 | AliTOFReconstructor::AliTOFReconstructor() | |
52 | : AliReconstructor(), | |
a98acac1 | 53 | fTOFcalib(0) |
54 | { | |
55 | // | |
56 | // ctor | |
57 | // | |
6b025efd | 58 | |
59 | //reading DCS DP processing result | |
60 | ||
61 | AliCDBManager *man = AliCDBManager::Instance(); | |
62 | Char_t *sel = "TOF/Calib/DCSData" ; | |
63 | Char_t out[100]; | |
64 | sprintf(out,"%s",sel); | |
65 | if (!man->Get(out,-1)) { | |
66 | AliInfo("No DCS data found in CDB"); | |
67 | } | |
68 | else{ | |
69 | AliCDBEntry *entry = man->Get(out,-1); | |
70 | if(!entry->GetObject()){ | |
71 | AliInfo("No DCS array found in CDB entry"); | |
72 | } | |
73 | ||
74 | else { | |
75 | TObjArray *array = (TObjArray*)entry->GetObject(); | |
76 | TString alias[4]={"tof_lv_i48","tof_lv_v48","tof_lv_i33","tof_lv_v33"}; | |
77 | for (Int_t jj=0;jj<4;jj++){ | |
78 | AliInfo(Form("Alias = %s",alias[jj].Data())); | |
79 | ||
80 | AliTOFFormatDCS *dcs = (AliTOFFormatDCS*)array->At(jj); | |
81 | for (Int_t i=0;i<3;i++){ | |
82 | AliInfo(Form("set value %i to %f at %f",i,dcs->GetFloat(i),dcs->GetTimeStampFloat(i))); | |
83 | } | |
84 | for (Int_t i=0;i<2;i++){ | |
85 | AliInfo(Form("set variation %i to %f at %f",i,dcs->GetDelta(i),dcs->GetTimeStampDelta(i))); | |
86 | } | |
87 | ||
88 | } | |
89 | } | |
90 | } | |
91 | ||
a98acac1 | 92 | //Retrieving the TOF calibration info |
ba66add8 | 93 | fTOFcalib = new AliTOFcalib(); |
94 | fTOFcalib->CreateCalArrays(); | |
95 | if(!fTOFcalib->ReadParOnlineFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);} | |
96 | if(!fTOFcalib->ReadParOfflineFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);} | |
a98acac1 | 97 | } |
98 | ||
99 | //------------------------------------------------------------------------ | |
100 | AliTOFReconstructor::AliTOFReconstructor(const AliTOFReconstructor &source) | |
101 | : AliReconstructor(), | |
a98acac1 | 102 | fTOFcalib(0) |
103 | { | |
104 | // | |
105 | // copy ctor | |
106 | // | |
a98acac1 | 107 | this->fTOFcalib=source.fTOFcalib; |
108 | } | |
109 | ||
110 | //------------------------------------------------------------------------ | |
111 | AliTOFReconstructor & AliTOFReconstructor::operator=(const AliTOFReconstructor &source) | |
112 | { | |
113 | // | |
114 | // assignment op. | |
115 | // | |
a98acac1 | 116 | this->fTOFcalib=source.fTOFcalib; |
117 | return *this; | |
118 | } | |
119 | //_____________________________________________________________________________ | |
120 | AliTOFReconstructor::~AliTOFReconstructor() | |
121 | { | |
122 | // | |
123 | // dtor | |
124 | // | |
a98acac1 | 125 | delete fTOFcalib; |
126 | } | |
127 | ||
d08a92dd | 128 | //_____________________________________________________________________________ |
129 | void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader, | |
130 | TTree *clustersTree) const | |
131 | { | |
132 | // reconstruct clusters from Raw Data | |
133 | ||
a98acac1 | 134 | AliTOFClusterFinder tofClus(fTOFcalib); |
d08a92dd | 135 | tofClus.Digits2RecPoints(rawReader, clustersTree); |
121a60bd | 136 | |
137 | } | |
138 | ||
a98acac1 | 139 | //_____________________________________________________________________________ |
140 | void AliTOFReconstructor::Reconstruct(TTree *digitsTree, | |
141 | TTree *clustersTree) const | |
142 | { | |
143 | // reconstruct clusters from Raw Data | |
144 | ||
145 | AliDebug(2,Form("Global Event loop mode: Creating Recpoints from Digits Tree")); | |
146 | AliTOFClusterFinder tofClus(fTOFcalib); | |
147 | tofClus.Digits2RecPoints(digitsTree, clustersTree); | |
148 | ||
149 | } | |
150 | //_____________________________________________________________________________ | |
151 | void AliTOFReconstructor::ConvertDigits(AliRawReader* reader, TTree* digitsTree) const | |
152 | { | |
153 | // reconstruct clusters from digits | |
154 | ||
155 | AliDebug(2,Form("Global Event loop mode: Converting Raw Data to a Digits Tree")); | |
156 | AliTOFClusterFinder tofClus(fTOFcalib); | |
157 | tofClus.Raw2Digits(reader, digitsTree); | |
158 | ||
159 | } | |
160 | ||
121a60bd | 161 | //_____________________________________________________________________________ |
d76c31f4 | 162 | AliTracker* AliTOFReconstructor::CreateTracker() const |
121a60bd | 163 | { |
164 | // create a TOF tracker | |
165 | ||
d88fbf15 | 166 | TString selectedTracker = GetOption(); |
167 | // use MI tracker if selected | |
bc9f08da | 168 | if (selectedTracker.Contains("MI")) return new AliTOFtrackerMI(); |
eeef0c5d | 169 | if (selectedTracker.Contains("V1")) return new AliTOFtrackerV1(); |
bc9f08da | 170 | return new AliTOFtracker(); |
121a60bd | 171 | } |
172 |