PandaRoot
PndProcess Class Referenceabstract

Base Process class. More...

#include <PndProcess.h>

Inheritance diagram for PndProcess:
BSEmcAddLinksToCluster BSEmcApplyCalibrationProcess BSEmcClusteringProcess BSEmcCounter BSEmcCreateRecoHitProcess BSEmcDigiDCSetterProcess BSEmcDigiTimeBuncherProcess BSEmcExpClusterSplittingProcess BSEmcFetchDigisFromPreclusterLinks BSEmcFinishRecoHitProcess BSEmcFlagSplitOffs BSEmcFwEndcapAPDAndVPTTWaveformGenerator BSEmcFwEndcapBlindDeconvProcess BSEmcFwEndcapIdealDigitizerProcess BSEmcIdealDigitizationProcess BSEmcLocalMaxFindingProcess BSEmcMakePreclusters BSEmcMCDepositProductionProcess BSEmcMCPropagationProcess BSEmcMergePreclusters BSEmcMergeRecoHits BSEmcOnlineBumpSplitter BSEmcOnlineFeatureExtractionProcess BSEmcOutOfClusterCorrectionProcess BSEmcParameterLoadingProcess BSEmcPlotProcess BSEmcPreclusterTimeBuncherProcess BSEmcRecursiveClustering BSEmcRemoveSplitOffMax BSEmcWaveformGenerationProcess TestPndProcess

Public Member Functions

 PndProcess ()
 
 PndProcess (const std::string &t_processname)
 
virtual ~PndProcess ()
 
virtual void SetDetectorName (const std::string &t_detectorname)
 Set the Detector name. Important, as most EmcParameter need to know for which detector they need to be fetched (each Emc Subdetector has its own set of parameters) More...
 
const std::vector< std::string > & GetListOfRequiredParameters () const
 Get the List Of Required Parameters. More...
 
virtual void RequestDataContainer (PndContainerRegister *)
 Pass the container register to the process, and get the processes container requirements. More...
 
virtual void GetDataContainer (PndContainerRegister *)
 Pass the container register to the process, and set the processes container requirements. More...
 
virtual void SetupParameters (const PndParameterRegister *t_parameter)=0
 Fetch all parameters from the PndParameterRegister. More...
 
virtual void PreProcess ()
 PreProcess() is called before the actual Process() call in each event. More...
 
virtual void Process ()=0
 The actual data transformation (digitizing, clustering, etc.) should be defined here. More...
 
virtual void PostProcess ()
 Immediately after calling Process() PostProcess() is called for cleanup of internal process data, or if not needed, to end the time and memory increase measurement started by PreProcess() More...
 
virtual void TearDown ()
 Last actions at the end of the run. More...
 

Protected Attributes

std::vector< std::string > fParameterList {}
 Parameter names required by this PndProcess. Needs to be populated in derived class. More...
 
std::string fDetectorName {""}
 Set Detector name this PndProcess transforms data for. Required for example by EMC Processes to fetch right parameters. More...
 
std::string fProcessName {"PndProcess"}
 Name of current PndProcess (for debugging) More...
 
TStopwatch fTimer {}
 Timer to monitor Process() time. More...
 
Double_t fTotalTime {0}
 Time taken by this Process' Process() More...
 
ProcInfo_t fProcInfo
 Helper to access cpu process Memory Info. More...
 
Long_t fLastMemSize
 

Detailed Description

Base Process class.

Base class for Processes. Processes are intended to help separate data and parameter handling from the implementation of algorithms

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

Definition at line 24 of file PndProcess.h.

Constructor & Destructor Documentation

◆ PndProcess() [1/2]

PndProcess::PndProcess ( )
inline

Definition at line 26 of file PndProcess.h.

26 {}

◆ PndProcess() [2/2]

PndProcess::PndProcess ( const std::string &  t_processname)
inline

Definition at line 27 of file PndProcess.h.

27 : fProcessName(t_processname) {}
std::string fProcessName
Name of current PndProcess (for debugging)
Definition: PndProcess.h:107

◆ ~PndProcess()

virtual PndProcess::~PndProcess ( )
inlinevirtual

Definition at line 28 of file PndProcess.h.

28 {}

Member Function Documentation

◆ GetDataContainer()

◆ GetListOfRequiredParameters()

const std::vector<std::string>& PndProcess::GetListOfRequiredParameters ( ) const
inline

Get the List Of Required Parameters.

Returns
const std::vector<std::string>&

Definition at line 42 of file PndProcess.h.

References fParameterList.

42 { return fParameterList; }
std::vector< std::string > fParameterList
Parameter names required by this PndProcess. Needs to be populated in derived class.
Definition: PndProcess.h:105

◆ PostProcess()

virtual void PndProcess::PostProcess ( )
inlinevirtual

Immediately after calling Process() PostProcess() is called for cleanup of internal process data, or if not needed, to end the time and memory increase measurement started by PreProcess()

Reimplemented in BSEmcOnlineBumpSplitter, and TestPndProcess.

Definition at line 87 of file PndProcess.h.

References fDetectorName, fLastMemSize, fProcessName, fProcInfo, fTimer, and fTotalTime.

88  {
89  fTimer.Stop();
90  fTotalTime += fTimer.RealTime();
91  gSystem->GetProcInfo(&fProcInfo);
92  LOG_IF(debug1, fProcInfo.fMemResident - fLastMemSize != 0) << "PndProcess" << fDetectorName << " Process() Memory increase after Process " << fProcessName << ". Increase by "
93  << fProcInfo.fMemResident - fLastMemSize << " KB. Total memory used is: " << fProcInfo.fMemResident << " KB.";
94 
95  fLastMemSize = fProcInfo.fMemResident;
96  };
std::string fDetectorName
Set Detector name this PndProcess transforms data for. Required for example by EMC Processes to fetch...
Definition: PndProcess.h:106
Double_t fTotalTime
Time taken by this Process&#39; Process()
Definition: PndProcess.h:109
Long_t fLastMemSize
Definition: PndProcess.h:111
std::string fProcessName
Name of current PndProcess (for debugging)
Definition: PndProcess.h:107
ProcInfo_t fProcInfo
Helper to access cpu process Memory Info.
Definition: PndProcess.h:110
TStopwatch fTimer
Timer to monitor Process() time.
Definition: PndProcess.h:108

◆ PreProcess()

virtual void PndProcess::PreProcess ( )
inlinevirtual

PreProcess() is called before the actual Process() call in each event.

Intended for preprocess setup calls, e.g. for reseting internal process data, or, if not needed, to monitor processing time and memory increase

Reimplemented in TestPndProcess.

Definition at line 69 of file PndProcess.h.

References fLastMemSize, fProcInfo, fTimer, and Process().

70  {
71  gSystem->GetProcInfo(&fProcInfo);
72  fLastMemSize = fProcInfo.fMemResident;
73  fTimer.Reset();
74  fTimer.Start();
75  };
Long_t fLastMemSize
Definition: PndProcess.h:111
ProcInfo_t fProcInfo
Helper to access cpu process Memory Info.
Definition: PndProcess.h:110
TStopwatch fTimer
Timer to monitor Process() time.
Definition: PndProcess.h:108

◆ Process()

◆ RequestDataContainer()

◆ SetDetectorName()

virtual void PndProcess::SetDetectorName ( const std::string &  t_detectorname)
inlinevirtual

◆ SetupParameters()

◆ TearDown()

virtual void PndProcess::TearDown ( )
inlinevirtual

Last actions at the end of the run.

Reimplemented in TestPndProcess.

Definition at line 102 of file PndProcess.h.

References fDetectorName, fProcessName, and fTotalTime.

102 { LOG(debug) << fProcessName << " - " << fDetectorName << " took " << fTotalTime << " s processing time."; };
std::string fDetectorName
Set Detector name this PndProcess transforms data for. Required for example by EMC Processes to fetch...
Definition: PndProcess.h:106
Double_t fTotalTime
Time taken by this Process&#39; Process()
Definition: PndProcess.h:109
std::string fProcessName
Name of current PndProcess (for debugging)
Definition: PndProcess.h:107

Member Data Documentation

◆ fDetectorName

std::string PndProcess::fDetectorName {""}
protected

Set Detector name this PndProcess transforms data for. Required for example by EMC Processes to fetch right parameters.

Definition at line 106 of file PndProcess.h.

Referenced by PostProcess(), SetDetectorName(), and TearDown().

◆ fLastMemSize

Long_t PndProcess::fLastMemSize
protected

Value containing the memory footprint of the cpu process before the Process() call of this PndProcess, to be able to flag if during Process() used memory increased

Definition at line 111 of file PndProcess.h.

Referenced by PostProcess(), and PreProcess().

◆ fParameterList

std::vector<std::string> PndProcess::fParameterList {}
protected

Parameter names required by this PndProcess. Needs to be populated in derived class.

Definition at line 105 of file PndProcess.h.

Referenced by GetListOfRequiredParameters().

◆ fProcessName

std::string PndProcess::fProcessName {"PndProcess"}
protected

Name of current PndProcess (for debugging)

Definition at line 107 of file PndProcess.h.

Referenced by PostProcess(), and TearDown().

◆ fProcInfo

ProcInfo_t PndProcess::fProcInfo
protected

Helper to access cpu process Memory Info.

Definition at line 110 of file PndProcess.h.

Referenced by PostProcess(), and PreProcess().

◆ fTimer

TStopwatch PndProcess::fTimer {}
protected

Timer to monitor Process() time.

Definition at line 108 of file PndProcess.h.

Referenced by PostProcess(), and PreProcess().

◆ fTotalTime

Double_t PndProcess::fTotalTime {0}
protected

Time taken by this Process' Process()

Definition at line 109 of file PndProcess.h.

Referenced by PostProcess(), and TearDown().


The documentation for this class was generated from the following file: