Task based version of a PndProcessHandler.
More...
#include <PndProcessTask.h>
|
void | SetParContainers () final |
| Fetch the FairRuntimeDb and populate the PndParameterRegister with all requested parameter. Has to be called before Init() More...
|
|
virtual void | PreProcessing (Option_t *) |
| Do some task preparation before PndProcesses are run once per event. More...
|
|
virtual void | PostProcessing (Option_t *) |
| Do some task post clean up after PndProcesses are run once per event. More...
|
|
virtual void | SetupDataArrays ()=0 |
| Define which data containers need to be fetched from the FairRootManager, pass the data container addresses into a simple struct to distribute the addresses to the PndProcesses so they can read and write the data to them. Needs to be implemented in the derived PndProcessTask, such as the BSEmcClusteringTask. More...
|
|
template<class T > |
Bool_t | DispatchRequest (const PndContainerRegister::PndContainerType_t &t_container, PndContainerRegister *t_register, const TString &t_defaultName) |
|
TClonesArray * | GetInputArray (const TString &t_branchname, const TString &t_classtype) |
|
TClonesArray * | GetOutputArray (const TString &t_branchname, const TString &t_classtype, const TString &t_foldername, Bool_t t_persistenxy) |
|
template<class T > |
Bool_t | HandledRequest (const PndContainerRegister::PndContainerType_t &t_container, PndContainerRegister *t_register, const TString &t_defaultName) |
|
Protected Member Functions inherited from PndProcessHandler |
virtual void | SetupProcess (PndProcess *t_process) |
|
Task based version of a PndProcessHandler.
- Author
- Ben Salisbury salis.nosp@m.bury.nosp@m.@hisk.nosp@m.p.un.nosp@m.i-bon.nosp@m.n.de, HISKP Bonn
- Date
- 2021-02
- Template Parameters
-
Definition at line 30 of file PndProcessTask.h.
◆ PndProcessTask()
PndProcessTask::PndProcessTask |
( |
const std::string & |
t_detectorName | ) |
|
◆ ~PndProcessTask()
virtual PndProcessTask::~PndProcessTask |
( |
| ) |
|
|
virtual |
◆ DispatchRequest()
◆ Exec()
virtual void PndProcessTask::Exec |
( |
Option_t * |
t_opt = nullptr | ) |
|
|
virtual |
Prepare Task for processing of PndProcess (e.g. reset data arrays), process the PndProcesses and do cleanup during the PostProcessing.
◆ Finish()
virtual void PndProcessTask::Finish |
( |
| ) |
|
|
virtual |
End the task, call TearDown for all PndProcesses.
◆ GetInputArray()
TClonesArray* PndProcessTask::GetInputArray |
( |
const TString & |
t_branchname, |
|
|
const TString & |
t_classtype |
|
) |
| |
|
inlineprotected |
Definition at line 93 of file PndProcessTask.h.
Referenced by HandledRequest().
95 TClonesArray *tca{
nullptr};
96 FairRootManager *ioman = FairRootManager::Instance();
97 if (ioman ==
nullptr) {
98 throw std::runtime_error(
"FairRootManager::Instance() returned nullptr");
100 tca =
dynamic_cast<TClonesArray *
>(ioman->GetObject(t_branchname));
101 if (tca ==
nullptr) {
102 LOG(error) <<
"PndTCAConstContainer<" << t_classtype <<
">::Init(" << t_branchname <<
"): No " << t_classtype <<
" array with name " << t_branchname <<
" found!";
◆ GetOutputArray()
TClonesArray* PndProcessTask::GetOutputArray |
( |
const TString & |
t_branchname, |
|
|
const TString & |
t_classtype, |
|
|
const TString & |
t_foldername, |
|
|
Bool_t |
t_persistenxy |
|
) |
| |
|
inlineprotected |
Definition at line 109 of file PndProcessTask.h.
Referenced by HandledRequest().
111 TClonesArray *tca{
nullptr};
112 FairRootManager *ioman = FairRootManager::Instance();
113 if (ioman ==
nullptr) {
114 throw std::runtime_error(
"FairRootManager::Instance() returned nullptr");
116 if (ioman->CheckBranch(t_branchname) == 0) {
117 LOG(debug) <<
"Attempting to register " << t_branchname <<
" as a container for " << t_classtype <<
" in folder " << t_foldername;
118 tca = ioman->Register(t_branchname, t_classtype, t_foldername, t_persistenxy);
120 tca =
dynamic_cast<TClonesArray *
>(ioman->GetObject(t_branchname));
121 if (tca ==
nullptr) {
122 LOG(error) <<
"PndTCAMutableContainer<" << t_classtype <<
">::Init(" << t_branchname <<
"): No " << t_classtype <<
" array with name " << t_branchname
123 <<
" already exists but could not be fetched!";
127 LOG(debug) <<
"Found a branch already called " << t_branchname <<
". Using this for container for " << t_classtype <<
" in folder " << t_foldername;
◆ HandledRequest()
Definition at line 134 of file PndProcessTask.h.
References PndContainerRegister::PndContainerType_t::fBranchname, PndContainerRegister::PndContainerType_t::fClassType, PndProcessHandler::fDetectorName, PndContainerRegister::PndContainerType_t::fIsOutput, PndContainerRegister::PndContainerType_t::fIsPersistent, GetInputArray(), GetOutputArray(), PndContainerRegister::IsBranchSet(), PndContainerRegister::PndContainerType_t::RequestsSpecificBranch(), PndContainerBaseI::SetBranchName(), PndContainerRegister::SetInput(), PndContainerRegister::SetOutput(), PndMutableContainerI< T >::SetPersistency(), PndTCAConstContainer< T >::SetTCA(), PndTCAMutableContainer< T >::SetTCA(), and status.
138 LOG(debug) <<
"PndProcessTask::HandledRequest " << t_container.
fBranchname <<
"(" << branchname <<
") for " << t_container.
fClassType;
151 t_register->
SetOutput(branchname, output);
152 LOG(debug) <<
"PndProcessTask::HandledRequest " << t_container.
fBranchname <<
"(" << branchname <<
") for " << t_container.
fClassType <<
" as output container.";
159 t_register->
SetInput(branchname, input);
160 LOG(debug) <<
"PndProcessTask::HandledRequest " << t_container.
fBranchname <<
"(" << branchname <<
") for " << t_container.
fClassType <<
" as input container.";
void SetTCA(TClonesArray *t_tca)
Set the TClonesArray address.
void SetInput(const TString &t_branchname, PndContainerI< T > *t_ptr)
void SetOutput(const TString &t_branchname, PndContainerI< T > *t_ptr)
void SetTCA(TClonesArray *t_tca)
Set the TClonesArray address.
Bool_t RequestsSpecificBranch() const
void SetPersistency(Bool_t t_persistency)
Set the Persistency of the data.
PndTCAMutableContainer implementation of PndMutableContainerI<T> for FairRootManager and TClonesArray...
void SetBranchName(const TString &t_branchname)
Set the Branch Name.
TClonesArray * GetOutputArray(const TString &t_branchname, const TString &t_classtype, const TString &t_foldername, Bool_t t_persistenxy)
PndTCAConstContainer implementation of PndConstContainerI<T> for FairRootManager and TClonesArray...
TClonesArray * GetInputArray(const TString &t_branchname, const TString &t_classtype)
std::string fDetectorName
Bool_t IsBranchSet(const TString &t_branchname) const
◆ Init()
virtual InitStatus PndProcessTask::Init |
( |
| ) |
|
|
finalvirtual |
Initialise this task. This must be called AFTER SetParContainers(), otherwise we will try to pass the parameters to the PndProcesses, while the parameter were not fetched yet.
- Returns
- InitStatus
◆ PostProcessing()
virtual void PndProcessTask::PostProcessing |
( |
Option_t * |
| ) |
|
|
protectedvirtual |
◆ PreProcessing()
virtual void PndProcessTask::PreProcessing |
( |
Option_t * |
| ) |
|
|
protectedvirtual |
◆ SetParContainers()
void PndProcessTask::SetParContainers |
( |
| ) |
|
|
finalprotected |
◆ SetupDataArrays()
virtual void PndProcessTask::SetupDataArrays |
( |
| ) |
|
|
protectedpure virtual |
The documentation for this class was generated from the following file: