]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDReconstructor.cxx
09c712dbabf2adfb5b611ae188cfde0254b14d2d
[u/mrichter/AliRoot.git] / TRD / AliTRDReconstructor.cxx
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 TRD reconstruction                                              //
21 //                                                                           //
22 ///////////////////////////////////////////////////////////////////////////////
23
24
25 #include "AliTRDReconstructor.h"
26 #include "AliRunLoader.h"
27 #include "AliTRDparameter.h"
28 #include "AliTRD.h"
29 #include "AliTRDclusterizerV1.h"
30 #include "AliTRDtracker.h"
31 #include <TFile.h>
32
33
34 ClassImp(AliTRDReconstructor)
35
36
37 //_____________________________________________________________________________
38 void AliTRDReconstructor::Reconstruct(AliRunLoader* runLoader) const
39 {
40 // reconstruct clusters
41
42   AliTRDclusterizerV1 clusterer("clusterer", "TRD clusterizer");
43   runLoader->CdGAFile();
44   AliTRDparameter* trdParam = GetTRDparameter(runLoader); 
45   if (!trdParam) {
46     Error("Reconstruct", "no TRD parameters found");
47     return;
48   }
49   trdParam->ReInit();
50   clusterer.SetParameter(trdParam);
51   Int_t nEvents = runLoader->GetNumberOfEvents();
52
53   for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
54     clusterer.Open(runLoader->GetFileName(), iEvent);
55     clusterer.ReadDigits();
56     clusterer.MakeClusters();
57     clusterer.WriteClusters(-1);
58   }
59 }
60
61 //_____________________________________________________________________________
62 AliTracker* AliTRDReconstructor::CreateTracker(AliRunLoader* runLoader) const
63 {
64 // create a TRD tracker
65
66   runLoader->CdGAFile();
67   return new AliTRDtracker(gFile);
68 }
69
70 //_____________________________________________________________________________
71 void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/, 
72                                   AliESD* /*esd*/) const
73 {
74 }
75
76
77 //_____________________________________________________________________________
78 AliTRDparameter* AliTRDReconstructor::GetTRDparameter(AliRunLoader* runLoader) const
79 {
80 // get the TRD parameters
81
82   runLoader->CdGAFile();
83   AliTRDparameter* trdParam = (AliTRDparameter*) gFile->Get("TRDparameter"); 
84   if (!trdParam) {
85     Error("GetTRDparameter", "no TRD parameters available");
86     return NULL;
87   }
88   return trdParam;
89 }
90
91