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 TRD reconstruction //
22 ///////////////////////////////////////////////////////////////////////////////
26 #include "AliRunLoader.h"
27 #include "AliRawReader.h"
29 #include "AliESDTrdTrack.h"
32 #include "AliTRDReconstructor.h"
33 #include "AliTRDclusterizerV1.h"
34 #include "AliTRDtracker.h"
35 #include "AliTRDpidESD.h"
36 #include "AliTRDgtuTrack.h"
37 #include "AliTRDrawData.h"
38 #include "AliTRDdigitsManager.h"
40 ClassImp(AliTRDReconstructor)
42 Bool_t AliTRDReconstructor::fgkSeedingOn = kFALSE;
43 Int_t AliTRDReconstructor::fgStreamLevel = 0; // Stream (debug) level
45 //_____________________________________________________________________________
46 void AliTRDReconstructor::ConvertDigits(AliRawReader *rawReader
47 , TTree *digitsTree) const
50 // Convert raw data digits into digit objects in a root tree
53 AliTRDrawData rawData;
54 AliTRDdigitsManager *manager = rawData.Raw2Digits(rawReader);
55 manager->MakeBranch(digitsTree);
56 manager->WriteDigits();
60 //_____________________________________________________________________________
61 void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader
62 , AliRawReader *rawReader) const
65 // Reconstruct clusters
68 AliInfo("Reconstruct TRD clusters from RAW data");
70 AliLoader *loader = runLoader->GetLoader("TRDLoader");
71 loader->LoadRecPoints("recreate");
73 runLoader->CdGAFile();
74 Int_t nEvents = runLoader->GetNumberOfEvents();
76 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
77 if (!rawReader->NextEvent()) break;
78 AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
79 clusterer.Open(runLoader->GetFileName(),iEvent);
80 clusterer.ReadDigits(rawReader);
81 clusterer.MakeClusters();
82 clusterer.WriteClusters(-1);
85 loader->UnloadRecPoints();
89 //_____________________________________________________________________________
90 void AliTRDReconstructor::Reconstruct(AliRawReader *rawReader
91 , TTree *clusterTree) const
94 // Reconstruct clusters
97 AliInfo("Reconstruct TRD clusters from RAW data");
99 AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
100 clusterer.OpenOutput(clusterTree);
101 clusterer.ReadDigits(rawReader);
102 clusterer.MakeClusters();
106 //_____________________________________________________________________________
107 void AliTRDReconstructor::Reconstruct(TTree *digitsTree
108 , TTree *clusterTree) const
111 // Reconstruct clusters
114 AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
115 clusterer.OpenOutput(clusterTree);
116 clusterer.ReadDigits(digitsTree);
117 clusterer.MakeClusters();
121 //_____________________________________________________________________________
122 void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader) const
125 // Reconstruct clusters
128 AliLoader *loader = runLoader->GetLoader("TRDLoader");
129 loader->LoadRecPoints("recreate");
131 runLoader->CdGAFile();
132 Int_t nEvents = runLoader->GetNumberOfEvents();
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);
142 loader->UnloadRecPoints();
146 //_____________________________________________________________________________
147 AliTracker *AliTRDReconstructor::CreateTracker(AliRunLoader *runLoader) const
150 // Create a TRD tracker
153 runLoader->CdGAFile();
155 return new AliTRDtracker(gFile);
159 //_____________________________________________________________________________
160 void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/
161 , AliRawReader* /*rawReader*/
173 //_____________________________________________________________________________
174 void AliTRDReconstructor::FillESD(AliRawReader* /*rawReader*/
175 , TTree* /*clusterTree*/
187 //_____________________________________________________________________________
188 void AliTRDReconstructor::FillESD(TTree* /*digitsTree*/
189 , TTree* /*clusterTree*/
201 //_____________________________________________________________________________
202 void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/