Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[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"
a2fbb6ec 15#include "AliRecoParam.h"
7e88424f 16#include "AliDetectorRecoParam.h"
0d83b3a5 17#include "AliTRDpidUtil.h"
d39401ad 18#include "AliTRDrecoParam.h"
828c6f80 19#include "AliTRDdigitsParam.h"
c4daee41 20#include "AliESDTrdTrigger.h"
7e88424f 21
66f6bfd9 22class TClonesArray;
29f95561 23class TTreeSRedirector;
3a039a31 24class AliRawReader;
5127281e 25class AliTRDclusterizer;
ff4c44cb 26class AliTRDonlineTrackMatching;
eb38ed55 27class AliTRDReconstructor: public AliReconstructor
28{
3a039a31 29public:
89971837 30 enum ETRDReconstructorSteer {
00872461 31 kDigitsConversion= BIT(0)
a2fbb6ec 32 ,kWriteClusters = BIT(1)
33 ,kWriteTracklets = BIT(2)
34 ,kSeeding = BIT(3)
35 ,kHLT = BIT(4)
36 ,kProcTracklets = BIT(5) // process online tracklets
37 ,kDebug = BIT(6)
8fc736d7 38 ,kClRadialCorr = BIT(7) // toggle radial correction in clusters
39 ,kOwner = BIT(8)
40 ,kNsteer = 8 // number of tasks
3a039a31 41 };
3a039a31 42 AliTRDReconstructor();
48f8adf3 43 virtual ~AliTRDReconstructor();
acd241e9 44
45 virtual void Init();
3bc9d03e 46
3a039a31 47 virtual void ConvertDigits(AliRawReader *rawReader, TTree *digitsTree) const;
48 virtual AliTracker* CreateTracker() const;
8fc736d7 49 TTreeSRedirector* GetDebugStream(AliTRDrecoParam::ETRDReconstructionTask task) const { return task < AliTRDrecoParam::kTRDreconstructionTasks ? fDebugStream[task] : NULL; }
25ca55ce 50
3a039a31 51 virtual void FillESD(AliRawReader *, TTree *clusterTree, AliESDEvent *esd) const { FillESD((TTree * )NULL, clusterTree, esd); }
52 virtual void FillESD(TTree *digitsTree, TTree *clusterTree, AliESDEvent *esd) const;
d2eba04b 53 static TClonesArray* GetClusters();
eea7663c 54 static TClonesArray* GetTracklets(const char *trkltype = "");
d2eba04b 55 static TClonesArray* GetTracks();
952051c5 56 static Int_t GetNTimeBins() { return fgNTimeBins;}
0d83b3a5 57 Int_t GetNdEdxSlices() const { return (Int_t)AliTRDpidUtil::GetNdEdxSlices(GetPIDMethod());}
a2fbb6ec 58 AliTRDpidUtil::ETRDPIDMethod GetPIDMethod() const { return GetRecoParam()->IsPIDNeuralNetwork() ? AliTRDpidUtil::kNN : AliTRDpidUtil::kLQ;}
952051c5 59 static const AliTRDrecoParam* GetRecoParam() { return dynamic_cast<const AliTRDrecoParam*>(AliReconstructor::GetRecoParam(2)); }
60 static Float_t GetMinClustersInTrack() { return fgkMinClustersInTrack;}
61 static Float_t GetLabelFraction() { return fgkLabelFraction;}
62 static Double_t GetMaxChi2() { return fgkMaxChi2;}
63 static Double_t GetMaxSnp() { return fgkMaxSnp;}
64 static Double_t GetMaxStep() { return fgkMaxStep;}
65 static Double_t GetEpsilon() { return fgkEpsilon;}
a0446ff1 66
b72f4eaf 67 virtual Bool_t HasDigitConversion() const { return fSteerParam&kDigitsConversion; };
952051c5 68 Bool_t IsCosmic() const { return GetRecoParam()->GetEventSpecie() & AliRecoParam::kCosmic;}
3a039a31 69 Bool_t IsWritingClusters() const { return fSteerParam&kWriteClusters;}
70 Bool_t IsWritingTracklets() const { return fSteerParam&kWriteTracklets;}
4302c900 71 Bool_t IsHLT() const { return fSteerParam&kHLT;}
3a039a31 72 Bool_t IsSeeding() const { return fSteerParam&kSeeding;}
a5b99acd 73 Bool_t IsProcessingTracklets() const { return fSteerParam&kProcTracklets;}
2c7f43b6 74 Bool_t IsDebugStreaming() const { return (fSteerParam&kDebug || AliTRDReconstructor::GetStreamLevel()>0);}
8fc736d7 75 Bool_t UseClusterRadialCorrection() const { return fSteerParam&kClRadialCorr;}
a2fbb6ec 76
77 static void Options(UInt_t steer=0);
3a039a31 78 virtual void Reconstruct(AliRawReader *rawReader, TTree *clusterTree) const;
79 virtual void Reconstruct(TTree *digitsTree, TTree *clusterTree) const;
3bc9d03e 80
d2eba04b 81 static void SetClusters(TClonesArray *clusters) { fgClusters = clusters;}
82 static void SetTracklets(TClonesArray *tracklets) { fgTracklets = tracklets;}
83 static void SetTracks(TClonesArray *tracks) { fgTracks = tracks;}
3a039a31 84 void SetOption(Option_t *opt);
2c7f43b6 85 static Int_t GetStreamLevel() { return fgStreamLevel;}
86 static void SetStreamLevel(Int_t level) { fgStreamLevel = level;}
3bc9d03e 87
3a039a31 88private:
3abc001d 89 AliTRDReconstructor(const AliTRDReconstructor &r); //Not implemented
90 AliTRDReconstructor& operator = (const AliTRDReconstructor&); //Not implemented
d2eba04b 91 void ResetContainers() const;
2c7f43b6 92 static Int_t fgStreamLevel; // flag for streaming - for TRD reconstruction
3abc001d 93
828c6f80 94 static Char_t const *fgSteerNames[kNsteer];//! steering names
95 static Char_t const *fgSteerFlags[kNsteer];//! steering flags
96 static Char_t const *fgTaskNames[AliTRDrecoParam::kTRDreconstructionTasks]; //! tasks names
97 static Char_t const *fgTaskFlags[AliTRDrecoParam::kTRDreconstructionTasks]; //! tasks flags
b72f4eaf 98 UInt_t fSteerParam; // steering bits
952051c5 99 // configuration vars for tracking
100 static const Double_t fgkMaxChi2; // Max increment in track chi2
101 static const Float_t fgkMinClustersInTrack; // Min number of clusters in track
102 static const Float_t fgkLabelFraction; // Min fraction of same label
103 static const Double_t fgkMaxSnp; // Maximal snp for tracking
104 static const Double_t fgkMaxStep; // Maximal step for tracking
105 static const Double_t fgkEpsilon; // Precision of radial coordinate
106
a2fbb6ec 107 TTreeSRedirector *fDebugStream[AliTRDrecoParam::kTRDreconstructionTasks];// Debug Streamer container;
3a039a31 108
5127281e 109 static TClonesArray *fgClusters; // list of clusters for local reconstructor
110 static TClonesArray *fgTracklets; // list of online tracklets for local reconstructor
cb8b99ee 111 static TClonesArray *fgTracks; // list of GTU tracks for local reconstructor
5127281e 112 static Int_t fgNTimeBins; // number of time bins as given by the clusterizer
113 AliTRDclusterizer *fClusterizer; //! instance of TRD clusterizer
ff4c44cb 114 static AliTRDonlineTrackMatching fgOnlineTrackMatcher; // track matcher between on-line and off-line track
c4daee41 115 static AliESDTrdTrigger fgTriggerFlags; // L1 trigger flags
3bc9d03e 116
cb8b99ee 117 ClassDef(AliTRDReconstructor, 5) // Class for the TRD reconstruction
3bc9d03e 118
121a60bd 119};
120
3a039a31 121
3a039a31 122
121a60bd 123#endif
5127281e 124