PandaRoot
BSEmcCounter< DataStruct > Class Template Reference

Simple Process that prints every 100 Events the number of events. More...

#include <BSEmcCounter.h>

Inheritance diagram for BSEmcCounter< DataStruct >:
PndProcess< DataStruct >

Public Member Functions

virtual void SetData (DataStruct *)
 Pass the data container ptrs to the process, and store pointers in class members. More...
 
virtual void Process ()
 The actual data transformation (digitizing, clustering, etc.) should be defined here. More...
 
virtual void SetupParameters (const PndParameterRegister *)
 Fetch all parameters from the PndParameterRegister. More...
 
- Public Member Functions inherited from PndProcess< DataStruct >
 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 PreProcess ()
 PreProcess() is called before the actual Process() call in each event. 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...
 

Additional Inherited Members

- Protected Attributes inherited from PndProcess< DataStruct >
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

template<class DataStruct>
class BSEmcCounter< DataStruct >

Simple Process that prints every 100 Events the number of events.

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 20 of file BSEmcCounter.h.

Member Function Documentation

◆ Process()

template<class DataStruct>
virtual void BSEmcCounter< DataStruct >::Process ( )
inlinevirtual

The actual data transformation (digitizing, clustering, etc.) should be defined here.

Implements PndProcess< DataStruct >.

Definition at line 23 of file BSEmcCounter.h.

24  {
25  if (fEventnumber % 100 == 0) {
26  fTimer.Stop();
27  Double_t realTime = fTimer.RealTime();
28  fTotalTime += realTime;
29  if (fEventnumber > 0) {
30  LOG(info) << "Event: " << fEventnumber << " - Last 100 Events took " << realTime << " s - expeting to finish in "
31  << (fTotalTime) * ((Double_t)fTotalEventNumber / (Double_t)(fEventnumber)-1);
32  }
33  fTimer.Reset();
34  fTimer.Start();
35  }
36  ++fEventnumber;
37  }

◆ SetData()

template<class DataStruct>
virtual void BSEmcCounter< DataStruct >::SetData ( DataStruct *  t_data)
inlinevirtual

Pass the data container ptrs to the process, and store pointers in class members.

Parameters
t_data

Implements PndProcess< DataStruct >.

Definition at line 22 of file BSEmcCounter.h.

22 {};

◆ SetupParameters()

template<class DataStruct>
virtual void BSEmcCounter< DataStruct >::SetupParameters ( const PndParameterRegister t_parameter)
inlinevirtual

Fetch all parameters from the PndParameterRegister.

Parameters
t_parameter

Implements PndProcess< DataStruct >.

Definition at line 39 of file BSEmcCounter.h.

40  {
41  fTotalEventNumber = FairRootManager::Instance()->CheckMaxEventNo();
42  fTimer.Start();
43  };

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