]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDReconstructor.cxx
Fix for 64-bit platforms
[u/mrichter/AliRoot.git] / TRD / AliTRDReconstructor.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// //
4fad09c9 20// Class for TRD reconstruction //
121a60bd 21// //
22///////////////////////////////////////////////////////////////////////////////
23
e3b2b5e5 24#include <TFile.h>
121a60bd 25
121a60bd 26#include "AliRunLoader.h"
3bc9d03e 27#include "AliRawReader.h"
28#include "AliLog.h"
3bc9d03e 29#include "AliESDTrdTrack.h"
30#include "AliESD.h"
31
32#include "AliTRDReconstructor.h"
121a60bd 33#include "AliTRDclusterizerV1.h"
34#include "AliTRDtracker.h"
b0f03c34 35#include "AliTRDpidESD.h"
e3b2b5e5 36#include "AliTRDgtuTrack.h"
a8fbb161 37#include "AliTRDrawData.h"
38#include "AliTRDdigitsManager.h"
121a60bd 39
40ClassImp(AliTRDReconstructor)
41
3bc9d03e 42Bool_t AliTRDReconstructor::fgkSeedingOn = kFALSE;
43Int_t AliTRDReconstructor::fgStreamLevel = 0; // Stream (debug) level
0397ce53 44
121a60bd 45//_____________________________________________________________________________
a8fbb161 46void AliTRDReconstructor::ConvertDigits(AliRawReader *rawReader
47 , TTree *digitsTree) const
121a60bd 48{
3bc9d03e 49 //
25ca55ce 50 // Convert raw data digits into digit objects in a root tree
3bc9d03e 51 //
121a60bd 52
a8fbb161 53 AliTRDrawData rawData;
54 AliTRDdigitsManager *manager = rawData.Raw2Digits(rawReader);
55 manager->MakeBranch(digitsTree);
56 manager->WriteDigits();
0ee00e25 57
121a60bd 58}
59
60//_____________________________________________________________________________
3bc9d03e 61void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader
62 , AliRawReader *rawReader) const
928e9fae 63{
3bc9d03e 64 //
65 // Reconstruct clusters
66 //
928e9fae 67
68 AliInfo("Reconstruct TRD clusters from RAW data");
69
3bc9d03e 70 AliLoader *loader = runLoader->GetLoader("TRDLoader");
928e9fae 71 loader->LoadRecPoints("recreate");
72
928e9fae 73 runLoader->CdGAFile();
928e9fae 74 Int_t nEvents = runLoader->GetNumberOfEvents();
75
76 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
77 if (!rawReader->NextEvent()) break;
3bc9d03e 78 AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
79 clusterer.Open(runLoader->GetFileName(),iEvent);
928e9fae 80 clusterer.ReadDigits(rawReader);
81 clusterer.MakeClusters();
82 clusterer.WriteClusters(-1);
83 }
84
85 loader->UnloadRecPoints();
0ee00e25 86
25ca55ce 87}
a8fbb161 88
25ca55ce 89//_____________________________________________________________________________
90void AliTRDReconstructor::Reconstruct(AliRawReader *rawReader
91 , TTree *clusterTree) const
92{
93 //
94 // Reconstruct clusters
95 //
96
97 AliInfo("Reconstruct TRD clusters from RAW data");
98
99 AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
100 clusterer.OpenOutput(clusterTree);
101 clusterer.ReadDigits(rawReader);
102 clusterer.MakeClusters();
25ca55ce 103
25ca55ce 104}
105
106//_____________________________________________________________________________
a8fbb161 107void AliTRDReconstructor::Reconstruct(TTree *digitsTree
108 , TTree *clusterTree) const
25ca55ce 109{
110 //
111 // Reconstruct clusters
112 //
113
114 AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
115 clusterer.OpenOutput(clusterTree);
116 clusterer.ReadDigits(digitsTree);
117 clusterer.MakeClusters();
25ca55ce 118
25ca55ce 119}
120
121//_____________________________________________________________________________
122void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader) const
123{
124 //
125 // Reconstruct clusters
126 //
127
128 AliLoader *loader = runLoader->GetLoader("TRDLoader");
129 loader->LoadRecPoints("recreate");
130
131 runLoader->CdGAFile();
132 Int_t nEvents = runLoader->GetNumberOfEvents();
133
134 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
135 AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
136 clusterer.Open(runLoader->GetFileName(),iEvent);
137 clusterer.ReadDigits();
138 clusterer.MakeClusters();
139 clusterer.WriteClusters(-1);
140 }
141
142 loader->UnloadRecPoints();
143
928e9fae 144}
145
146//_____________________________________________________________________________
3bc9d03e 147AliTracker *AliTRDReconstructor::CreateTracker(AliRunLoader *runLoader) const
121a60bd 148{
3bc9d03e 149 //
150 // Create a TRD tracker
151 //
121a60bd 152
153 runLoader->CdGAFile();
3bc9d03e 154
121a60bd 155 return new AliTRDtracker(gFile);
3bc9d03e 156
121a60bd 157}
158
25ca55ce 159//_____________________________________________________________________________
160void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/
161 , AliRawReader* /*rawReader*/
162 , AliESD *esd) const
163{
164 //
165 // Make PID
166 //
167
168 AliTRDpidESD trdPID;
169 trdPID.MakePID(esd);
170
25ca55ce 171}
172
173//_____________________________________________________________________________
174void AliTRDReconstructor::FillESD(AliRawReader* /*rawReader*/
175 , TTree* /*clusterTree*/
176 , AliESD *esd) const
177{
178 //
179 // Make PID
180 //
181
182 AliTRDpidESD trdPID;
183 trdPID.MakePID(esd);
184
25ca55ce 185}
186
187//_____________________________________________________________________________
188void AliTRDReconstructor::FillESD(TTree* /*digitsTree*/
189 , TTree* /*clusterTree*/
190 , AliESD *esd) const
191{
192 //
193 // Make PID
194 //
195
196 AliTRDpidESD trdPID;
197 trdPID.MakePID(esd);
198
25ca55ce 199}
200
121a60bd 201//_____________________________________________________________________________
36698bd7 202void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/
c965eab1 203 , AliESD *esd) const
121a60bd 204{
3bc9d03e 205 //
206 // Make PID
207 //
b0f03c34 208
b52cb1b6 209 AliTRDpidESD trdPID;
b0f03c34 210 trdPID.MakePID(esd);
0ee00e25 211
121a60bd 212}