PandaRoot
ProcessTaskTestClasses.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 PROCESSTASKTESTCLASSES_HH
14 #define PROCESSTASKTESTCLASSES_HH
15 #include <string>
16 
17 #include "TBuffer.h"
18 #include "TString.h"
19 
20 #include "PndParameterRegister.h"
21 #include "PndProcess.h"
22 #include "PndProcessTask.h"
23 
25 
26  public:
27  TestPndProcessTask(const std::string &t_detectorName) : PndProcessTask(t_detectorName) {}
29  virtual void Exec(Option_t *t_opt = nullptr) /*override*/
30  {
31  PreProcessing(t_opt);
32  for (PndProcess *process : this->fProcesses) {
33  process->PreProcess();
34  process->Process();
35  process->PostProcess();
36  }
37  PostProcessing(t_opt);
38  }
39 
40  private:
41  virtual void SetupDataArrays(){};
42  ClassDef(TestPndProcessTask, 1);
43 };
44 
45 class TestPndProcess : public PndProcess {
46  public:
49  virtual void SetupParameters(const PndParameterRegister * /*t_parameter*/) { fParametersSet = kTRUE; }
50  virtual void RequestDataContainer(PndContainerRegister * /*t_register*/){};
51  virtual void GetDataContainer(PndContainerRegister * /*t_register*/) { fDataSet = kTRUE; }
52  virtual void PreProcess() { fPreProcessSet = kTRUE; }
53  virtual void Process() { fProcessSet = kTRUE; }
54  virtual void PostProcess() { fPostProcessSet = kTRUE; }
55  virtual void TearDown() { fTearDownSet = kTRUE; }
56  TString GetDetectorName() const { return this->fDetectorName; }
57  Bool_t fDataSet{kFALSE};
58  Bool_t fParametersSet{kFALSE};
59  Bool_t fPreProcessSet{kFALSE};
60  Bool_t fProcessSet{kFALSE};
61  Bool_t fPostProcessSet{kFALSE};
62  Bool_t fTearDownSet{kFALSE};
63 
64  private:
65  ClassDef(TestPndProcess, 1);
66 };
67 
68 #endif /*PROCESSTASKTESTCLASSES_HH*/
Base Process class.
Definition: PndProcess.h:36
Task based version of a PndProcessHandler.
virtual void TearDown()
Last actions at the end of the run.
virtual void PreProcessing(Option_t *)
Do some task preparation before PndProcesses are run once per event.
virtual void RequestDataContainer(PndContainerRegister *)
Pass the container register to the process, and get the processes container requirements.
virtual void GetDataContainer(PndContainerRegister *)
Pass the container register to the process, and set the processes container requirements.
virtual void SetupParameters(const PndParameterRegister *)
Fetch all parameters from the PndParameterRegister.
virtual void PreProcess()
PreProcess() is called before the actual Process() call in each event.
TestPndProcessTask(const std::string &t_detectorName)
virtual void PostProcessing(Option_t *)
Do some task post clean up after PndProcesses are run once per event.
virtual void Exec(Option_t *t_opt=nullptr)
Prepare Task for processing of PndProcess (e.g. reset data arrays), process the PndProcesses and do c...
TString GetDetectorName() const
Helper class to indirect the Parameter fetching via the FairRuntimeDb.
virtual void Process()
The actual data transformation (digitizing, clustering, etc.) should be defined here.
std::string fDetectorName
std::vector< PndProcess * > fProcesses
virtual void PostProcess()
Immediately after calling Process() PostProcess() is called for cleanup of internal process data...