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...
 
virtual void SetEventTime (Double_t t_eventtime)
 Set the Event time. 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
 
Double_t fEventTime {0}
 

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 36 of file PndProcess.h.

Constructor & Destructor Documentation

◆ PndProcess() [1/2]

PndProcess::PndProcess ( )
inline

Definition at line 38 of file PndProcess.h.

38 {}

◆ PndProcess() [2/2]

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

Definition at line 39 of file PndProcess.h.

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

◆ ~PndProcess()

virtual PndProcess::~PndProcess ( )
inlinevirtual

Definition at line 40 of file PndProcess.h.

40 {}

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 54 of file PndProcess.h.

References fParameterList.

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

◆ 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 99 of file PndProcess.h.

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

100  {
101  fTimer.Stop();
102  fTotalTime += fTimer.RealTime();
103  gSystem->GetProcInfo(&fProcInfo);
104  LOG_IF(debug1, fProcInfo.fMemResident - fLastMemSize != 0) << "PndProcess" << fDetectorName << " Process() Memory increase after Process " << fProcessName << ". Increase by "
105  << fProcInfo.fMemResident - fLastMemSize << " KB. Total memory used is: " << fProcInfo.fMemResident << " KB.";
106 
107  fLastMemSize = fProcInfo.fMemResident;
108  };
std::string fDetectorName
Set Detector name this PndProcess transforms data for. Required for example by EMC Processes to fetch...
Definition: PndProcess.h:125
Double_t fTotalTime
Time taken by this Process&#39; Process()
Definition: PndProcess.h:128
Long_t fLastMemSize
Definition: PndProcess.h:130
std::string fProcessName
Name of current PndProcess (for debugging)
Definition: PndProcess.h:126
ProcInfo_t fProcInfo
Helper to access cpu process Memory Info.
Definition: PndProcess.h:129
TStopwatch fTimer
Timer to monitor Process() time.
Definition: PndProcess.h:127

◆ 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 81 of file PndProcess.h.

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

82  {
83  gSystem->GetProcInfo(&fProcInfo);
84  fLastMemSize = fProcInfo.fMemResident;
85  fTimer.Reset();
86  fTimer.Start();
87  };
Long_t fLastMemSize
Definition: PndProcess.h:130
ProcInfo_t fProcInfo
Helper to access cpu process Memory Info.
Definition: PndProcess.h:129
TStopwatch fTimer
Timer to monitor Process() time.
Definition: PndProcess.h:127

◆ Process()

◆ RequestDataContainer()

◆ SetDetectorName()

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

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)

Parameters
t_detectorname

Reimplemented in BSEmcMCDepositProductionProcess, BSEmcExpClusterSplittingProcess, BSEmcOnlineBumpSplitter, BSEmcLocalMaxFindingProcess, BSEmcLateralClusterSplittingProcess, BSEmcRemoveSplitOffMax, BSEmcClusteringProcess, BSEmcMergePreclusters, BSEmcMakePreclusters, BSEmcWaveformGenerationProcess, BSEmcPlotProcess, BSEmcMCPropagationProcess, BSEmcRecursiveClustering, BSEmcCreateRecoHitProcess, BSEmcFwEndcapBlindDeconvProcess, BSEmcAddLinksToCluster, BSEmcBwEndcapOnlineFeatureExtraction, BSEmcFwEndcapIdealDigitizerProcess, BSEmcFwEndcapWaveformGeneration, BSEmcFinishRecoHitProcess, BSEmcOnlineFeatureExtractionProcess, BSEmcFwEndcapAPDAndVPTTWaveformGenerator, BSEmcFetchDigisFromPreclusterLinks, BSEmcIdealDigitizationProcess, BSEmcFwEndcapCosmicWaveformGeneration, BSEmcApplyCalibrationProcess, BSEmcDigiTimeBuncherProcess, BSEmcPreclusterTimeBuncherProcess, BSEmcFwEndcapOnlineFeatureExtraction, BSEmcDigiDCSetterProcess, BSEmcOutOfClusterCorrectionProcess, BSEmcParameterLoadingProcess, BSEmcMergeRecoHits, and BSEmcFlagSplitOffs.

Definition at line 47 of file PndProcess.h.

References fDetectorName.

47 { fDetectorName = t_detectorname; }
std::string fDetectorName
Set Detector name this PndProcess transforms data for. Required for example by EMC Processes to fetch...
Definition: PndProcess.h:125

◆ SetEventTime()

virtual void PndProcess::SetEventTime ( Double_t  t_eventtime)
inlinevirtual

Set the Event time.

Parameters
t_eventtime

Definition at line 121 of file PndProcess.h.

References fEventTime.

121 { fEventTime = t_eventtime; }
Double_t fEventTime
Definition: PndProcess.h:132

◆ SetupParameters()

◆ TearDown()

virtual void PndProcess::TearDown ( )
inlinevirtual

Last actions at the end of the run.

Reimplemented in TestPndProcess.

Definition at line 114 of file PndProcess.h.

References fDetectorName, fProcessName, and fTotalTime.

114 { 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:125
Double_t fTotalTime
Time taken by this Process&#39; Process()
Definition: PndProcess.h:128
std::string fProcessName
Name of current PndProcess (for debugging)
Definition: PndProcess.h:126

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 125 of file PndProcess.h.

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

◆ fEventTime

Double_t PndProcess::fEventTime {0}
protected

Definition at line 132 of file PndProcess.h.

Referenced by SetEventTime().

◆ 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 130 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 124 of file PndProcess.h.

Referenced by GetListOfRequiredParameters().

◆ fProcessName

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

Name of current PndProcess (for debugging)

Definition at line 126 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 129 of file PndProcess.h.

Referenced by PostProcess(), and PreProcess().

◆ fTimer

TStopwatch PndProcess::fTimer {}
protected

Timer to monitor Process() time.

Definition at line 127 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 128 of file PndProcess.h.

Referenced by PostProcess(), and TearDown().


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