PandaRoot
PndSttCATask.h
Go to the documentation of this file.
1 #ifndef PndSttCATask_H_
2 #define PndSttCATask_H_
3 
4 #include "FairTask.h"
5 #include "PndGeoSttPar.h"
6 #include "PndSttGeometryMap.h"
7 #include "PndSttStrawMap.h"
8 #include "PndSttCA.h"
9 
10 #ifdef RUNCUDA
11 extern "C" int *AllocateStaticData(int *, int);
12 extern "C" void FreeStaticData(int *);
13 #endif
14 
15 #include <vector>
16 
17 class PndSttCATask : public FairTask {
18  public:
19  PndSttCATask() : FairTask("Stt CA"), fPersistence(kTRUE), fTrackFinder(nullptr)
20  {
21  fOutBranchNamePrefix = "";
22  fInBranchNamePrefix = "";
23  };
24 
25  virtual ~PndSttCATask(){};
26 
28  virtual void SetParContainers();
29  virtual InitStatus Init();
30  // virtual InitStatus ReInit();
31 
33  virtual void Exec(Option_t *opt);
34 
35  virtual void FinishEvent();
36 
37  virtual void FinishTask();
38 
39  void SetPersistence(Bool_t val) { fPersistence = val; };
40  void SetUseGPU(Bool_t val) { fUseGPU = val; };
41 
42  // define a Prefix for the Output in case you run more Instances of the CellTrackFinderTask
43  void SetOutBranchNamePrefix(TString prefix) { fOutBranchNamePrefix = prefix + "_"; };
44  // set a prefix for the defoult inbut Branch names
45  void SetInBranchNamePrefix(TString prefix) { fInBranchNamePrefix = prefix + "_"; };
46  // if nothing is defined, the standard STTHit branches are used.
47  // If InputBranches are defined, so far only Branches holding data of type STTHit are further processed (See "initHitArray" method)
48  void AddHitBranch(TString branchName) { fHitBranch.push_back(branchName); }; // Has to be called before Init() is used otherwise the default names are taken!
49  // initialise all STTHit type data, If someone wants to change this also the "Addhit" method of the Trackfinder must be adapted!
50  void InitHitArray(TString branchName);
51 
52  private:
53  TString fOutBranchNamePrefix;
54  TString fInBranchNamePrefix;
55 
56  // for GPU computing
57  Bool_t fUseGPU;
58  int *fDev_tubeNeighborings = nullptr;
59 
60  std::vector<TString> fHitBranch;
61  std::vector<TString> fSTTHitBranch;
62 
63  std::vector<TClonesArray *> fSTTHitArray;
64 
65  TClonesArray *fFirstTrackCandArray = nullptr;
66 
67  Bool_t fPersistence; // safe data?
68 
69  PndGeoSttPar *fSttParameters = nullptr; // needed for SttStrawMap
70  TClonesArray *fTubeArray = nullptr; // needed for SttStrawMap
71 
72  PndSttGeometryMap *fSttGeometryMap = nullptr;
73  PndSttStrawMap *fSttStrawMap = nullptr;
74  PndSttCA *fTrackFinder = nullptr;
75 
76  TClonesArray *fEventHeader = nullptr;
77 
78  std::vector<std::vector<int>> fNumHitsPerEvent;
79 
80  ClassDef(PndSttCATask, 1);
81 };
82 
83 #endif /*PndSttCATask_H_*/
void SetInBranchNamePrefix(TString prefix)
Definition: PndSttCATask.h:45
void SetPersistence(Bool_t val)
Definition: PndSttCATask.h:39
void SetUseGPU(Bool_t val)
Definition: PndSttCATask.h:40
virtual void Exec(Option_t *opt)
virtual InitStatus Init()
void InitHitArray(TString branchName)
virtual ~PndSttCATask()
Definition: PndSttCATask.h:25
void AddHitBranch(TString branchName)
Definition: PndSttCATask.h:48
virtual void FinishEvent()
virtual void FinishTask()
virtual void SetParContainers()
void SetOutBranchNamePrefix(TString prefix)
Definition: PndSttCATask.h:43