]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDReconstructor.cxx
Adding the cluster center as new data member (M.Ivanov)
[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// //
20// class for TRD reconstruction //
21// //
22///////////////////////////////////////////////////////////////////////////////
23
24
25#include "AliTRDReconstructor.h"
26#include "AliRunLoader.h"
27#include "AliTRDparameter.h"
121a60bd 28#include "AliTRDclusterizerV1.h"
29#include "AliTRDtracker.h"
b0f03c34 30#include "AliTRDpidESD.h"
121a60bd 31#include <TFile.h>
32
33
34ClassImp(AliTRDReconstructor)
35
36
37//_____________________________________________________________________________
38void AliTRDReconstructor::Reconstruct(AliRunLoader* runLoader) const
39{
40// reconstruct clusters
41
2b217b01 42 AliLoader *loader=runLoader->GetLoader("TRDLoader");
43 loader->LoadRecPoints("recreate");
44
121a60bd 45 AliTRDclusterizerV1 clusterer("clusterer", "TRD clusterizer");
46 runLoader->CdGAFile();
47 AliTRDparameter* trdParam = GetTRDparameter(runLoader);
48 if (!trdParam) {
49 Error("Reconstruct", "no TRD parameters found");
50 return;
51 }
52 trdParam->ReInit();
53 clusterer.SetParameter(trdParam);
54 Int_t nEvents = runLoader->GetNumberOfEvents();
55
56 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
57 clusterer.Open(runLoader->GetFileName(), iEvent);
58 clusterer.ReadDigits();
59 clusterer.MakeClusters();
60 clusterer.WriteClusters(-1);
61 }
1a39153b 62
63 loader->UnloadRecPoints();
121a60bd 64}
65
66//_____________________________________________________________________________
67AliTracker* AliTRDReconstructor::CreateTracker(AliRunLoader* runLoader) const
68{
69// create a TRD tracker
70
71 runLoader->CdGAFile();
72 return new AliTRDtracker(gFile);
73}
74
75//_____________________________________________________________________________
76void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/,
b0f03c34 77 AliESD* esd) const
121a60bd 78{
b0f03c34 79// make PID
80
81 Double_t parTRD[] = {
eab5961e 82 280., // Min. Ionizing Particle signal. Check it !!!
b0f03c34 83 0.23, // relative resolution Check it !!!
84 10. // PID range (in sigmas)
85 };
86 AliTRDpidESD trdPID(parTRD);
87 trdPID.MakePID(esd);
121a60bd 88}
89
90
91//_____________________________________________________________________________
92AliTRDparameter* AliTRDReconstructor::GetTRDparameter(AliRunLoader* runLoader) const
93{
94// get the TRD parameters
95
96 runLoader->CdGAFile();
97 AliTRDparameter* trdParam = (AliTRDparameter*) gFile->Get("TRDparameter");
98 if (!trdParam) {
99 Error("GetTRDparameter", "no TRD parameters available");
100 return NULL;
101 }
102 return trdParam;
103}
104
105