PandaRoot
PndSttCellTrackFinderTask.h
Go to the documentation of this file.
1 #ifndef PndSttCellTrackFinderTask_H_
2 #define PndSttCellTrackFinderTask_H_
3 
4 #include "FairTask.h"
5 #include "PndGeoSttPar.h"
6 #include "PndSttGeometryMap.h"
7 #include "PndSttStrawMap.h"
9 #include "FairTSBufferFunctional.h"
10 
11 #include <vector>
12 
13 #ifdef RUNCUDA
14 extern "C" int *AllocateStaticData(int *, int);
15 extern "C" void FreeStaticData(int *);
16 #endif
17 
18 class PndSttCellTrackFinderTask : public FairTask {
19  public:
21  : FairTask("Stt Cell Track Finder"), fClusterTime(250.0), fUseGPU(kFALSE), fDev_tubeNeighborings(nullptr), fRunTimeBased(kFALSE), fRunWithSortedHits(kFALSE),
22  fCalcWithCorrectedIsochrones(kFALSE), fVerbose(0), fPersistence(kTRUE), fAnalyseSteps(kFALSE), fTrackFinder(nullptr)
23  {
24  fOutBranchNamePrefix = "";
25  fInBranchNamePrefix = "";
26  };
27 
29 
31  virtual void SetParContainers();
32  virtual InitStatus Init();
33  // virtual InitStatus ReInit();
34 
36  virtual void Exec(Option_t *opt);
37 
38  virtual void FinishEvent();
39 
40  virtual void FinishTask();
41 
42  // void AddHitBranch(TString branchName);//Has to be called before Init() is used otherwise the default names are taken!
43 
44  void SetVerbose(Int_t verbose) { fVerbose = verbose; };
45  void SetPersistence(Bool_t val) { fPersistence = val; };
46  void SetAnalyseSteps(Bool_t val) { fAnalyseSteps = val; };
47  void SetUseGPU(Bool_t val) { fUseGPU = val; };
48  void SetRunTimeBased(Bool_t val) { fRunTimeBased = val; };
49  void SetRunWithSortedHits(Bool_t val) { fRunWithSortedHits = val; };
50  void SetClusterTime(double val) { fClusterTime = val; }; // J.R. 20/04-2018
51  void SetCalcWithCorrectedIsochrones(Bool_t val) { fCalcWithCorrectedIsochrones = val; }
52  // define a Prefix for the Output in case you run more Instances of the CellTrackFinderTask
53  void SetOutBranchNamePrefix(TString prefix) { fOutBranchNamePrefix = prefix + "_"; };
54  // set a prefix for the defoult inbut Branch names
55  void SetInBranchNamePrefix(TString prefix) { fInBranchNamePrefix = prefix + "_"; };
56  // if nothing is defined, the standard STTHit branches are used.
57  // If InputBranches are defined, so far only Branches holding data of type STTHit are further processed (See "initHitArray" method)
58  void AddHitBranch(TString branchName) { fHitBranch.push_back(branchName); };
59  // initialise all STTHit type data, If someone wants to change this also the "Addhit" method of the Trackfinder must be adapted!
60  void InitHitArray(TString branchName);
61 
62  private:
63  BinaryFunctor *fFunctorCellTrack;
64 
65  double fStopTimeValueCellTrack;
66 
67  double fClusterTime;
68  // for GPU computing
69  Bool_t fUseGPU;
70  int *fDev_tubeNeighborings;
71 
72  Bool_t fRunTimeBased;
73  Bool_t fRunWithSortedHits;
74 
75  Bool_t fCalcWithCorrectedIsochrones;
76 
77  TString fOutBranchNamePrefix;
78  TString fInBranchNamePrefix;
79 
80  std::vector<TString> fHitBranch;
81  std::vector<TString> fSTTHitBranch;
82  // TString fTrackBranch;
83 
84  std::vector<TClonesArray *> fSTTHitArray;
85 
86  // first step of trackfinding
87  TClonesArray *fFirstTrackCandArray;
88  TClonesArray *fFirstTrackArray;
89  TClonesArray *fFirstRiemannTrackArray;
90 
91  // second step of trackfinding
92  TClonesArray *fCombiTrackCandArray;
93  TClonesArray *fCombiRiemannTrackArray;
94  TClonesArray *fCombiTrackArray;
95  TClonesArray *fCorrectedIsochronesArray;
96 
97  Int_t fVerbose;
98  Bool_t fPersistence; // safe data?
99  Bool_t fAnalyseSteps; // if true, results of first step (generating tracklets) will be stored for AnalysisTask
100 
101  PndGeoSttPar *fSttParameters; // needed for SttStrawMap
102  TClonesArray *fTubeArray; // needed for SttStrawMap
103 
104  PndSttGeometryMap *fSttGeometryMap;
105  PndSttStrawMap *fSttStrawMap;
106  PndSttCellTrackFinder *fTrackFinder;
107 
108  TClonesArray *fEventHeader;
109 
110  // for runtime analysis: numHits, numHitsWithoutDouble, numUnambiguousHits
111  std::vector<std::vector<int>> fNumHitsPerEvent;
112 
113  int eventNumber; // J.R. For testing purpouses
114 
115  ClassDef(PndSttCellTrackFinderTask, 1);
116 };
117 
118 #endif /*PndSttCellTrackFinderTask_H_*/
virtual void FinishEvent()
virtual void Exec(Option_t *opt)
virtual void SetParContainers()
void SetOutBranchNamePrefix(TString prefix)
virtual InitStatus Init()
void AddHitBranch(TString branchName)
void SetInBranchNamePrefix(TString prefix)
void InitHitArray(TString branchName)
void SetCalcWithCorrectedIsochrones(Bool_t val)
virtual void FinishTask()