Belle II Software development
DQMHistAnalysisSVDDoseModule Class Referencefinal

The SVD dose-monitoring DQM analysis module. More...

#include <DQMHistAnalysisSVDDose.h>

Inheritance diagram for DQMHistAnalysisSVDDoseModule:
DQMHistAnalysisModule Module PathElement

Classes

struct  SensorGroup
 A struct to define the sensors group we average over. More...
 

Public Types

enum  EStatus {
  c_StatusTooFew = 0 ,
  c_StatusDefault = 1 ,
  c_StatusGood = 2 ,
  c_StatusWarning = 3 ,
  c_StatusError = 4
}
 Status flag of histogram/canvas. More...
 
enum  EStatusColor {
  c_ColorTooFew = kGray ,
  c_ColorDefault = kWhite ,
  c_ColorGood = kGreen ,
  c_ColorWarning = kYellow ,
  c_ColorError = kRed
}
 Status colors of histogram/canvas (corresponding to status) More...
 
enum  ERefScaling {
  c_RefScaleNone = 0 ,
  c_RefScaleEntries = 1 ,
  c_RefScaleMax = 2
}
 Reference plot scaling type. More...
 
typedef std::map< std::string, HistObjectHistList
 The type of list of histograms.
 
typedef std::map< std::string, MonitoringObjectMonObjList
 The type of list of MonitoringObjects.
 
typedef std::map< std::string, HistDeltaDeltaList
 The type of list of delta settings and histograms.
 
typedef std::map< std::string, bool > CanvasUpdatedList
 The type of list of canvas updated status.
 
typedef std::map< std::string, RefHistObjectRefList
 The type of list of references.
 
enum  EModulePropFlags {
  c_Input = 1 ,
  c_Output = 2 ,
  c_ParallelProcessingCertified = 4 ,
  c_HistogramManager = 8 ,
  c_InternalSerializer = 16 ,
  c_TerminateInAllProcesses = 32 ,
  c_DontCollectStatistics = 64
}
 Each module can be tagged with property flags, which indicate certain features of the module. More...
 
typedef ModuleCondition::EAfterConditionPath EAfterConditionPath
 Forward the EAfterConditionPath definition from the ModuleCondition.
 

Public Member Functions

TH1 * findHistInCanvas (const std::string &hname, TCanvas **canvas=nullptr)
 Find histogram in corresponding canvas.
 
TH1 * getDelta (const std::string &dirname, const std::string &histname="", int n=0, bool onlyIfUpdated=true)
 Get Delta histogram.
 
int registerEpicsPV (const std::string &pvname, const std::string &keyname="")
 EPICS related Functions.
 
int registerExternalEpicsPV (const std::string &pvname, const std::string &keyname="")
 Register a PV with its name and a key name.
 
void setEpicsPV (const std::string &keyname, double value)
 Write value to a EPICS PV.
 
void setEpicsPV (const std::string &keyname, int value)
 Write value to a EPICS PV.
 
void setEpicsPV (int index, double value)
 Write value to a EPICS PV.
 
void setEpicsPV (int index, int value)
 Write value to a EPICS PV.
 
void setEpicsStringPV (const std::string &keyname, const std::string &value)
 Write string to a EPICS PV.
 
void setEpicsStringPV (int index, const std::string &value)
 Write string to a EPICS PV.
 
double getEpicsPV (const std::string &keyname)
 Read value from a EPICS PV.
 
double getEpicsPV (int index)
 Read value from a EPICS PV.
 
std::string getEpicsStringPV (const std::string &keyname, bool &status)
 Read value from a EPICS PV.
 
std::string getEpicsStringPV (int index, bool &status)
 Read value from a EPICS PV.
 
int updateEpicsPVs (float timeout)
 Update all EPICS PV (flush to network)
 
chid getEpicsPVChID (const std::string &keyname)
 Get EPICS PV Channel Id.
 
chid getEpicsPVChID (int index)
 Get EPICS PV Channel Id.
 
bool requestLimitsFromEpicsPVs (chid id, double &lowerAlarm, double &lowerWarn, double &upperWarn, double &upperAlarm)
 Get Alarm Limits from EPICS PV.
 
bool requestLimitsFromEpicsPVs (const std::string &keyname, double &lowerAlarm, double &lowerWarn, double &upperWarn, double &upperAlarm)
 Get Alarm Limits from EPICS PV.
 
bool requestLimitsFromEpicsPVs (int index, double &lowerAlarm, double &lowerWarn, double &upperWarn, double &upperAlarm)
 Get Alarm Limits from EPICS PV.
 
void cleanupEpicsPVs (void)
 Unsubscribe from EPICS PVs on terminate.
 
void CheckEpicsError (int state, const std::string &message, const std::string &name)
 check the return status and check PV in case of error
 
virtual std::vector< std::string > getFileNames (bool outputFiles)
 Return a list of output filenames for this modules.
 
virtual void terminate ()
 This method is called at the end of the event processing.
 
const std::string & getName () const
 Returns the name of the module.
 
const std::string & getType () const
 Returns the type of the module (i.e.
 
const std::string & getPackage () const
 Returns the package this module is in.
 
const std::string & getDescription () const
 Returns the description of the module.
 
void setName (const std::string &name)
 Set the name of the module.
 
void setPropertyFlags (unsigned int propertyFlags)
 Sets the flags for the module properties.
 
LogConfiggetLogConfig ()
 Returns the log system configuration.
 
void setLogConfig (const LogConfig &logConfig)
 Set the log system configuration.
 
void setLogLevel (int logLevel)
 Configure the log level.
 
void setDebugLevel (int debugLevel)
 Configure the debug messaging level.
 
void setAbortLevel (int abortLevel)
 Configure the abort log level.
 
void setLogInfo (int logLevel, unsigned int logInfo)
 Configure the printed log information for the given level.
 
void if_value (const std::string &expression, const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 Add a condition to the module.
 
void if_false (const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 A simplified version to add a condition to the module.
 
void if_true (const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 A simplified version to set the condition of the module.
 
bool hasCondition () const
 Returns true if at least one condition was set for the module.
 
const ModuleConditiongetCondition () const
 Return a pointer to the first condition (or nullptr, if none was set)
 
const std::vector< ModuleCondition > & getAllConditions () const
 Return all set conditions for this module.
 
bool evalCondition () const
 If at least one condition was set, it is evaluated and true returned if at least one condition returns true.
 
std::shared_ptr< PathgetConditionPath () const
 Returns the path of the last true condition (if there is at least one, else reaturn a null pointer).
 
Module::EAfterConditionPath getAfterConditionPath () const
 What to do after the conditional path is finished.
 
std::vector< std::shared_ptr< Path > > getAllConditionPaths () const
 Return all condition paths currently set (no matter if the condition is true or not).
 
bool hasProperties (unsigned int propertyFlags) const
 Returns true if all specified property flags are available in this module.
 
bool hasUnsetForcedParams () const
 Returns true and prints error message if the module has unset parameters which the user has to set in the steering file.
 
const ModuleParamListgetParamList () const
 Return module param list.
 
template<typename T>
ModuleParam< T > & getParam (const std::string &name) const
 Returns a reference to a parameter.
 
bool hasReturnValue () const
 Return true if this module has a valid return value set.
 
int getReturnValue () const
 Return the return value set by this module.
 
std::shared_ptr< PathElementclone () const override
 Create an independent copy of this module.
 
std::shared_ptr< boost::python::list > getParamInfoListPython () const
 Returns a python list of all parameters.
 

Static Public Member Functions

static void clearlist (void)
 Clear all static global lists.
 
static HistListgetHistList ()
 Get the list of the histograms.
 
static MonObjListgetMonObjList ()
 Get the list of MonitoringObjects.
 
static const DeltaListgetDeltaList ()
 Get the list of the delta histograms.
 
static const CanvasUpdatedListgetCanvasUpdatedList ()
 Get the list of the canvas update status.
 
static const std::string & getRunType (void)
 Get the list of the reference histograms.
 
static int getEventProcessed (void)
 Get the number of processed events.
 
static void setRunType (const std::string &t)
 Set the Run Type.
 
static void setEventProcessed (int e)
 Set the number of processed events.
 
static TCanvas * findCanvas (TString cname)
 Find canvas by name.
 
static TH1 * findHist (const std::string &dirname, const std::string &histname="", bool onlyIfUpdated=false)
 Find histogram.
 
static TH1 * findRefHist (const std::string &dirname, const std::string &histname="", ERefScaling scaling=ERefScaling::c_RefScaleNone, const TH1 *hist=nullptr)
 Find reference histogram.
 
static TH1 * scaleReference (ERefScaling scaling, const TH1 *hist, TH1 *ref)
 Using the original and reference, create scaled version.
 
static TH1 * findHistInFile (TFile *file, const std::string &histname)
 Find histogram in specific TFile (e.g.
 
static MonitoringObjectfindMonitoringObject (const std::string &objName)
 Find MonitoringObject.
 
static double getSigma68 (TH1 *h)
 Helper function to compute half of the central interval covering 68% of a distribution.
 
static bool addHist (const std::string &dirname, const std::string &histname, TH1 *h)
 Add histogram.
 
static void addRefHist (const std::string &dirname, TH1 *hist)
 Add reference histogram.
 
static MonitoringObjectgetMonitoringObject (const std::string &name)
 Get MonitoringObject with given name (new object is created if non-existing)
 
static void clearCanvases (void)
 Clear content of all Canvases.
 
static void initHistListBeforeEvent (void)
 Reset the list of histograms.
 
static void clearHistList (void)
 Clears the list of histograms.
 
static void clearRefList (void)
 Clears the list of ref histograms.
 
static void resetDeltaList (void)
 Reset Delta.
 
static void addDeltaPar (const std::string &dirname, const std::string &histname, HistDelta::EDeltaType t, int p, unsigned int a=1)
 Add Delta histogram parameters.
 
static bool hasDeltaPar (const std::string &dirname, const std::string &histname)
 Check if Delta histogram parameters exist for histogram.
 
static void UpdateCanvas (const std::string &name, bool updated=true)
 Mark canvas as updated (or not)
 
static void UpdateCanvas (TCanvas *canvas, bool updated=true)
 Mark canvas as updated (or not)
 
static void ExtractRunType (std::vector< TH1 * > &hs)
 Extract Run Type from histogram title, called from input module.
 
static void ExtractNEvent (std::vector< TH1 * > &hs)
 Extract event processed from daq histogram, called from input module.
 
static void setUseEpics (bool flag)
 Setter for EPICS usage.
 
static void setUseEpicsReadOnly (bool flag)
 Setter EPICS flag in read only mode.
 
static bool getUseEpics (void)
 Getter for EPICS usage.
 
static bool getUseEpicsReadOnly (void)
 Getter EPICS flag in read only mode.
 
static std::string & getPVPrefix (void)
 get global prefix for EPICS PVs
 
static void setPVPrefix (const std::string &prefix)
 set global prefix for EPICS PVs
 
static EStatus makeStatus (bool enough, bool warn_flag, bool error_flag)
 Helper function to judge the status for coloring and EPICS.
 
static void colorizeCanvas (TCanvas *canvas, EStatus status)
 Helper function for Canvas colorization.
 
static EStatusColor getStatusColor (EStatus status)
 Return color for canvas state.
 
static void checkPVStatus (void)
 Check the status of all PVs and report if disconnected or not found.
 
static void printPVStatus (chid pv, bool onlyError=true)
 check the status of a PVs and report if disconnected or not found
 
static void CheckEpicsError (int state, const std::string &message, chid id)
 check the return status and check PV in case of error
 
static std::vector< std::string > StringSplit (const std::string &s, const char delim)
 Helper function for string token split.
 
static void exposePythonAPI ()
 Exposes methods of the Module class to Python.
 

Static Public Attributes

static DeltaList s_deltaList
 The list of Delta Histograms and settings.
 

Protected Member Functions

virtual void def_initialize ()
 Wrappers to make the methods without "def_" prefix callable from Python.
 
virtual void def_beginRun ()
 Wrapper method for the virtual function beginRun() that has the implementation to be used in a call from Python.
 
virtual void def_event ()
 Wrapper method for the virtual function event() that has the implementation to be used in a call from Python.
 
virtual void def_endRun ()
 This method can receive that the current run ends as a call from the Python side.
 
virtual void def_terminate ()
 Wrapper method for the virtual function terminate() that has the implementation to be used in a call from Python.
 
void setDescription (const std::string &description)
 Sets the description of the module.
 
void setType (const std::string &type)
 Set the module type.
 
template<typename T>
void addParam (const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
 Adds a new parameter to the module.
 
template<typename T>
void addParam (const std::string &name, T &paramVariable, const std::string &description)
 Adds a new enforced parameter to the module.
 
void setReturnValue (int value)
 Sets the return value for this module as integer.
 
void setReturnValue (bool value)
 Sets the return value for this module as bool.
 
void setParamList (const ModuleParamList &params)
 Replace existing parameter list.
 

Private Types

typedef struct Belle2::DQMHistAnalysisSVDDoseModule::SensorGroup SensorGroup
 A struct to define the sensors group we average over.
 

Private Member Functions

void initialize () override final
 Initializer.
 
void beginRun () override final
 Called when entering a new run.
 
void event () override final
 This method is called for each event.
 
void endRun () override final
 This method is called if the current run ends.
 
void updateCanvases ()
 updated canvas
 
int registerEpicsPVwithPrefix (const std::string &prefix, const std::string &pvname, const std::string &keyname="")
 Register a PV with its name and a key name.
 
std::list< ModulePtrgetModules () const override
 no submodules, return empty list
 
std::string getPathString () const override
 return the module name.
 
void setParamPython (const std::string &name, const boost::python::object &pyObj)
 Implements a method for setting boost::python objects.
 
void setParamPythonDict (const boost::python::dict &dictionary)
 Implements a method for reading the parameter values from a boost::python dictionary.
 

Static Private Member Functions

template<typename T>
static T * findHistT (TString name)
 Utility method.
 
template<typename T>
static T * divide (T *num, T *den, float scale=1.0f, T *res=nullptr)
 Divide two histograms, ignoring errors on the second histogram.
 
static void carryOverflowOver (TH1F *h)
 Carries the content of the overflow bin into the last bin.
 

Private Attributes

std::string m_pvPrefix
 Prefix for EPICS PVs.
 
double m_epicsUpdateSeconds
 Minimum interval between successive PV updates.
 
std::string m_pvSuffix
 Suffix for EPICS PVs.
 
std::string m_deltaTPVSuffix
 Suffix of the update-time monitoring PV.
 
std::string m_statePVSuffix
 Suffix of the state PV.
 
MonitoringObjectm_monObj = nullptr
 Monitoring object for MiraBelle.
 
TPaveText * m_legend = nullptr
 Legend of the inst.
 
std::vector< TCanvas * > m_c_instOccu
 Canvases for the instantaneous occupancy.
 
std::vector< TCanvas * > m_c_occuLER
 Canvases for the occu.
 
std::vector< TH2F * > m_h_occuLER
 Histograms for the occ.
 
std::vector< TCanvas * > m_c_occuHER
 Canvases for the occu.
 
std::vector< TH2F * > m_h_occuHER
 Histograms for the occu.
 
std::vector< TCanvas * > m_c_occuLER1
 Canvases for the 1D occu.
 
std::vector< TH1F * > m_h_occuLER1
 Histograms for the 1D occu.
 
std::vector< TCanvas * > m_c_occuHER1
 Canvases for the 1D occu.
 
std::vector< TH1F * > m_h_occuHER1
 Histograms for the 1D occu.
 
std::vector< TCanvas * > m_c_instOccuAll
 Canvases for the instantaneous occupancy.
 
std::vector< TCanvas * > m_c_occuLERAll
 Canvases for the occu.
 
std::vector< TH2F * > m_h_occuLERAll
 Histograms for the occu.
 
std::vector< TCanvas * > m_c_occuHERAll
 Canvases for the occu.
 
std::vector< TH2F * > m_h_occuHERAll
 Histograms for the occu.
 
std::vector< TCanvas * > m_c_occuLER1All
 Canvases for the 1D occu.
 
std::vector< TH1F * > m_h_occuLER1All
 Histograms for the 1D occu.
 
std::vector< TCanvas * > m_c_occuHER1All
 Canvases for the 1D occu.
 
std::vector< TH1F * > m_h_occuHER1All
 Histograms for the 1D occu.
 
std::string m_name
 The name of the module, saved as a string (user-modifiable)
 
std::string m_type
 The type of the module, saved as a string.
 
std::string m_package
 Package this module is found in (may be empty).
 
std::string m_description
 The description of the module.
 
unsigned int m_propertyFlags
 The properties of the module as bitwise or (with |) of EModulePropFlags.
 
LogConfig m_logConfig
 The log system configuration of the module.
 
ModuleParamList m_moduleParamList
 List storing and managing all parameter of the module.
 
bool m_hasReturnValue
 True, if the return value is set.
 
int m_returnValue
 The return value.
 
std::vector< ModuleConditionm_conditions
 Module condition, only non-null if set.
 

Static Private Attributes

static const std::vector< SensorGroupc_sensorGroups
 List of sensors groups.
 
static HistList s_histList
 The list of Histograms.
 
static MonObjList s_monObjList
 The list of MonitoringObjects.
 
static CanvasUpdatedList s_canvasUpdatedList
 The list of canvas updated status.
 
static RefList s_refList
 The list of references.
 
static int s_eventProcessed = 0
 Number of Events processed to fill histograms.
 
static std::string s_runType = ""
 The Run type.
 
static bool m_useEpics = false
 Flag if to use EPICS do not set by yourself, use EpicsEnable module to set.
 
static bool m_epicsReadOnly
 Flag if to use EPICS in ReadOnly mode (for reading limits) do not set by yourself, use EpicsEnable module to set.
 
static std::string m_PVPrefix = "TEST:"
 The Prefix for EPICS PVs.
 

Detailed Description

The SVD dose-monitoring DQM analysis module.

Takes the histograms from SVDDQMDoseModule and plots the instantaneous occupancy distributions and the occupancy vs time since last injection and time in beam revolution cycle.

Sends the occupancies averaged over 5 minutes (TBD, can be configured with the epicsUpdateSeconds parameter) to EPICS PVs (the names of the PVs are like pvPrefix + "L3" + pvSuffix or pvPrefix + "L3:1" + pvSuffix; the default names are like SVD:DQM:L3:OccPois:Avg).

Sends the occupancies averaged over the run to MiraBelle (via the svd MonitoringObject).

See also
[BII-7853]: https://gitlab.desy.de/belle2/software/basf2/-/work_items/7721

Definition at line 46 of file DQMHistAnalysisSVDDose.h.

Member Typedef Documentation

◆ CanvasUpdatedList

typedef std::map<std::string, bool> CanvasUpdatedList
inherited

The type of list of canvas updated status.

Definition at line 91 of file DQMHistAnalysis.h.

◆ DeltaList

typedef std::map<std::string, HistDelta> DeltaList
inherited

The type of list of delta settings and histograms.

Definition at line 86 of file DQMHistAnalysis.h.

◆ EAfterConditionPath

Forward the EAfterConditionPath definition from the ModuleCondition.

Definition at line 88 of file Module.h.

◆ HistList

typedef std::map<std::string, HistObject> HistList
inherited

The type of list of histograms.

Definition at line 77 of file DQMHistAnalysis.h.

◆ MonObjList

typedef std::map<std::string, MonitoringObject> MonObjList
inherited

The type of list of MonitoringObjects.

Definition at line 81 of file DQMHistAnalysis.h.

◆ RefList

typedef std::map<std::string, RefHistObject> RefList
inherited

The type of list of references.

Definition at line 96 of file DQMHistAnalysis.h.

◆ SensorGroup

typedef struct Belle2::DQMHistAnalysisSVDDoseModule::SensorGroup SensorGroup
private

A struct to define the sensors group we average over.

See Belle2::SVD::SVDDQMDoseModule::SensorGroup.

Member Enumeration Documentation

◆ EModulePropFlags

enum EModulePropFlags
inherited

Each module can be tagged with property flags, which indicate certain features of the module.

Enumerator
c_Input 

This module is an input module (reads data).

c_Output 

This module is an output module (writes data).

c_ParallelProcessingCertified 

This module can be run in parallel processing mode safely (All I/O must be done through the data store, in particular, the module must not write any files.)

c_HistogramManager 

This module is used to manage histograms accumulated by other modules.

c_InternalSerializer 

This module is an internal serializer/deserializer for parallel processing.

c_TerminateInAllProcesses 

When using parallel processing, call this module's terminate() function in all processes().

This will also ensure that there is exactly one process (single-core if no parallel modules found) or at least one input, one main and one output process.

c_DontCollectStatistics 

No statistics is collected for this module.

Definition at line 77 of file Module.h.

77 {
78 c_Input = 1,
79 c_Output = 2,
80 c_ParallelProcessingCertified = 4,
81 c_HistogramManager = 8,
82 c_InternalSerializer = 16,
83 c_TerminateInAllProcesses = 32,
84 c_DontCollectStatistics = 64,
85 };
@ c_Output
Output Process.
Definition ProcHelper.h:19
@ c_Input
Input Process.
Definition ProcHelper.h:17

◆ ERefScaling

enum ERefScaling
inherited

Reference plot scaling type.

Enumerator
c_RefScaleNone 

no scaling

c_RefScaleEntries 

to number of entries (integral)

c_RefScaleMax 

to maximum (bin entry)

Definition at line 68 of file DQMHistAnalysis.h.

68 {
69 c_RefScaleNone = 0,
70 c_RefScaleEntries = 1,
71 c_RefScaleMax = 2
72 };

◆ EStatus

enum EStatus
inherited

Status flag of histogram/canvas.

Enumerator
c_StatusTooFew 

Not enough entries/event to judge.

c_StatusDefault 

default for non-coloring

c_StatusGood 

Analysis result: Good.

c_StatusWarning 

Analysis result: Warning, there may be minor issues.

c_StatusError 

Analysis result: Severe issue found.

Definition at line 46 of file DQMHistAnalysis.h.

46 {
47 c_StatusTooFew = 0,
48 c_StatusDefault = 1,
49 c_StatusGood = 2,
50 c_StatusWarning = 3,
51 c_StatusError = 4
52 };

◆ EStatusColor

enum EStatusColor
inherited

Status colors of histogram/canvas (corresponding to status)

Enumerator
c_ColorTooFew 

Not enough entries/event to judge.

c_ColorDefault 

default for non-coloring

c_ColorGood 

Analysis result: Good.

c_ColorWarning 

Analysis result: Warning, there may be minor issues.

c_ColorError 

Analysis result: Severe issue found.

Definition at line 57 of file DQMHistAnalysis.h.

57 {
58 c_ColorTooFew = kGray,
59 c_ColorDefault = kWhite,
60 c_ColorGood = kGreen,
61 c_ColorWarning = kYellow,
62 c_ColorError = kRed
63 };

Constructor & Destructor Documentation

◆ DQMHistAnalysisSVDDoseModule()

Definition at line 22 of file DQMHistAnalysisSVDDose.cc.

23{
24 setDescription("Monitoring of SVD Dose with events from Poisson trigger w/o inj. veto. See also SVDDQMDoseModule.");
25 // THIS MODULE CAN NOT BE RUN IN PARALLEL
26 addParam("pvPrefix", m_pvPrefix, "Prefix for EPICS PVs.", std::string("DQM:SVD:"));
27 addParam("epicsUpdateSeconds", m_epicsUpdateSeconds,
28 "Minimum interval between two successive PV updates (in seconds).", 1000.0);
29 addParam("pvSuffix", m_pvSuffix, "Suffix for EPICS PVs.", std::string(":Occ:Pois:Avg"));
30 addParam("deltaTPVSuffix", m_deltaTPVSuffix, "Suffix for the PV that monitors the update interval of the PVs.",
31 std::string("Occ:Pois:UpdateInterval"));
32 addParam("statePVSuffix", m_statePVSuffix, "Suffix for the PV with the state of the monitoring.",
33 std::string("Occ:Pois:State"));
34}
std::string m_deltaTPVSuffix
Suffix of the update-time monitoring PV.
double m_epicsUpdateSeconds
Minimum interval between successive PV updates.
std::string m_pvPrefix
Prefix for EPICS PVs.
std::string m_statePVSuffix
Suffix of the state PV.
std::string m_pvSuffix
Suffix for EPICS PVs.
void setDescription(const std::string &description)
Sets the description of the module.
Definition Module.cc:214
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition Module.h:559

Member Function Documentation

◆ addDeltaPar()

void addDeltaPar ( const std::string & dirname,
const std::string & histname,
HistDelta::EDeltaType t,
int p,
unsigned int a = 1 )
staticinherited

Add Delta histogram parameters.

Parameters
dirnamedirectory
histnamename of histogram
ttype of delta histogramming
pnumerical parameter depending on type, e.g. number of entries
aamount of histograms in the past

Definition at line 95 of file DQMHistAnalysis.cc.

97{
98 std::string fullname;
99 if (dirname.size() > 0) {
100 fullname = dirname + "/" + histname;
101 } else {
102 fullname = histname;
103 }
104 s_deltaList[fullname].set(t, p, a);
105}
static DeltaList s_deltaList
The list of Delta Histograms and settings.

◆ addHist()

bool addHist ( const std::string & dirname,
const std::string & histname,
TH1 * h )
staticinherited

Add histogram.

Parameters
dirnameThe name of the directory.
histnameThe name of the histogram.
hThe TH1 pointer for the histogram.
Returns
histogram was updated flag

Definition at line 59 of file DQMHistAnalysis.cc.

60{
61 std::string fullname;
62 if (dirname.size() > 0) {
63 fullname = dirname + "/" + histname;
64 } else {
65 fullname = histname;
66 }
67
68 if (s_histList[fullname].update(h)) {
69 // only if histogram changed, check if delta histogram update needed
70 auto it = s_deltaList.find(fullname);
71 if (it != s_deltaList.end()) {
72 B2DEBUG(20, "Found Delta" << fullname);
73 it->second.update(h); // update
74 }
75 return true; // histogram changed
76 }
77
78 return false; // histogram didn't change
79}
static HistList s_histList
The list of Histograms.

◆ addRefHist()

void addRefHist ( const std::string & dirname,
TH1 * hist )
staticinherited

Add reference histogram.

Parameters
dirnameThe name of the directory.
histThe TH1 pointer for the reference.

Definition at line 81 of file DQMHistAnalysis.cc.

82{
83 string histname = hist->GetName();
84 std::string name = dirname + "/" + histname;
85 auto& n = s_refList[name];
86 n.m_orghist_name = name;
87 n.m_refhist_name = "ref/" + name;
88 hist->SetName((n.m_refhist_name).c_str());
89 hist->SetDirectory(0);
90 n.setRefHist(hist); // transfer ownership!
91 n.setRefCopy(nullptr);
92 n.setCanvas(nullptr);
93}
static RefList s_refList
The list of references.

◆ beginRun()

void beginRun ( void )
finaloverrideprivatevirtual

Called when entering a new run.

Reimplemented from Module.

Definition at line 137 of file DQMHistAnalysisSVDDose.cc.

138{
139 // Set status PV to running, reset last update time
140#ifdef _BELLE2_EPICS
141 if (getUseEpics()) {
142 B2DEBUG(19, "beginRun: setting state PV to RUNNING");
143 m_stateCtrl.value = 1;
144 if (m_stateChan) {
145 SEVCHK(ca_put(DBR_ENUM, m_stateChan, &m_stateCtrl.value), "ca_put");
146 } else {
147 SEVCHK(ca_create_channel((m_pvPrefix + m_statePVSuffix).data(),
148 NULL, NULL, 10, &m_stateChan), "ca_create_channel (reconnection)");
149 }
150 SEVCHK(ca_pend_io(2.0), "ca_pend_io");
151 // First update should happen m_epicsUpdateSeconds from now
152 m_lastPVUpdate = getClockSeconds();
153 }
154#endif
155}
static bool getUseEpics(void)
Getter for EPICS usage.

◆ carryOverflowOver()

void carryOverflowOver ( TH1F * h)
staticprivate

Carries the content of the overflow bin into the last bin.

Definition at line 465 of file DQMHistAnalysisSVDDose.cc.

466{
467 int i = h->GetNbinsX();
468 float t = h->GetBinContent(i) + h->GetBinContent(i + 1);
469 h->SetBinContent(i, t);
470 h->SetBinContent(i + 1, 0);
471}

◆ CheckEpicsError() [1/2]

void CheckEpicsError ( int state,
const std::string & message,
chid id = nullptr )
staticinherited

check the return status and check PV in case of error

Parameters
statereturn state of epics function
messagemessage to print out
idthe chid of the affected PV

Definition at line 793 of file DQMHistAnalysis.cc.

794{
795 if (state != ECA_NORMAL) {
796 std::string name;
797 if (id) name = ca_name(id);
798 B2WARNING(message << ": " << name);
799 printPVStatus(id, false);
800 }
801}
static void printPVStatus(chid pv, bool onlyError=true)
check the status of a PVs and report if disconnected or not found

◆ CheckEpicsError() [2/2]

void CheckEpicsError ( int state,
const std::string & message,
const std::string & name )
inherited

check the return status and check PV in case of error

Parameters
statereturn state of epics function
messagemessage to print out
namethe (key)name of the affected PV

Definition at line 785 of file DQMHistAnalysis.cc.

786{
787 if (state != ECA_NORMAL) {
788 B2WARNING(message << ": " << name);
789 printPVStatus(m_epicsNameToChID[name], false);
790 }
791}

◆ checkPVStatus()

void checkPVStatus ( void )
staticinherited

Check the status of all PVs and report if disconnected or not found.

Definition at line 749 of file DQMHistAnalysis.cc.

750{
751 B2INFO("Check PV Connections");
752
753 for (const auto& it : m_epicsChID) {
754 printPVStatus(it);
755 }
756 B2INFO("Check PVs done");
757}

◆ cleanupEpicsPVs()

void cleanupEpicsPVs ( void )
inherited

Unsubscribe from EPICS PVs on terminate.

Definition at line 630 of file DQMHistAnalysis.cc.

631{
632 // this should be called in terminate function of analysis modules
633#ifdef _BELLE2_EPICS
634 if (getUseEpics()) {
635 for (auto& it : m_epicsChID) CheckEpicsError(ca_clear_channel(it), "ca_clear_channel failure", it);
636 updateEpicsPVs(5.0);
637 // Make sure we clean up both afterwards!
638 m_epicsChID.clear();
639 m_epicsNameToChID.clear();
640 }
641#endif
642}
void CheckEpicsError(int state, const std::string &message, const std::string &name)
check the return status and check PV in case of error
int updateEpicsPVs(float timeout)
Update all EPICS PV (flush to network)

◆ clearCanvases()

void clearCanvases ( void )
staticinherited

Clear content of all Canvases.

Definition at line 295 of file DQMHistAnalysis.cc.

296{
297 TIter nextckey(gROOT->GetListOfCanvases());
298 TObject* cobj = nullptr;
299
300 while ((cobj = dynamic_cast<TObject*>(nextckey()))) {
301 if (cobj->IsA()->InheritsFrom("TCanvas")) {
302 TCanvas* cnv = dynamic_cast<TCanvas*>(cobj);
303 cnv->Clear();
305 }
306 }
307}
static void colorizeCanvas(TCanvas *canvas, EStatus status)
Helper function for Canvas colorization.
@ c_StatusDefault
default for non-coloring

◆ clearHistList()

void clearHistList ( void )
staticinherited

Clears the list of histograms.

Definition at line 323 of file DQMHistAnalysis.cc.

324{
325 s_histList.clear();
326}

◆ clearlist()

void clearlist ( void )
staticinherited

Clear all static global lists.

Definition at line 50 of file DQMHistAnalysis.cc.

51{
52 s_histList.clear();
53 s_refList.clear();
54// s_monObjList;
55 s_deltaList.clear();
56 s_canvasUpdatedList.clear();
57}
static CanvasUpdatedList s_canvasUpdatedList
The list of canvas updated status.

◆ clearRefList()

void clearRefList ( void )
staticinherited

Clears the list of ref histograms.

Definition at line 328 of file DQMHistAnalysis.cc.

329{
330 s_refList.clear();
331}

◆ clone()

std::shared_ptr< PathElement > clone ( ) const
overridevirtualinherited

Create an independent copy of this module.

Note that parameters are shared, so changing them on a cloned module will also affect the original module.

Implements PathElement.

Definition at line 179 of file Module.cc.

180{
183 newModule->setName(getName());
184 newModule->m_package = m_package;
185 newModule->m_propertyFlags = m_propertyFlags;
186 newModule->m_logConfig = m_logConfig;
187 newModule->m_conditions = m_conditions;
188
189 return newModule;
190}
std::shared_ptr< Module > registerModule(const std::string &moduleName, std::string sharedLibPath="") noexcept(false)
Creates an instance of a module and registers it to the ModuleManager.
static ModuleManager & Instance()
Exception is thrown if the requested module could not be created by the ModuleManager.
void setParameters(const ModuleParamList &params)
Set values for parameters from other parameter list.
const ModuleParamList & getParamList() const
Return module param list.
Definition Module.h:362
const std::string & getName() const
Returns the name of the module.
Definition Module.h:186
const std::string & getType() const
Returns the type of the module (i.e.
Definition Module.cc:41
unsigned int m_propertyFlags
The properties of the module as bitwise or (with |) of EModulePropFlags.
Definition Module.h:511
ModuleParamList m_moduleParamList
List storing and managing all parameter of the module.
Definition Module.h:515
void setName(const std::string &name)
Set the name of the module.
Definition Module.h:213
LogConfig m_logConfig
The log system configuration of the module.
Definition Module.h:513
std::vector< ModuleCondition > m_conditions
Module condition, only non-null if set.
Definition Module.h:520
std::string m_package
Package this module is found in (may be empty).
Definition Module.h:509
std::shared_ptr< Module > ModulePtr
Defines a pointer to a module object as a boost shared pointer.
Definition Module.h:43

◆ colorizeCanvas()

void colorizeCanvas ( TCanvas * canvas,
EStatus status )
staticinherited

Helper function for Canvas colorization.

Parameters
canvasCanvas to change
statusstatus to color

Definition at line 736 of file DQMHistAnalysis.cc.

737{
738 if (!canvas) return;
739 auto color = DQMHistAnalysisModule::getStatusColor(stat);
740
741 canvas->Pad()->SetFillColor(color);
742
743 canvas->Pad()->SetFrameFillColor(10); // White (kWhite is not used since it results in transparent!)
744 canvas->Pad()->SetFrameFillStyle(1001);// White
745 canvas->Pad()->Modified();
746 canvas->Pad()->Update();
747}
static EStatusColor getStatusColor(EStatus status)
Return color for canvas state.

◆ def_beginRun()

virtual void def_beginRun ( )
inlineprotectedvirtualinherited

Wrapper method for the virtual function beginRun() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 425 of file Module.h.

425{ beginRun(); }

◆ def_endRun()

virtual void def_endRun ( )
inlineprotectedvirtualinherited

This method can receive that the current run ends as a call from the Python side.

For regular C++-Modules that forwards the call to the regular endRun() method.

Reimplemented in PyModule.

Definition at line 438 of file Module.h.

438{ endRun(); }

◆ def_event()

virtual void def_event ( )
inlineprotectedvirtualinherited

Wrapper method for the virtual function event() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 431 of file Module.h.

431{ event(); }

◆ def_initialize()

virtual void def_initialize ( )
inlineprotectedvirtualinherited

Wrappers to make the methods without "def_" prefix callable from Python.

Overridden in PyModule. Wrapper method for the virtual function initialize() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 419 of file Module.h.

419{ initialize(); }

◆ def_terminate()

virtual void def_terminate ( )
inlineprotectedvirtualinherited

Wrapper method for the virtual function terminate() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 444 of file Module.h.

444{ terminate(); }

◆ divide()

template<typename T>
static T * divide ( T * num,
T * den,
float scale = 1.0f,
T * res = nullptr )
inlinestaticprivate

Divide two histograms, ignoring errors on the second histogram.

Parameters
numThe numerator histogram.
denThe denominator histogram. Must have the same bins as num.
scaleOptional rescaling factor.
resThe resulting histogram. If this parameter is null, a new histogram will be created and returned; otherwise, this histogram will be overwritten and returned.
Returns
The result of the division, see parameter res.

In short, for each bin we have:

  • result_bin = scale * num_bin / den_bin
  • result_err = scale * num_err / den_bin

Definition at line 111 of file DQMHistAnalysisSVDDose.h.

112 {
113 if (!res) {
114 TString name = TString("occu_from_") + num->GetName();
115 res = dynamic_cast<T*>(num->Clone(name));
116 }
117 for (int i = 0; i < num->GetNcells(); i++) {
118 float n = num->GetBinContent(i), d = den->GetBinContent(i), e = num->GetBinError(i);
119 res->SetBinContent(i, d ? scale * n / d : 0.0f);
120 res->SetBinError(i, d ? scale * e / d : 0.0f);
121 }
122 return res;
123 }

◆ endRun()

void endRun ( void )
finaloverrideprivatevirtual

This method is called if the current run ends.

Reimplemented from Module.

Definition at line 229 of file DQMHistAnalysisSVDDose.cc.

230{
231 B2DEBUG(18, "DQMHistAnalysisSVDDose: endRun");
232
233 // EPICS: reset the counters used for the delta computation, set state to NOT RUNNING
234#ifdef _BELLE2_EPICS
235 if (getUseEpics()) {
236 B2DEBUG(19, "endRun: setting state PV to NOT RUNNING");
237 m_stateCtrl.value = 0;
238 if (m_stateChan) {
239 SEVCHK(ca_put(DBR_ENUM, m_stateChan, &m_stateCtrl.value), "ca_put");
240 } else {
241 SEVCHK(ca_create_channel((m_pvPrefix + m_statePVSuffix).data(),
242 NULL, NULL, 10, &m_stateChan), "ca_create_channel (reconnection)");
243 }
244 SEVCHK(ca_pend_io(2.0), "ca_pend_io");
245 // Reset events and hits counters
246 for (auto& pv : m_myPVs)
247 pv.lastNEvts = pv.lastNHits = 0.0;
248 }
249#endif
250
251 // Write to MiraBelle
252 for (unsigned int g = 0; g < c_sensorGroups.size(); g++) {
253 const auto& group = c_sensorGroups[g];
254 double nHits = 0.0, nEvts = 0.0;
255 for (TString dir : {"SVDDoseLERInjPois", "SVDDoseHERInjPois", "SVDDoseNoInjPois"}) {
256 auto hHits = findHistT<TH2F>(dir + "/SVDHitsVsTime_" + group.nameSuffix);
257 auto hEvts = findHistT<TH2F>(dir + "/SVDEvtsVsTime");
258 if (!hHits || !hEvts) {
259 B2WARNING("Histograms needed for Average Poisson Occupancy U-side not found.");
260 nEvts = 0.0;
261 break;
262 }
263 nHits += hHits->GetEntries();
264 nEvts += hEvts->GetEntries();
265 }
266
267 B2DEBUG(19, "DQMHistAnalysisSVDDose: MonObj write"
268 << LogVar("group", group.nameSuffix.Data())
269 << LogVar("nEvts", nEvts) << LogVar("nHits", nHits));
270
271 if (nEvts > 0) {
272 const double occ = nHits / nEvts * 100.0 / group.nStrips;
273 TString vName = group.nameSuffix + "OccPoisAvg"; // e.g. L3XXUOccPoisAvg
274 m_monObj->setVariable(vName.Data(), occ);
275 }
276 }
277
279}
MonitoringObject * m_monObj
Monitoring object for MiraBelle.
static const std::vector< SensorGroup > c_sensorGroups
List of sensors groups.
static T * findHistT(TString name)
Utility method.

◆ evalCondition()

bool evalCondition ( ) const
inherited

If at least one condition was set, it is evaluated and true returned if at least one condition returns true.

If no condition or result value was defined, the method returns false. Otherwise, the condition is evaluated and true returned, if at least one condition returns true. To speed up the evaluation, the condition strings were already parsed in the method if_value().

Returns
True if at least one condition and return value exists and at least one condition expression was evaluated to true.

Definition at line 96 of file Module.cc.

97{
98 if (m_conditions.empty()) return false;
99
100 //okay, a condition was set for this Module...
101 if (!m_hasReturnValue) {
102 B2FATAL("A condition was set for '" << getName() << "', but the module did not set a return value!");
103 }
104
105 for (const auto& condition : m_conditions) {
106 if (condition.evaluate(m_returnValue)) {
107 return true;
108 }
109 }
110 return false;
111}
int m_returnValue
The return value.
Definition Module.h:518
bool m_hasReturnValue
True, if the return value is set.
Definition Module.h:517

◆ event()

void event ( void )
finaloverrideprivatevirtual

This method is called for each event.

Reimplemented from Module.

Definition at line 157 of file DQMHistAnalysisSVDDose.cc.

158{
159 // Update PVs ("write" to EPICS)
160#ifdef _BELLE2_EPICS
161 double timeSinceLastPVUpdate = getClockSeconds() - m_lastPVUpdate;
162 if (getUseEpics() && timeSinceLastPVUpdate >= m_epicsUpdateSeconds) {
163 // Dummy ca_get to ensure reconnection to the IOC in case of past errors
164 if (m_stateChan) {
165 SEVCHK(ca_get(DBR_CTRL_ENUM, m_stateChan, &m_stateCtrl), "ca_get");
166 } else {
167 SEVCHK(ca_create_channel((m_pvPrefix + m_statePVSuffix).data(),
168 NULL, NULL, 10, &m_stateChan), "ca_create_channel (reconnection)");
169 }
170 SEVCHK(ca_pend_io(2.0), "ca_pend_io");
171
172 // Write updateInterval PV and state PV first
173 if (m_timeSinceLastPVUpdateChan) {
174 SEVCHK(ca_put(DBR_DOUBLE, m_timeSinceLastPVUpdateChan, (void*)&timeSinceLastPVUpdate), "ca_put");
175 } else {
176 SEVCHK(ca_create_channel((m_pvPrefix + m_deltaTPVSuffix).data(), NULL, NULL, 10, &m_timeSinceLastPVUpdateChan),
177 "ca_create_channel (reconnection)");
178 }
179 m_stateCtrl.value = 1; // If IOC is restarted this PV must be re-updated
180 if (m_stateChan) {
181 SEVCHK(ca_put(DBR_ENUM, m_stateChan, &m_stateCtrl.value), "ca_put");
182 } else {
183 SEVCHK(ca_create_channel((m_pvPrefix + m_statePVSuffix).data(),
184 NULL, NULL, 10, &m_stateChan), "ca_create_channel (reconnection)");
185 }
186 // Update occupancy PVs
187 for (unsigned int g = 0; g < c_sensorGroups.size(); g++) {
188 const auto& group = c_sensorGroups[g];
189 double nHits = 0.0, nEvts = 0.0;
190 for (TString dir : {"SVDDoseLERInjPois", "SVDDoseHERInjPois", "SVDDoseNoInjPois"}) {
191 auto hHits = findHistT<TH2F>(dir + "/SVDHitsVsTime_" + group.nameSuffix);
192 auto hEvts = findHistT<TH2F>(dir + "/SVDEvtsVsTime");
193 if (!hHits || !hEvts) {
194 B2WARNING("Histograms needed for Average Poisson Occupancy U-side not found.");
195 nEvts = 0.0;
196 break;
197 }
198 nHits += hHits->GetEntries();
199 nEvts += hEvts->GetEntries();
200 }
201
202 B2DEBUG(19, "DQMHistAnalysisSVDDose: PV write"
203 << LogVar("group", group.nameSuffix.Data())
204 << LogVar("nEvts", nEvts) << LogVar("nHits", nHits));
205
206 auto& pv = m_myPVs[g];
207 double delta_nHits = nHits - pv.lastNHits;
208 double delta_nEvts = nEvts - pv.lastNEvts;
209 double occ = delta_nEvts > 0.0 ? (delta_nHits / delta_nEvts * 100.0 / group.nStrips) : -1.0;
210 if (pv.mychid) {
211 SEVCHK(ca_put(DBR_DOUBLE, pv.mychid, (void*)&occ), "ca_put");
212 } else {
213 SEVCHK(ca_create_channel((m_pvPrefix + c_sensorGroups[g].pvMiddle + m_pvSuffix).data(),
214 NULL, NULL, 10, &m_myPVs[g].mychid), "ca_create_channel (reconnection)");
215 }
216 pv.lastNEvts = nEvts;
217 pv.lastNHits = nHits;
218 }
219
220 // Actually write all the PVs
221 SEVCHK(ca_pend_io(2.0), "ca_pend_io");
222 m_lastPVUpdate = getClockSeconds();
223 }
224#endif
225
227}

◆ exposePythonAPI()

void exposePythonAPI ( )
staticinherited

Exposes methods of the Module class to Python.

Definition at line 325 of file Module.cc.

326{
327 // to avoid confusion between std::arg and boost::python::arg we want a shorthand namespace as well
328 namespace bp = boost::python;
329
330 docstring_options options(true, true, false); //userdef, py sigs, c++ sigs
331
332 void (Module::*setReturnValueInt)(int) = &Module::setReturnValue;
333
334 enum_<Module::EAfterConditionPath>("AfterConditionPath",
335 R"(Determines execution behaviour after a conditional path has been executed:
336
337.. attribute:: END
338
339 End processing of this path after the conditional path. (this is the default for if_value() etc.)
340
341.. attribute:: CONTINUE
342
343 After the conditional path, resume execution after this module.)")
344 .value("END", Module::EAfterConditionPath::c_End)
345 .value("CONTINUE", Module::EAfterConditionPath::c_Continue)
346 ;
347
348 /* Do not change the names of >, <, ... we use them to serialize conditional paths */
349 enum_<Belle2::ModuleCondition::EConditionOperators>("ConditionOperator")
356 ;
357
358 enum_<Module::EModulePropFlags>("ModulePropFlags",
359 R"(Flags to indicate certain low-level features of modules, see :func:`Module.set_property_flags()`, :func:`Module.has_properties()`. Most useful flags are:
360
361.. attribute:: PARALLELPROCESSINGCERTIFIED
362
363 This module can be run in parallel processing mode safely (All I/O must be done through the data store, in particular, the module must not write any files.)
364
365.. attribute:: HISTOGRAMMANAGER
366
367 This module is used to manage histograms accumulated by other modules
368
369.. attribute:: TERMINATEINALLPROCESSES
370
371 When using parallel processing, call this module's terminate() function in all processes. This will also ensure that there is exactly one process (single-core if no parallel modules found) or at least one input, one main and one output process.
372)")
373 .value("INPUT", Module::EModulePropFlags::c_Input)
374 .value("OUTPUT", Module::EModulePropFlags::c_Output)
375 .value("PARALLELPROCESSINGCERTIFIED", Module::EModulePropFlags::c_ParallelProcessingCertified)
376 .value("HISTOGRAMMANAGER", Module::EModulePropFlags::c_HistogramManager)
377 .value("INTERNALSERIALIZER", Module::EModulePropFlags::c_InternalSerializer)
378 .value("TERMINATEINALLPROCESSES", Module::EModulePropFlags::c_TerminateInAllProcesses)
379 ;
380
381 //Python class definition
382 class_<Module, PyModule> module("Module", R"(
383Base class for Modules.
384
385A module is the smallest building block of the framework.
386A typical event processing chain consists of a Path containing
387modules. By inheriting from this base class, various types of
388modules can be created. To use a module, please refer to
389:func:`Path.add_module()`. A list of modules is available by running
390``basf2 -m`` or ``basf2 -m package``, detailed information on parameters is
391given by e.g. ``basf2 -m RootInput``.
392
393The 'Module Development' section in the manual provides detailed information
394on how to create modules, setting parameters, or using return values/conditions:
395https://xwiki.desy.de/xwiki/rest/p/f4fa4/#HModuleDevelopment
396
397)");
398 module
399 .def("__str__", &Module::getPathString)
400 .def("name", &Module::getName, return_value_policy<copy_const_reference>(),
401 "Returns the name of the module. Can be changed via :func:`set_name() <Module.set_name()>`, use :func:`type() <Module.type()>` for identifying a particular module class.")
402 .def("type", &Module::getType, return_value_policy<copy_const_reference>(),
403 "Returns the type of the module (i.e. class name minus 'Module')")
404 .def("set_name", &Module::setName, args("name"), R"(
405Set custom name, e.g. to distinguish multiple modules of the same type.
406
407>>> path.add_module('EventInfoSetter')
408>>> ro = path.add_module('RootOutput', branchNames=['EventMetaData'])
409>>> ro.set_name('RootOutput_metadata_only')
410>>> print(path)
411[EventInfoSetter -> RootOutput_metadata_only]
412
413)")
414 .def("description", &Module::getDescription, return_value_policy<copy_const_reference>(),
415 "Returns the description of this module.")
416 .def("package", &Module::getPackage, return_value_policy<copy_const_reference>(),
417 "Returns the package this module belongs to.")
418 .def("available_params", &_getParamInfoListPython,
419 "Return list of all module parameters as `ModuleParamInfo` instances")
420 .def("has_properties", &Module::hasProperties, (bp::arg("properties")),
421 R"DOCSTRING(Allows to check if the module has the given properties out of `ModulePropFlags` set.
422
423>>> if module.has_properties(ModulePropFlags.PARALLELPROCESSINGCERTIFIED):
424>>> ...
425
426Parameters:
427 properties (int): bitmask of `ModulePropFlags` to check for.
428)DOCSTRING")
429 .def("set_property_flags", &Module::setPropertyFlags, args("property_mask"),
430 "Set module properties in the form of an OR combination of `ModulePropFlags`.");
431 {
432 // python signature is too crowded, make ourselves
433 docstring_options subOptions(true, false, false); //userdef, py sigs, c++ sigs
434 module
435 .def("if_value", &Module::if_value,
436 (bp::arg("expression"), bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
437 R"DOCSTRING(if_value(expression, condition_path, after_condition_path=AfterConditionPath.END)
438
439Sets a conditional sub path which will be executed after this
440module if the return value set in the module passes the given ``expression``.
441
442Modules can define a return value (int or bool) using ``setReturnValue()``,
443which can be used in the steering file to split the Path based on this value, for example
444
445>>> module_with_condition.if_value("<1", another_path)
446
447In case the return value of the ``module_with_condition`` for a given event is
448less than 1, the execution will be diverted into ``another_path`` for this event.
449
450You could for example set a special return value if an error occurs, and divert
451the execution into a path containing :b2:mod:`RootOutput` if it is found;
452saving only the data producing/produced by the error.
453
454After a conditional path has executed, basf2 will by default stop processing
455the path for this event. This behaviour can be changed by setting the
456``after_condition_path`` argument.
457
458Parameters:
459 expression (str): Expression to determine if the conditional path should be executed.
460 This should be one of the comparison operators ``<``, ``>``, ``<=``,
461 ``>=``, ``==``, or ``!=`` followed by a numerical value for the return value
462 condition_path (Path): path to execute in case the expression is fulfilled
463 after_condition_path (AfterConditionPath): What to do once the ``condition_path`` has been executed.
464)DOCSTRING")
465 .def("if_false", &Module::if_false,
466 (bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
467 R"DOC(if_false(condition_path, after_condition_path=AfterConditionPath.END)
468
469Sets a conditional sub path which will be executed after this module if
470the return value of the module evaluates to False. This is equivalent to
471calling `if_value` with ``expression=\"<1\"``)DOC")
472 .def("if_true", &Module::if_true,
473 (bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
474 R"DOC(if_true(condition_path, after_condition_path=AfterConditionPath.END)
475
476Sets a conditional sub path which will be executed after this module if
477the return value of the module evaluates to True. It is equivalent to
478calling `if_value` with ``expression=\">=1\"``)DOC");
479 }
480 module
481 .def("has_condition", &Module::hasCondition,
482 "Return true if a conditional path has been set for this module "
483 "using `if_value`, `if_true` or `if_false`")
484 .def("get_all_condition_paths", &_getAllConditionPathsPython,
485 "Return a list of all conditional paths set for this module using "
486 "`if_value`, `if_true` or `if_false`")
487 .def("get_all_conditions", &_getAllConditionsPython,
488 "Return a list of all conditional path expressions set for this module using "
489 "`if_value`, `if_true` or `if_false`")
490 .add_property("logging", make_function(&Module::getLogConfig, return_value_policy<reference_existing_object>()),
491 &Module::setLogConfig)
@ c_GE
Greater or equal than: ">=".
@ c_SE
Smaller or equal than: "<=".
@ c_GT
Greater than: ">".
@ c_NE
Not equal: "!=".
@ c_EQ
Equal: "=" or "==".
@ c_ST
Smaller than: "<".
void if_value(const std::string &expression, const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
Add a condition to the module.
Definition Module.cc:79
void if_true(const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
A simplified version to set the condition of the module.
Definition Module.cc:90
Module()
Constructor.
Definition Module.cc:30
void setReturnValue(int value)
Sets the return value for this module as integer.
Definition Module.cc:220
@ c_HistogramManager
This module is used to manage histograms accumulated by other modules.
Definition Module.h:81
@ c_Input
This module is an input module (reads data).
Definition Module.h:78
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition Module.h:80
@ c_InternalSerializer
This module is an internal serializer/deserializer for parallel processing.
Definition Module.h:82
@ c_Output
This module is an output module (writes data).
Definition Module.h:79
@ c_TerminateInAllProcesses
When using parallel processing, call this module's terminate() function in all processes().
Definition Module.h:83
void if_false(const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
A simplified version to add a condition to the module.
Definition Module.cc:85
ModuleCondition::EAfterConditionPath EAfterConditionPath
Forward the EAfterConditionPath definition from the ModuleCondition.
Definition Module.h:88

◆ ExtractNEvent()

void ExtractNEvent ( std::vector< TH1 * > & hs)
staticinherited

Extract event processed from daq histogram, called from input module.

Definition at line 362 of file DQMHistAnalysis.cc.

363{
365 for (size_t i = 0; i < hs.size(); i++) {
366 if (hs[i]->GetName() == std::string("DAQ/Nevent")) {
367 s_eventProcessed = hs[i]->GetEntries();
368 return;
369 }
370 }
371 B2ERROR("ExtractEvent: Histogram \"DAQ/Nevent\" missing");
372}
static int s_eventProcessed
Number of Events processed to fill histograms.

◆ ExtractRunType()

void ExtractRunType ( std::vector< TH1 * > & hs)
staticinherited

Extract Run Type from histogram title, called from input module.

Definition at line 350 of file DQMHistAnalysis.cc.

351{
352 s_runType = "";
353 for (size_t i = 0; i < hs.size(); i++) {
354 if (hs[i]->GetName() == std::string("DQMInfo/rtype")) {
355 s_runType = hs[i]->GetTitle();
356 return;
357 }
358 }
359 B2ERROR("ExtractRunType: Histogram \"DQMInfo/rtype\" missing");
360}
static std::string s_runType
The Run type.

◆ findCanvas()

TCanvas * findCanvas ( TString cname)
staticinherited

Find canvas by name.

Parameters
cnameName of the canvas
Returns
The pointer to the canvas, or nullptr if not found.

Definition at line 139 of file DQMHistAnalysis.cc.

140{
141 TIter nextkey(gROOT->GetListOfCanvases());
142 TObject* obj{};
143
144 while ((obj = dynamic_cast<TObject*>(nextkey()))) {
145 if (obj->IsA()->InheritsFrom("TCanvas")) {
146 if (obj->GetName() == canvas_name)
147 return dynamic_cast<TCanvas*>(obj);
148 }
149 }
150 return nullptr;
151}

◆ findHist()

TH1 * findHist ( const std::string & dirname,
const std::string & histname = "",
bool onlyIfUpdated = false )
staticinherited

Find histogram.

Parameters
dirnameThe name of the directory.
histnameThe name of the histogram.
onlyIfUpdatedreq only updated hists, return nullptr otherwise
Returns
The found histogram, or nullptr if not found.

Definition at line 154 of file DQMHistAnalysis.cc.

155{
156 std::string fullname = dirname + "/" + histname;
157 if (dirname.size() == 0) fullname = histname; // assume contains dirname
158 if (histname.size() == 0) fullname = dirname; // assume contains histname
159
160 if (s_histList.find(fullname) != s_histList.end()) {
161 if (was_updated && !s_histList[fullname].isUpdated()) return nullptr;
162 if (s_histList[fullname].getHist()) {
163 return s_histList[fullname].getHist();
164 } else {
165 B2ERROR("Histogram " << fullname << " in histogram list but nullptr.");
166 }
167 }
168 B2INFO("Histogram " << fullname << " not in list.");
169 return nullptr;
170}

◆ findHistInCanvas()

TH1 * findHistInCanvas ( const std::string & hname,
TCanvas ** canvas = nullptr )
inherited

Find histogram in corresponding canvas.

Parameters
hnameName of the histogram (dir+name)
canvasptr to specific canvas ptr or nullptr
Returns
The pointer to the histogram, or nullptr if not found.

Definition at line 214 of file DQMHistAnalysis.cc.

215{
216 TCanvas* cnv = nullptr;
217 // try to get canvas from outside
218 if (cobj) cnv = *cobj;
219 // if no canvas search for it
220 if (cnv == nullptr) {
221 // parse the dir+histo name and create the corresponding canvas name
222 auto s = StringSplit(histo_name, '/');
223 if (s.size() != 2) {
224 B2ERROR("findHistInCanvas: histoname not valid (missing dir?), should be 'dirname/histname': " << histo_name);
225 return nullptr;
226 }
227 auto dirname = s.at(0);
228 auto hname = s.at(1);
229 std::string canvas_name = dirname + "/c_" + hname;
230 cnv = findCanvas(canvas_name);
231 // set canvas pointer for outside
232 if (cnv && cobj) *cobj = cnv;
233 }
234
235 // get histogram pointer
236 if (cnv != nullptr) {
237 TIter nextkey(cnv->GetListOfPrimitives());
238 TObject* obj{};
239 while ((obj = dynamic_cast<TObject*>(nextkey()))) {
240 if (obj->IsA()->InheritsFrom("TH1")) {
241 if (obj->GetName() == histo_name)
242 return dynamic_cast<TH1*>(obj);
243 }
244 }
245 }
246 return nullptr;
247}
static TCanvas * findCanvas(TString cname)
Find canvas by name.
static std::vector< std::string > StringSplit(const std::string &s, const char delim)
Helper function for string token split.

◆ findHistInFile()

TH1 * findHistInFile ( TFile * file,
const std::string & histname )
staticinherited

Find histogram in specific TFile (e.g.

ref file).

Parameters
fileThe TFile to search.
histnameThe name of the histogram, can incl directory
Returns
The found histogram, or nullptr if not found.

Definition at line 249 of file DQMHistAnalysis.cc.

250{
251 // find histogram by name in file, histname CAN contain directory!
252 // will return nullptr if file is zeroptr, not found or not correct type
253 if (file && file->IsOpen()) {
254 auto obj = file->Get(histname.data());
255 if (obj != nullptr) {
256 // check class type
257 if (obj->IsA()->InheritsFrom("TH1")) {
258 B2DEBUG(20, "Histogram " << histname << " found in file");
259 return dynamic_cast<TH1*>(obj);
260 } else {
261 B2INFO("Found Object " << histname << " in file is not a histogram");
262 }
263 } else {
264 B2INFO("Histogram " << histname << " not found in file");
265 }
266 }
267 return nullptr;
268}

◆ findHistT()

template<typename T>
static T * findHistT ( TString name)
inlinestaticprivate

Utility method.

Definition at line 94 of file DQMHistAnalysisSVDDose.h.

94{ return dynamic_cast<T*>(findHist(name.Data())); }

◆ findMonitoringObject()

MonitoringObject * findMonitoringObject ( const std::string & objName)
staticinherited

Find MonitoringObject.

Parameters
objNameThe name of the MonitoringObject.
Returns
The found MonitoringObject, or nullptr if not found.

Definition at line 270 of file DQMHistAnalysis.cc.

271{
272 if (s_monObjList.find(objName) != s_monObjList.end()) {
273 return &s_monObjList[objName];
274 }
275 B2INFO("MonitoringObject " << objName << " not in memfile.");
276 return nullptr;
277}
static MonObjList s_monObjList
The list of MonitoringObjects.

◆ findRefHist()

TH1 * findRefHist ( const std::string & dirname,
const std::string & histname = "",
ERefScaling scaling = ERefScaling::c_RefScaleNone,
const TH1 * hist = nullptr )
staticinherited

Find reference histogram.

Parameters
dirnameThe name of the directory.
histnameThe name of the histogram.
scalingenum what scaling to use
histhistogram to scale to
Returns
The found histogram, or nullptr if not found.

Definition at line 198 of file DQMHistAnalysis.cc.

200{
201 std::string fullname = dirname + "/" + histname;
202 if (dirname.size() == 0) fullname = histname; // assume contains dirname
203 if (histname.size() == 0) fullname = dirname; // assume contains histname
204
205 if (s_refList.find(fullname) != s_refList.end()) {
206 // get a copy of the reference which we can modify
207 // (it is still owned and managed by the framework)
208 // then do the scaling
209 return scaleReference(scaling, hist, s_refList[fullname].getReference());
210 }
211 return nullptr;
212}
static TH1 * scaleReference(ERefScaling scaling, const TH1 *hist, TH1 *ref)
Using the original and reference, create scaled version.

◆ getAfterConditionPath()

Module::EAfterConditionPath getAfterConditionPath ( ) const
inherited

What to do after the conditional path is finished.

(defaults to c_End if no condition is set)

Definition at line 133 of file Module.cc.

134{
135 if (m_conditions.empty()) return EAfterConditionPath::c_End;
136
137 //okay, a condition was set for this Module...
138 if (!m_hasReturnValue) {
139 B2FATAL("A condition was set for '" << getName() << "', but the module did not set a return value!");
140 }
141
142 for (const auto& condition : m_conditions) {
143 if (condition.evaluate(m_returnValue)) {
144 return condition.getAfterConditionPath();
145 }
146 }
147
148 return EAfterConditionPath::c_End;
149}

◆ getAllConditionPaths()

std::vector< std::shared_ptr< Path > > getAllConditionPaths ( ) const
inherited

Return all condition paths currently set (no matter if the condition is true or not).

Definition at line 150 of file Module.cc.

151{
152 std::vector<std::shared_ptr<Path>> allConditionPaths;
153 for (const auto& condition : m_conditions) {
154 allConditionPaths.push_back(condition.getPath());
155 }
156
157 return allConditionPaths;
158}

◆ getAllConditions()

const std::vector< ModuleCondition > & getAllConditions ( ) const
inlineinherited

Return all set conditions for this module.

Definition at line 323 of file Module.h.

324 {
325 return m_conditions;
326 }

◆ getCanvasUpdatedList()

static const CanvasUpdatedList & getCanvasUpdatedList ( )
inlinestaticinherited

Get the list of the canvas update status.

Returns
The list of the canvases.

Definition at line 202 of file DQMHistAnalysis.h.

202{ return s_canvasUpdatedList;};

◆ getCondition()

const ModuleCondition * getCondition ( ) const
inlineinherited

Return a pointer to the first condition (or nullptr, if none was set)

Definition at line 313 of file Module.h.

314 {
315 if (m_conditions.empty()) {
316 return nullptr;
317 } else {
318 return &m_conditions.front();
319 }
320 }

◆ getConditionPath()

std::shared_ptr< Path > getConditionPath ( ) const
inherited

Returns the path of the last true condition (if there is at least one, else reaturn a null pointer).

Definition at line 113 of file Module.cc.

114{
115 PathPtr p;
116 if (m_conditions.empty()) return p;
117
118 //okay, a condition was set for this Module...
119 if (!m_hasReturnValue) {
120 B2FATAL("A condition was set for '" << getName() << "', but the module did not set a return value!");
121 }
122
123 for (const auto& condition : m_conditions) {
124 if (condition.evaluate(m_returnValue)) {
125 return condition.getPath();
126 }
127 }
128
129 // if none of the conditions were true, return a null pointer.
130 return p;
131}
std::shared_ptr< Path > PathPtr
Defines a pointer to a path object as a boost shared pointer.
Definition Path.h:35

◆ getDelta()

TH1 * getDelta ( const std::string & dirname,
const std::string & histname = "",
int n = 0,
bool onlyIfUpdated = true )
inherited

Get Delta histogram.

Parameters
dirnamedirectory
histnamename of histogram
nindex of delta histogram, 0 is most recent one
onlyIfUpdatedreq only updated deltas, return nullptr otherwise
Returns
delta histogram or nullptr

Definition at line 118 of file DQMHistAnalysis.cc.

119{
120 std::string fullname = dirname + "/" + histname;
121 if (dirname.size() == 0) fullname = histname; // assume contains dirname
122 if (histname.size() == 0) fullname = dirname; // assume contains histname
123
124 auto it = s_deltaList.find(fullname);
125 if (it != s_deltaList.end()) {
126 return it->second.getDelta(n, onlyIfUpdated);
127 }
128 B2WARNING("Delta hist " << fullname << " not found");
129 return nullptr;
130}

◆ getDeltaList()

static const DeltaList & getDeltaList ( )
inlinestaticinherited

Get the list of the delta histograms.

Returns
The list of the delta histograms.

Definition at line 196 of file DQMHistAnalysis.h.

196{ return s_deltaList;};

◆ getDescription()

const std::string & getDescription ( ) const
inlineinherited

Returns the description of the module.

Definition at line 201 of file Module.h.

201{return m_description;}

◆ getEpicsPV() [1/2]

double getEpicsPV ( const std::string & keyname)
inherited

Read value from a EPICS PV.

Parameters
keynamekey name (or full PV name) of PV
Returns
value or NAN if not existing

Definition at line 493 of file DQMHistAnalysis.cc.

494{
495 double value{NAN};
496 if (!m_useEpics) return value;
497#ifdef _BELLE2_EPICS
498 if (m_epicsNameToChID[keyname] == nullptr) {
499 B2ERROR("Epics PV " << keyname << " not registered!");
500 return value;
501 }
502 // From EPICS doc. When ca_get or ca_array_get are invoked the returned channel value can't be assumed to be stable
503 // in the application supplied buffer until after ECA_NORMAL is returned from ca_pend_io. If a connection is lost
504 // outstanding get requests are not automatically reissued following reconnect.
505 auto r = ca_get(DBR_DOUBLE, m_epicsNameToChID[keyname], (void*)&value);
506 if (r == ECA_NORMAL) r = ca_pend_io(5.0); // this is needed!
507 if (r == ECA_NORMAL) {
508 return value;
509 } else {
510 CheckEpicsError(r, "Read PV failed in ca_get or ca_pend_io failure", keyname);
511 }
512#endif
513 return NAN;
514}
static bool m_useEpics
Flag if to use EPICS do not set by yourself, use EpicsEnable module to set.

◆ getEpicsPV() [2/2]

double getEpicsPV ( int index)
inherited

Read value from a EPICS PV.

Parameters
indexindex of PV
Returns
value or NAN if not existing

Definition at line 516 of file DQMHistAnalysis.cc.

517{
518 double value{NAN};
519 if (!m_useEpics) return value;
520#ifdef _BELLE2_EPICS
521 if (index < 0 || index >= (int)m_epicsChID.size()) {
522 B2ERROR("Epics PV with " << index << " not registered!");
523 return value;
524 }
525 // From EPICS doc. When ca_get or ca_array_get are invoked the returned channel value can't be assumed to be stable
526 // in the application supplied buffer until after ECA_NORMAL is returned from ca_pend_io. If a connection is lost
527 // outstanding get requests are not automatically reissued following reconnect.
528 auto r = ca_get(DBR_DOUBLE, m_epicsChID[index], (void*)&value);
529 if (r == ECA_NORMAL) r = ca_pend_io(5.0); // this is needed!
530 if (r == ECA_NORMAL) {
531 return value;
532 } else {
533 CheckEpicsError(r, "Read PV failed in ca_get or ca_pend_io failure", m_epicsChID[index]);
534 }
535#endif
536 return NAN;
537}

◆ getEpicsPVChID() [1/2]

chid getEpicsPVChID ( const std::string & keyname)
inherited

Get EPICS PV Channel Id.

Parameters
keynamekey name (or full PV name) of PV
Returns
Channel ID is written on success, otherwise nullptr

Definition at line 589 of file DQMHistAnalysis.cc.

590{
591#ifdef _BELLE2_EPICS
592 if (m_useEpics) {
593 if (m_epicsNameToChID[keyname] != nullptr) {
594 return m_epicsNameToChID[keyname];
595 } else {
596 B2ERROR("Epics PV " << keyname << " not registered!");
597 }
598 }
599#endif
600 return nullptr;
601}

◆ getEpicsPVChID() [2/2]

chid getEpicsPVChID ( int index)
inherited

Get EPICS PV Channel Id.

Parameters
indexindex of PV
Returns
Channel ID is written on success, otherwise nullptr

Definition at line 603 of file DQMHistAnalysis.cc.

604{
605#ifdef _BELLE2_EPICS
606 if (m_useEpics) {
607 if (index >= 0 && index < (int)m_epicsChID.size()) {
608 return m_epicsChID[index];
609 } else {
610 B2ERROR("Epics PV with " << index << " not registered!");
611 }
612 }
613#endif
614 return nullptr;
615}

◆ getEpicsStringPV() [1/2]

std::string getEpicsStringPV ( const std::string & keyname,
bool & status )
inherited

Read value from a EPICS PV.

Parameters
keynamekey name (or full PV name) of PV
statusreturn status (true on success)
Returns
string value (empty string if non existing)

Definition at line 539 of file DQMHistAnalysis.cc.

540{
541 status = false;
542 char value[40] = "";
543 if (!m_useEpics) return std::string(value);
544#ifdef _BELLE2_EPICS
545 if (m_epicsNameToChID[keyname] == nullptr) {
546 B2ERROR("Epics PV " << keyname << " not registered!");
547 return std::string(value);
548 }
549 // From EPICS doc. When ca_get or ca_array_get are invoked the returned channel value can't be assumed to be stable
550 // in the application supplied buffer until after ECA_NORMAL is returned from ca_pend_io. If a connection is lost
551 // outstanding get requests are not automatically reissued following reconnect.
552 auto r = ca_get(DBR_STRING, m_epicsNameToChID[keyname], value);
553 if (r == ECA_NORMAL) r = ca_pend_io(5.0); // this is needed!
554 if (r == ECA_NORMAL) {
555 status = true;
556 return std::string(value);
557 } else {
558 CheckEpicsError(r, "Read PV (string) failed in ca_get or ca_pend_io failure", keyname);
559 }
560#endif
561 return std::string(value);
562}

◆ getEpicsStringPV() [2/2]

std::string getEpicsStringPV ( int index,
bool & status )
inherited

Read value from a EPICS PV.

Parameters
indexindex of PV
statusreturn status (true on success)
Returns
string value (empty string if non existing)

Definition at line 564 of file DQMHistAnalysis.cc.

565{
566 status = false;
567 char value[40] = "";
568 if (!m_useEpics) return std::string(value);
569#ifdef _BELLE2_EPICS
570 if (index < 0 || index >= (int)m_epicsChID.size()) {
571 B2ERROR("Epics PV with " << index << " not registered!");
572 return std::string(value);
573 }
574 // From EPICS doc. When ca_get or ca_array_get are invoked the returned channel value can't be assumed to be stable
575 // in the application supplied buffer until after ECA_NORMAL is returned from ca_pend_io. If a connection is lost
576 // outstanding get requests are not automatically reissued following reconnect.
577 auto r = ca_get(DBR_STRING, m_epicsChID[index], value);
578 if (r == ECA_NORMAL) r = ca_pend_io(5.0); // this is needed!
579 if (r == ECA_NORMAL) {
580 status = true;
581 return std::string(value);
582 } else {
583 CheckEpicsError(r, "Read PV (string) failed in ca_get or ca_pend_io failure", m_epicsChID[index]);
584 }
585#endif
586 return std::string(value);
587}

◆ getEventProcessed()

static int getEventProcessed ( void )
inlinestaticinherited

Get the number of processed events.

(Attention, asynch histogram updates!)

Returns
Processed events.

Definition at line 221 of file DQMHistAnalysis.h.

221{ return s_eventProcessed;};

◆ getFileNames()

virtual std::vector< std::string > getFileNames ( bool outputFiles)
inlinevirtualinherited

Return a list of output filenames for this modules.

This will be called when basf2 is run with "--dry-run" if the module has set either the c_Input or c_Output properties.

If the parameter outputFiles is false (for modules with c_Input) the list of input filenames should be returned (if any). If outputFiles is true (for modules with c_Output) the list of output files should be returned (if any).

If a module has sat both properties this member is called twice, once for each property.

The module should return the actual list of requested input or produced output filenames (including handling of input/output overrides) so that the grid system can handle input/output files correctly.

This function should return the same value when called multiple times. This is especially important when taking the input/output overrides from Environment as they get consumed when obtained so the finalized list of output files should be stored for subsequent calls.

Reimplemented in RootInputModule, RootOutputModule, and StorageRootOutputModule.

Definition at line 133 of file Module.h.

134 {
135 return std::vector<std::string>();
136 }

◆ getHistList()

static HistList & getHistList ( )
inlinestaticinherited

Get the list of the histograms.

Returns
The list of the histograms.

Definition at line 184 of file DQMHistAnalysis.h.

184{ return s_histList;};

◆ getLogConfig()

LogConfig & getLogConfig ( )
inlineinherited

Returns the log system configuration.

Definition at line 224 of file Module.h.

224{return m_logConfig;}

◆ getModules()

std::list< ModulePtr > getModules ( ) const
inlineoverrideprivatevirtualinherited

no submodules, return empty list

Implements PathElement.

Definition at line 505 of file Module.h.

505{ return std::list<ModulePtr>(); }

◆ getMonitoringObject()

MonitoringObject * getMonitoringObject ( const std::string & name)
staticinherited

Get MonitoringObject with given name (new object is created if non-existing)

Parameters
namename of MonitoringObject to get
Returns
The MonitoringObject

Definition at line 132 of file DQMHistAnalysis.cc.

133{
134 auto obj = &s_monObjList[objName];
135 obj->SetName(objName.c_str());
136 return obj;
137}

◆ getMonObjList()

static MonObjList & getMonObjList ( )
inlinestaticinherited

Get the list of MonitoringObjects.

Returns
The list of the MonitoringObjects.

Definition at line 190 of file DQMHistAnalysis.h.

190{ return s_monObjList;};

◆ getName()

const std::string & getName ( ) const
inlineinherited

Returns the name of the module.

This can be changed via e.g. set_name() in the steering file to give more useful names if there is more than one module of the same type.

For identifying the type of a module, using getType() (or type() in Python) is recommended.

Definition at line 186 of file Module.h.

186{return m_name;}

◆ getPackage()

const std::string & getPackage ( ) const
inlineinherited

Returns the package this module is in.

Definition at line 196 of file Module.h.

196{return m_package;}

◆ getParamInfoListPython()

std::shared_ptr< boost::python::list > getParamInfoListPython ( ) const
inherited

Returns a python list of all parameters.

Each item in the list consists of the name of the parameter, a string describing its type, a python list of all default values and the description of the parameter.

Returns
A python list containing the parameters of this parameter list.

Definition at line 279 of file Module.cc.

280{
282}
std::shared_ptr< boost::python::list > getParamInfoListPython() const
Returns a python list of all parameters.

◆ getParamList()

const ModuleParamList & getParamList ( ) const
inlineinherited

Return module param list.

Definition at line 362 of file Module.h.

362{ return m_moduleParamList; }

◆ getPathString()

std::string getPathString ( ) const
overrideprivatevirtualinherited

return the module name.

Implements PathElement.

Definition at line 192 of file Module.cc.

193{
194
195 std::string output = getName();
196
197 for (const auto& condition : m_conditions) {
198 output += condition.getString();
199 }
200
201 return output;
202}

◆ getPVPrefix()

static std::string & getPVPrefix ( void )
inlinestaticinherited

get global prefix for EPICS PVs

Returns
prefix in use

Definition at line 584 of file DQMHistAnalysis.h.

584{return m_PVPrefix;};

◆ getReturnValue()

int getReturnValue ( ) const
inlineinherited

Return the return value set by this module.

This value is only meaningful if hasReturnValue() is true

Definition at line 380 of file Module.h.

380{ return m_returnValue; }

◆ getRunType()

static const std::string & getRunType ( void )
inlinestaticinherited

Get the list of the reference histograms.

Returns
The list of the reference histograms. Get the Run Type.
Run type string.

Definition at line 215 of file DQMHistAnalysis.h.

215{ return s_runType;};

◆ getSigma68()

double getSigma68 ( TH1 * h)
staticinherited

Helper function to compute half of the central interval covering 68% of a distribution.

This quantity is an alternative to the standard deviation.

Parameters
hhistogram
Returns
Half of the central interval covering 68% of a distribution.

Definition at line 279 of file DQMHistAnalysis.cc.

280{
281 double probs[2] = {0.16, 1 - 0.16};
282 double quant[2] = {0, 0};
283 h->GetQuantiles(2, quant, probs);
284 const double sigma68 = (-quant[0] + quant[1]) / 2;
285 return sigma68;
286}

◆ getStatusColor()

DQMHistAnalysisModule::EStatusColor getStatusColor ( EStatus status)
staticinherited

Return color for canvas state.

Parameters
statuscanvas status
Returns
alarm color

Definition at line 709 of file DQMHistAnalysis.cc.

710{
711 // white color is the default, if no colorize
713 switch (stat) {
714 case c_StatusTooFew:
715 color = c_ColorTooFew; // Magenta or Gray
716 break;
717 case c_StatusDefault:
718 color = c_ColorDefault; // default no colors
719 break;
720 case c_StatusGood:
721 color = c_ColorGood; // Good
722 break;
723 case c_StatusWarning:
724 color = c_ColorWarning; // Warning
725 break;
726 case c_StatusError:
727 color = c_ColorError; // Severe
728 break;
729 default:
730 color = c_ColorDefault; // default no colors
731 break;
732 }
733 return color;
734}
EStatusColor
Status colors of histogram/canvas (corresponding to status)
@ c_ColorWarning
Analysis result: Warning, there may be minor issues.
@ c_ColorError
Analysis result: Severe issue found.
@ c_ColorTooFew
Not enough entries/event to judge.
@ c_ColorGood
Analysis result: Good.
@ c_ColorDefault
default for non-coloring
@ c_StatusTooFew
Not enough entries/event to judge.
@ c_StatusError
Analysis result: Severe issue found.
@ c_StatusWarning
Analysis result: Warning, there may be minor issues.
@ c_StatusGood
Analysis result: Good.

◆ getType()

const std::string & getType ( ) const
inherited

Returns the type of the module (i.e.

class name minus 'Module')

Definition at line 41 of file Module.cc.

42{
43 if (m_type.empty())
44 B2FATAL("Module type not set for " << getName());
45 return m_type;
46}
std::string m_type
The type of the module, saved as a string.
Definition Module.h:508

◆ getUseEpics()

static bool getUseEpics ( void )
inlinestaticinherited

Getter for EPICS usage.

Returns
flag is in use

Definition at line 567 of file DQMHistAnalysis.h.

567{return m_useEpics;};

◆ getUseEpicsReadOnly()

static bool getUseEpicsReadOnly ( void )
inlinestaticinherited

Getter EPICS flag in read only mode.

Returns
flag if read only

Definition at line 573 of file DQMHistAnalysis.h.

573{return m_epicsReadOnly;};

◆ hasCondition()

bool hasCondition ( ) const
inlineinherited

Returns true if at least one condition was set for the module.

Definition at line 310 of file Module.h.

310{ return not m_conditions.empty(); };

◆ hasDeltaPar()

bool hasDeltaPar ( const std::string & dirname,
const std::string & histname )
staticinherited

Check if Delta histogram parameters exist for histogram.

Parameters
dirnamedirectory
histnamename of histogram
Returns
true if parameters have been set already

Definition at line 107 of file DQMHistAnalysis.cc.

108{
109 std::string fullname;
110 if (dirname.size() > 0) {
111 fullname = dirname + "/" + histname;
112 } else {
113 fullname = histname;
114 }
115 return s_deltaList.find(fullname) != s_deltaList.end(); // contains() if we switch to C++20
116}

◆ hasProperties()

bool hasProperties ( unsigned int propertyFlags) const
inherited

Returns true if all specified property flags are available in this module.

Parameters
propertyFlagsOred EModulePropFlags which should be compared with the module flags.

Definition at line 160 of file Module.cc.

161{
162 return (propertyFlags & m_propertyFlags) == propertyFlags;
163}

◆ hasReturnValue()

bool hasReturnValue ( ) const
inlineinherited

Return true if this module has a valid return value set.

Definition at line 377 of file Module.h.

377{ return m_hasReturnValue; }

◆ hasUnsetForcedParams()

bool hasUnsetForcedParams ( ) const
inherited

Returns true and prints error message if the module has unset parameters which the user has to set in the steering file.

Definition at line 166 of file Module.cc.

167{
169 std::string allMissing = "";
170 for (const auto& s : missing)
171 allMissing += s + " ";
172 if (!missing.empty())
173 B2ERROR("The following required parameters of Module '" << getName() << "' were not specified: " << allMissing <<
174 "\nPlease add them to your steering file.");
175 return !missing.empty();
176}
std::vector< std::string > getUnsetForcedParams() const
Returns list of unset parameters (if they are required to have a value.

◆ if_false()

void if_false ( const std::shared_ptr< Path > & path,
EAfterConditionPath afterConditionPath = EAfterConditionPath::c_End )
inherited

A simplified version to add a condition to the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

It is equivalent to the if_value() method, using the expression "<1". This method is meant to be used together with the setReturnValue(bool value) method.

Parameters
pathShared pointer to the Path which will be executed if the return value is false.
afterConditionPathWhat to do after executing 'path'.

Definition at line 85 of file Module.cc.

86{
87 if_value("<1", path, afterConditionPath);
88}

◆ if_true()

void if_true ( const std::shared_ptr< Path > & path,
EAfterConditionPath afterConditionPath = EAfterConditionPath::c_End )
inherited

A simplified version to set the condition of the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

It is equivalent to the if_value() method, using the expression ">=1". This method is meant to be used together with the setReturnValue(bool value) method.

Parameters
pathShared pointer to the Path which will be executed if the return value is true.
afterConditionPathWhat to do after executing 'path'.

Definition at line 90 of file Module.cc.

91{
92 if_value(">=1", path, afterConditionPath);
93}

◆ if_value()

void if_value ( const std::string & expression,
const std::shared_ptr< Path > & path,
EAfterConditionPath afterConditionPath = EAfterConditionPath::c_End )
inherited

Add a condition to the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

See https://xwiki.desy.de/xwiki/rest/p/a94f2 or ModuleCondition for a description of the syntax.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

Parameters
expressionThe expression of the condition.
pathShared pointer to the Path which will be executed if the condition is evaluated to true.
afterConditionPathWhat to do after executing 'path'.

Definition at line 79 of file Module.cc.

80{
81 m_conditions.emplace_back(expression, path, afterConditionPath);
82}

◆ initHistListBeforeEvent()

void initHistListBeforeEvent ( void )
staticinherited

Reset the list of histograms.

Definition at line 309 of file DQMHistAnalysis.cc.

310{
311 for (auto& it : s_histList) {
312 // attention, we must use reference, otherwise we work on a copy
313 it.second.resetBeforeEvent();
314 }
315 for (auto& it : s_deltaList) {
316 // attention, we must use reference, otherwise we work on a copy
317 it.second.setNotUpdated();
318 }
319
320 s_canvasUpdatedList.clear();
321}

◆ initialize()

void initialize ( void )
finaloverrideprivatevirtual

Initializer.

Reimplemented from Module.

Definition at line 36 of file DQMHistAnalysisSVDDose.cc.

37{
38 B2DEBUG(18, "DQMHistAnalysisSVDDose: initialize");
39
40 gROOT->cd(); // Don't know why I need this, but DQMHistAnalysisSVDOnMiraBelle uses it
41
42 m_monObj = getMonitoringObject("svd"); // To write to MiraBelle
43
44 m_c_instOccu.reserve(c_sensorGroups.size());
45 m_c_occuLER.reserve(c_sensorGroups.size());
46 m_h_occuLER.reserve(c_sensorGroups.size());
47 m_c_occuHER.reserve(c_sensorGroups.size());
48 m_h_occuHER.reserve(c_sensorGroups.size());
49 m_c_occuLER1.reserve(c_sensorGroups.size());
50 m_h_occuLER1.reserve(c_sensorGroups.size());
51 m_c_occuHER1.reserve(c_sensorGroups.size());
52 m_h_occuHER1.reserve(c_sensorGroups.size());
53 m_c_instOccuAll.reserve(c_sensorGroups.size());
54 m_c_occuLERAll.reserve(c_sensorGroups.size());
55 m_h_occuLERAll.reserve(c_sensorGroups.size());
56 m_c_occuHERAll.reserve(c_sensorGroups.size());
57 m_h_occuHERAll.reserve(c_sensorGroups.size());
58 m_c_occuLER1All.reserve(c_sensorGroups.size());
59 m_h_occuLER1All.reserve(c_sensorGroups.size());
60 m_c_occuHER1All.reserve(c_sensorGroups.size());
61 m_h_occuHER1All.reserve(c_sensorGroups.size());
62 for (const auto& group : c_sensorGroups) {
63 TCanvas* c = new TCanvas("SVDDOSE/c_svd_instOccupancy_" + group.nameSuffix + "_pois",
64 "Instantaneous occupancy (Pois. trig.) " + group.titleSuffix);
65 m_c_instOccu.push_back(c);
66 c = new TCanvas("SVDDOSE/c_svd_occuLER_" + group.nameSuffix + "_pois",
67 "Occupancy vs time since LER inj. (Pois. trig.) " + group.titleSuffix);
68 m_c_occuLER.push_back(c);
69 m_h_occuLER.push_back(nullptr);
70 c = new TCanvas("SVDDOSE/c_svd_occuHER_" + group.nameSuffix + "_pois",
71 "Occupancy vs time since HER inj. (Pois. trig.) " + group.titleSuffix);
72 m_c_occuHER.push_back(c);
73 m_h_occuHER.push_back(nullptr);
74 c = new TCanvas("SVDDOSE/c_svd_1DoccuLER_" + group.nameSuffix + "_pois",
75 "Occupancy vs time since LER inj. (Pois. trig.) " + group.titleSuffix);
76 m_c_occuLER1.push_back(c);
77 m_h_occuLER1.push_back(nullptr);
78 c = new TCanvas("SVDDOSE/c_svd_1DoccuHER_" + group.nameSuffix + "_pois",
79 "Occupancy vs time since HER inj. (Pois. trig.) " + group.titleSuffix);
80 m_c_occuHER1.push_back(c);
81 m_h_occuHER1.push_back(nullptr);
82
83 c = new TCanvas("SVDDOSE/c_svd_instOccupancy_" + group.nameSuffix + "_all",
84 "Instantaneous occupancy (all events) " + group.titleSuffix);
85 m_c_instOccuAll.push_back(c);
86 c = new TCanvas("SVDDOSE/c_svd_occuLER_" + group.nameSuffix + "_all",
87 "Occupancy vs time since LER inj. (all events) " + group.titleSuffix);
88 m_c_occuLERAll.push_back(c);
89 m_h_occuLERAll.push_back(nullptr);
90 c = new TCanvas("SVDDOSE/c_svd_occuHER_" + group.nameSuffix + "_all",
91 "Occupancy vs time since HER inj. (all events) " + group.titleSuffix);
92 m_c_occuHERAll.push_back(c);
93 m_h_occuHERAll.push_back(nullptr);
94 c = new TCanvas("SVDDOSE/c_svd_1DoccuLER_" + group.nameSuffix + "_all",
95 "Occupancy vs time since LER inj. (all events) " + group.titleSuffix);
96 m_c_occuLER1All.push_back(c);
97 m_h_occuLER1All.push_back(nullptr);
98 c = new TCanvas("SVDDOSE/c_svd_1DoccuHER_" + group.nameSuffix + "_all",
99 "Occupancy vs time since HER inj. (all events) " + group.titleSuffix);
100 m_c_occuHER1All.push_back(c);
101 m_h_occuHER1All.push_back(nullptr);
102 }
103
104 m_legend = new TPaveText(0.53, 0.73, 0.68, 0.88, "brNDC");
105 m_legend->AddText("LER inj."); static_cast<TText*>(m_legend->GetListOfLines()->Last())->SetTextColor(kRed);
106 m_legend->AddText("HER inj."); static_cast<TText*>(m_legend->GetListOfLines()->Last())->SetTextColor(kAzure);
107 m_legend->AddText("No inj."); static_cast<TText*>(m_legend->GetListOfLines()->Last())->SetTextColor(kBlack);
108
109#ifdef _BELLE2_EPICS
110 if (getUseEpics()) {
111 // Channels for the occupancies
112 m_myPVs.resize(c_sensorGroups.size());
113 for (unsigned int g = 0; g < c_sensorGroups.size(); g++)
114 SEVCHK(ca_create_channel((m_pvPrefix + c_sensorGroups[g].pvMiddle + m_pvSuffix).data(),
115 NULL, NULL, 10, &m_myPVs[g].mychid), "ca_create_channel");
116 // Channels for update interval and state
117 SEVCHK(ca_create_channel((m_pvPrefix + m_deltaTPVSuffix).data(),
118 NULL, NULL, 10, &m_timeSinceLastPVUpdateChan), "ca_create_channel");
119 SEVCHK(ca_create_channel((m_pvPrefix + m_statePVSuffix).data(),
120 NULL, NULL, 10, &m_stateChan), "ca_create_channel");
121 // Actually do create the channels, communicating with the IOC
122 SEVCHK(ca_pend_io(2.0), "ca_pend_io");
123 // Get the state enum
124 if (m_stateChan) {
125 SEVCHK(ca_get(DBR_CTRL_ENUM, m_stateChan, &m_stateCtrl), "ca_get");
126 B2DEBUG(19, "State PV initialized (ca_get)" << LogVar("value", m_stateCtrl.value));
127 SEVCHK(ca_pend_io(2.0), "ca_pend_io");
128 } else {
129 B2DEBUG(18, "State PV failed to initialize, will retry in beginRun(), event() and endRun().");
130 }
131 // First update should happen m_epicsUpdateSeconds from now
132 m_lastPVUpdate = getClockSeconds();
133 }
134#endif
135}
static MonitoringObject * getMonitoringObject(const std::string &name)
Get MonitoringObject with given name (new object is created if non-existing)
std::vector< TCanvas * > m_c_occuLER
Canvases for the occu.
std::vector< TH2F * > m_h_occuHERAll
Histograms for the occu.
std::vector< TH1F * > m_h_occuLER1
Histograms for the 1D occu.
std::vector< TCanvas * > m_c_occuHERAll
Canvases for the occu.
std::vector< TCanvas * > m_c_instOccu
Canvases for the instantaneous occupancy.
std::vector< TH2F * > m_h_occuLER
Histograms for the occ.
std::vector< TH2F * > m_h_occuLERAll
Histograms for the occu.
std::vector< TCanvas * > m_c_occuLER1
Canvases for the 1D occu.
std::vector< TH1F * > m_h_occuHER1All
Histograms for the 1D occu.
std::vector< TCanvas * > m_c_occuLER1All
Canvases for the 1D occu.
std::vector< TCanvas * > m_c_occuLERAll
Canvases for the occu.
std::vector< TCanvas * > m_c_occuHER
Canvases for the occu.
std::vector< TCanvas * > m_c_occuHER1All
Canvases for the 1D occu.
std::vector< TH1F * > m_h_occuLER1All
Histograms for the 1D occu.
std::vector< TH1F * > m_h_occuHER1
Histograms for the 1D occu.
std::vector< TCanvas * > m_c_instOccuAll
Canvases for the instantaneous occupancy.
TPaveText * m_legend
Legend of the inst.
std::vector< TCanvas * > m_c_occuHER1
Canvases for the 1D occu.
std::vector< TH2F * > m_h_occuHER
Histograms for the occu.

◆ makeStatus()

DQMHistAnalysisModule::EStatus makeStatus ( bool enough,
bool warn_flag,
bool error_flag )
staticinherited

Helper function to judge the status for coloring and EPICS.

Parameters
enoughenough events for judging
warn_flagoutside of expected range
error_flagoutside of warning range
Returns
the status

Definition at line 691 of file DQMHistAnalysis.cc.

692{
693 // white color is the default, if no colorize
694 if (!enough) {
695 return (c_StatusTooFew);
696 } else {
697 if (error_flag) {
698 return (c_StatusError);
699 } else if (warn_flag) {
700 return (c_StatusWarning);
701 } else {
702 return (c_StatusGood);
703 }
704 }
705
706 return (c_StatusDefault); // default, but should not be reached
707}

◆ printPVStatus()

void printPVStatus ( chid pv,
bool onlyError = true )
staticinherited

check the status of a PVs and report if disconnected or not found

Parameters
pvthe chid of the PV to check
onlyErrorprint only if in error condition (default)

Definition at line 759 of file DQMHistAnalysis.cc.

760{
761 if (pv == nullptr) {
762 B2WARNING("PV chid was nullptr");
763 return;
764 }
765 auto state = ca_state(pv);
766 switch (state) {
767 case cs_never_conn: /* valid chid, server not found or unavailable */
768 B2WARNING("Channel never connected " << ca_name(pv));
769 break;
770 case cs_prev_conn: /* valid chid, previously connected to server */
771 B2WARNING("Channel was connected, but now is not " << ca_name(pv));
772 break;
773 case cs_closed: /* channel deleted by user */
774 B2WARNING("Channel deleted already " << ca_name(pv));
775 break;
776 case cs_conn: /* valid chid, connected to server */
777 if (!onlyError) B2INFO("Channel connected and OK " << ca_name(pv));
778 break;
779 default:
780 B2WARNING("Undefined status for channel " << ca_name(pv));
781 break;
782 }
783}

◆ registerEpicsPV()

int registerEpicsPV ( const std::string & pvname,
const std::string & keyname = "" )
inherited

EPICS related Functions.

Register a PV with its name and a key name

Parameters
pvnamefull PV name
keynamekey name for easier access
Returns
an index which can be used to access the PV instead of key name, -1 if failure

Definition at line 374 of file DQMHistAnalysis.cc.

375{
376 return registerEpicsPVwithPrefix(m_PVPrefix, pvname, keyname);
377}
static std::string m_PVPrefix
The Prefix for EPICS PVs.
int registerEpicsPVwithPrefix(const std::string &prefix, const std::string &pvname, const std::string &keyname="")
Register a PV with its name and a key name.

◆ registerEpicsPVwithPrefix()

int registerEpicsPVwithPrefix ( const std::string & prefix,
const std::string & pvname,
const std::string & keyname = "" )
privateinherited

Register a PV with its name and a key name.

Parameters
prefixprefix to PV name
pvnamefull PV name without prefix
keynamekey name for easier access
Returns
an index which can be used to access the PV instead of key name, -1 if failure

Definition at line 384 of file DQMHistAnalysis.cc.

386{
387 if (!m_useEpics) return -1;
388#ifdef _BELLE2_EPICS
389 if (m_epicsNameToChID[pvname] != nullptr) {
390 B2ERROR("Epics PV " << pvname << " already registered!");
391 return -1;
392 }
393 if (keyname != "" && m_epicsNameToChID[keyname] != nullptr) {
394 B2ERROR("Epics PV with key " << keyname << " already registered!");
395 return -1;
396 }
397
398 m_epicsChID.emplace_back();
399 auto ptr = &m_epicsChID.back();
400 if (!ca_current_context()) SEVCHK(ca_context_create(ca_disable_preemptive_callback), "ca_context_create");
401 // the subscribed name includes the prefix, the map below does *not*
402 CheckEpicsError(ca_create_channel((prefix + pvname).data(), NULL, NULL, 10, ptr), "ca_create_channel failure", pvname);
403
404 m_epicsNameToChID[pvname] = *ptr;
405 if (keyname != "") m_epicsNameToChID[keyname] = *ptr;
406 return m_epicsChID.size() - 1; // return index to last added item
407#else
408 return -1;
409#endif
410}

◆ registerExternalEpicsPV()

int registerExternalEpicsPV ( const std::string & pvname,
const std::string & keyname = "" )
inherited

Register a PV with its name and a key name.

Parameters
pvnamefull PV name
keynamekey name for easier access
Returns
an index which can be used to access the PV instead of key name, -1 if failure

Definition at line 379 of file DQMHistAnalysis.cc.

380{
381 return registerEpicsPVwithPrefix(std::string(""), pvname, keyname);
382}

◆ requestLimitsFromEpicsPVs() [1/3]

bool requestLimitsFromEpicsPVs ( chid id,
double & lowerAlarm,
double & lowerWarn,
double & upperWarn,
double & upperAlarm )
inherited

Get Alarm Limits from EPICS PV.

Parameters
idChannel ID
&lowerAlarmreturn low Alarm limit (lolo) if set, not changed otherwise
&lowerWarnreturn low Warning limit (low) if set, not changed otherwise
&upperWarnreturn upper Warning limit (high) if set, not changed otherwise
&upperAlarmreturn upper Alarm limit (hihi) if set, not changed otherwise
Returns
true if limits could be read (even if there are none set)

Definition at line 656 of file DQMHistAnalysis.cc.

658{
659 // get warn and error limit only if pv exists
660 // overwrite only if limit is defined (not NaN)
661 // user should initialize with NaN before calling, unless
662 // some "default" values should be set otherwise
663 if (pv != nullptr) {
664 struct dbr_ctrl_double tPvData;
665 // From EPICS doc. When ca_get or ca_array_get are invoked the returned channel value can't be assumed to be stable
666 // in the application supplied buffer until after ECA_NORMAL is returned from ca_pend_io. If a connection is lost
667 // outstanding get requests are not automatically reissued following reconnect.
668 auto r = ca_get(DBR_CTRL_DOUBLE, pv, &tPvData);
669 if (r == ECA_NORMAL) r = ca_pend_io(5.0); // this is needed!
670 if (r == ECA_NORMAL) {
671 if (!std::isnan(tPvData.lower_alarm_limit)) {
672 lowerAlarm = tPvData.lower_alarm_limit;
673 }
674 if (!std::isnan(tPvData.lower_warning_limit)) {
675 lowerWarn = tPvData.lower_warning_limit;
676 }
677 if (!std::isnan(tPvData.upper_warning_limit)) {
678 upperWarn = tPvData.upper_warning_limit;
679 }
680 if (!std::isnan(tPvData.upper_alarm_limit)) {
681 upperAlarm = tPvData.upper_alarm_limit;
682 }
683 return true;
684 } else {
685 CheckEpicsError(r, "Reading PV Limits failed in ca_get or ca_pend_io failure", pv);
686 }
687 }
688 return false;
689}

◆ requestLimitsFromEpicsPVs() [2/3]

bool requestLimitsFromEpicsPVs ( const std::string & keyname,
double & lowerAlarm,
double & lowerWarn,
double & upperWarn,
double & upperAlarm )
inherited

Get Alarm Limits from EPICS PV.

Parameters
keynamekey name (or full PV name) of PV
&lowerAlarmreturn low Alarm limit (lolo) if set, not changed otherwise
&lowerWarnreturn low Warning limit (low) if set, not changed otherwise
&upperWarnreturn upper Warning limit (high) if set, not changed otherwise
&upperAlarmreturn upper Alarm limit (hihi) if set, not changed otherwise
Returns
true if limits could be read (even if there are none set)

Definition at line 644 of file DQMHistAnalysis.cc.

646{
647 return requestLimitsFromEpicsPVs(getEpicsPVChID(name), lowerAlarm, lowerWarn, upperWarn, upperAlarm);
648}
chid getEpicsPVChID(const std::string &keyname)
Get EPICS PV Channel Id.
bool requestLimitsFromEpicsPVs(chid id, double &lowerAlarm, double &lowerWarn, double &upperWarn, double &upperAlarm)
Get Alarm Limits from EPICS PV.

◆ requestLimitsFromEpicsPVs() [3/3]

bool requestLimitsFromEpicsPVs ( int index,
double & lowerAlarm,
double & lowerWarn,
double & upperWarn,
double & upperAlarm )
inherited

Get Alarm Limits from EPICS PV.

Parameters
indexindex of PV
&lowerAlarmreturn low Alarm limit (lolo) if set, not changed otherwise
&lowerWarnreturn low Warning limit (low) if set, not changed otherwise
&upperWarnreturn upper Warning limit (high) if set, not changed otherwise
&upperAlarmreturn upper Alarm limit (hihi) if set, not changed otherwise
Returns
true if limits could be read (even if there are none set)

Definition at line 650 of file DQMHistAnalysis.cc.

652{
653 return requestLimitsFromEpicsPVs(getEpicsPVChID(index), lowerAlarm, lowerWarn, upperWarn, upperAlarm);
654}

◆ resetDeltaList()

void resetDeltaList ( void )
staticinherited

Reset Delta.

Definition at line 333 of file DQMHistAnalysis.cc.

334{
335 for (auto& d : s_deltaList) {
336 d.second.reset();
337 }
338}

◆ scaleReference()

TH1 * scaleReference ( ERefScaling scaling,
const TH1 * hist,
TH1 * ref )
staticinherited

Using the original and reference, create scaled version.

Parameters
scalingscaling algorithm
histpointer to histogram
refpointer to reference
Returns
scaled reference

Definition at line 172 of file DQMHistAnalysis.cc.

173{
174 // if hist/ref is nullptr, nothing to do
175 if (!hist || !ref)
176 return ref;
177
178 switch (scaling) {
179 // default: do nothing
180 case ERefScaling::c_RefScaleNone: //do nothing
181 break;
182 case ERefScaling::c_RefScaleEntries: // Integral
183 // only if we have entries in reference
184 if (hist->Integral() != 0 and ref->Integral() != 0) {
185 ref->Scale(hist->Integral() / ref->Integral());
186 }
187 break;
188 case ERefScaling::c_RefScaleMax: // Maximum
189 // only if we have entries in reference
190 if (hist->GetMaximum() != 0 and ref->GetMaximum() != 0) {
191 ref->Scale(hist->GetMaximum() / ref->GetMaximum());
192 }
193 break;
194 }
195 return ref;
196}
@ c_RefScaleEntries
to number of entries (integral)
@ c_RefScaleMax
to maximum (bin entry)

◆ setAbortLevel()

void setAbortLevel ( int abortLevel)
inherited

Configure the abort log level.

Definition at line 67 of file Module.cc.

68{
69 m_logConfig.setAbortLevel(static_cast<LogConfig::ELogLevel>(abortLevel));
70}
ELogLevel
Definition of the supported log levels.
Definition LogConfig.h:26
void setAbortLevel(ELogLevel abortLevel)
Configure the abort level.
Definition LogConfig.h:112

◆ setDebugLevel()

void setDebugLevel ( int debugLevel)
inherited

Configure the debug messaging level.

Definition at line 61 of file Module.cc.

62{
63 m_logConfig.setDebugLevel(debugLevel);
64}
void setDebugLevel(int debugLevel)
Configure the debug messaging level.
Definition LogConfig.h:98

◆ setDescription()

void setDescription ( const std::string & description)
protectedinherited

Sets the description of the module.

Parameters
descriptionA description of the module.

Definition at line 214 of file Module.cc.

215{
216 m_description = description;
217}
std::string m_description
The description of the module.
Definition Module.h:510

◆ setEpicsPV() [1/4]

void setEpicsPV ( const std::string & keyname,
double value )
inherited

Write value to a EPICS PV.

Parameters
keynamekey name (or full PV name) of PV
valuevalue to write

Definition at line 412 of file DQMHistAnalysis.cc.

413{
414 if (!m_useEpics || m_epicsReadOnly) return;
415#ifdef _BELLE2_EPICS
416 if (m_epicsNameToChID[keyname] == nullptr) {
417 B2ERROR("Epics PV " << keyname << " not registered!");
418 return;
419 }
420 CheckEpicsError(ca_put(DBR_DOUBLE, m_epicsNameToChID[keyname], (void*)&value), "ca_set failure", keyname);
421#endif
422}
static bool m_epicsReadOnly
Flag if to use EPICS in ReadOnly mode (for reading limits) do not set by yourself,...

◆ setEpicsPV() [2/4]

void setEpicsPV ( const std::string & keyname,
int value )
inherited

Write value to a EPICS PV.

Parameters
keynamekey name (or full PV name) of PV
valuevalue to write

Definition at line 424 of file DQMHistAnalysis.cc.

425{
426 if (!m_useEpics || m_epicsReadOnly) return;
427#ifdef _BELLE2_EPICS
428 if (m_epicsNameToChID[keyname] == nullptr) {
429 B2ERROR("Epics PV " << keyname << " not registered!");
430 return;
431 }
432 CheckEpicsError(ca_put(DBR_SHORT, m_epicsNameToChID[keyname], (void*)&value), "ca_set failure", keyname);
433#endif
434}

◆ setEpicsPV() [3/4]

void setEpicsPV ( int index,
double value )
inherited

Write value to a EPICS PV.

Parameters
indexindex of PV
valuevalue to write

Definition at line 454 of file DQMHistAnalysis.cc.

455{
456 if (!m_useEpics || m_epicsReadOnly) return;
457#ifdef _BELLE2_EPICS
458 if (index < 0 || index >= (int)m_epicsChID.size()) {
459 B2ERROR("Epics PV with " << index << " not registered!");
460 return;
461 }
462 CheckEpicsError(ca_put(DBR_DOUBLE, m_epicsChID[index], (void*)&value), "ca_set failure", m_epicsChID[index]);
463#endif
464}

◆ setEpicsPV() [4/4]

void setEpicsPV ( int index,
int value )
inherited

Write value to a EPICS PV.

Parameters
indexindex of PV
valuevalue to write

Definition at line 466 of file DQMHistAnalysis.cc.

467{
468 if (!m_useEpics || m_epicsReadOnly) return;
469#ifdef _BELLE2_EPICS
470 if (index < 0 || index >= (int)m_epicsChID.size()) {
471 B2ERROR("Epics PV with " << index << " not registered!");
472 return;
473 }
474 CheckEpicsError(ca_put(DBR_SHORT, m_epicsChID[index], (void*)&value), "ca_set failure", m_epicsChID[index]);
475#endif
476}

◆ setEpicsStringPV() [1/2]

void setEpicsStringPV ( const std::string & keyname,
const std::string & value )
inherited

Write string to a EPICS PV.

Parameters
keynamekey name (or full PV name) of PV
valuestring to write

Definition at line 436 of file DQMHistAnalysis.cc.

437{
438 if (!m_useEpics || m_epicsReadOnly) return;
439#ifdef _BELLE2_EPICS
440 if (m_epicsNameToChID[keyname] == nullptr) {
441 B2ERROR("Epics PV " << keyname << " not registered!");
442 return;
443 }
444 if (value.length() > 40) {
445 B2ERROR("Epics string PV " << keyname << " too long (>40 characters)!");
446 return;
447 }
448 char text[40];
449 strcpy(text, value.c_str());
450 CheckEpicsError(ca_put(DBR_STRING, m_epicsNameToChID[keyname], text), "ca_set failure", keyname);
451#endif
452}

◆ setEpicsStringPV() [2/2]

void setEpicsStringPV ( int index,
const std::string & value )
inherited

Write string to a EPICS PV.

Parameters
indexindex of PV
valuestring to write

Definition at line 478 of file DQMHistAnalysis.cc.

479{
480 if (!m_useEpics || m_epicsReadOnly) return;
481#ifdef _BELLE2_EPICS
482 if (index < 0 || index >= (int)m_epicsChID.size()) {
483 B2ERROR("Epics PV with " << index << " not registered!");
484 return;
485 }
486 char text[41];
487 strncpy(text, value.c_str(), 40);
488 text[40] = 0;
489 CheckEpicsError(ca_put(DBR_STRING, m_epicsChID[index], text), "ca_set failure", m_epicsChID[index]);
490#endif
491}

◆ setEventProcessed()

static void setEventProcessed ( int e)
inlinestaticinherited

Set the number of processed events.

(Attention, asynch histogram updates!)

e Processed events.

Definition at line 233 of file DQMHistAnalysis.h.

233{s_eventProcessed = e;};

◆ setLogConfig()

void setLogConfig ( const LogConfig & logConfig)
inlineinherited

Set the log system configuration.

Definition at line 229 of file Module.h.

229{m_logConfig = logConfig;}

◆ setLogInfo()

void setLogInfo ( int logLevel,
unsigned int logInfo )
inherited

Configure the printed log information for the given level.

Parameters
logLevelThe log level (one of LogConfig::ELogLevel)
logInfoWhat kind of info should be printed? ORed combination of LogConfig::ELogInfo flags.

Definition at line 73 of file Module.cc.

74{
75 m_logConfig.setLogInfo(static_cast<LogConfig::ELogLevel>(logLevel), logInfo);
76}
void setLogInfo(ELogLevel logLevel, unsigned int logInfo)
Configure the printed log information for the given level.
Definition LogConfig.h:127

◆ setLogLevel()

void setLogLevel ( int logLevel)
inherited

Configure the log level.

Definition at line 55 of file Module.cc.

56{
57 m_logConfig.setLogLevel(static_cast<LogConfig::ELogLevel>(logLevel));
58}
void setLogLevel(ELogLevel logLevel)
Configure the log level.
Definition LogConfig.cc:25

◆ setName()

void setName ( const std::string & name)
inlineinherited

Set the name of the module.

Note
The module name is set when using the REG_MODULE macro, but the module can be renamed before calling process() using the set_name() function in your steering file.
Parameters
nameThe name of the module

Definition at line 213 of file Module.h.

213{ m_name = name; };

◆ setParamList()

void setParamList ( const ModuleParamList & params)
inlineprotectedinherited

Replace existing parameter list.

Definition at line 500 of file Module.h.

500{ m_moduleParamList = params; }

◆ setParamPython()

void setParamPython ( const std::string & name,
const boost::python::object & pyObj )
privateinherited

Implements a method for setting boost::python objects.

The method supports the following types: list, dict, int, double, string, bool The conversion of the python object to the C++ type and the final storage of the parameter value is done in the ModuleParam class.

Parameters
nameThe unique name of the parameter.
pyObjThe object which should be converted and stored as the parameter value.

Definition at line 234 of file Module.cc.

235{
236 LogSystem& logSystem = LogSystem::Instance();
237 logSystem.updateModule(&(getLogConfig()), getName());
238 try {
240 } catch (std::runtime_error& e) {
241 throw std::runtime_error("Cannot set parameter '" + name + "' for module '"
242 + m_name + "': " + e.what());
243 }
244
245 logSystem.updateModule(nullptr);
246}
void updateModule(const LogConfig *moduleLogConfig=nullptr, const std::string &moduleName="")
Sets the log configuration to the given module log configuration and sets the module name This method...
Definition LogSystem.h:200
static LogSystem & Instance()
Static method to get a reference to the LogSystem instance.
Definition LogSystem.cc:28
LogConfig & getLogConfig()
Returns the log system configuration.
Definition Module.h:224
std::string m_name
The name of the module, saved as a string (user-modifiable)
Definition Module.h:507
void setParamPython(const std::string &name, const PythonObject &pyObj)
Implements a method for setting boost::python objects.

◆ setParamPythonDict()

void setParamPythonDict ( const boost::python::dict & dictionary)
privateinherited

Implements a method for reading the parameter values from a boost::python dictionary.

The key of the dictionary has to be the name of the parameter and the value has to be of one of the supported parameter types.

Parameters
dictionaryThe python dictionary from which the parameter values are read.

Definition at line 249 of file Module.cc.

250{
251
252 LogSystem& logSystem = LogSystem::Instance();
253 logSystem.updateModule(&(getLogConfig()), getName());
254
255 boost::python::list dictKeys = dictionary.keys();
256 int nKey = boost::python::len(dictKeys);
257
258 //Loop over all keys in the dictionary
259 for (int iKey = 0; iKey < nKey; ++iKey) {
260 boost::python::object currKey = dictKeys[iKey];
261 boost::python::extract<std::string> keyProxy(currKey);
262
263 if (keyProxy.check()) {
264 const boost::python::object& currValue = dictionary[currKey];
265 setParamPython(keyProxy, currValue);
266 } else {
267 B2ERROR("Setting the module parameters from a python dictionary: invalid key in dictionary!");
268 }
269 }
270
271 logSystem.updateModule(nullptr);
272}
void setParamPython(const std::string &name, const boost::python::object &pyObj)
Implements a method for setting boost::python objects.
Definition Module.cc:234

◆ setPropertyFlags()

void setPropertyFlags ( unsigned int propertyFlags)
inherited

Sets the flags for the module properties.

Parameters
propertyFlagsbitwise OR of EModulePropFlags

Definition at line 208 of file Module.cc.

209{
210 m_propertyFlags = propertyFlags;
211}

◆ setPVPrefix()

static void setPVPrefix ( const std::string & prefix)
inlinestaticinherited

set global prefix for EPICS PVs

Parameters
prefixPrefix to set

Definition at line 590 of file DQMHistAnalysis.h.

590{ m_PVPrefix = prefix;};

◆ setReturnValue() [1/2]

void setReturnValue ( bool value)
protectedinherited

Sets the return value for this module as bool.

The bool value is saved as an integer with the convention 1 meaning true and 0 meaning false. The value can be used in the steering file to divide the analysis chain into several paths.

Parameters
valueThe value of the return value.

Definition at line 227 of file Module.cc.

228{
229 m_hasReturnValue = true;
230 m_returnValue = value;
231}

◆ setReturnValue() [2/2]

void setReturnValue ( int value)
protectedinherited

Sets the return value for this module as integer.

The value can be used in the steering file to divide the analysis chain into several paths.

Parameters
valueThe value of the return value.

Definition at line 220 of file Module.cc.

221{
222 m_hasReturnValue = true;
223 m_returnValue = value;
224}

◆ setRunType()

static void setRunType ( const std::string & t)
inlinestaticinherited

Set the Run Type.

t Run type string.

Definition at line 227 of file DQMHistAnalysis.h.

227{s_runType = t;};

◆ setType()

void setType ( const std::string & type)
protectedinherited

Set the module type.

Only for use by internal modules (which don't use the normal REG_MODULE mechanism).

Definition at line 48 of file Module.cc.

49{
50 if (!m_type.empty())
51 B2FATAL("Trying to change module type from " << m_type << " is not allowed, the value is assumed to be fixed.");
52 m_type = type;
53}

◆ setUseEpics()

static void setUseEpics ( bool flag)
inlinestaticinherited

Setter for EPICS usage.

Parameters
flagset in use

Definition at line 555 of file DQMHistAnalysis.h.

555{m_useEpics = flag;};

◆ setUseEpicsReadOnly()

static void setUseEpicsReadOnly ( bool flag)
inlinestaticinherited

Setter EPICS flag in read only mode.

Parameters
flagset read only

Definition at line 561 of file DQMHistAnalysis.h.

561{m_epicsReadOnly = flag;};

◆ StringSplit()

std::vector< std::string > StringSplit ( const std::string & s,
const char delim )
staticinherited

Helper function for string token split.

Parameters
sString to split
delimdelimiter
Returns
vector of strings

Definition at line 288 of file DQMHistAnalysis.cc.

289{
290 std::vector <std::string> out;
291 boost::split(out, in, [delim](char c) {return c == delim;});
292 return out;
293}

◆ terminate()

virtual void terminate ( void )
inlinevirtualinherited

This method is called at the end of the event processing.

This method is called only once after the event processing finished. Use this method for cleaning up, closing files, etc.

This method can be implemented by subclasses.

Reimplemented in AafhInputModule, AnalysisPhase1StudyModule, ARICHBackgroundModule, arichBtestModule, ARICHNtupleModule, arichToNtupleModule, AsyncWrapper, AWESOMEBasicModule, B2BIIConvertMdstModule, B2BIIFixMdstModule, B2BIIMCParticlesMonitorModule, B2BIIMdstInputModule, BabayagaNLOInputModule, BBBremInputModule, BeamabortModule, BeamabortStudyModule, BeamDigitizerModule, BeamBkgGeneratorModule, BeamBkgHitRateMonitorModule, BeamBkgMixerModule, BeamBkgNeutronModule, BeamSpotMonitorModule, BelleMCOutputModule, BgoDigitizerModule, BgoModule, BgoStudyModule, BGOverlayInputModule, BHWideInputModule, BKLMAnaModule, BKLMDigitAnalyzerModule, BKLMSimHistogrammerModule, BKLMTrackingModule, CalibrationCollectorModule, CaveModule, CDCCosmicAnalysisModule, CDCCRTestModule, CDCPackerModule, CDCRecoTrackFilterModule, CDCUnpackerModule, CDCCrossTalkAdderModule, CDCDedxCorrectionModule, CDCDedxDQMModule, CDCDedxPIDModule, CDCDedxScanModule, CDCDedxSkimCDSTModule, CDCDedxSkimModule, CDCDedxValidationModule, CDCDigitizerModule, cdcDQM7Module, CDCDQMModule, CDCInitialT0DeterminationModule, CDCTrigger2DFinderModule, CDCTriggerHoughETFModule, CDCTriggerNDFinderModule, CDCTriggerNeuroDataModule, CDCTriggerNeuroDQMModule, CDCTriggerNeuroDQMOnlineModule, CDCTriggerNeuroIDHistModule, CDCTriggerTSFFirmwareModule, CDCTriggerTSFModule, CDCTriggerUnpackerModule, CertifyParallelModule, CheckErrorEventModule, Chi2MCTrackMatcherModule, ClawDigitizerModule, ClawModule, ClawStudyModule, ClawsDigitizerModule, CLAWSModule, ClawsStudyModule, CollectorTestModule, Convert2RawDetModule, CosmicsAlignmentValidationModule, CRYInputModule, CsiDigitizer_v2Module, CsIDigitizerModule, CsiModule, CsiStudy_v2Module, CsIStudyModule, CurlingTrackCandSplitterModule, CurlTaggerModule, DAQPerfModule, DataWriterModule, DeSerializerModule, DeSerializerPXDModule, DisplayModule, DosiDigitizerModule, DosiModule, DosiStudyModule, DQMHistAnalysisARICHModule, DQMHistAnalysisARICHMonObjModule, DQMHistAnalysisCDCDedxModule, DQMHistAnalysisCDCEpicsModule, DQMHistAnalysisCDCMonObjModule, DQMHistAnalysisDAQMonObjModule, DQMHistAnalysisDeltaEpicsMonObjExampleModule, DQMHistAnalysisDeltaTestModule, DQMHistAnalysisECLConnectedRegionsModule, DQMHistAnalysisECLModule, DQMHistAnalysisECLOutOfTimeDigitsModule, DQMHistAnalysisECLShapersModule, DQMHistAnalysisECLSummaryModule, DQMHistAnalysisEcmsMonObjModule, DQMHistAnalysisEpicsExampleModule, DQMHistAnalysisEventT0EfficiencyModule, DQMHistAnalysisEventT0TriggerJitterModule, DQMHistAnalysisExampleFlagsModule, DQMHistAnalysisExampleModule, DQMHistAnalysisHLTModule, DQMHistAnalysisHLTMonObjModule, DQMHistAnalysisInput2Module, DQMHistAnalysisInputPVSrvModule, DQMHistAnalysisInputTestModule, DQMHistAnalysisKLMModule, DQMHistAnalysisKLMMonObjModule, DQMHistAnalysisMiraBelleModule, DQMHistAnalysisMonObjModule, DQMHistAnalysisOutputFileModule, DQMHistAnalysisOutputMonObjModule, DQMHistAnalysisOutputRelayMsgModule, DQMHistAnalysisPeakModule, DQMHistAnalysisPhysicsModule, DQMHistAnalysisPXDChargeModule, DQMHistAnalysisPXDCMModule, DQMHistAnalysisPXDDAQModule, DQMHistAnalysisPXDEffModule, DQMHistAnalysisPXDERModule, DQMHistAnalysisPXDFitsModule, DQMHistAnalysisPXDInjectionModule, DQMHistAnalysisPXDReductionModule, DQMHistAnalysisPXDTrackChargeModule, DQMHistAnalysisRooFitExampleModule, DQMHistAnalysisRunNrModule, DQMHistAnalysisSVDClustersOnTrackModule, DQMHistAnalysisSVDEfficiencyModule, DQMHistAnalysisSVDOccupancyModule, DQMHistAnalysisSVDOnMiraBelleModule, DQMHistAnalysisSVDUnpackerModule, DQMHistAnalysisTOPModule, DQMHistAnalysisTrackingAbortModule, DQMHistAnalysisTRGECLModule, DQMHistAnalysisTRGEFFModule, DQMHistAnalysisTRGGDLModule, DQMHistAnalysisTRGModule, DQMHistAutoCanvasModule, DQMHistComparitorModule, DQMHistDeltaHistoModule, DqmHistoManagerModule, DQMHistOutputToEPICSModule, DQMHistReferenceModule, DQMHistSnapshotsModule, Ds2RawFileModule, Ds2RawModule, Ds2RbufModule, Ds2SampleModule, ECLLOMModule, ECLBackgroundModule, EclBackgroundStudyModule, ECLChargedPIDDataAnalysisModule, ECLChargedPIDDataAnalysisValidationModule, ECLChargedPIDModule, ECLClusterPSDModule, ECLCompressBGOverlayModule, ECLCovarianceMatrixModule, EclCovMatrixNtupleModule, ECLCRFinderModule, ECLDataAnalysisModule, ECLDigiStudyModule, ECLDigitCalibratorModule, ECLDigitizerModule, ECLDigitizerPureCsIModule, EclDisplayModule, ECLDQMEXTENDEDModule, ECLDQMModule, ECLExpertModule, ECLFillCellIdMappingModule, ECLFinalizerModule, ECLHitDebugModule, ECLLocalMaximumFinderModule, ECLMatchingPerformanceExpertModule, ECLPackerModule, ECLShowerCorrectorModule, ECLShowerShapeModule, ECLSplitterN1Module, ECLSplitterN2Module, ECLTrackClusterMatchingModule, ECLTrackClusterMatchingParametrizationExpertModule, ECLTrackClusterMatchingPerformanceModule, ECLTRGInformationModule, ECLTrimShowersAndDigitsModule, ECLUnpackerModule, eclWaveformCalibCollectorModule, ECLWaveformFitModule, EffPlotsModule, EKLMDataCheckerModule, ElapsedTimeModule, EvReductionModule, EvtGenDecayModule, ExtModule, FANGSDigitizerModule, FANGSModule, FANGSStudyModule, FastBDTClassifierAnalyzerModule, FastBDTClassifierTrainingModule, FastRbuf2DsModule, FillTrackFitNtupleModule, FragmentationModule, FullSimModule, FullSimTimingModule, TRGGDLUnpackerModule, GeneratedVertexDisplacerModule, GeneratorPreselectionModule, GenfitVisModule, GenRawSendModule, GeometryModule, GetEventFromSocketModule, GFTC2SPTCConverterModule, GRLNeuroModule, He3DigitizerModule, He3tubeModule, He3tubeStudyModule, HepevtOutputModule, HepMCInputModule, HepMCOutputModule, HerwigHepMCFragmentationModule, HerwigLHEWriterModule, HistoManagerModule, HitLevelInfoWriterModule, HitXPModule, HLTDQM2ZMQModule, HLTDs2ZMQModule, KinkFinderModule, KKGenInputModule, KLMClusterEfficiencyModule, KLMClustersReconstructorModule, KLMDigitizerModule, KLMDQM2Module, KLMDQMModule, KLMEventT0EstimatorModule, KLMExpertModule, KLMMuonIDDNNExpertModule, KLMPackerModule, KLMReconstructorModule, KLMScintillatorSimulatorModule, KLMTrackingModule, KLMTriggerModule, KLMUnpackerModule, KoralWInputModule, LowEnergyPi0IdentificationExpertModule, LowEnergyPi0VetoExpertModule, MasterClassModule, MCMatcherTRGECLModule, MCTrackCandClassifierModule, MCV0MatcherModule, MergeDataStoreModule, MicrotpcModule, MicrotpcStudyModule, TpcDigitizerModule, MLSegmentNetworkProducerModule, MonitorDataModule, MuidModule, MVAExpertModule, MVAMultipleExpertsModule, NoKickCutsEvalModule, NtuplePhase1_v6Module, ParticleKinematicFitterModule, OverrideGenerationFlagsModule, PartialSeqRootReaderModule, ParticleLoaderModule, ParticleMassHypothesesUpdaterModule, ParticleMCDecayStringModule, ParticleMomentumUpdaterModule, ParticleStatsModule, ParticleWeightingLookUpCreatorModule, Ph1bpipeModule, Ph1sustrModule, PhaseSpaceAnalysisModule, PhokharaInputModule, PhysicsObjectsDQMModule, PIDNtupleModule, PinDigitizerModule, PindiodeModule, PindiodeStudyModule, PlumeDigitizerModule, PlumeModule, ProfileModule, ProgressBarModule, PXDBackgroundModule, PXDBgTupleProducerModule, PXDMCBgTupleProducerModule, PXDPackerErrModule, PXDPackerModule, PXDReadRawBonnDAQMatchedModule, PXDReadRawBonnDAQModule, PXDReadRawONSENModule, PXDUnpackerModule, PXDUnpackerOldModule, PXDUnpackerOTModule, PXDClustersFromTracksModule, PXDDQMEfficiencyNtupleModule, PXDDQMEfficiencyNtupleSelftrackModule, PXDDQMTrackRawNtupleModule, PXDPerformanceModule, PXDROIFinderAnalysisModule, PXDSpacePointCreatorModule, PyModule, QcsmonitorDigitizerModule, QcsmonitorModule, QcsmonitorStudyModule, Raw2DsModule, RawInputModule, Rbuf2DsModule, Rbuf2RbufModule, ReceiveEventModule, RemoveMCParticlesModule, RemoveParticlesNotInListsModule, ReprocessorModule, ROIDQMModule, ROIReadTestModule, ROISenderModule, Root2BinaryModule, Root2RawModule, RootInputModule, RootOutputModule, RT2SPTCConverterModule, RxModule, RxSocketModule, ScanCDCGeoModule, SecMapTrainerBaseModule, SecMapTrainerVXDTFModule, SegmentNetworkAnalyzerModule, SeqRootInputModule, SeqRootMergerModule, SeqRootOutputModule, SerializerModule, SkimFilterModule, SoftwareTriggerModule, SoftwareTriggerResultPrinterModule, SpacePoint2TrueHitConnectorModule, SpacePointCreatorTestModule, SPTC2GFTCConverterModule, SPTC2RTConverterModule, SPTCRefereeModule, SrsensorModule, StandardTrackingPerformanceModule, StorageDeserializerModule, StorageRootOutputModule, StorageSerializerModule, StudyMaterialEffectsModule, SubEventModule, SVD3SamplesEmulatorModule, SVDBackgroundModule, SVDDigitizerModule, SVDPackerModule, SVDVariablesToStorageModule, SVDChannelMappingModule, SVDChargeSharingAnalysisModule, SVDClusterEvaluationTrueInfoModule, SVDClusterFilterModule, SVDClusterQualityEstimatorCalibrationModule, SVDClusterQualityEstimatorModule, SVDCoGTimeEstimatorModule, SVDCrossTalkFinderModule, SVDDataFormatCheckModule, SVDDQMClustersOnTrackModule, SVDDQMExpressRecoModule, svdDumpModule, SVDEventT0PerformanceTTreeModule, SVDHotStripFinderModule, SVDMaxStripTTreeModule, SVDPerformanceTTreeModule, SVDROIFinderAnalysisDataModule, SVDROIFinderAnalysisModule, SVDROIFinderModule, SVDShaperDigitsFromTracksModule, SVDSpacePointCreatorModule, SVDSpacePointQICalibrationModule, SVDTriggerQualityGeneratorModule, SwitchDataStoreModule, TCConvertersTestModule, TeeggInputModule, TOPAlignerModule, TOPBackgroundModule, TOPBunchFinderModule, TOPChannelT0CalibratorModule, TOPChannelT0MCModule, TOPCommonT0CalibratorModule, TOPCosmicT0FinderModule, TOPGainEfficiencyCalculatorModule, TOPLaserCalibratorModule, TOPModuleT0CalibratorModule, TOPNtupleModule, TOPPDFCheckerModule, TOPRingPlotterModule, TOPTBCComparatorModule, TOPTimeBaseCalibratorModule, TrackAnaModule, TrackFilterModule, TrackFinderVXDAnalizerModule, TrackingPerformanceEvaluationModule, FindletModule< AFindlet >, FindletModule< AsicBackgroundLibraryCreator >, FindletModule< AxialSegmentPairCreator >, FindletModule< AxialSegmentPairCreator >, FindletModule< AxialStraightTrackFinder >, FindletModule< AxialStraightTrackFinder >, FindletModule< AxialTrackCreatorMCTruth >, FindletModule< AxialTrackCreatorMCTruth >, FindletModule< AxialTrackCreatorSegmentHough >, FindletModule< AxialTrackCreatorSegmentHough >, FindletModule< AxialTrackFinderHough >, FindletModule< AxialTrackFinderHough >, FindletModule< AxialTrackFinderLegendre >, FindletModule< AxialTrackFinderLegendre >, FindletModule< CDCHitsRemover >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFromHitsFindlet >, FindletModule< CDCTrackingEventLevelMdstInfoFillerFromSegmentsFindlet >, FindletModule< CKFToCDCFindlet >, FindletModule< CKFToCDCFromEclFindlet >, FindletModule< CKFToPXDFindlet >, FindletModule< CKFToSVDFindlet >, FindletModule< CKFToSVDSeedFindlet >, FindletModule< ClusterBackgroundDetector >, FindletModule< ClusterBackgroundDetector >, FindletModule< ClusterPreparer >, FindletModule< ClusterPreparer >, FindletModule< ClusterRefiner< BridgingWireHitRelationFilter > >, FindletModule< ClusterRefiner< BridgingWireHitRelationFilter > >, FindletModule< CosmicsTrackMergerFindlet >, FindletModule< DATCONFPGAFindlet >, FindletModule< FacetCreator >, FindletModule< FacetCreator >, FindletModule< HitBasedT0Extractor >, FindletModule< HitBasedT0Extractor >, FindletModule< HitReclaimer >, FindletModule< HitReclaimer >, FindletModule< MCVXDCDCTrackMergerFindlet >, FindletModule< MonopoleAxialTrackFinderLegendre >, FindletModule< MonopoleAxialTrackFinderLegendre >, FindletModule< MonopoleStereoHitFinder >, FindletModule< MonopoleStereoHitFinder >, FindletModule< MonopoleStereoHitFinderQuadratic >, FindletModule< MonopoleStereoHitFinderQuadratic >, FindletModule< SegmentCreatorFacetAutomaton >, FindletModule< SegmentCreatorFacetAutomaton >, FindletModule< SegmentCreatorMCTruth >, FindletModule< SegmentCreatorMCTruth >, FindletModule< SegmentFinderFacetAutomaton >, FindletModule< SegmentFinderFacetAutomaton >, FindletModule< SegmentFitter >, FindletModule< SegmentFitter >, FindletModule< SegmentLinker >, FindletModule< SegmentLinker >, FindletModule< SegmentOrienter >, FindletModule< SegmentOrienter >, FindletModule< SegmentPairCreator >, FindletModule< SegmentPairCreator >, FindletModule< SegmentRejecter >, FindletModule< SegmentRejecter >, FindletModule< SegmentTrackCombiner >, FindletModule< SegmentTrackCombiner >, FindletModule< SegmentTripleCreator >, FindletModule< SegmentTripleCreator >, FindletModule< StereoHitFinder >, FindletModule< StereoHitFinder >, FindletModule< SuperClusterCreator >, FindletModule< SuperClusterCreator >, FindletModule< TrackCombiner >, FindletModule< TrackCombiner >, FindletModule< TrackCreatorSegmentPairAutomaton >, FindletModule< TrackCreatorSegmentPairAutomaton >, FindletModule< TrackCreatorSegmentTripleAutomaton >, FindletModule< TrackCreatorSegmentTripleAutomaton >, FindletModule< TrackCreatorSingleSegments >, FindletModule< TrackCreatorSingleSegments >, FindletModule< TrackExporter >, FindletModule< TrackExporter >, FindletModule< TrackFinder >, FindletModule< TrackFinderAutomaton >, FindletModule< TrackFinderCosmics >, FindletModule< TrackFinderSegmentPairAutomaton >, FindletModule< TrackFinderSegmentPairAutomaton >, FindletModule< TrackFinderSegmentTripleAutomaton >, FindletModule< TrackFinderSegmentTripleAutomaton >, FindletModule< TrackFlightTimeAdjuster >, FindletModule< TrackFlightTimeAdjuster >, FindletModule< TrackingUtilities::FindletStoreArrayInput< BaseEventTimeExtractorModuleFindlet< AFindlet > > >, FindletModule< TrackingUtilities::FindletStoreArrayInput< BaseEventTimeExtractorModuleFindlet< AFindlet > > >, FindletModule< TrackLinker >, FindletModule< TrackLinker >, FindletModule< TrackOrienter >, FindletModule< TrackOrienter >, FindletModule< TrackQualityAsserter >, FindletModule< TrackQualityAsserter >, FindletModule< TrackQualityEstimator >, FindletModule< TrackQualityEstimator >, FindletModule< TrackRejecter >, FindletModule< TrackRejecter >, FindletModule< vxdHoughTracking::SVDHoughTracking >, FindletModule< WireHitBackgroundDetector >, FindletModule< WireHitBackgroundDetector >, FindletModule< WireHitCreator >, FindletModule< WireHitCreator >, FindletModule< WireHitPreparer >, FindletModule< WireHitPreparer >, TrackQETrainingDataCollectorModule, TreeFitterModule, TrepsInputModule, TRGCDCETFUnpackerModule, TRGCDCModule, TRGCDCT2DDQMModule, TRGCDCT3DConverterModule, TRGCDCT3DDQMModule, TRGCDCT3DUnpackerModule, TRGCDCTSFUnpackerModule, TRGCDCTSFDQMModule, TRGCDCTSStreamModule, TRGECLBGTCHitModule, TRGECLDQMModule, TRGECLFAMModule, TRGECLModule, TRGECLQAMModule, TRGECLRawdataAnalysisModule, TRGECLTimingCalModule, TRGECLUnpackerModule, TRGGDLDQMModule, TRGGDLDSTModule, TRGGDLModule, TRGGDLSummaryModule, TRGGRLDQMModule, TRGGRLMatchModule, TRGGRLModule, TRGGRLProjectsModule, TRGGRLUnpackerModule, TRGRAWDATAModule, TRGTOPDQMModule, TRGTOPTRD2TTSConverterModule, TRGTOPUnpackerModule, TRGTOPUnpackerWaveformModule, TRGTOPWaveformPlotterModule, TxModule, TxSocketModule, V0FinderModule, V0findingPerformanceEvaluationModule, VariablesToEventBasedTreeModule, VariablesToHistogramModule, VariablesToNtupleModule, VXDMisalignmentModule, VXDDedxPIDModule, VXDQETrainingDataCollectorModule, VXDTFTrainingDataCollectorModule, ZMQRxOutputModule, ZMQRxWorkerModule, ZMQTxInputModule, and ZMQTxWorkerModule.

Definition at line 175 of file Module.h.

175{};

◆ UpdateCanvas() [1/2]

void UpdateCanvas ( const std::string & name,
bool updated = true )
staticinherited

Mark canvas as updated (or not)

Parameters
namename of Canvas
updatedwas updated

Definition at line 340 of file DQMHistAnalysis.cc.

341{
342 s_canvasUpdatedList[name] = updated;
343}

◆ UpdateCanvas() [2/2]

void UpdateCanvas ( TCanvas * canvas,
bool updated = true )
staticinherited

Mark canvas as updated (or not)

Parameters
canvasCanvas from which to take the name for update
updatedwas updated

Definition at line 345 of file DQMHistAnalysis.cc.

346{
347 if (c) UpdateCanvas(c->GetName(), updated);
348}
static void UpdateCanvas(const std::string &name, bool updated=true)
Mark canvas as updated (or not)

◆ updateCanvases()

void updateCanvases ( )
private

updated canvas

Definition at line 281 of file DQMHistAnalysisSVDDose.cc.

282{
283 B2DEBUG(18, "DQMHistAnalysisSVDDose: updating canvases");
284
285 for (unsigned int g = 0; g < c_sensorGroups.size(); g++) {
286 const auto& group = c_sensorGroups[g];
287
288 auto c = m_c_instOccu[g];
289 auto hLER = findHistT<TH1F>("SVDDoseLERInjPois/SVDInstOccu_" + group.nameSuffix);
290 auto hHER = findHistT<TH1F>("SVDDoseHERInjPois/SVDInstOccu_" + group.nameSuffix);
291 auto hNo = findHistT<TH1F>("SVDDoseNoInjPois/SVDInstOccu_" + group.nameSuffix);
292 if (hLER && hHER && hNo) {
293 hLER->SetLineColor(kRed);
294 hHER->SetLineColor(kAzure);
295 hNo->SetLineColor(kBlack);
296 carryOverflowOver(hLER);
297 carryOverflowOver(hHER);
299 c->Clear();
300 c->cd(0);
301 hNo->SetTitle("SVD instantaneous occu. " + group.titleSuffix + " U-side Pois. trig.");
302 hNo->Draw("hist"); // hNo usually has the larger maximum by far
303 hLER->Draw("hist same");
304 hHER->Draw("hist same");
305 c->SetLogy();
306 m_legend->Draw();
307 }
308
309 c = m_c_occuLER[g];
310 auto hHits = findHistT<TH2F>("SVDDoseLERInjPois/SVDHitsVsTime_" + group.nameSuffix);
311 auto hEvts = findHistT<TH2F>("SVDDoseLERInjPois/SVDEvtsVsTime");
312 if (hHits && hEvts) {
313 m_h_occuLER[g] = divide(hHits, hEvts, 100.0f / group.nStrips, m_h_occuLER[g]);
314 m_h_occuLER[g]->SetTitle("SVD Occupancy " + group.titleSuffix + " - LER inj. Pois. trig."
315 ";Time since last injection [#mus];Time in beam cycle [#mus]"
316 ";Occupancy [%]");
317 m_h_occuLER[g]->SetMinimum(1e-3);
318 m_h_occuLER[g]->SetMaximum(10);
319 c->Clear();
320 c->cd(0);
321 c->SetRightMargin(0.16); // For the colorbar
322 m_h_occuLER[g]->Draw("COLZ");
323 c->SetLogz();
324 }
325
326 c = m_c_occuLER1[g];
327 auto hpEvts = findHistT<TH1F>("SVDDoseLERInjPois/SVDEvtsVsTime1");
328 auto hpHits = findHistT<TH1F>("SVDDoseLERInjPois/SVDHitsVsTime1_" + group.nameSuffix);
329 if (hpHits && hpEvts) {
330 m_h_occuLER1[g] = divide(hpHits, hpEvts, 100.0f / group.nStrips, m_h_occuLER1[g]);
331 m_h_occuLER1[g]->SetTitle("SVD Occupancy " + group.titleSuffix + " - LER inj. Pois. trig."
332 ";Time since last injection [#mus];Occupancy [%]");
333 m_h_occuLER1[g]->SetMinimum(1e-3);
334 m_h_occuLER1[g]->SetMaximum(10);
335 c->Clear();
336 c->cd(0);
337 m_h_occuLER1[g]->SetMarkerStyle(7);
338 m_h_occuLER1[g]->Draw("hist P");
339 c->SetLogy();
340 }
341
342 c = m_c_occuHER[g];
343 hHits = findHistT<TH2F>("SVDDoseHERInjPois/SVDHitsVsTime_" + group.nameSuffix);
344 hEvts = findHistT<TH2F>("SVDDoseHERInjPois/SVDEvtsVsTime");
345 if (hHits && hEvts) {
346 m_h_occuHER[g] = divide(hHits, hEvts, 100.0f / group.nStrips, m_h_occuHER[g]);
347 m_h_occuHER[g]->SetTitle("SVD Occupancy " + group.titleSuffix + " - HER inj. Pois. trig."
348 ";Time since last injection [#mus];Time in beam cycle [#mus]"
349 ";Occupancy [%]");
350 m_h_occuHER[g]->SetMinimum(1e-3);
351 m_h_occuHER[g]->SetMaximum(10);
352 c->Clear();
353 c->cd(0);
354 c->SetRightMargin(0.16); // For the colorbar
355 m_h_occuHER[g]->Draw("COLZ");
356 c->SetLogz();
357 }
358
359 c = m_c_occuHER1[g];
360 hpEvts = findHistT<TH1F>("SVDDoseHERInjPois/SVDEvtsVsTime1");
361 hpHits = findHistT<TH1F>("SVDDoseHERInjPois/SVDHitsVsTime1_" + group.nameSuffix);
362 if (hpHits && hpEvts) {
363 m_h_occuHER1[g] = divide(hpHits, hpEvts, 100.0f / group.nStrips, m_h_occuHER1[g]);
364 m_h_occuHER1[g]->SetTitle("SVD Occupancy " + group.titleSuffix + " - HER inj. Pois. trig."
365 ";Time since last injection [#mus];Occupancy [%]");
366 m_h_occuHER1[g]->SetMinimum(1e-3);
367 m_h_occuHER1[g]->SetMaximum(10);
368 c->Clear();
369 c->cd(0);
370 m_h_occuHER1[g]->SetMarkerStyle(7);
371 m_h_occuHER1[g]->Draw("hist P");
372 c->SetLogy();
373 }
374
375 // ========== All events =============
376 c = m_c_instOccuAll[g];
377 hLER = findHistT<TH1F>("SVDDoseLERInjAll/SVDInstOccu_" + group.nameSuffix);
378 hHER = findHistT<TH1F>("SVDDoseHERInjAll/SVDInstOccu_" + group.nameSuffix);
379 hNo = findHistT<TH1F>("SVDDoseNoInjAll/SVDInstOccu_" + group.nameSuffix);
380 if (hLER && hHER && hNo) {
381 hLER->SetLineColor(kRed);
382 hHER->SetLineColor(kAzure);
383 hNo->SetLineColor(kBlack);
384 carryOverflowOver(hLER);
385 carryOverflowOver(hHER);
387 c->Clear();
388 c->cd(0);
389 hNo->SetTitle("SVD instantaneous occu. " + group.titleSuffix + " U-side all events");
390 hNo->Draw("hist"); // hNo usually has the larger maximum by far
391 hLER->Draw("hist same");
392 hHER->Draw("hist same");
393 c->SetLogy();
394 m_legend->Draw();
395 }
396
397 c = m_c_occuLERAll[g];
398 hHits = findHistT<TH2F>("SVDDoseLERInjAll/SVDHitsVsTime_" + group.nameSuffix);
399 hEvts = findHistT<TH2F>("SVDDoseLERInjAll/SVDEvtsVsTime");
400 if (hHits && hEvts) {
401 m_h_occuLERAll[g] = divide(hHits, hEvts, 100.0f / group.nStrips, m_h_occuLERAll[g]);
402 m_h_occuLERAll[g]->SetTitle("SVD Occupancy " + group.titleSuffix + " - LER inj. all events"
403 ";Time since last injection [#mus];Time in beam cycle [#mus]"
404 ";Occupancy [%]");
405 m_h_occuLERAll[g]->SetMinimum(1e-3);
406 m_h_occuLERAll[g]->SetMaximum(10);
407 c->Clear();
408 c->cd(0);
409 c->SetRightMargin(0.16); // For the colorbar
410 m_h_occuLERAll[g]->Draw("COLZ");
411 c->SetLogz();
412 }
413
414 c = m_c_occuLER1All[g];
415 hpEvts = findHistT<TH1F>("SVDDoseLERInjAll/SVDEvtsVsTime1");
416 hpHits = findHistT<TH1F>("SVDDoseLERInjAll/SVDHitsVsTime1_" + group.nameSuffix);
417 if (hpHits && hpEvts) {
418 m_h_occuLER1All[g] = divide(hpHits, hpEvts, 100.0f / group.nStrips, m_h_occuLER1All[g]);
419 m_h_occuLER1All[g]->SetTitle("SVD Occupancy " + group.titleSuffix + " - LER inj. all events"
420 ";Time since last injection [#mus];Occupancy [%]");
421 m_h_occuLER1All[g]->SetMinimum(1e-3);
422 m_h_occuLER1All[g]->SetMaximum(10);
423 c->Clear();
424 c->cd(0);
425 m_h_occuLER1All[g]->SetMarkerStyle(7);
426 m_h_occuLER1All[g]->Draw("hist P");
427 c->SetLogy();
428 }
429
430 c = m_c_occuHERAll[g];
431 hHits = findHistT<TH2F>("SVDDoseHERInjAll/SVDHitsVsTime_" + group.nameSuffix);
432 hEvts = findHistT<TH2F>("SVDDoseHERInjAll/SVDEvtsVsTime");
433 if (hHits && hEvts) {
434 m_h_occuHERAll[g] = divide(hHits, hEvts, 100.0f / group.nStrips, m_h_occuHERAll[g]);
435 m_h_occuHERAll[g]->SetTitle("SVD Occupancy " + group.titleSuffix + " - HER inj. all events"
436 ";Time since last injection [#mus];Time in beam cycle [#mus]"
437 ";Occupancy [%]");
438 m_h_occuHERAll[g]->SetMinimum(1e-3);
439 m_h_occuHERAll[g]->SetMaximum(10);
440 c->Clear();
441 c->cd(0);
442 c->SetRightMargin(0.16); // For the colorbar
443 m_h_occuHERAll[g]->Draw("COLZ");
444 c->SetLogz();
445 }
446
447 c = m_c_occuHER1All[g];
448 hpEvts = findHistT<TH1F>("SVDDoseHERInjAll/SVDEvtsVsTime1");
449 hpHits = findHistT<TH1F>("SVDDoseHERInjAll/SVDHitsVsTime1_" + group.nameSuffix);
450 if (hpHits && hpEvts) {
451 m_h_occuHER1All[g] = divide(hpHits, hpEvts, 100.0f / group.nStrips, m_h_occuHER1All[g]);
452 m_h_occuHER1All[g]->SetTitle("SVD Occupancy " + group.titleSuffix + " - HER inj. all events"
453 ";Time since last injection [#mus];Occupancy [%]");
454 m_h_occuHER1All[g]->SetMinimum(1e-3);
455 m_h_occuHER1All[g]->SetMaximum(10);
456 c->Clear();
457 c->cd(0);
458 m_h_occuHER1All[g]->SetMarkerStyle(7);
459 m_h_occuHER1All[g]->Draw("hist P");
460 c->SetLogy();
461 }
462 }
463}
static void carryOverflowOver(TH1F *h)
Carries the content of the overflow bin into the last bin.
static T * divide(T *num, T *den, float scale=1.0f, T *res=nullptr)
Divide two histograms, ignoring errors on the second histogram.

◆ updateEpicsPVs()

int updateEpicsPVs ( float timeout)
inherited

Update all EPICS PV (flush to network)

Parameters
timeoutmaximum time until timeout in s
Returns
status of ca_pend_io

Definition at line 617 of file DQMHistAnalysis.cc.

618{
619 int state = ECA_NORMAL;
620 if (!m_useEpics) return state;
621#ifdef _BELLE2_EPICS
622 if (wait > 0.) {
623 state = ca_pend_io(wait);
624 SEVCHK(state, "ca_pend_io failure");
625 }
626#endif
627 return state;
628}

Member Data Documentation

◆ c_sensorGroups

const vector< DQMHistAnalysisSVDDoseModule::SensorGroup > c_sensorGroups
staticprivate
Initial value:
= {
{"L31XU", "L3.1", "L3:1", 768 * 2},
{"L32XU", "L3.2", "L3:2", 768 * 2},
{"L3XXU", "L3 avg.", "L3", 768 * 14},
{"L4XXU", "L4 avg.", "L4", 768 * 30},
{"L5XXU", "L5 avg.", "L5", 768 * 48},
{"L6XXU", "L6 avg.", "L6", 768 * 80}
}

List of sensors groups.

Must match Belle2::SVD::SVDDQMDoseModule::c_sensorGroups. Defined in DQMHistAnalysisSVDDose.cc.

Definition at line 170 of file DQMHistAnalysisSVDDose.h.

◆ m_c_instOccu

std::vector<TCanvas*> m_c_instOccu
private

Canvases for the instantaneous occupancy.

Definition at line 139 of file DQMHistAnalysisSVDDose.h.

◆ m_c_instOccuAll

std::vector<TCanvas*> m_c_instOccuAll
private

Canvases for the instantaneous occupancy.

Definition at line 149 of file DQMHistAnalysisSVDDose.h.

◆ m_c_occuHER

std::vector<TCanvas*> m_c_occuHER
private

Canvases for the occu.

vs time after HER inj.

Definition at line 142 of file DQMHistAnalysisSVDDose.h.

◆ m_c_occuHER1

std::vector<TCanvas*> m_c_occuHER1
private

Canvases for the 1D occu.

vs time after HER inj.

Definition at line 146 of file DQMHistAnalysisSVDDose.h.

◆ m_c_occuHER1All

std::vector<TCanvas*> m_c_occuHER1All
private

Canvases for the 1D occu.

vs time after HER inj.

Definition at line 156 of file DQMHistAnalysisSVDDose.h.

◆ m_c_occuHERAll

std::vector<TCanvas*> m_c_occuHERAll
private

Canvases for the occu.

vs time after HER inj.

Definition at line 152 of file DQMHistAnalysisSVDDose.h.

◆ m_c_occuLER

std::vector<TCanvas*> m_c_occuLER
private

Canvases for the occu.

vs time after LER inj.

Definition at line 140 of file DQMHistAnalysisSVDDose.h.

◆ m_c_occuLER1

std::vector<TCanvas*> m_c_occuLER1
private

Canvases for the 1D occu.

vs time after LER inj.

Definition at line 144 of file DQMHistAnalysisSVDDose.h.

◆ m_c_occuLER1All

std::vector<TCanvas*> m_c_occuLER1All
private

Canvases for the 1D occu.

vs time after LER inj.

Definition at line 154 of file DQMHistAnalysisSVDDose.h.

◆ m_c_occuLERAll

std::vector<TCanvas*> m_c_occuLERAll
private

Canvases for the occu.

vs time after LER inj.

Definition at line 150 of file DQMHistAnalysisSVDDose.h.

◆ m_conditions

std::vector<ModuleCondition> m_conditions
privateinherited

Module condition, only non-null if set.

Definition at line 520 of file Module.h.

◆ m_deltaTPVSuffix

std::string m_deltaTPVSuffix
private

Suffix of the update-time monitoring PV.

Definition at line 132 of file DQMHistAnalysisSVDDose.h.

◆ m_description

std::string m_description
privateinherited

The description of the module.

Definition at line 510 of file Module.h.

◆ m_epicsReadOnly

bool m_epicsReadOnly
staticprivateinherited
Initial value:
=
false

Flag if to use EPICS in ReadOnly mode (for reading limits) do not set by yourself, use EpicsEnable module to set.

Definition at line 155 of file DQMHistAnalysis.h.

◆ m_epicsUpdateSeconds

double m_epicsUpdateSeconds
private

Minimum interval between successive PV updates.

Definition at line 130 of file DQMHistAnalysisSVDDose.h.

◆ m_h_occuHER

std::vector<TH2F*> m_h_occuHER
private

Histograms for the occu.

vs time after HER inj.

Definition at line 143 of file DQMHistAnalysisSVDDose.h.

◆ m_h_occuHER1

std::vector<TH1F*> m_h_occuHER1
private

Histograms for the 1D occu.

vs time after HER inj.

Definition at line 147 of file DQMHistAnalysisSVDDose.h.

◆ m_h_occuHER1All

std::vector<TH1F*> m_h_occuHER1All
private

Histograms for the 1D occu.

vs time after HER inj.

Definition at line 157 of file DQMHistAnalysisSVDDose.h.

◆ m_h_occuHERAll

std::vector<TH2F*> m_h_occuHERAll
private

Histograms for the occu.

vs time after HER inj.

Definition at line 153 of file DQMHistAnalysisSVDDose.h.

◆ m_h_occuLER

std::vector<TH2F*> m_h_occuLER
private

Histograms for the occ.

vs time after LER inj.

Definition at line 141 of file DQMHistAnalysisSVDDose.h.

◆ m_h_occuLER1

std::vector<TH1F*> m_h_occuLER1
private

Histograms for the 1D occu.

vs time after LER inj.

Definition at line 145 of file DQMHistAnalysisSVDDose.h.

◆ m_h_occuLER1All

std::vector<TH1F*> m_h_occuLER1All
private

Histograms for the 1D occu.

vs time after LER inj.

Definition at line 155 of file DQMHistAnalysisSVDDose.h.

◆ m_h_occuLERAll

std::vector<TH2F*> m_h_occuLERAll
private

Histograms for the occu.

vs time after LER inj.

Definition at line 151 of file DQMHistAnalysisSVDDose.h.

◆ m_hasReturnValue

bool m_hasReturnValue
privateinherited

True, if the return value is set.

Definition at line 517 of file Module.h.

◆ m_legend

TPaveText* m_legend = nullptr
private

Legend of the inst.

occu. plots

Definition at line 137 of file DQMHistAnalysisSVDDose.h.

◆ m_logConfig

LogConfig m_logConfig
privateinherited

The log system configuration of the module.

Definition at line 513 of file Module.h.

◆ m_moduleParamList

ModuleParamList m_moduleParamList
privateinherited

List storing and managing all parameter of the module.

Definition at line 515 of file Module.h.

◆ m_monObj

MonitoringObject* m_monObj = nullptr
private

Monitoring object for MiraBelle.

Definition at line 136 of file DQMHistAnalysisSVDDose.h.

◆ m_name

std::string m_name
privateinherited

The name of the module, saved as a string (user-modifiable)

Definition at line 507 of file Module.h.

◆ m_package

std::string m_package
privateinherited

Package this module is found in (may be empty).

Definition at line 509 of file Module.h.

◆ m_propertyFlags

unsigned int m_propertyFlags
privateinherited

The properties of the module as bitwise or (with |) of EModulePropFlags.

Definition at line 511 of file Module.h.

◆ m_PVPrefix

std::string m_PVPrefix = "TEST:"
staticprivateinherited

The Prefix for EPICS PVs.

Definition at line 160 of file DQMHistAnalysis.h.

◆ m_pvPrefix

std::string m_pvPrefix
private

Prefix for EPICS PVs.

Definition at line 129 of file DQMHistAnalysisSVDDose.h.

◆ m_pvSuffix

std::string m_pvSuffix
private

Suffix for EPICS PVs.

Definition at line 131 of file DQMHistAnalysisSVDDose.h.

◆ m_returnValue

int m_returnValue
privateinherited

The return value.

Definition at line 518 of file Module.h.

◆ m_statePVSuffix

std::string m_statePVSuffix
private

Suffix of the state PV.

Definition at line 133 of file DQMHistAnalysisSVDDose.h.

◆ m_type

std::string m_type
privateinherited

The type of the module, saved as a string.

Definition at line 508 of file Module.h.

◆ m_useEpics

bool m_useEpics = false
staticprivateinherited

Flag if to use EPICS do not set by yourself, use EpicsEnable module to set.

Definition at line 149 of file DQMHistAnalysis.h.

◆ s_canvasUpdatedList

DQMHistAnalysisModule::CanvasUpdatedList s_canvasUpdatedList
staticprivateinherited

The list of canvas updated status.

Definition at line 124 of file DQMHistAnalysis.h.

◆ s_deltaList

DQMHistAnalysisModule::DeltaList s_deltaList
staticinherited

The list of Delta Histograms and settings.

Definition at line 118 of file DQMHistAnalysis.h.

◆ s_eventProcessed

int s_eventProcessed = 0
inlinestaticprivateinherited

Number of Events processed to fill histograms.

Attention: histograms are updates asynchronously Thus the number for a specific histogram may be lower or higher. If you need precise number, you must fill it in the histogram itself (e.g. underflow bin)

Definition at line 138 of file DQMHistAnalysis.h.

◆ s_histList

DQMHistAnalysisModule::HistList s_histList
staticprivateinherited

The list of Histograms.

Definition at line 108 of file DQMHistAnalysis.h.

◆ s_monObjList

DQMHistAnalysisModule::MonObjList s_monObjList
staticprivateinherited

The list of MonitoringObjects.

Definition at line 112 of file DQMHistAnalysis.h.

◆ s_refList

DQMHistAnalysisModule::RefList s_refList
staticprivateinherited

The list of references.

Definition at line 129 of file DQMHistAnalysis.h.

◆ s_runType

std::string s_runType = ""
inlinestaticprivateinherited

The Run type.

Definition at line 143 of file DQMHistAnalysis.h.


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