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