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 ///////////////////////////////////////////////////////////////////////////////
25 #include "AliTRDReconstructor.h"
26 #include "AliRunLoader.h"
27 #include "AliTRDparameter.h"
28 #include "AliTRDclusterizerV1.h"
29 #include "AliTRDtracker.h"
30 #include "AliTRDpidESD.h"
32 #include "AliRawReader.h"
35 ClassImp(AliTRDReconstructor)
38 //_____________________________________________________________________________
39 void AliTRDReconstructor::Reconstruct(AliRunLoader* runLoader) const
41 // reconstruct clusters
43 AliLoader *loader=runLoader->GetLoader("TRDLoader");
44 loader->LoadRecPoints("recreate");
46 AliTRDclusterizerV1 clusterer("clusterer", "TRD clusterizer");
47 runLoader->CdGAFile();
48 AliTRDparameter* trdParam = GetTRDparameter(runLoader);
50 Error("Reconstruct", "no TRD parameters found");
54 clusterer.SetParameter(trdParam);
55 Int_t nEvents = runLoader->GetNumberOfEvents();
57 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
58 clusterer.Open(runLoader->GetFileName(), iEvent);
59 clusterer.ReadDigits();
60 clusterer.MakeClusters();
61 clusterer.WriteClusters(-1);
64 loader->UnloadRecPoints();
67 //_____________________________________________________________________________
68 void AliTRDReconstructor::Reconstruct(AliRunLoader* runLoader,
69 AliRawReader* rawReader) const
71 // reconstruct clusters
73 AliInfo("Reconstruct TRD clusters from RAW data");
75 AliLoader *loader=runLoader->GetLoader("TRDLoader");
76 loader->LoadRecPoints("recreate");
78 AliTRDclusterizerV1 clusterer("clusterer", "TRD clusterizer");
79 runLoader->CdGAFile();
80 AliTRDparameter* trdParam = GetTRDparameter(runLoader);
82 Error("Reconstruct", "no TRD parameters found");
86 clusterer.SetParameter(trdParam);
87 Int_t nEvents = runLoader->GetNumberOfEvents();
89 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
90 if (!rawReader->NextEvent()) break;
91 clusterer.Open(runLoader->GetFileName(), iEvent);
92 clusterer.ReadDigits(rawReader);
93 clusterer.MakeClusters();
94 clusterer.WriteClusters(-1);
97 loader->UnloadRecPoints();
100 //_____________________________________________________________________________
101 AliTracker* AliTRDReconstructor::CreateTracker(AliRunLoader* runLoader) const
103 // create a TRD tracker
105 runLoader->CdGAFile();
106 return new AliTRDtracker(gFile);
109 //_____________________________________________________________________________
110 void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/,
115 Double_t parTRD[] = {
116 280., // Min. Ionizing Particle signal. Check it !!!
117 0.23, // relative resolution Check it !!!
118 10. // PID range (in sigmas)
120 AliTRDpidESD trdPID(parTRD);
125 //_____________________________________________________________________________
126 AliTRDparameter* AliTRDReconstructor::GetTRDparameter(AliRunLoader* runLoader) const
128 // get the TRD parameters
130 runLoader->CdGAFile();
131 AliTRDparameter* trdParam = (AliTRDparameter*) gFile->Get("TRDparameter");
133 Error("GetTRDparameter", "no TRD parameters available");