PandaRoot
PndSorterTask.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 
18 #ifndef PndSorterTask_H
19 #define PndSorterTask_H
20 
21 #include "FairTask.h"
22 
23 #include "TClonesArray.h"
24 
25 #include "PndRingSorter.h"
26 
27 class TClonesArray;
28 
29 class PndSorterTask : public FairTask {
30  public:
32  PndSorterTask() : FairTask("SorterTask"), fNumberOfCells(1000), fWidthOfCells(10), fEntryNr(0)
33  {
34  SetVerbose(3);
36  }
37 
39  PndSorterTask(const char *name) : FairTask(name), fNumberOfCells(1000), fWidthOfCells(10), fEntryNr(0)
40  {
41  SetVerbose(3);
43  };
44 
45  PndSorterTask(Int_t numberOfCells, Double_t widthOfCells, TString inputBranch, TString outputBranch, TString folderName)
46  : FairTask("Sorter"), fNumberOfCells(numberOfCells), fWidthOfCells(widthOfCells), fInputBranch(inputBranch), fOutputBranch(outputBranch), fFolder(folderName)
47  {
48  SetVerbose(3);
50  }
51 
53  virtual ~PndSorterTask()
54  {
55  if (fSorter != nullptr)
56  delete fSorter;
57  }
58 
60  virtual InitStatus Init();
61  virtual InitStatus ReInit();
62 
64  virtual void Exec(Option_t *opt);
65  virtual void FinishEvent();
66  virtual void FinishTask();
67 
68  virtual void SetParContainers(){};
69 
70  void SetPersistance(Bool_t p = kTRUE) { fPersistance = p; };
71  Bool_t GetPersistance() { return fPersistance; };
72 
73  virtual void AddNewDataToTClonesArray(FairTimeStamp *data) = 0;
74  virtual PndRingSorter *InitSorter(Int_t numberOfCells, Double_t widthOfCells) = 0;
75 
76  protected:
78 
79  Bool_t fPersistance; // switch to turn on/off storing the arrays to a file
80  Bool_t fDigiPixelMCInfo; // switch to turn on/off storing additional MC Info of Digis
81 
83  Double_t fWidthOfCells; // in ns
84 
86  TString fInputBranch;
87  TClonesArray *fInputArray;
88 
90  TString fOutputBranch;
91  TString fFolder;
92  TClonesArray *fOutputArray;
93 
94  Int_t fEntryNr;
95 
97 };
98 
99 #endif
PndSorterTask(Int_t numberOfCells, Double_t widthOfCells, TString inputBranch, TString outputBranch, TString folderName)
Definition: PndSorterTask.h:45
virtual PndRingSorter * InitSorter(Int_t numberOfCells, Double_t widthOfCells)=0
TString fFolder
Definition: PndSorterTask.h:91
virtual ~PndSorterTask()
Definition: PndSorterTask.h:53
virtual InitStatus Init()
TClonesArray * fInputArray
Definition: PndSorterTask.h:87
virtual void FinishTask()
Bool_t GetPersistance()
Definition: PndSorterTask.h:71
Bool_t fPersistance
Definition: PndSorterTask.h:79
virtual InitStatus ReInit()
virtual void FinishEvent()
TString fOutputBranch
Definition: PndSorterTask.h:90
Double_t fWidthOfCells
Definition: PndSorterTask.h:83
PndRingSorter * fSorter
Definition: PndSorterTask.h:77
ClassDef(PndSorterTask, 2)
TString fInputBranch
Definition: PndSorterTask.h:86
void SetPersistance(Bool_t p=kTRUE)
Definition: PndSorterTask.h:70
Bool_t fDigiPixelMCInfo
Definition: PndSorterTask.h:80
Int_t fNumberOfCells
Definition: PndSorterTask.h:82
TClonesArray * fOutputArray
Definition: PndSorterTask.h:92
virtual void SetParContainers()
Definition: PndSorterTask.h:68
virtual void AddNewDataToTClonesArray(FairTimeStamp *data)=0
PndSorterTask(const char *name)
Definition: PndSorterTask.h:39
virtual void Exec(Option_t *opt)