PandaRoot
PndGapEventBuilderTask.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 PndGapEventBuilderTask_H_
14 #define PndGapEventBuilderTask_H_
15 
16 #include "TClonesArray.h"
17 #include "FairTask.h"
18 //#include "PndSdsHit.h"
19 
20 #include "FairTSBufferFunctional.h"
21 
22 #include <vector>
23 
24 class PndGapEventBuilderTask : public FairTask {
25  public:
27  virtual ~PndGapEventBuilderTask();
28 
30  virtual void SetParContainers();
31  virtual InitStatus Init();
32  virtual InitStatus ReInit();
33 
35  virtual void Exec(Option_t *opt);
36  virtual void FinishEvent();
37 
38  void SetTimeGap(double val) { fTimeGap = val; }
39  void SetBranchName(TString name) { fMainBranchName = name; };
40 
41  void AddAdditionalBranches(TString branchName, Double_t timeWindow)
42  {
43  std::pair<TString, Double_t> val(branchName, timeWindow);
44  fAddBranches.push_back(val);
45  }
46 
47  void SetPersistence(Bool_t val) { fPersistence = val; };
48 
49  private:
50  int fEventNr;
51 
52  double fTimeGap;
53  TString fMainBranchName;
54  TClonesArray *fMainHitArray;
55  TClonesArray *fMainEventHitArray;
56 
57  std::vector<std::pair<TString, Double_t>> fAddBranches;
58  std::vector<TClonesArray *> fAddHitArray;
59  std::vector<TClonesArray *> fAddEventHitArray;
60 
61  Bool_t fInitDone;
62  Bool_t fPersistence;
63 
64  BinaryFunctor *fStartFunctor;
65  BinaryFunctor *fStopFunctor;
66  BinaryFunctor *fTimeGapFunctor;
67 
68  Int_t fEntryNr;
69 
70  void Register();
71  void Reset();
72  void ProduceHits();
73 
74  ClassDef(PndGapEventBuilderTask, 1);
75 };
76 
77 #endif /*PndGapEventBuilderTask_H_*/
virtual void Exec(Option_t *opt)
virtual InitStatus Init()
virtual void SetParContainers()
virtual ~PndGapEventBuilderTask()
void SetBranchName(TString name)
virtual void FinishEvent()
void AddAdditionalBranches(TString branchName, Double_t timeWindow)
virtual InitStatus ReInit()