expantion of recoParam (Markus) and fix bug in HLT mode
[u/mrichter/AliRoot.git] / TRD / AliTRDReconstructor.h
CommitLineData
121a60bd 1#ifndef ALITRDRECONSTRUCTOR_H
2#define ALITRDRECONSTRUCTOR_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
3bc9d03e 6/* $Id$ */
7
121a60bd 8///////////////////////////////////////////////////////////////////////////////
9// //
3bc9d03e 10// Class for TRD reconstruction //
121a60bd 11// //
12///////////////////////////////////////////////////////////////////////////////
13
121a60bd 14#include "AliReconstructor.h"
7e88424f 15#include "AliDetectorRecoParam.h"
16#include "AliTRDrecoParam.h"
17
66f6bfd9 18class TClonesArray;
3a039a31 19class AliRawReader;
eb38ed55 20class AliTRDReconstructor: public AliReconstructor
21{
3a039a31 22public:
23 enum AliTRDsteerParam {
24 kWriteClusters = BIT(0)
25 ,kSeeding = BIT(1)
26 ,kSteerPID = BIT(2)
27 ,kWriteTracklets = BIT(3)
28 ,kDriftGas = BIT(4)
4302c900 29 ,kHLT = BIT(5)
91834b8d 30 ,kCosmic = BIT(6)
3a039a31 31 };
32 enum AliTRDReconstructorTask {
33 kClusterizer = 0
34 ,kTracker = 1
35 ,kPID = 2
36 };
37 enum AliTRDpidMethod {
38 kLQPID = 0,
39 kNNPID = 1
40 };
41 enum AliTRDdriftGas {
42 kXe = 0,
43 kAr = 1
44 };
cd40b287 45 enum{
46 kNNslices = 8
47 ,kLQslices = 3
48 };
3bc9d03e 49
3a039a31 50 AliTRDReconstructor();
51 AliTRDReconstructor(const AliTRDReconstructor &r);
48f8adf3 52 virtual ~AliTRDReconstructor();
3a039a31 53 AliTRDReconstructor& operator = (const AliTRDReconstructor&) { return *this;}
acd241e9 54
55 virtual void Init();
3bc9d03e 56
3a039a31 57 virtual void ConvertDigits(AliRawReader *rawReader, TTree *digitsTree) const;
58 virtual AliTracker* CreateTracker() const;
25ca55ce 59
3a039a31 60 virtual void FillESD(AliRawReader *, TTree *clusterTree, AliESDEvent *esd) const { FillESD((TTree * )NULL, clusterTree, esd); }
61 virtual void FillESD(TTree *digitsTree, TTree *clusterTree, AliESDEvent *esd) const;
66f6bfd9 62 static TClonesArray* GetClusters() {return fgClusters;}
3a039a31 63 Int_t GetNdEdxSlices() const { return GetPIDMethod() == kNNPID ? kNNslices : kLQslices;}
64 AliTRDdriftGas GetDriftGas() const { return fSteerParam&kDriftGas ? kAr : kXe;}
65 AliTRDpidMethod GetPIDMethod() const { return fSteerParam&kSteerPID ? kNNPID : kLQPID;}
66 static const AliTRDrecoParam* GetRecoParam() { return dynamic_cast<const AliTRDrecoParam*>(AliReconstructor::GetRecoParam(2)); }
67 Int_t GetStreamLevel(AliTRDReconstructorTask task) const { return fStreamLevel[task];}
68 inline void GetTCParams(Double_t *par) const;
69 virtual Bool_t HasDigitConversion() const { return kFALSE; };
70 Bool_t IsWritingClusters() const { return fSteerParam&kWriteClusters;}
71 Bool_t IsWritingTracklets() const { return fSteerParam&kWriteTracklets;}
4302c900 72 Bool_t IsHLT() const { return fSteerParam&kHLT;}
3a039a31 73 Bool_t IsSeeding() const { return fSteerParam&kSeeding;}
91834b8d 74 Bool_t IsCosmic() const { return fSteerParam&kCosmic;}
3bc9d03e 75
3a039a31 76 virtual void Reconstruct(AliRawReader *rawReader, TTree *clusterTree) const;
77 virtual void Reconstruct(TTree *digitsTree, TTree *clusterTree) const;
3bc9d03e 78
66f6bfd9 79 static void SetClusters(TClonesArray *clusters) {fgClusters = clusters;}
3a039a31 80 void SetOption(Option_t *opt);
81 inline void SetTCParams(Double_t *par);
acd241e9 82 void SetStreamLevel(Int_t level, AliTRDReconstructorTask task= kTracker);
3bc9d03e 83
3a039a31 84private:
3a039a31 85 UChar_t fStreamLevel[5]; // stream level for each reconstruction task
86 UInt_t fSteerParam; // steering flags
87 Double_t fTCParams[8]; // Tail Cancellation parameters for drift gases
88
66f6bfd9 89 static TClonesArray *fgClusters; // list of clusters for local reconstructor
3bc9d03e 90
66f6bfd9 91 ClassDef(AliTRDReconstructor, 1) // Class for the TRD reconstruction
3bc9d03e 92
121a60bd 93};
94
3a039a31 95//___________________________________________________
96inline void AliTRDReconstructor::GetTCParams(Double_t *par) const
97{
98 if(!par) return;
99 if(GetDriftGas()==kAr) memcpy(par, &fTCParams[4], 4*sizeof(Double_t));
100 else memcpy(par, &fTCParams[0], 4*sizeof(Double_t));
101}
102
103//___________________________________________________
104inline void AliTRDReconstructor::SetTCParams(Double_t *par)
105{
106 if(!par) return;
107 memcpy(fTCParams, par, 8*sizeof(Double_t));
108}
109
121a60bd 110#endif