Making online tracklets usable in offline reconstruction
[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"
0d83b3a5 17#include "AliTRDpidUtil.h"
7e88424f 18
66f6bfd9 19class TClonesArray;
29f95561 20class TTreeSRedirector;
3a039a31 21class AliRawReader;
eb38ed55 22class AliTRDReconstructor: public AliReconstructor
23{
3a039a31 24public:
89971837 25 enum ETRDReconstructorSteer {
00872461 26 kDigitsConversion= BIT(0)
b72f4eaf 27 ,kTC = BIT(1) // tail cancelation
28 ,kLUT = BIT(2) // look up table for cluster position determination
29 ,kGAUS = BIT(3) // look up table for cluster position determination
30 ,kClusterSharing = BIT(4) // Toggle cluster sharing
31 ,kSteerPID = BIT(5)
32 ,kEightSlices = BIT(6)
33 ,kWriteClusters = BIT(7)
34 ,kWriteTracklets = BIT(8)
35 ,kDriftGas = BIT(9)
36 ,kSeeding = BIT(10)
37 ,kVertexConstrained = BIT(11) // Perform vertex constrained fit
38 ,kImproveTracklet = BIT(12) // Improve tracklet in the SA TRD track finder
39 ,kHLT = BIT(13)
40 ,kCosmic = BIT(14)
a5b99acd 41 ,kProcTracklets = BIT(15) // process online tracklets
42 ,kOwner = BIT(16)
43 ,kNsteer = 16 // number of tasks
3a039a31 44 };
89971837 45 enum ETRDReconstructorTask {
29f95561 46 kRawReader = 0
47 ,kClusterizer = 1
48 ,kTracker = 2
49 ,kPID = 3
89971837 50 ,kNtasks = 4 // number of reconsruction tasks
3a039a31 51 };
89971837 52 enum ETRDReconstructorGas {
53 kXe = 0
54 ,kAr = 1
29f95561 55 };
3bc9d03e 56
3a039a31 57 AliTRDReconstructor();
58 AliTRDReconstructor(const AliTRDReconstructor &r);
48f8adf3 59 virtual ~AliTRDReconstructor();
3a039a31 60 AliTRDReconstructor& operator = (const AliTRDReconstructor&) { return *this;}
acd241e9 61
62 virtual void Init();
3bc9d03e 63
3a039a31 64 virtual void ConvertDigits(AliRawReader *rawReader, TTree *digitsTree) const;
65 virtual AliTracker* CreateTracker() const;
89971837 66 TTreeSRedirector* GetDebugStream(ETRDReconstructorTask task) const { return task < kNtasks ? fDebugStream[task] : 0x0; }
25ca55ce 67
3a039a31 68 virtual void FillESD(AliRawReader *, TTree *clusterTree, AliESDEvent *esd) const { FillESD((TTree * )NULL, clusterTree, esd); }
69 virtual void FillESD(TTree *digitsTree, TTree *clusterTree, AliESDEvent *esd) const;
66f6bfd9 70 static TClonesArray* GetClusters() {return fgClusters;}
a5b99acd 71 static TClonesArray* GetTracklets() {return fgTracklets;}
0d83b3a5 72 Int_t GetNdEdxSlices() const { return (Int_t)AliTRDpidUtil::GetNdEdxSlices(GetPIDMethod());}
89971837 73 ETRDReconstructorGas GetDriftGas() const { return fSteerParam&kDriftGas ? kAr : kXe;}
0d83b3a5 74 AliTRDpidUtil::ETRDPIDMethod GetPIDMethod() const { return fSteerParam&kSteerPID ? AliTRDpidUtil::kNN : AliTRDpidUtil::kLQ;}
3a039a31 75 static const AliTRDrecoParam* GetRecoParam() { return dynamic_cast<const AliTRDrecoParam*>(AliReconstructor::GetRecoParam(2)); }
89971837 76 Int_t GetStreamLevel(ETRDReconstructorTask task) const { return fStreamLevel[task];}
3a039a31 77 inline void GetTCParams(Double_t *par) const;
b72f4eaf 78 virtual Bool_t HasDigitConversion() const { return fSteerParam&kDigitsConversion; };
79 Bool_t HasVertexConstrained() const { return fSteerParam&kVertexConstrained; }
80 Bool_t HasImproveTracklets() const { return fSteerParam&kImproveTracklet; }
3a039a31 81 Bool_t IsWritingClusters() const { return fSteerParam&kWriteClusters;}
82 Bool_t IsWritingTracklets() const { return fSteerParam&kWriteTracklets;}
4302c900 83 Bool_t IsHLT() const { return fSteerParam&kHLT;}
3a039a31 84 Bool_t IsSeeding() const { return fSteerParam&kSeeding;}
91834b8d 85 Bool_t IsCosmic() const { return fSteerParam&kCosmic;}
56b32fd7 86 Bool_t IsEightSlices() const { return fSteerParam&kEightSlices;}
b72f4eaf 87 Bool_t UseClusterSharing() const { return fSteerParam&kClusterSharing;}
88 Bool_t UseLUT() const { return fSteerParam&kLUT;}
89 Bool_t UseGAUS() const { return fSteerParam&kGAUS;}
90 Bool_t UseTailCancelation() const { return fSteerParam&kTC;}
a5b99acd 91 Bool_t IsProcessingTracklets() const { return fSteerParam&kProcTracklets;}
b72f4eaf 92
93 static void Options(UInt_t steer=0, UChar_t *stream=0x0);
3a039a31 94 virtual void Reconstruct(AliRawReader *rawReader, TTree *clusterTree) const;
95 virtual void Reconstruct(TTree *digitsTree, TTree *clusterTree) const;
3bc9d03e 96
66f6bfd9 97 static void SetClusters(TClonesArray *clusters) {fgClusters = clusters;}
a5b99acd 98 static void SetTracklets(TClonesArray *tracklets) {fgTracklets = tracklets;}
3a039a31 99 void SetOption(Option_t *opt);
100 inline void SetTCParams(Double_t *par);
89971837 101 void SetStreamLevel(Int_t level, ETRDReconstructorTask task= kTracker);
3bc9d03e 102
3a039a31 103private:
b72f4eaf 104 static Char_t *fgSteerNames[kNsteer];//! steering names
105 static Char_t *fgSteerFlags[kNsteer];//! steering flags
106 static Char_t *fgTaskNames[kNtasks]; //! tasks names
107 static Char_t *fgTaskFlags[kNtasks]; //! tasks flags
108 UChar_t fStreamLevel[kNtasks];// stream level for each reconstruction task
109 UInt_t fSteerParam; // steering bits
29f95561 110 Double_t fTCParams[8]; // Tail Cancellation parameters for drift gases
89971837 111 TTreeSRedirector *fDebugStream[kNtasks];// Debug Streamer container;
3a039a31 112
66f6bfd9 113 static TClonesArray *fgClusters; // list of clusters for local reconstructor
a5b99acd 114 static TClonesArray *fgTracklets; // list of online tracklets for local reconstructor
3bc9d03e 115
b72f4eaf 116 ClassDef(AliTRDReconstructor, 2) // Class for the TRD reconstruction
3bc9d03e 117
121a60bd 118};
119
3a039a31 120//___________________________________________________
121inline void AliTRDReconstructor::GetTCParams(Double_t *par) const
122{
123 if(!par) return;
124 if(GetDriftGas()==kAr) memcpy(par, &fTCParams[4], 4*sizeof(Double_t));
125 else memcpy(par, &fTCParams[0], 4*sizeof(Double_t));
126}
127
128//___________________________________________________
129inline void AliTRDReconstructor::SetTCParams(Double_t *par)
130{
131 if(!par) return;
132 memcpy(fTCParams, par, 8*sizeof(Double_t));
133}
134
121a60bd 135#endif