Belle II Software development
DQMHistAnalysisMiraBelleModule Class Referencefinal

Make summary of data quality from reconstruction. More...

#include <DQMHistAnalysisMiraBelle.h>

Inheritance diagram for DQMHistAnalysisMiraBelleModule:
DQMHistAnalysisModule Module PathElement

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...
 
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

 DQMHistAnalysisMiraBelleModule ()
 Constructor.
 
 ~DQMHistAnalysisMiraBelleModule ()
 Destructor.
 
void initialize () override final
 Initialize the Module.
 
void beginRun () override final
 Called when entering a new run.
 
void event () override final
 Event processor.
 
void endRun () override final
 End-of-run action.
 
void terminate () override final
 Termination action.
 
void clearlist (void)
 Clear all static global lists.
 
void setRunType (std::string &t)
 Set the Run Type.
 
void setEventProcessed (int e)
 Set the number of processed events.
 
TCanvas * findCanvas (TString cname)
 Find canvas by name.
 
TH1 * findHistInCanvas (const std::string &hname, TCanvas **canvas=nullptr)
 Find histogram in corresponding canvas.
 
double getSigma68 (TH1 *h) const
 Helper function to compute half of the central interval covering 68% of a distribution.
 
void clearCanvases (void)
 Clear content of all Canvases.
 
void resetDeltaList (void)
 Reset Delta.
 
TH1 * getDelta (const std::string &fullname, int n=0, bool onlyIfUpdated=true)
 Get Delta histogram.
 
TH1 * getDelta (const std::string &dirname, const std::string &histname, int n=0, bool onlyIfUpdated=true)
 Get Delta histogram.
 
void addDeltaPar (const std::string &dirname, const std::string &histname, HistDelta::EDeltaType t, int p, unsigned int a=1)
 Add Delta histogram parameters.
 
bool hasDeltaPar (const std::string &dirname, const std::string &histname)
 Check if Delta histogram parameters exist for histogram.
 
void UpdateCanvas (std::string name, bool updated=true)
 Mark canvas as updated (or not)
 
void UpdateCanvas (TCanvas *canvas, bool updated=true)
 Mark canvas as updated (or not)
 
void ExtractRunType (std::vector< TH1 * > &hs)
 Extract Run Type from histogram title, called from input module.
 
void ExtractEvent (std::vector< TH1 * > &hs)
 Extract event processed from daq histogram, called from input module.
 
int registerEpicsPV (std::string pvname, std::string keyname="")
 EPICS related Functions.
 
int registerExternalEpicsPV (std::string pvname, std::string keyname="")
 Register a PV with its name and a key name.
 
void setEpicsPV (std::string keyname, double value)
 Write value to a EPICS PV.
 
void setEpicsPV (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 (std::string keyname, std::string value)
 Write string to a EPICS PV.
 
void setEpicsStringPV (int index, std::string value)
 Write string to a EPICS PV.
 
double getEpicsPV (std::string keyname)
 Read value from a EPICS PV.
 
double getEpicsPV (int index)
 Read value from a EPICS PV.
 
std::string getEpicsStringPV (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 (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 (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 setUseEpics (bool flag)
 Setter for EPICS usage.
 
void setUseEpicsReadOnly (bool flag)
 Setter EPICS flag in read only mode.
 
bool getUseEpics (void)
 Getter for EPICS usage.
 
bool getUseEpicsReadOnly (void)
 Getter EPICS flag in read only mode.
 
void cleanupEpicsPVs (void)
 Unsubscribe from EPICS PVs on terminate.
 
std::string & getPVPrefix (void)
 get global Prefix for EPICS PVs
 
void setPVPrefix (std::string &prefix)
 set global Prefix for EPICS PVs
 
EStatus makeStatus (bool enough, bool warn_flag, bool error_flag)
 Helper function to judge the status for coloring and EPICS.
 
void colorizeCanvas (TCanvas *canvas, EStatus status)
 Helper function for Canvas colorization.
 
EStatusColor getStatusColor (EStatus status)
 Return color for canvas state.
 
void checkPVStatus (void)
 Check the status of all PVs and report if disconnected or not found.
 
void printPVStatus (chid pv, bool onlyError=true)
 check the status of a PVs and report if disconnected or not found
 
void CheckEpicsError (int state, const std::string &message, const std::string &name)
 check the return status and check PV in case of error
 
void CheckEpicsError (int state, const std::string &message, chid id)
 check the return status and check PV in case of error
 
std::vector< std::string > StringSplit (const std::string &s, const char delim)
 Helper function for string token split.
 
virtual std::vector< std::string > getFileNames (bool outputFiles)
 Return a list of output filenames for this modules.
 
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 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 RefListgetRefList ()
 Get the list of the reference histograms.
 
static const std::string & getRunType (void)
 Get the Run Type.
 
static int getEventProcessed (void)
 Get the number of processed events.
 
static TH1 * findHist (const std::string &histname, bool onlyIfUpdated=false)
 Get histogram from list (no other search).
 
static TH1 * findHist (const std::string &dirname, const std::string &histname, bool onlyIfUpdated=false)
 Find histogram.
 
static TH1 * findRefHist (const std::string &histname, int scaling=0, const TH1 *hist=nullptr)
 Get referencehistogram from list (no other search).
 
static TH1 * findRefHist (const std::string &dirname, const std::string &histname, int scaling=0, const TH1 *hist=nullptr)
 Find reference histogram.
 
static TH1 * scaleReference (int 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 bool addHist (const std::string &dirname, const std::string &histname, TH1 *h)
 Add histogram.
 
static MonitoringObjectgetMonitoringObject (const std::string &name)
 Get MonitoringObject with given name (new object is created if non-existing)
 
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 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.
 

Protected Attributes

double m_scale_dst
 Scale factor "signal region" / "sideband", assuming uniform events.
 
Belle2::MonitoringObjectmon_mumu = nullptr
 MonitoringObject for mumu events.
 
Belle2::MonitoringObjectmon_dst = nullptr
 MonitoringObject for D* events.
 
Belle2::MonitoringObjectmon_bhabha = nullptr
 MonitoringObject for bhabha events.
 
Belle2::MonitoringObjectmon_hadron = nullptr
 MonitoringObject for hadronb2 tight events.
 
TCanvas * mumu_main = nullptr
 TCanvas object for main display.
 
TCanvas * mumu_resolution = nullptr
 TCanvas object for resolution display.
 
TCanvas * mumu_muon_val = nullptr
 TCanvas object for mumu values display.
 
TCanvas * dst_mass = nullptr
 TCanvas object for D0 mass, delta mass, and pi0 mass.
 
TCanvas * dst_pi_val = nullptr
 TCanvas object for PID distributions of pi.
 
TCanvas * dst_k_val = nullptr
 TCanvas object for PID distributions of K.
 
TCanvas * bhabha_main = nullptr
 TCanvas object for main display.
 
TCanvas * bhabha_resolution = nullptr
 TCanvas object for resolution display.
 
TCanvas * hadron_main = nullptr
 TCanvas object for main display.
 

Private Member Functions

int registerEpicsPVwithPrefix (std::string prefix, std::string pvname, 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.
 

Private Attributes

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 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

Make summary of data quality from reconstruction.

Definition at line 26 of file DQMHistAnalysisMiraBelle.h.

Member Typedef Documentation

◆ CanvasUpdatedList

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

The type of list of canvas updated status.

Definition at line 82 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 77 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 68 of file DQMHistAnalysis.h.

◆ MonObjList

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

The type of list of MonitoringObjects.

Definition at line 72 of file DQMHistAnalysis.h.

◆ RefList

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

The type of list of references.

Definition at line 87 of file DQMHistAnalysis.h.

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,
85 };
@ 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_DontCollectStatistics
No statistics is collected for this module.
Definition: Module.h:84
@ 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

◆ 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 };
@ c_StatusDefault
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.

◆ 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 };
@ 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

Constructor & Destructor Documentation

◆ DQMHistAnalysisMiraBelleModule()

Constructor.

Definition at line 24 of file DQMHistAnalysisMiraBelle.cc.

26{
27 // set module description (e.g. insert text)
28 setDescription("Modify and analyze the data quality histograms of MiraBelle");
30 addParam("scale_dst", m_scale_dst, "Scale factor signal/sideband", 0.09375);
31}
double m_scale_dst
Scale factor "signal region" / "sideband", assuming uniform events.
DQMHistAnalysisModule()
Constructor / Destructor.
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:208
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:560

◆ ~DQMHistAnalysisMiraBelleModule()

Destructor.

Definition at line 33 of file DQMHistAnalysisMiraBelle.cc.

34{
35}

Member Function Documentation

◆ addDeltaPar()

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

Add Delta histogram parameters.

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

Definition at line 96 of file DQMHistAnalysis.cc.

98{
99 std::string fullname;
100 if (dirname.size() > 0) {
101 fullname = dirname + "/" + histname;
102 } else {
103 fullname = histname;
104 }
105 s_deltaList[fullname].set(t, p, a);
106}
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 didnt change
79}
static HistList s_histList
The list of Histograms.

◆ beginRun()

void beginRun ( void  )
finaloverridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 76 of file DQMHistAnalysisMiraBelle.cc.

77{
78 B2DEBUG(20, "DQMHistAnalysisMiraBelle: beginRun called.");
79}

◆ CheckEpicsError() [1/2]

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

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 806 of file DQMHistAnalysis.cc.

807{
808 if (state != ECA_NORMAL) {
809 std::string name;
810 if (id) name = ca_name(id);
811 B2WARNING(message << ": " << name);
812 printPVStatus(id, false);
813 }
814}
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 798 of file DQMHistAnalysis.cc.

799{
800 if (state != ECA_NORMAL) {
801 B2WARNING(message << ": " << name);
802 printPVStatus(m_epicsNameToChID[name], false);
803 }
804}

◆ checkPVStatus()

void checkPVStatus ( void  )
inherited

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

Definition at line 762 of file DQMHistAnalysis.cc.

763{
764 B2INFO("Check PV Connections");
765
766 for (auto& it : m_epicsChID) {
767 printPVStatus(it);
768 }
769 B2INFO("Check PVs done");
770}

◆ cleanupEpicsPVs()

void cleanupEpicsPVs ( void  )
inherited

Unsubscribe from EPICS PVs on terminate.

Definition at line 643 of file DQMHistAnalysis.cc.

644{
645 // this should be called in terminate function of analysis modules
646#ifdef _BELLE2_EPICS
647 if (getUseEpics()) {
648 for (auto& it : m_epicsChID) CheckEpicsError(ca_clear_channel(it), "ca_clear_channel failure", it);
649 updateEpicsPVs(5.0);
650 // Make sure we clean up both afterwards!
651 m_epicsChID.clear();
652 m_epicsNameToChID.clear();
653 }
654#endif
655}
bool getUseEpics(void)
Getter for EPICS usage.
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  )
inherited

Clear content of all Canvases.

Definition at line 309 of file DQMHistAnalysis.cc.

310{
311 TIter nextckey(gROOT->GetListOfCanvases());
312 TObject* cobj = nullptr;
313
314 while ((cobj = dynamic_cast<TObject*>(nextckey()))) {
315 if (cobj->IsA()->InheritsFrom("TCanvas")) {
316 TCanvas* cnv = dynamic_cast<TCanvas*>(cobj);
317 cnv->Clear();
319 }
320 }
321}
void colorizeCanvas(TCanvas *canvas, EStatus status)
Helper function for Canvas colorization.

◆ clearHistList()

void clearHistList ( void  )
staticinherited

Clears the list of histograms.

Definition at line 337 of file DQMHistAnalysis.cc.

338{
339 s_histList.clear();
340}

◆ clearlist()

void clearlist ( void  )
inherited

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 RefList s_refList
The list of references.
static CanvasUpdatedList s_canvasUpdatedList
The list of canvas updated status.

◆ clearRefList()

void clearRefList ( void  )
staticinherited

Clears the list of ref histograms.

Definition at line 342 of file DQMHistAnalysis.cc.

343{
344 s_refList.clear();
345}

◆ 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{
182 newModule->m_moduleParamList.setParameters(getParamList());
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.
const ModuleParamList & getParamList() const
Return module param list.
Definition: Module.h:363
const std::string & getName() const
Returns the name of the module.
Definition: Module.h:187
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:512
LogConfig m_logConfig
The log system configuration of the module.
Definition: Module.h:514
std::vector< ModuleCondition > m_conditions
Module condition, only non-null if set.
Definition: Module.h:521
std::string m_package
Package this module is found in (may be empty).
Definition: Module.h:510
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 
)
inherited

Helper function for Canvas colorization.

Parameters
canvasCanvas to change
statusstatus to color

Definition at line 749 of file DQMHistAnalysis.cc.

750{
751 if (!canvas) return;
752 auto color = getStatusColor(stat);
753
754 canvas->Pad()->SetFillColor(color);
755
756 canvas->Pad()->SetFrameFillColor(10); // White (kWhite is not used since it results in transparent!)
757 canvas->Pad()->SetFrameFillStyle(1001);// White
758 canvas->Pad()->Modified();
759 canvas->Pad()->Update();
760}
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 426 of file Module.h.

426{ beginRun(); }
virtual void beginRun()
Called when entering a new run.
Definition: Module.h:147

◆ 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 439 of file Module.h.

439{ endRun(); }
virtual void endRun()
This method is called if the current run ends.
Definition: Module.h:166

◆ 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 432 of file Module.h.

432{ event(); }
virtual void event()
This method is the core of the module.
Definition: Module.h:157

◆ 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 420 of file Module.h.

420{ initialize(); }
virtual void initialize()
Initialize the Module.
Definition: Module.h:109

◆ 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 445 of file Module.h.

445{ terminate(); }
virtual void terminate()
This method is called at the end of the event processing.
Definition: Module.h:176

◆ endRun()

void endRun ( void  )
finaloverridevirtual

End-of-run action.

Save run-related stuff, such as statistics.

Reimplemented from Module.

Definition at line 86 of file DQMHistAnalysisMiraBelle.cc.

87{
88 // ========== mumutight
89 // get existing histograms produced by DQM modules
90 auto* hist_npxd = findHist("PhysicsObjectsMiraBelle/hist_npxd");
91 auto* hist_nsvd = findHist("PhysicsObjectsMiraBelle/hist_nsvd");
92 auto* hist_ncdc = findHist("PhysicsObjectsMiraBelle/hist_ncdc");
93 auto* hist_topdig = findHist("PhysicsObjectsMiraBelle/hist_topdig");
94 auto* hist_DetPhotonARICH = findHist("PhysicsObjectsMiraBelle/hist_DetPhotonARICH");
95 auto* hist_klmTotalHits = findHist("PhysicsObjectsMiraBelle/hist_klmTotalHits");
96 auto* hist_klmClusterLayers = findHist("PhysicsObjectsMiraBelle/hist_klmClusterLayers");
97 auto* hist_dD0 = findHist("PhysicsObjectsMiraBelle/hist_dD0");
98 auto* hist_dZ0 = findHist("PhysicsObjectsMiraBelle/hist_dZ0");
99 auto* hist_dPtcms = findHist("PhysicsObjectsMiraBelle/hist_dPtcms");
100 auto* hist_Pval = findHist("PhysicsObjectsMiraBelle/hist_Pval");
101 auto* hist_nExtraCDCHits = findHist("PhysicsObjectsMiraBelle/hist_nExtraCDCHits");
102 auto* hist_nECLClusters = findHist("PhysicsObjectsMiraBelle/hist_nECLClusters");
103 auto* hist_muid = findHist("PhysicsObjectsMiraBelle/hist_muid");
104 auto* hist_inv_p = findHist("PhysicsObjectsMiraBelle/hist_inv_p");
105 auto* hist_ndf = findHist("PhysicsObjectsMiraBelle/hist_ndf");
106 auto* hist_D0 = findHist("PhysicsObjectsMiraBelle/hist_D0");
107 auto* hist_Z0 = findHist("PhysicsObjectsMiraBelle/hist_Z0");
108 auto* hist_theta = findHist("PhysicsObjectsMiraBelle/hist_theta");
109 auto* hist_Phi0 = findHist("PhysicsObjectsMiraBelle/hist_Phi0");
110 auto* hist_Pt = findHist("PhysicsObjectsMiraBelle/hist_Pt");
111 auto* hist_Mom = findHist("PhysicsObjectsMiraBelle/hist_Mom");
112 auto* hist_klmTotalBarrelHits = findHist("PhysicsObjectsMiraBelle/hist_klmTotalBarrelHits");
113 auto* hist_klmTotalEndcapHits = findHist("PhysicsObjectsMiraBelle/hist_klmTotalEndcapHits");
114 auto* hist_dPhicms = findHist("PhysicsObjectsMiraBelle/hist_dPhicms");
115
116 if (hist_npxd == nullptr) {
117 B2ERROR("Can not find the hist_npxd histogram!");
118 return;
119 }
120 if (hist_nsvd == nullptr) {
121 B2ERROR("Can not find the hist_nsvd histogram!");
122 return;
123 }
124 if (hist_ncdc == nullptr) {
125 B2ERROR("Can not find the hist_ncdc histogram!");
126 return;
127 }
128 if (hist_topdig == nullptr) {
129 B2ERROR("Can not find the hist_topdig histogram!");
130 return;
131 }
132 if (hist_DetPhotonARICH == nullptr) {
133 B2ERROR("Can not find the hist_DetPhotonARICH histogram!");
134 return;
135 }
136 if (hist_klmTotalHits == nullptr) {
137 B2ERROR("Can not find the hist_klmTotalHits histogram!");
138 return;
139 }
140 if (hist_klmClusterLayers == nullptr) {
141 B2ERROR("Can not find the hist_klmClusterLayers histogram!");
142 return;
143 }
144 if (hist_dD0 == nullptr) {
145 B2ERROR("Can not find the hist_dD0 histogram!");
146 return;
147 }
148 if (hist_dZ0 == nullptr) {
149 B2ERROR("Can not find the hist_dZ0 histogram!");
150 return;
151 }
152 if (hist_dPtcms == nullptr) {
153 B2ERROR("Can not find the hist_dPtcms histogram!");
154 return;
155 }
156 if (hist_Pval == nullptr) {
157 B2ERROR("Can not find the hist_Pval histogram!");
158 return;
159 }
160 if (hist_nExtraCDCHits == nullptr) {
161 B2ERROR("Can not find the hist_nExtraCDCHits histogram!");
162 return;
163 }
164 if (hist_nECLClusters == nullptr) {
165 B2ERROR("Can not find the hist_nECLClusters histogram!");
166 return;
167 }
168 if (hist_muid == nullptr) {
169 B2ERROR("Can not find the hist_muid histogram!");
170 return;
171 }
172 if (hist_inv_p == nullptr) {
173 B2ERROR("Can not find the hist_inv_p histogram!");
174 return;
175 }
176 if (hist_ndf == nullptr) {
177 B2ERROR("Can not find the hist_ndf histogram!");
178 return;
179 }
180 if (hist_D0 == nullptr) {
181 B2ERROR("Can not find the hist_D0 histogram!");
182 return;
183 }
184 if (hist_Z0 == nullptr) {
185 B2ERROR("Can not find the hist_Z0 histogram!");
186 return;
187 }
188 if (hist_theta == nullptr) {
189 B2ERROR("Can not find the hist_theta histogram!");
190 return;
191 }
192 if (hist_Phi0 == nullptr) {
193 B2ERROR("Can not find the hist_Phi0 histogram!");
194 return;
195 }
196 if (hist_Pt == nullptr) {
197 B2ERROR("Can not find the hist_Pt histogram!");
198 return;
199 }
200 if (hist_Mom == nullptr) {
201 B2ERROR("Can not find the hist_Mom histogram!");
202 return;
203 }
204 if (hist_klmTotalBarrelHits == nullptr) {
205 B2ERROR("Can not find the hist_klmTotalBarrelHits histogram!");
206 return;
207 }
208 if (hist_klmTotalEndcapHits == nullptr) {
209 B2ERROR("Can not find the hist_klmTotalEndcapHits histogram!");
210 return;
211 }
212 if (hist_dPhicms == nullptr) {
213 B2ERROR("Can not find the hist_dPhicms histogram!");
214 return;
215 }
216
217 // Make TCanvases
218 // --- Mumu_Main
219 mumu_main->Divide(4, 3);
220 mumu_main->cd(1); hist_theta->Draw();
221 mumu_main->cd(2); hist_Phi0->Draw();
222 mumu_main->cd(3); hist_Mom->Draw();
223 mumu_main->cd(4); hist_Pt->Draw();
224 mumu_main->cd(5); hist_npxd->Draw();
225 mumu_main->cd(6); hist_nsvd->Draw();
226 mumu_main->cd(7); hist_ncdc->Draw();
227 mumu_main->cd(8); hist_topdig->Draw();
228 mumu_main->cd(9); hist_DetPhotonARICH->Draw();
229 mumu_main->cd(10); hist_klmClusterLayers->Draw();
230 mumu_main->cd(11); hist_nExtraCDCHits->Draw();
231 mumu_main->cd(12); hist_nECLClusters->Draw();
232 // --- Mumu_Resolution
233 mumu_resolution->Divide(3, 3);
234 mumu_resolution->cd(1); hist_inv_p->Draw();
235 mumu_resolution->cd(2); hist_dD0->Draw();
236 mumu_resolution->cd(3); hist_dZ0->Draw();
237 mumu_resolution->cd(4); hist_dPtcms->Draw();
238 mumu_resolution->cd(5); hist_dPhicms->Draw();
239 mumu_resolution->cd(6); hist_nECLClusters->Draw();
240 mumu_resolution->cd(7); hist_nExtraCDCHits->Draw();
241 mumu_resolution->cd(8); hist_ndf->Draw();
242 mumu_muon_val->Divide(2, 2);
243 // --- Muon variables
244 mumu_muon_val->cd(1); hist_muid->Draw();
245 mumu_muon_val->cd(2); hist_Pval->Draw();
246 mumu_muon_val->cd(3); hist_theta->Draw();
247 mumu_muon_val->cd(4); hist_Phi0->Draw();
248
249 // calculate the values of monitoring variables
250 double mean_npxd = hist_npxd->GetMean();
251 double mean_nsvd = hist_nsvd->GetMean();
252 double mean_ncdc = hist_ncdc->GetMean();
253 double mean_nklmlayer = hist_klmClusterLayers->GetMean();
254 double mean_nklm = hist_klmTotalHits->GetMean();
255 double mean_nbklm = hist_klmTotalBarrelHits->GetMean();
256 double mean_neklm = hist_klmTotalEndcapHits->GetMean();
257 double mean_topdig = hist_topdig->GetMean();
258 double mean_parich = hist_DetPhotonARICH->GetMean();
259 double mean_ncdc_ex = hist_nExtraCDCHits->GetMean();
260 double mean_necl = hist_nECLClusters->GetMean();
261 double mean_muid = hist_muid->GetMean();
262 double mean_d0 = hist_D0->GetMean();
263 double mean_z0 = hist_Z0->GetMean();
264 double mean_pval = hist_Pval->GetMean();
265 double mean_ndf = hist_ndf->GetMean();
266 double dif_ndf_ncdc = mean_ndf - mean_ncdc;
267 double mean_dd0 = hist_dD0->GetMean();
268 double mean_dz0 = hist_dZ0->GetMean();
269 double mean_dpt = hist_dPtcms->GetMean();
270 double rms_dd0 = hist_dD0->GetRMS();
271 double rms_dz0 = hist_dZ0->GetRMS();
272 double rms_dpt = hist_dPtcms->GetRMS();
273 double sigma68_dd0 = getSigma68(hist_dD0);
274 double sigma68_dz0 = getSigma68(hist_dZ0);
275 double sigma68_dpt = getSigma68(hist_dPtcms);
276 int ntot = hist_nsvd->GetEntries();
277 double neve_mumu = ntot;
278 double goodmu_frac = -1.;
279 double pval_frac_0 = -1.;
280 double pval_frac_1 = -1.;
281 double nocdc_frac = -1.;
282 double notop_frac = -1.;
283 double noarich_frac = -1.;
284 double muidcontent = hist_muid->GetBinContent(1);
285 double goodmu_o_badmu = -1.;
286 if (muidcontent != 0) {
287 goodmu_o_badmu = hist_muid->GetBinContent(20) / muidcontent;
288 } else {
289 goodmu_o_badmu = 0.0;
290 }
291 double pval_more95 = 0.0;
292 double pval_less05 = 0.0;
293 for (int i = 95; i < 100; i++) pval_more95 += hist_Pval->GetBinContent(i + 1);
294 for (int i = 0; i < 5; i++) pval_less05 += hist_Pval->GetBinContent(i + 1);
295 if (ntot != 0) {
296 goodmu_frac = hist_muid->GetBinContent(20) / neve_mumu;
297 pval_frac_0 = pval_less05 / neve_mumu;
298 pval_frac_1 = pval_more95 / neve_mumu;
299 nocdc_frac = hist_ncdc->GetBinContent(1) / neve_mumu;
300 notop_frac = hist_topdig->GetBinContent(1) / neve_mumu;
301 noarich_frac = hist_DetPhotonARICH->GetBinContent(1) / neve_mumu;
302 } else {
303 goodmu_frac = 0.0;
304 pval_frac_0 = 0.0;
305 pval_frac_1 = 0.0;
306 nocdc_frac = 0.0;
307 notop_frac = 0.0;
308 noarich_frac = 0.0;
309 }
310 //Calculate M(mumu)
311 double peak_mumu = hist_inv_p->GetXaxis()->GetBinCenter(hist_inv_p->GetMaximumBin());
312 TF1* f_mumuInvM = new TF1("f_mumuInvM", "gaus", peak_mumu - 0.05, peak_mumu + 0.05);
313 f_mumuInvM->SetParameters(hist_inv_p->GetMaximum(), peak_mumu, 0.045);
314 f_mumuInvM->SetParLimits(1, peak_mumu - 0.05, peak_mumu + 0.05);
315 f_mumuInvM->SetParLimits(2, 0.01, 0.08);
316 hist_inv_p->Fit(f_mumuInvM, "R");
317 double fit_mumumass = f_mumuInvM->GetParameter(1);
318 if (fit_mumumass < 9.) fit_mumumass = 9.;
319 if (fit_mumumass > 12.) fit_mumumass = 12.;
320 double fit_mumumass_error = f_mumuInvM->GetParError(1);
321 double mumumass_reference = 10.573;
322 double pull_mumumass = (fit_mumumass - mumumass_reference) / fit_mumumass_error;
323 double fit_sigma_mumu = f_mumuInvM->GetParameter(2);
324
325 // set values
326 mon_mumu->setVariable("mean_npxd", mean_npxd);
327 mon_mumu->setVariable("mean_nsvd", mean_nsvd);
328 mon_mumu->setVariable("mean_ncdc", mean_ncdc);
329 mon_mumu->setVariable("mean_nklmlayer", mean_nklmlayer);
330 mon_mumu->setVariable("mean_nklm", mean_nklm);
331 mon_mumu->setVariable("mean_nbklm", mean_nbklm);
332 mon_mumu->setVariable("mean_neklm", mean_neklm);
333 mon_mumu->setVariable("mean_topdig", mean_topdig);
334 mon_mumu->setVariable("mean_parich", mean_parich);
335 mon_mumu->setVariable("mean_ncdc_ex", mean_ncdc_ex);
336 mon_mumu->setVariable("mean_necl", mean_necl);
337 mon_mumu->setVariable("mean_muid", mean_muid);
338 mon_mumu->setVariable("mean_d0", mean_d0);
339 mon_mumu->setVariable("mean_z0", mean_z0);
340 mon_mumu->setVariable("mean_pval", mean_pval);
341 mon_mumu->setVariable("mean_ndf", mean_ndf);
342 mon_mumu->setVariable("dif_ndf_ncdc", dif_ndf_ncdc);
343 mon_mumu->setVariable("mean_dd0", mean_dd0);
344 mon_mumu->setVariable("mean_dz0", mean_dz0);
345 mon_mumu->setVariable("mean_dpt", mean_dpt);
346 mon_mumu->setVariable("rms_dd0", rms_dd0);
347 mon_mumu->setVariable("rms_dz0", rms_dz0);
348 mon_mumu->setVariable("rms_dpt", rms_dpt);
349 mon_mumu->setVariable("sigma68_dd0", sigma68_dd0);
350 mon_mumu->setVariable("sigma68_dz0", sigma68_dz0);
351 mon_mumu->setVariable("sigma68_dpt", sigma68_dpt);
352 mon_mumu->setVariable("neve_mumu", neve_mumu);
353 mon_mumu->setVariable("goodmu_frac", goodmu_frac);
354 mon_mumu->setVariable("goodmu_o_badmu", goodmu_o_badmu);
355 mon_mumu->setVariable("pval_frac_0", pval_frac_0);
356 mon_mumu->setVariable("pval_frac_1", pval_frac_1);
357 mon_mumu->setVariable("nocdc_frac", nocdc_frac);
358 mon_mumu->setVariable("notop_frac", notop_frac);
359 mon_mumu->setVariable("noarich_frac", noarich_frac);
360 mon_mumu->setVariable("fit_mumumass", fit_mumumass);
361 mon_mumu->setVariable("fit_mumumass_error", fit_mumumass_error);
362 mon_mumu->setVariable("pull_mumumass", pull_mumumass);
363 mon_mumu->setVariable("sigma_mumumass", fit_sigma_mumu);
364
365 // ========== D*
366 // get existing histograms produced by DQM modules
367 auto* hist_D0_InvM = findHist("PhysicsObjectsMiraBelleDst/hist_D0_InvM");
368 auto* hist_delta_m = findHist("PhysicsObjectsMiraBelleDst/hist_delta_m");
369 auto* hist_D0_softpi_PID_ALL_pion = findHist("PhysicsObjectsMiraBelleDst/hist_D0_softpi_PID_ALL_pion");
370 auto* hist_D0_softpi_PID_SVD_pion = findHist("PhysicsObjectsMiraBelleDst/hist_D0_softpi_PID_SVD_pion");
371 auto* hist_D0_softpi_PID_CDC_pion = findHist("PhysicsObjectsMiraBelleDst/hist_D0_softpi_PID_CDC_pion");
372 auto* hist_D0_softpi_PID_TOP_pion = findHist("PhysicsObjectsMiraBelleDst/hist_D0_softpi_PID_TOP_pion");
373 auto* hist_D0_softpi_PID_ARICH_pion = findHist("PhysicsObjectsMiraBelleDst/hist_D0_softpi_PID_ARICH_pion");
374 auto* hist_D0_softpi_PID_ECL_pion = findHist("PhysicsObjectsMiraBelleDst/hist_D0_softpi_PID_ECL_pion");
375 auto* hist_D0_softpi_PID_KLM_pion = findHist("PhysicsObjectsMiraBelleDst/hist_D0_softpi_PID_KLM_pion");
376 auto* hist_D0_pi_PID_ALL_pion = findHist("PhysicsObjectsMiraBelleDst/hist_D0_pi_PID_ALL_pion");
377 auto* hist_D0_pi_PID_SVD_pion = findHist("PhysicsObjectsMiraBelleDst/hist_D0_pi_PID_SVD_pion");
378 auto* hist_D0_pi_PID_CDC_pion = findHist("PhysicsObjectsMiraBelleDst/hist_D0_pi_PID_CDC_pion");
379 auto* hist_D0_pi_PID_TOP_pion = findHist("PhysicsObjectsMiraBelleDst/hist_D0_pi_PID_TOP_pion");
380 auto* hist_D0_pi_PID_ARICH_pion = findHist("PhysicsObjectsMiraBelleDst/hist_D0_pi_PID_ARICH_pion");
381 auto* hist_D0_pi_PID_ECL_pion = findHist("PhysicsObjectsMiraBelleDst/hist_D0_pi_PID_ECL_pion");
382 auto* hist_D0_pi_PID_KLM_pion = findHist("PhysicsObjectsMiraBelleDst/hist_D0_pi_PID_KLM_pion");
383 auto* hist_D0_K_PID_ALL_kaon = findHist("PhysicsObjectsMiraBelleDst/hist_D0_K_PID_ALL_kaon");
384 auto* hist_D0_K_PID_SVD_kaon = findHist("PhysicsObjectsMiraBelleDst/hist_D0_K_PID_SVD_kaon");
385 auto* hist_D0_K_PID_CDC_kaon = findHist("PhysicsObjectsMiraBelleDst/hist_D0_K_PID_CDC_kaon");
386 auto* hist_D0_K_PID_TOP_kaon = findHist("PhysicsObjectsMiraBelleDst/hist_D0_K_PID_TOP_kaon");
387 auto* hist_D0_K_PID_ARICH_kaon = findHist("PhysicsObjectsMiraBelleDst/hist_D0_K_PID_ARICH_kaon");
388 auto* hist_D0_K_PID_ECL_kaon = findHist("PhysicsObjectsMiraBelleDst/hist_D0_K_PID_ECL_kaon");
389 auto* hist_D0_K_PID_KLM_kaon = findHist("PhysicsObjectsMiraBelleDst/hist_D0_K_PID_KLM_kaon");
390 auto* hist_sideband_D0_softpi_PID_ALL_pion = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_softpi_PID_ALL_pion");
391 auto* hist_sideband_D0_softpi_PID_SVD_pion = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_softpi_PID_SVD_pion");
392 auto* hist_sideband_D0_softpi_PID_CDC_pion = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_softpi_PID_CDC_pion");
393 auto* hist_sideband_D0_softpi_PID_TOP_pion = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_softpi_PID_TOP_pion");
394 auto* hist_sideband_D0_softpi_PID_ARICH_pion = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_softpi_PID_ARICH_pion");
395 auto* hist_sideband_D0_softpi_PID_ECL_pion = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_softpi_PID_ECL_pion");
396 auto* hist_sideband_D0_softpi_PID_KLM_pion = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_softpi_PID_KLM_pion");
397 auto* hist_sideband_D0_pi_PID_ALL_pion = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_pi_PID_ALL_pion");
398 auto* hist_sideband_D0_pi_PID_SVD_pion = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_pi_PID_SVD_pion");
399 auto* hist_sideband_D0_pi_PID_CDC_pion = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_pi_PID_CDC_pion");
400 auto* hist_sideband_D0_pi_PID_TOP_pion = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_pi_PID_TOP_pion");
401 auto* hist_sideband_D0_pi_PID_ARICH_pion = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_pi_PID_ARICH_pion");
402 auto* hist_sideband_D0_pi_PID_ECL_pion = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_pi_PID_ECL_pion");
403 auto* hist_sideband_D0_pi_PID_KLM_pion = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_pi_PID_KLM_pion");
404 auto* hist_sideband_D0_K_PID_ALL_kaon = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_K_PID_ALL_kaon");
405 auto* hist_sideband_D0_K_PID_SVD_kaon = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_K_PID_SVD_kaon");
406 auto* hist_sideband_D0_K_PID_CDC_kaon = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_K_PID_CDC_kaon");
407 auto* hist_sideband_D0_K_PID_TOP_kaon = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_K_PID_TOP_kaon");
408 auto* hist_sideband_D0_K_PID_ARICH_kaon = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_K_PID_ARICH_kaon");
409 auto* hist_sideband_D0_K_PID_ECL_kaon = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_K_PID_ECL_kaon");
410 auto* hist_sideband_D0_K_PID_KLM_kaon = findHist("PhysicsObjectsMiraBelleDst/hist_sideband_D0_K_PID_KLM_kaon");
411 auto* hist_D0_pi0_InvM = findHist("PhysicsObjectsMiraBelleDst2/hist_D0_pi0_InvM");
412 if (hist_D0_InvM == nullptr) {
413 B2ERROR("Can not find the hist_D0_InvM histogram!");
414 return;
415 }
416 if (hist_delta_m == nullptr) {
417 B2ERROR("Can not find the hist_delta_m histogram!");
418 return;
419 }
420 if (hist_D0_softpi_PID_ALL_pion == nullptr) {
421 B2ERROR("Can not find the hist_D0_softpi_PID_ALL_pion histogram!");
422 return;
423 }
424 if (hist_D0_softpi_PID_SVD_pion == nullptr) {
425 B2ERROR("Can not find the hist_D0_softpi_PID_SVD_pion histogram!");
426 return;
427 }
428 if (hist_D0_softpi_PID_CDC_pion == nullptr) {
429 B2ERROR("Can not find the hist_D0_softpi_PID_CDC_pion histogram!");
430 return;
431 }
432 if (hist_D0_softpi_PID_TOP_pion == nullptr) {
433 B2ERROR("Can not find the hist_D0_softpi_PID_TOP_pion histogram!");
434 return;
435 }
436 if (hist_D0_softpi_PID_ARICH_pion == nullptr) {
437 B2ERROR("Can not find the hist_D0_softpi_PID_ARICH_pion histogram!");
438 return;
439 }
440 if (hist_D0_softpi_PID_ECL_pion == nullptr) {
441 B2ERROR("Can not find the hist_D0_softpi_PID_ECL_pion histogram!");
442 return;
443 }
444 if (hist_D0_softpi_PID_KLM_pion == nullptr) {
445 B2ERROR("Can not find the hist_D0_softpi_PID_KLM_pion histogram!");
446 return;
447 }
448 if (hist_D0_pi_PID_ALL_pion == nullptr) {
449 B2ERROR("Can not find the hist_D0_pi_PID_ALL_pion histogram!");
450 return;
451 }
452 if (hist_D0_pi_PID_SVD_pion == nullptr) {
453 B2ERROR("Can not find the hist_D0_pi_PID_SVD_pion histogram!");
454 return;
455 }
456 if (hist_D0_pi_PID_CDC_pion == nullptr) {
457 B2ERROR("Can not find the hist_D0_pi_PID_CDC_pion histogram!");
458 return;
459 }
460 if (hist_D0_pi_PID_TOP_pion == nullptr) {
461 B2ERROR("Can not find the hist_D0_pi_PID_TOP_pion histogram!");
462 return;
463 }
464 if (hist_D0_pi_PID_ARICH_pion == nullptr) {
465 B2ERROR("Can not find the hist_D0_pi_PID_ARICH_pion histogram!");
466 return;
467 }
468 if (hist_D0_pi_PID_ECL_pion == nullptr) {
469 B2ERROR("Can not find the hist_D0_pi_PID_ECL_pion histogram!");
470 return;
471 }
472 if (hist_D0_pi_PID_KLM_pion == nullptr) {
473 B2ERROR("Can not find the hist_D0_pi_PID_KLM_pion histogram!");
474 return;
475 }
476 if (hist_D0_K_PID_ALL_kaon == nullptr) {
477 B2ERROR("Can not find the hist_D0_K_PID_ALL_kaon histogram!");
478 return;
479 }
480 if (hist_D0_K_PID_SVD_kaon == nullptr) {
481 B2ERROR("Can not find the hist_D0_K_PID_SVD_kaon histogram!");
482 return;
483 }
484 if (hist_D0_K_PID_CDC_kaon == nullptr) {
485 B2ERROR("Can not find the hist_D0_K_PID_CDC_kaon histogram!");
486 return;
487 }
488 if (hist_D0_K_PID_TOP_kaon == nullptr) {
489 B2ERROR("Can not find the hist_D0_K_PID_TOP_kaon histogram!");
490 return;
491 }
492 if (hist_D0_K_PID_ARICH_kaon == nullptr) {
493 B2ERROR("Can not find the hist_D0_K_PID_ARICH_kaon histogram!");
494 return;
495 }
496 if (hist_D0_K_PID_ECL_kaon == nullptr) {
497 B2ERROR("Can not find the hist_D0_K_PID_ECL_kaon histogram!");
498 return;
499 }
500 if (hist_D0_K_PID_KLM_kaon == nullptr) {
501 B2ERROR("Can not find the hist_D0_K_PID_KLM_kaon histogram!");
502 return;
503 }
504 if (hist_sideband_D0_softpi_PID_ALL_pion == nullptr) {
505 B2ERROR("Can not find the hist_sideband_D0_softpi_PID_ALL_pion histogram!");
506 return;
507 }
508 if (hist_sideband_D0_softpi_PID_SVD_pion == nullptr) {
509 B2ERROR("Can not find the hist_sideband_D0_softpi_PID_SVD_pion histogram!");
510 return;
511 }
512 if (hist_sideband_D0_softpi_PID_CDC_pion == nullptr) {
513 B2ERROR("Can not find the hist_sideband_D0_softpi_PID_CDC_pion histogram!");
514 return;
515 }
516 if (hist_sideband_D0_softpi_PID_TOP_pion == nullptr) {
517 B2ERROR("Can not find the hist_sideband_D0_softpi_PID_TOP_pion histogram!");
518 return;
519 }
520 if (hist_sideband_D0_softpi_PID_ARICH_pion == nullptr) {
521 B2ERROR("Can not find the hist_sideband_D0_softpi_PID_ARICH_pion histogram!");
522 return;
523 }
524 if (hist_sideband_D0_softpi_PID_ECL_pion == nullptr) {
525 B2ERROR("Can not find the hist_sideband_D0_softpi_PID_ECL_pion histogram!");
526 return;
527 }
528 if (hist_sideband_D0_softpi_PID_KLM_pion == nullptr) {
529 B2ERROR("Can not find the hist_sideband_D0_softpi_PID_KLM_pion histogram!");
530 return;
531 }
532 if (hist_sideband_D0_pi_PID_ALL_pion == nullptr) {
533 B2ERROR("Can not find the hist_sideband_D0_pi_PID_ALL_pion histogram!");
534 return;
535 }
536 if (hist_sideband_D0_pi_PID_SVD_pion == nullptr) {
537 B2ERROR("Can not find the hist_sideband_D0_pi_PID_SVD_pion histogram!");
538 return;
539 }
540 if (hist_sideband_D0_pi_PID_CDC_pion == nullptr) {
541 B2ERROR("Can not find the hist_sideband_D0_pi_PID_CDC_pion histogram!");
542 return;
543 }
544 if (hist_sideband_D0_pi_PID_TOP_pion == nullptr) {
545 B2ERROR("Can not find the hist_sideband_D0_pi_PID_TOP_pion histogram!");
546 return;
547 }
548 if (hist_sideband_D0_pi_PID_ARICH_pion == nullptr) {
549 B2ERROR("Can not find the hist_sideband_D0_pi_PID_ARICH_pion histogram!");
550 return;
551 }
552 if (hist_sideband_D0_pi_PID_ECL_pion == nullptr) {
553 B2ERROR("Can not find the hist_sideband_D0_pi_PID_ECL_pion histogram!");
554 return;
555 }
556 if (hist_sideband_D0_pi_PID_KLM_pion == nullptr) {
557 B2ERROR("Can not find the hist_sideband_D0_pi_PID_KLM_pion histogram!");
558 return;
559 }
560 if (hist_sideband_D0_K_PID_ALL_kaon == nullptr) {
561 B2ERROR("Can not find the hist_sideband_D0_K_PID_ALL_kaon histogram!");
562 return;
563 }
564 if (hist_sideband_D0_K_PID_SVD_kaon == nullptr) {
565 B2ERROR("Can not find the hist_sideband_D0_K_PID_SVD_kaon histogram!");
566 return;
567 }
568 if (hist_sideband_D0_K_PID_CDC_kaon == nullptr) {
569 B2ERROR("Can not find the hist_sideband_D0_K_PID_CDC_kaon histogram!");
570 return;
571 }
572 if (hist_sideband_D0_K_PID_TOP_kaon == nullptr) {
573 B2ERROR("Can not find the hist_sideband_D0_K_PID_TOP_kaon histogram!");
574 return;
575 }
576 if (hist_sideband_D0_K_PID_ARICH_kaon == nullptr) {
577 B2ERROR("Can not find the hist_sideband_D0_K_PID_ARICH_kaon histogram!");
578 return;
579 }
580 if (hist_sideband_D0_K_PID_ECL_kaon == nullptr) {
581 B2ERROR("Can not find the hist_sideband_D0_K_PID_ECL_kaon histogram!");
582 return;
583 }
584 if (hist_sideband_D0_K_PID_KLM_kaon == nullptr) {
585 B2ERROR("Can not find the hist_sideband_D0_K_PID_KLM_kaon histogram!");
586 return;
587 }
588 if (hist_D0_pi0_InvM == nullptr) {
589 B2ERROR("Can not find the hist_D0_pi0_InvM histogram!");
590 return;
591 }
592 // Fit mass distributions for scale factor
593 TF1* f_InvM = new TF1("f_InvM", "[0]*TMath::Gaus(x,[1],[2])+[3]*pow(x-[4],2)+[5]", 1.81, 1.95);
594 f_InvM->SetParNames("Height", "#mu", "#sigma", "a", "b", "c");
595 f_InvM->SetParameters(hist_D0_InvM->GetMaximum(), 1.86, 5e-3, 0., 1.86, 0.);
596 hist_D0_InvM->Fit(f_InvM, "", "", 1.81, 1.95);
597 f_InvM->SetLineColor(kRed);
598
599 TF1* f_delta_m = new TF1("f_delta_m", "[0]*TMath::Gaus(x,[1],[2])+[3]*pow(x-[4],2)+[5]", 0.14, 0.16);
600 f_delta_m->SetParNames("Height", "#mu", "#sigma", "a", "b", "c");
601 f_delta_m->SetParameters(hist_delta_m->GetMaximum(), 0.145, 5e-4, 0., 0.145, 0.);
602 hist_delta_m->Fit(f_delta_m, "", "", 0.14, 0.16);
603 f_delta_m->SetLineColor(kRed);
604
605 TF1* f_pi0_InvM = new TF1("f_pi0_InvM", "[0]*TMath::Gaus(x,[1],[2])+[3]*pow(x-[4],2)+[5]", 0.09, 0.17);
606 f_pi0_InvM->SetParNames("Height", "#mu", "#sigma", "a", "b", "c");
607 f_pi0_InvM->SetParameters(hist_D0_pi0_InvM->GetMaximum(), 0.13, 5e-3, 0., 0.13, 0.);
608 hist_D0_pi0_InvM->Fit(f_pi0_InvM, "", "", 0.09, 0.17);
609 f_pi0_InvM->SetLineColor(kRed);
610
611 // D->KPi and D->KPiPi0 yields
612 TF1* f_gaus_InvM = new TF1("f_gaus_InvM", "gaus", 1.81, 1.95);
613 f_gaus_InvM->SetParameters(f_InvM->GetParameter(0), f_InvM->GetParameter(1), f_InvM->GetParameter(2));
614 double InvM_bin_width = hist_D0_InvM->GetXaxis()->GetBinWidth(1);
615 double neve_dst = f_gaus_InvM->Integral(1.81, 1.95) / InvM_bin_width;
616
617 TF1* f_gaus_pi0_InvM = new TF1("f_gaus_pi0_InvM", "gaus", 0.09, 0.17);
618 f_gaus_pi0_InvM->SetParameters(f_pi0_InvM->GetParameter(0), f_pi0_InvM->GetParameter(1), f_pi0_InvM->GetParameter(2));
619 double pi0_InvM_bin_width = hist_D0_pi0_InvM->GetXaxis()->GetBinWidth(1);
620 double neve_pi0 = f_gaus_pi0_InvM->Integral(0.09, 0.17) / pi0_InvM_bin_width;
621
622 // Sumw2
623 hist_D0_softpi_PID_ALL_pion->Sumw2();
624 hist_D0_softpi_PID_SVD_pion->Sumw2();
625 hist_D0_softpi_PID_CDC_pion->Sumw2();
626 hist_D0_softpi_PID_TOP_pion->Sumw2();
627 hist_D0_softpi_PID_ARICH_pion->Sumw2();
628 hist_D0_softpi_PID_ECL_pion->Sumw2();
629 hist_D0_softpi_PID_KLM_pion->Sumw2();
630 hist_D0_pi_PID_ALL_pion->Sumw2();
631 hist_D0_pi_PID_SVD_pion->Sumw2();
632 hist_D0_pi_PID_CDC_pion->Sumw2();
633 hist_D0_pi_PID_TOP_pion->Sumw2();
634 hist_D0_pi_PID_ARICH_pion->Sumw2();
635 hist_D0_pi_PID_ECL_pion->Sumw2();
636 hist_D0_pi_PID_KLM_pion->Sumw2();
637 hist_D0_K_PID_ALL_kaon->Sumw2();
638 hist_D0_K_PID_SVD_kaon->Sumw2();
639 hist_D0_K_PID_CDC_kaon->Sumw2();
640 hist_D0_K_PID_TOP_kaon->Sumw2();
641 hist_D0_K_PID_ARICH_kaon->Sumw2();
642 hist_D0_K_PID_ECL_kaon->Sumw2();
643 hist_D0_K_PID_KLM_kaon->Sumw2();
644 hist_sideband_D0_softpi_PID_ALL_pion->Sumw2();
645 hist_sideband_D0_softpi_PID_SVD_pion->Sumw2();
646 hist_sideband_D0_softpi_PID_CDC_pion->Sumw2();
647 hist_sideband_D0_softpi_PID_TOP_pion->Sumw2();
648 hist_sideband_D0_softpi_PID_ARICH_pion->Sumw2();
649 hist_sideband_D0_softpi_PID_ECL_pion->Sumw2();
650 hist_sideband_D0_softpi_PID_KLM_pion->Sumw2();
651 hist_sideband_D0_pi_PID_ALL_pion->Sumw2();
652 hist_sideband_D0_pi_PID_SVD_pion->Sumw2();
653 hist_sideband_D0_pi_PID_CDC_pion->Sumw2();
654 hist_sideband_D0_pi_PID_TOP_pion->Sumw2();
655 hist_sideband_D0_pi_PID_ARICH_pion->Sumw2();
656 hist_sideband_D0_pi_PID_ECL_pion->Sumw2();
657 hist_sideband_D0_pi_PID_KLM_pion->Sumw2();
658 hist_sideband_D0_K_PID_ALL_kaon->Sumw2();
659 hist_sideband_D0_K_PID_SVD_kaon->Sumw2();
660 hist_sideband_D0_K_PID_CDC_kaon->Sumw2();
661 hist_sideband_D0_K_PID_TOP_kaon->Sumw2();
662 hist_sideband_D0_K_PID_ARICH_kaon->Sumw2();
663 hist_sideband_D0_K_PID_ECL_kaon->Sumw2();
664 hist_sideband_D0_K_PID_KLM_kaon->Sumw2();
665
666 // Scale the distributions in sideband
667 hist_sideband_D0_softpi_PID_ALL_pion->Scale(m_scale_dst);
668 hist_sideband_D0_softpi_PID_SVD_pion->Scale(m_scale_dst);
669 hist_sideband_D0_softpi_PID_CDC_pion->Scale(m_scale_dst);
670 hist_sideband_D0_softpi_PID_TOP_pion->Scale(m_scale_dst);
671 hist_sideband_D0_softpi_PID_ARICH_pion->Scale(m_scale_dst);
672 hist_sideband_D0_softpi_PID_ECL_pion->Scale(m_scale_dst);
673 hist_sideband_D0_softpi_PID_KLM_pion->Scale(m_scale_dst);
674 hist_sideband_D0_pi_PID_ALL_pion->Scale(m_scale_dst);
675 hist_sideband_D0_pi_PID_SVD_pion->Scale(m_scale_dst);
676 hist_sideband_D0_pi_PID_CDC_pion->Scale(m_scale_dst);
677 hist_sideband_D0_pi_PID_TOP_pion->Scale(m_scale_dst);
678 hist_sideband_D0_pi_PID_ARICH_pion->Scale(m_scale_dst);
679 hist_sideband_D0_pi_PID_ECL_pion->Scale(m_scale_dst);
680 hist_sideband_D0_pi_PID_KLM_pion->Scale(m_scale_dst);
681 hist_sideband_D0_K_PID_ALL_kaon->Scale(m_scale_dst);
682 hist_sideband_D0_K_PID_SVD_kaon->Scale(m_scale_dst);
683 hist_sideband_D0_K_PID_CDC_kaon->Scale(m_scale_dst);
684 hist_sideband_D0_K_PID_TOP_kaon->Scale(m_scale_dst);
685 hist_sideband_D0_K_PID_ARICH_kaon->Scale(m_scale_dst);
686 hist_sideband_D0_K_PID_ECL_kaon->Scale(m_scale_dst);
687 hist_sideband_D0_K_PID_KLM_kaon->Scale(m_scale_dst);
688
689 // BG subtraction
690 hist_D0_softpi_PID_ALL_pion->Add(hist_sideband_D0_softpi_PID_ALL_pion, -1);
691 hist_D0_softpi_PID_SVD_pion->Add(hist_sideband_D0_softpi_PID_SVD_pion, -1);
692 hist_D0_softpi_PID_CDC_pion->Add(hist_sideband_D0_softpi_PID_CDC_pion, -1);
693 hist_D0_softpi_PID_TOP_pion->Add(hist_sideband_D0_softpi_PID_TOP_pion, -1);
694 hist_D0_softpi_PID_ARICH_pion->Add(hist_sideband_D0_softpi_PID_ARICH_pion, -1);
695 hist_D0_softpi_PID_ECL_pion->Add(hist_sideband_D0_softpi_PID_ECL_pion, -1);
696 hist_D0_softpi_PID_KLM_pion->Add(hist_sideband_D0_softpi_PID_KLM_pion, -1);
697 hist_D0_pi_PID_ALL_pion->Add(hist_sideband_D0_pi_PID_ALL_pion, -1);
698 hist_D0_pi_PID_SVD_pion->Add(hist_sideband_D0_pi_PID_SVD_pion, -1);
699 hist_D0_pi_PID_CDC_pion->Add(hist_sideband_D0_pi_PID_CDC_pion, -1);
700 hist_D0_pi_PID_TOP_pion->Add(hist_sideband_D0_pi_PID_TOP_pion, -1);
701 hist_D0_pi_PID_ARICH_pion->Add(hist_sideband_D0_pi_PID_ARICH_pion, -1);
702 hist_D0_pi_PID_ECL_pion->Add(hist_sideband_D0_pi_PID_ECL_pion, -1);
703 hist_D0_pi_PID_KLM_pion->Add(hist_sideband_D0_pi_PID_KLM_pion, -1);
704 hist_D0_K_PID_ALL_kaon->Add(hist_sideband_D0_K_PID_ALL_kaon, -1);
705 hist_D0_K_PID_SVD_kaon->Add(hist_sideband_D0_K_PID_SVD_kaon, -1);
706 hist_D0_K_PID_CDC_kaon->Add(hist_sideband_D0_K_PID_CDC_kaon, -1);
707 hist_D0_K_PID_TOP_kaon->Add(hist_sideband_D0_K_PID_TOP_kaon, -1);
708 hist_D0_K_PID_ARICH_kaon->Add(hist_sideband_D0_K_PID_ARICH_kaon, -1);
709 hist_D0_K_PID_ECL_kaon->Add(hist_sideband_D0_K_PID_ECL_kaon, -1);
710 hist_D0_K_PID_KLM_kaon->Add(hist_sideband_D0_K_PID_KLM_kaon, -1);
711
712 // Make TCanvases
713 // --- D* -> D0pi mass resolution
714 dst_mass->Divide(3, 1);
715 dst_mass->cd(1);
716 hist_D0_InvM->Draw();
717 f_InvM->Draw("SAME");
718 dst_mass->cd(2);
719 hist_delta_m->Draw();
720 f_delta_m->Draw("SAME");
721 dst_mass->cd(3);
722 hist_D0_pi0_InvM->Draw();
723 f_pi0_InvM->Draw("SAME");
724 // --- pi variables for D0 -> K pi
725 dst_pi_val->Divide(4, 2);
726 dst_pi_val->cd(1); hist_D0_pi_PID_ALL_pion->Draw();
727 dst_pi_val->cd(2); hist_D0_pi_PID_SVD_pion->Draw();
728 dst_pi_val->cd(3); hist_D0_pi_PID_CDC_pion->Draw();
729 dst_pi_val->cd(4); hist_D0_pi_PID_TOP_pion->Draw();
730 dst_pi_val->cd(5); hist_D0_pi_PID_ARICH_pion->Draw();
731 dst_pi_val->cd(6); hist_D0_pi_PID_ECL_pion->Draw();
732 dst_pi_val->cd(7); hist_D0_pi_PID_KLM_pion->Draw();
733 // --- K variables for D0 -> K pi
734 dst_k_val->Divide(4, 2);
735 dst_k_val->cd(1); hist_D0_K_PID_ALL_kaon->Draw();
736 dst_k_val->cd(2); hist_D0_K_PID_SVD_kaon->Draw();
737 dst_k_val->cd(3); hist_D0_K_PID_CDC_kaon->Draw();
738 dst_k_val->cd(4); hist_D0_K_PID_TOP_kaon->Draw();
739 dst_k_val->cd(5); hist_D0_K_PID_ARICH_kaon->Draw();
740 dst_k_val->cd(6); hist_D0_K_PID_ECL_kaon->Draw();
741 dst_k_val->cd(7); hist_D0_K_PID_KLM_kaon->Draw();
742
743 // calculate the values of monitoring variables
744 double mean_D0_InvM = f_InvM->GetParameter(1);
745 double width_D0_InvM = f_InvM->GetParameter(2);
746 double mean_delta_m = f_delta_m->GetParameter(1);
747 double width_delta_m = f_delta_m->GetParameter(2);
748 double mean_pi0_InvM = f_pi0_InvM->GetParameter(1);
749 double width_pi0_InvM = f_pi0_InvM->GetParameter(2);
750 double mean_D0_softpi_PID_ALL_pion = hist_D0_softpi_PID_ALL_pion->GetMean();
751 double mean_D0_softpi_PID_SVD_pion = hist_D0_softpi_PID_SVD_pion->GetMean();
752 double mean_D0_softpi_PID_CDC_pion = hist_D0_softpi_PID_CDC_pion->GetMean();
753 double mean_D0_softpi_PID_TOP_pion = hist_D0_softpi_PID_TOP_pion->GetMean();
754 double mean_D0_softpi_PID_ARICH_pion = hist_D0_softpi_PID_ARICH_pion->GetMean();
755 double mean_D0_softpi_PID_ECL_pion = hist_D0_softpi_PID_ECL_pion->GetMean();
756 double mean_D0_softpi_PID_KLM_pion = hist_D0_softpi_PID_KLM_pion->GetMean();
757 double mean_D0_pi_PID_ALL_pion = hist_D0_pi_PID_ALL_pion->GetMean();
758 double mean_D0_pi_PID_SVD_pion = hist_D0_pi_PID_SVD_pion->GetMean();
759 double mean_D0_pi_PID_CDC_pion = hist_D0_pi_PID_CDC_pion->GetMean();
760 double mean_D0_pi_PID_TOP_pion = hist_D0_pi_PID_TOP_pion->GetMean();
761 double mean_D0_pi_PID_ARICH_pion = hist_D0_pi_PID_ARICH_pion->GetMean();
762 double mean_D0_pi_PID_ECL_pion = hist_D0_pi_PID_ECL_pion->GetMean();
763 double mean_D0_pi_PID_KLM_pion = hist_D0_pi_PID_KLM_pion->GetMean();
764 double mean_D0_K_PID_ALL_kaon = hist_D0_K_PID_ALL_kaon->GetMean();
765 double mean_D0_K_PID_SVD_kaon = hist_D0_K_PID_SVD_kaon->GetMean();
766 double mean_D0_K_PID_CDC_kaon = hist_D0_K_PID_CDC_kaon->GetMean();
767 double mean_D0_K_PID_TOP_kaon = hist_D0_K_PID_TOP_kaon->GetMean();
768 double mean_D0_K_PID_ARICH_kaon = hist_D0_K_PID_ARICH_kaon->GetMean();
769 double mean_D0_K_PID_ECL_kaon = hist_D0_K_PID_ECL_kaon->GetMean();
770 double mean_D0_K_PID_KLM_kaon = hist_D0_K_PID_KLM_kaon->GetMean();
771
772 // set values
773 mon_dst->setVariable("neve_dst", neve_dst);
774 mon_dst->setVariable("neve_pi0", neve_pi0);
775 mon_dst->setVariable("mean_D0_InvM", mean_D0_InvM);
776 mon_dst->setVariable("width_D0_InvM", width_D0_InvM);
777 mon_dst->setVariable("mean_delta_m", mean_delta_m);
778 mon_dst->setVariable("width_delta_m", width_delta_m);
779 mon_dst->setVariable("mean_pi0_InvM", mean_pi0_InvM);
780 mon_dst->setVariable("width_pi0_InvM", width_pi0_InvM);
781 mon_dst->setVariable("mean_D0_softpi_PID_ALL_pion", mean_D0_softpi_PID_ALL_pion);
782 mon_dst->setVariable("mean_D0_softpi_PID_SVD_pion", mean_D0_softpi_PID_SVD_pion);
783 mon_dst->setVariable("mean_D0_softpi_PID_CDC_pion", mean_D0_softpi_PID_CDC_pion);
784 mon_dst->setVariable("mean_D0_softpi_PID_TOP_pion", mean_D0_softpi_PID_TOP_pion);
785 mon_dst->setVariable("mean_D0_softpi_PID_ARICH_pion", mean_D0_softpi_PID_ARICH_pion);
786 mon_dst->setVariable("mean_D0_softpi_PID_ECL_pion", mean_D0_softpi_PID_ECL_pion);
787 mon_dst->setVariable("mean_D0_softpi_PID_KLM_pion", mean_D0_softpi_PID_KLM_pion);
788 mon_dst->setVariable("mean_D0_pi_PID_ALL_pion", mean_D0_pi_PID_ALL_pion);
789 mon_dst->setVariable("mean_D0_pi_PID_SVD_pion", mean_D0_pi_PID_SVD_pion);
790 mon_dst->setVariable("mean_D0_pi_PID_CDC_pion", mean_D0_pi_PID_CDC_pion);
791 mon_dst->setVariable("mean_D0_pi_PID_TOP_pion", mean_D0_pi_PID_TOP_pion);
792 mon_dst->setVariable("mean_D0_pi_PID_ARICH_pion", mean_D0_pi_PID_ARICH_pion);
793 mon_dst->setVariable("mean_D0_pi_PID_ECL_pion", mean_D0_pi_PID_ECL_pion);
794 mon_dst->setVariable("mean_D0_pi_PID_KLM_pion", mean_D0_pi_PID_KLM_pion);
795 mon_dst->setVariable("mean_D0_K_PID_ALL_kaon", mean_D0_K_PID_ALL_kaon);
796 mon_dst->setVariable("mean_D0_K_PID_SVD_kaon", mean_D0_K_PID_SVD_kaon);
797 mon_dst->setVariable("mean_D0_K_PID_CDC_kaon", mean_D0_K_PID_CDC_kaon);
798 mon_dst->setVariable("mean_D0_K_PID_TOP_kaon", mean_D0_K_PID_TOP_kaon);
799 mon_dst->setVariable("mean_D0_K_PID_ARICH_kaon", mean_D0_K_PID_ARICH_kaon);
800 mon_dst->setVariable("mean_D0_K_PID_ECL_kaon", mean_D0_K_PID_ECL_kaon);
801 mon_dst->setVariable("mean_D0_K_PID_KLM_kaon", mean_D0_K_PID_KLM_kaon);
802
803 //bhabha,hadrons
804 // ========== bhabha_all
805 // get existing histograms produced by DQM modules
806 auto* histbh_npxd = findHist("PhysicsObjectsMiraBelleBhabha/hist_npxd");
807 auto* histbh_nsvd = findHist("PhysicsObjectsMiraBelleBhabha/hist_nsvd");
808 auto* histbh_ncdc = findHist("PhysicsObjectsMiraBelleBhabha/hist_ncdc");
809 auto* histbh_topdig = findHist("PhysicsObjectsMiraBelleBhabha/hist_topdig");
810 auto* histbh_DetPhotonARICH = findHist("PhysicsObjectsMiraBelleBhabha/hist_DetPhotonARICH");
811 auto* histbh_dD0 = findHist("PhysicsObjectsMiraBelleBhabha/hist_dD0");
812 auto* histbh_dZ0 = findHist("PhysicsObjectsMiraBelleBhabha/hist_dZ0");
813 auto* histbh_dPtcms = findHist("PhysicsObjectsMiraBelleBhabha/hist_dPtcms");
814 auto* histbh_Pval = findHist("PhysicsObjectsMiraBelleBhabha/hist_Pval");
815 auto* histbh_nExtraCDCHits = findHist("PhysicsObjectsMiraBelleBhabha/hist_nExtraCDCHits");
816 auto* histbh_nECLClusters = findHist("PhysicsObjectsMiraBelleBhabha/hist_nECLClusters");
817 auto* histbh_electronid = findHist("PhysicsObjectsMiraBelleBhabha/hist_electronid");
818 auto* histbh_inv_p = findHist("PhysicsObjectsMiraBelleBhabha/hist_inv_p");
819 auto* histbh_ndf = findHist("PhysicsObjectsMiraBelleBhabha/hist_ndf");
820 auto* histbh_D0 = findHist("PhysicsObjectsMiraBelleBhabha/hist_D0");
821 auto* histbh_Z0 = findHist("PhysicsObjectsMiraBelleBhabha/hist_Z0");
822 auto* histbh_theta = findHist("PhysicsObjectsMiraBelleBhabha/hist_theta");
823 auto* histbh_Phi0 = findHist("PhysicsObjectsMiraBelleBhabha/hist_Phi0");
824 auto* histbh_Pt = findHist("PhysicsObjectsMiraBelleBhabha/hist_Pt");
825 auto* histbh_Mom = findHist("PhysicsObjectsMiraBelleBhabha/hist_Mom");
826 auto* histbh_dPhicms = findHist("PhysicsObjectsMiraBelleBhabha/hist_dPhicms");
827
828 if (histbh_npxd == nullptr) {
829 B2ERROR("Can not find the histbh_npxd histogram!");
830 return;
831 }
832 if (histbh_nsvd == nullptr) {
833 B2ERROR("Can not find the histbh_nsvd histogram!");
834 return;
835 }
836 if (histbh_ncdc == nullptr) {
837 B2ERROR("Can not find the histbh_ncdc histogram!");
838 return;
839 }
840 if (histbh_topdig == nullptr) {
841 B2ERROR("Can not find the histbh_topdig histogram!");
842 return;
843 }
844 if (histbh_DetPhotonARICH == nullptr) {
845 B2ERROR("Can not find the histbh_DetPhotonARICH histogram!");
846 return;
847 }
848 if (histbh_dD0 == nullptr) {
849 B2ERROR("Can not find the histbh_dD0 histogram!");
850 return;
851 }
852 if (histbh_dZ0 == nullptr) {
853 B2ERROR("Can not find the histbh_dZ0 histogram!");
854 return;
855 }
856 if (histbh_dPtcms == nullptr) {
857 B2ERROR("Can not find the histbh_dPtcms histogram!");
858 return;
859 }
860 if (histbh_Pval == nullptr) {
861 B2ERROR("Can not find the histbh_Pval histogram!");
862 return;
863 }
864 if (histbh_nExtraCDCHits == nullptr) {
865 B2ERROR("Can not find the histbh_nExtraCDCHits histogram!");
866 return;
867 }
868 if (histbh_nECLClusters == nullptr) {
869 B2ERROR("Can not find the histbh_nECLClusters histogram!");
870 return;
871 }
872 if (histbh_electronid == nullptr) {
873 B2ERROR("Can not find the histbh_electronid histogram!");
874 return;
875 }
876 if (histbh_inv_p == nullptr) {
877 B2ERROR("Can not find the histbh_inv_p histogram!");
878 return;
879 }
880 if (histbh_ndf == nullptr) {
881 B2ERROR("Can not find the histbh_ndf histogram!");
882 return;
883 }
884 if (histbh_D0 == nullptr) {
885 B2ERROR("Can not find the histbh_D0 histogram!");
886 return;
887 }
888 if (histbh_Z0 == nullptr) {
889 B2ERROR("Can not find the histbh_Z0 histogram!");
890 return;
891 }
892 if (histbh_theta == nullptr) {
893 B2ERROR("Can not find the histbh_theta histogram!");
894 return;
895 }
896 if (histbh_Phi0 == nullptr) {
897 B2ERROR("Can not find the histbh_Phi0 histogram!");
898 return;
899 }
900 if (histbh_Pt == nullptr) {
901 B2ERROR("Can not find the histbh_Pt histogram!");
902 return;
903 }
904 if (histbh_Mom == nullptr) {
905 B2ERROR("Can not find the histbh_Mom histogram!");
906 return;
907 }
908 if (histbh_dPhicms == nullptr) {
909 B2ERROR("Can not find the histbh_dPhicms histogram!");
910 return;
911 }
912
913 // Make TCanvases
914 // --- bhabha_Main
915 bhabha_main->Divide(4, 3);
916 bhabha_main->cd(1); histbh_theta->Draw();
917 bhabha_main->cd(2); histbh_Phi0->Draw();
918 bhabha_main->cd(3); histbh_Mom->Draw();
919 bhabha_main->cd(4); histbh_Pt->Draw();
920 bhabha_main->cd(5); histbh_npxd->Draw();
921 bhabha_main->cd(6); histbh_nsvd->Draw();
922 bhabha_main->cd(7); histbh_ncdc->Draw();
923 bhabha_main->cd(8); histbh_topdig->Draw();
924 bhabha_main->cd(9); histbh_DetPhotonARICH->Draw();
925 bhabha_main->cd(10); histbh_nExtraCDCHits->Draw();
926 bhabha_main->cd(11); histbh_nECLClusters->Draw();
927 // --- bhabha_Resolution
928 bhabha_resolution->Divide(3, 3);
929 bhabha_resolution->cd(1); histbh_inv_p->Draw();
930 bhabha_resolution->cd(2); histbh_dD0->Draw();
931 bhabha_resolution->cd(3); histbh_dZ0->Draw();
932 bhabha_resolution->cd(4); histbh_dPtcms->Draw();
933 bhabha_resolution->cd(5); histbh_dPhicms->Draw();
934 bhabha_resolution->cd(6); histbh_nECLClusters->Draw();
935 bhabha_resolution->cd(7); histbh_nExtraCDCHits->Draw();
936 bhabha_resolution->cd(8); histbh_ndf->Draw();
937
938 // calculate the values of monitoring variables
939 double bh_mean_npxd = histbh_npxd->GetMean();
940 double bh_mean_nsvd = histbh_nsvd->GetMean();
941 double bh_mean_ncdc = histbh_ncdc->GetMean();
942 double bh_mean_topdig = histbh_topdig->GetMean();
943 double bh_mean_parich = histbh_DetPhotonARICH->GetMean();
944 double bh_mean_ncdc_ex = histbh_nExtraCDCHits->GetMean();
945 double bh_mean_necl = histbh_nECLClusters->GetMean();
946 double bh_mean_electronid = histbh_electronid->GetMean();
947 double bh_mean_d0 = histbh_D0->GetMean();
948 double bh_mean_z0 = histbh_Z0->GetMean();
949 double bh_mean_pval = histbh_Pval->GetMean();
950 double bh_mean_ndf = histbh_ndf->GetMean();
951 double bh_dif_ndf_ncdc = mean_ndf - mean_ncdc;
952 double bh_mean_dd0 = histbh_dD0->GetMean();
953 double bh_mean_dz0 = histbh_dZ0->GetMean();
954 double bh_mean_dpt = histbh_dPtcms->GetMean();
955 double bh_rms_dd0 = histbh_dD0->GetRMS();
956 double bh_rms_dz0 = histbh_dZ0->GetRMS();
957 double bh_rms_dpt = histbh_dPtcms->GetRMS();
958 double bh_sigma68_dd0 = getSigma68(histbh_dD0);
959 double bh_sigma68_dz0 = getSigma68(histbh_dZ0);
960 double bh_sigma68_dpt = getSigma68(histbh_dPtcms);
961 int bh_ntot = histbh_nECLClusters->GetEntries();
962 double bh_neve_bhabha = bh_ntot;
963 int bh_ntot_sign = histbh_nsvd->GetEntries();
964 double bh_neve_bhabha_sign = bh_ntot_sign;
965 double bh_goode_frac = -1.;
966 double bh_pval_frac_0 = -1.;
967 double bh_pval_frac_1 = -1.;
968 double bh_nocdc_frac = -1.;
969 double bh_notop_frac = -1.;
970 double bh_noarich_frac = -1.;
971 double eidcontent = histbh_electronid->GetBinContent(1);
972 double bh_goode_o_bade;
973 if (eidcontent != 0) {
974 bh_goode_o_bade = histbh_electronid->GetBinContent(20) / eidcontent;
975 } else {
976 bh_goode_o_bade = 0.0;
977 }
978 double bh_pval_more95 = 0.0;
979 double bh_pval_less05 = 0.0;
980 for (int i = 95; i < 100; i++) bh_pval_more95 += histbh_Pval->GetBinContent(i + 1);
981 for (int i = 0; i < 5; i++) bh_pval_less05 += histbh_Pval->GetBinContent(i + 1);
982 if (bh_neve_bhabha_sign != 0) {
983 bh_goode_frac = histbh_electronid->GetBinContent(20) / bh_neve_bhabha_sign;
984 bh_pval_frac_0 = bh_pval_less05 / bh_neve_bhabha_sign;
985 bh_pval_frac_1 = bh_pval_more95 / bh_neve_bhabha_sign;
986 bh_nocdc_frac = histbh_ncdc->GetBinContent(1) / bh_neve_bhabha_sign;
987 bh_notop_frac = histbh_topdig->GetBinContent(1) / bh_neve_bhabha_sign;
988 bh_noarich_frac = histbh_DetPhotonARICH->GetBinContent(1) / bh_neve_bhabha_sign;
989 } else {
990 bh_goode_frac = 0.0;
991 bh_pval_frac_0 = 0.0;
992 bh_pval_frac_1 = 0.0;
993 bh_nocdc_frac = 0.0;
994 bh_notop_frac = 0.0;
995 bh_noarich_frac = 0.0;
996 }
997 // set values
998 mon_bhabha->setVariable("bh_mean_npxd", bh_mean_npxd);
999 mon_bhabha->setVariable("bh_mean_nsvd", bh_mean_nsvd);
1000 mon_bhabha->setVariable("bh_mean_ncdc", bh_mean_ncdc);
1001 mon_bhabha->setVariable("bh_mean_topdig", bh_mean_topdig);
1002 mon_bhabha->setVariable("bh_mean_parich", bh_mean_parich);
1003 mon_bhabha->setVariable("bh_mean_ncdc_ex", bh_mean_ncdc_ex);
1004 mon_bhabha->setVariable("bh_mean_necl", bh_mean_necl);
1005 mon_bhabha->setVariable("bh_mean_electronid", bh_mean_electronid);
1006 mon_bhabha->setVariable("bh_mean_d0", bh_mean_d0);
1007 mon_bhabha->setVariable("bh_mean_z0", bh_mean_z0);
1008 mon_bhabha->setVariable("bh_mean_pval", bh_mean_pval);
1009 mon_bhabha->setVariable("bh_mean_ndf", bh_mean_ndf);
1010 mon_bhabha->setVariable("bh_dif_ndf_ncdc", bh_dif_ndf_ncdc);
1011 mon_bhabha->setVariable("bh_mean_dd0", bh_mean_dd0);
1012 mon_bhabha->setVariable("bh_mean_dz0", bh_mean_dz0);
1013 mon_bhabha->setVariable("bh_mean_dpt", bh_mean_dpt);
1014 mon_bhabha->setVariable("bh_rms_dd0", bh_rms_dd0);
1015 mon_bhabha->setVariable("bh_rms_dz0", bh_rms_dz0);
1016 mon_bhabha->setVariable("bh_rms_dpt", bh_rms_dpt);
1017 mon_bhabha->setVariable("bh_sigma68_dd0", bh_sigma68_dd0);
1018 mon_bhabha->setVariable("bh_sigma68_dz0", bh_sigma68_dz0);
1019 mon_bhabha->setVariable("bh_sigma68_dpt", bh_sigma68_dpt);
1020 mon_bhabha->setVariable("bh_neve_bhabha", bh_neve_bhabha);
1021 mon_bhabha->setVariable("bh_neve_bhabha_sign", bh_neve_bhabha_sign);
1022 mon_bhabha->setVariable("bh_goode_frac", bh_goode_frac);
1023 mon_bhabha->setVariable("bh_goode_o_bade", bh_goode_o_bade);
1024 mon_bhabha->setVariable("bh_pval_frac_0", bh_pval_frac_0);
1025 mon_bhabha->setVariable("bh_pval_frac_1", bh_pval_frac_1);
1026 mon_bhabha->setVariable("bh_nocdc_frac", bh_nocdc_frac);
1027 mon_bhabha->setVariable("bh_notop_frac", bh_notop_frac);
1028 mon_bhabha->setVariable("bh_noarich_frac", bh_noarich_frac);
1029 // ========== hadronb2 + tight
1030 // get existing histograms produced by DQM modules
1031 auto* histhad_nECLClusters = findHist("PhysicsObjectsMiraBelleHadron/hist_nECLClusters");
1032 auto* histhad_visibleEnergyCMSnorm = findHist("PhysicsObjectsMiraBelleHadron/hist_visibleEnergyCMSnorm");
1033 auto* histhad_EsumCMSnorm = findHist("PhysicsObjectsMiraBelleHadron/hist_EsumCMSnorm");
1034 auto* histhad_R2 = findHist("PhysicsObjectsMiraBelleHadron/hist_R2");
1035 auto* histhad_physicsresultsH = findHist("PhysicsObjectsMiraBelleHadron/hist_physicsresultsH");
1036
1037 if (histhad_nECLClusters == nullptr) {
1038 B2ERROR("Can not find the histhad_nECLClusters histogram!");
1039 return;
1040 }
1041 if (histhad_visibleEnergyCMSnorm == nullptr) {
1042 B2ERROR("Can not find the histhad_visibleEnergyCMSnorm histogram!");
1043 return;
1044 }
1045 if (histhad_EsumCMSnorm == nullptr) {
1046 B2ERROR("Can not find the histhad_EsumCMSnorm histogram!");
1047 return;
1048 }
1049 if (histhad_R2 == nullptr) {
1050 B2ERROR("Can not find the histhad_R2 histogram!");
1051 return;
1052 }
1053 if (histhad_physicsresultsH == nullptr) {
1054 B2ERROR("Can not find the histhad_physicsresultsH histogram!");
1055 return;
1056 }
1057
1058 // Make TCanvases
1059 // --- hadron_Main
1060 hadron_main->Divide(2, 2);
1061 hadron_main->cd(1); histhad_nECLClusters->Draw();
1062 hadron_main->cd(2); histhad_visibleEnergyCMSnorm->Draw();
1063 hadron_main->cd(3); histhad_EsumCMSnorm->Draw();
1064 hadron_main->cd(4); histhad_R2->Draw();
1065 // calculate the values of monitoring variables
1066 double had_ntot = histhad_physicsresultsH->GetBinContent(3);
1067 double ratio_hadron_bhabha = 0.;
1068 //pull
1069 double ratio_pull_hadBhabha = -10.;
1070 double error_ratio = -10.;
1071
1072 if (bh_ntot != 0) {
1073 ratio_hadron_bhabha = had_ntot / bh_neve_bhabha;
1074 //pull
1075 double ratio_reference = 0.206;
1076 error_ratio = ratio_hadron_bhabha * sqrt((1 / had_ntot) + (1 / bh_neve_bhabha));
1077 ratio_pull_hadBhabha = (ratio_hadron_bhabha - ratio_reference) / error_ratio;
1078 }
1079 // set values
1080 mon_bhabha->setVariable("had_ntot", had_ntot);
1081 mon_hadron->setVariable("ratio_hadron_bhabha", ratio_hadron_bhabha);
1082 mon_hadron->setVariable("error_ratio", error_ratio);
1083 mon_hadron->setVariable("ratio_pull_hadBhabha", ratio_pull_hadBhabha);
1084
1085 B2DEBUG(20, "DQMHistAnalysisMiraBelle : endRun called");
1086}
TCanvas * dst_k_val
TCanvas object for PID distributions of K.
TCanvas * bhabha_main
TCanvas object for main display.
TCanvas * hadron_main
TCanvas object for main display.
TCanvas * bhabha_resolution
TCanvas object for resolution display.
TCanvas * mumu_resolution
TCanvas object for resolution display.
Belle2::MonitoringObject * mon_bhabha
MonitoringObject for bhabha events.
TCanvas * dst_pi_val
TCanvas object for PID distributions of pi.
Belle2::MonitoringObject * mon_dst
MonitoringObject for D* events.
TCanvas * mumu_main
TCanvas object for main display.
TCanvas * mumu_muon_val
TCanvas object for mumu values display.
Belle2::MonitoringObject * mon_mumu
MonitoringObject for mumu events.
TCanvas * dst_mass
TCanvas object for D0 mass, delta mass, and pi0 mass.
Belle2::MonitoringObject * mon_hadron
MonitoringObject for hadronb2 tight events.
static TH1 * findHist(const std::string &histname, bool onlyIfUpdated=false)
Get histogram from list (no other search).
double getSigma68(TH1 *h) const
Helper function to compute half of the central interval covering 68% of a distribution.
void setVariable(const std::string &var, float val, float upErr=-1., float dwErr=-1)
set value to float variable (new variable is made if not yet existing)
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28

◆ 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:519
bool m_hasReturnValue
True, if the return value is set.
Definition: Module.h:518

◆ event()

void event ( void  )
finaloverridevirtual

Event processor.

Reimplemented from Module.

Definition at line 81 of file DQMHistAnalysisMiraBelle.cc.

82{
83 B2DEBUG(20, "DQMHistAnalysisOutputMiraBelle: event called.");
84}

◆ 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 pathes */
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://confluence.desy.de/display/BI/Software+Basf2manual#Module_Development
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>()),
@ 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: "<"
Base class for Modules.
Definition: Module.h:72
LogConfig & getLogConfig()
Returns the log system configuration.
Definition: Module.h:225
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
void setReturnValue(int value)
Sets the return value for this module as integer.
Definition: Module.cc:220
void setLogConfig(const LogConfig &logConfig)
Set the log system configuration.
Definition: Module.h:230
const std::string & getDescription() const
Returns the description of the module.
Definition: Module.h:202
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
bool hasCondition() const
Returns true if at least one condition was set for the module.
Definition: Module.h:311
const std::string & getPackage() const
Returns the package this module is in.
Definition: Module.h:197
void setName(const std::string &name)
Set the name of the module.
Definition: Module.h:214
bool hasProperties(unsigned int propertyFlags) const
Returns true if all specified property flags are available in this module.
Definition: Module.cc:160
std::string getPathString() const override
return the module name.
Definition: Module.cc:192

◆ ExtractEvent()

void ExtractEvent ( std::vector< TH1 * > &  hs)
inherited

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

Definition at line 376 of file DQMHistAnalysis.cc.

377{
379 for (size_t i = 0; i < hs.size(); i++) {
380 if (hs[i]->GetName() == std::string("DAQ/Nevent")) {
381 s_eventProcessed = hs[i]->GetEntries();
382 return;
383 }
384 }
385 B2ERROR("ExtractEvent: Histogram \"DAQ/Nevent\" missing");
386}
static int s_eventProcessed
Number of Events processed to fill histograms.

◆ ExtractRunType()

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

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

Definition at line 364 of file DQMHistAnalysis.cc.

365{
366 s_runType = "";
367 for (size_t i = 0; i < hs.size(); i++) {
368 if (hs[i]->GetName() == std::string("DQMInfo/rtype")) {
369 s_runType = hs[i]->GetTitle();
370 return;
371 }
372 }
373 B2ERROR("ExtractRunType: Histogram \"DQMInfo/rtype\" missing");
374}
static std::string s_runType
The Run type.

◆ findCanvas()

TCanvas * findCanvas ( TString  cname)
inherited

Find canvas by name.

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

Definition at line 147 of file DQMHistAnalysis.cc.

148{
149 TIter nextkey(gROOT->GetListOfCanvases());
150 TObject* obj{};
151
152 while ((obj = dynamic_cast<TObject*>(nextkey()))) {
153 if (obj->IsA()->InheritsFrom("TCanvas")) {
154 if (obj->GetName() == canvas_name)
155 return dynamic_cast<TCanvas*>(obj);
156 }
157 }
158 return nullptr;
159}

◆ findHist() [1/2]

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 175 of file DQMHistAnalysis.cc.

176{
177 if (dirname.size() > 0) {
178 return findHist(dirname + "/" + histname, updated);
179 }
180 return findHist(histname, updated);
181}

◆ findHist() [2/2]

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

Get histogram from list (no other search).

Parameters
histnameThe name of the histogram (incl dir).
onlyIfUpdatedreq only updated hists, return nullptr otherwise
Returns
The found histogram, or nullptr if not found.

Definition at line 161 of file DQMHistAnalysis.cc.

162{
163 if (s_histList.find(histname) != s_histList.end()) {
164 if (was_updated && !s_histList[histname].isUpdated()) return nullptr;
165 if (s_histList[histname].getHist()) {
166 return s_histList[histname].getHist();
167 } else {
168 B2ERROR("Histogram " << histname << " in histogram list but nullptr.");
169 }
170 }
171 B2INFO("Histogram " << histname << " not in list.");
172 return nullptr;
173}

◆ 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 228 of file DQMHistAnalysis.cc.

229{
230 TCanvas* cnv = nullptr;
231 // try to get canvas from outside
232 if (cobj) cnv = *cobj;
233 // if no canvas search for it
234 if (cnv == nullptr) {
235 // parse the dir+histo name and create the corresponding canvas name
236 auto s = StringSplit(histo_name, '/');
237 if (s.size() != 2) {
238 B2ERROR("findHistInCanvas: histoname not valid (missing dir?), should be 'dirname/histname': " << histo_name);
239 return nullptr;
240 }
241 auto dirname = s.at(0);
242 auto hname = s.at(1);
243 std::string canvas_name = dirname + "/c_" + hname;
244 cnv = findCanvas(canvas_name);
245 // set canvas pointer for outside
246 if (cnv && cobj) *cobj = cnv;
247 }
248
249 // get histogram pointer
250 if (cnv != nullptr) {
251 TIter nextkey(cnv->GetListOfPrimitives());
252 TObject* obj{};
253 while ((obj = dynamic_cast<TObject*>(nextkey()))) {
254 if (obj->IsA()->InheritsFrom("TH1")) {
255 if (obj->GetName() == histo_name)
256 return dynamic_cast<TH1*>(obj);
257 }
258 }
259 }
260 return nullptr;
261}
TCanvas * findCanvas(TString cname)
Find canvas by name.
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 263 of file DQMHistAnalysis.cc.

264{
265 // find histogram by name in file, histname CAN contain directory!
266 // will return nullptr if file is zeroptr, not found or not correct type
267 if (file && file->IsOpen()) {
268 auto obj = file->Get(histname.data());
269 if (obj != nullptr) {
270 // check class type
271 if (obj->IsA()->InheritsFrom("TH1")) {
272 B2DEBUG(20, "Histogram " << histname << " found in file");
273 return dynamic_cast<TH1*>(obj);
274 } else {
275 B2INFO("Found Object " << histname << " in file is not a histogram");
276 }
277 } else {
278 B2INFO("Histogram " << histname << " not found in file");
279 }
280 }
281 return nullptr;
282}

◆ 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 284 of file DQMHistAnalysis.cc.

285{
286 if (s_monObjList.find(objName) != s_monObjList.end()) {
287 return &s_monObjList[objName];
288 }
289 B2INFO("MonitoringObject " << objName << " not in memfile.");
290 return NULL;
291}
static MonObjList s_monObjList
The list of MonitoringObjects.

◆ findRefHist() [1/2]

TH1 * findRefHist ( const std::string &  dirname,
const std::string &  histname,
int  scaling = 0,
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 220 of file DQMHistAnalysis.cc.

221{
222 if (dirname.size() > 0) {
223 return findRefHist(dirname + "/" + histname, scaling, hist);
224 }
225 return findRefHist(histname, scaling, hist);
226}
static TH1 * findRefHist(const std::string &histname, int scaling=0, const TH1 *hist=nullptr)
Get referencehistogram from list (no other search).

◆ findRefHist() [2/2]

TH1 * findRefHist ( const std::string &  histname,
int  scaling = 0,
const TH1 *  hist = nullptr 
)
staticinherited

Get referencehistogram from list (no other search).

Parameters
histnameThe name of the histogram (incl dir).
scalingenum what scaling to use
histhistogram to scale to
Returns
The found histogram, or nullptr if not found.

Definition at line 208 of file DQMHistAnalysis.cc.

209{
210 if (s_refList.find(histname) != s_refList.end()) {
211 // get a copy of the reference which we can modify
212 // (it is still owned and managed by the framework)
213 // then do the scaling
214 return scaleReference(scaling, hist, s_refList[histname].getReference());
215 }
216 B2INFO("Ref Histogram " << histname << " not in list.");
217 return nullptr;
218}
static TH1 * scaleReference(int 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 324 of file Module.h.

325 {
326 return m_conditions;
327 }

◆ getCanvasUpdatedList()

static const CanvasUpdatedList & getCanvasUpdatedList ( )
inlinestaticinherited

Get the list of the canvas update status.

Returns
The list of the canvases.

Definition at line 193 of file DQMHistAnalysis.h.

193{ 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 314 of file Module.h.

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

◆ 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() [1/2]

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 119 of file DQMHistAnalysis.cc.

120{
121 std::string fullname;
122 if (dirname.size() > 0) {
123 fullname = dirname + "/" + histname;
124 } else {
125 fullname = histname;
126 }
127 return getDelta(fullname, n, onlyIfUpdated);
128}
TH1 * getDelta(const std::string &fullname, int n=0, bool onlyIfUpdated=true)
Get Delta histogram.

◆ getDelta() [2/2]

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

Get Delta histogram.

Parameters
fullnamedirectory+name 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 130 of file DQMHistAnalysis.cc.

131{
132 auto it = s_deltaList.find(fullname);
133 if (it != s_deltaList.end()) {
134 return it->second.getDelta(n, onlyIfUpdated);
135 }
136 B2WARNING("Delta hist " << fullname << " not found");
137 return nullptr;
138}

◆ getDeltaList()

static const DeltaList & getDeltaList ( )
inlinestaticinherited

Get the list of the delta histograms.

Returns
The list of the delta histograms.

Definition at line 187 of file DQMHistAnalysis.h.

187{ return s_deltaList;};

◆ getDescription()

const std::string & getDescription ( ) const
inlineinherited

Returns the description of the module.

Definition at line 202 of file Module.h.

202{return m_description;}
std::string m_description
The description of the module.
Definition: Module.h:511

◆ getEpicsPV() [1/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 529 of file DQMHistAnalysis.cc.

530{
531 double value{NAN};
532 if (!m_useEpics) return value;
533#ifdef _BELLE2_EPICS
534 if (index < 0 || index >= (int)m_epicsChID.size()) {
535 B2ERROR("Epics PV with " << index << " not registered!");
536 return value;
537 }
538 // From EPICS doc. When ca_get or ca_array_get are invoked the returned channel value cant be assumed to be stable
539 // in the application supplied buffer until after ECA_NORMAL is returned from ca_pend_io. If a connection is lost
540 // outstanding get requests are not automatically reissued following reconnect.
541 auto r = ca_get(DBR_DOUBLE, m_epicsChID[index], (void*)&value);
542 if (r == ECA_NORMAL) r = ca_pend_io(5.0); // this is needed!
543 if (r == ECA_NORMAL) {
544 return value;
545 } else {
546 CheckEpicsError(r, "Read PV failed in ca_get or ca_pend_io failure", m_epicsChID[index]);
547 }
548#endif
549 return NAN;
550}
static bool m_useEpics
Flag if to use EPICS do not set by yourself, use EpicsEnable module to set.

◆ getEpicsPV() [2/2]

double getEpicsPV ( 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 506 of file DQMHistAnalysis.cc.

507{
508 double value{NAN};
509 if (!m_useEpics) return value;
510#ifdef _BELLE2_EPICS
511 if (m_epicsNameToChID[keyname] == nullptr) {
512 B2ERROR("Epics PV " << keyname << " not registered!");
513 return value;
514 }
515 // From EPICS doc. When ca_get or ca_array_get are invoked the returned channel value cant be assumed to be stable
516 // in the application supplied buffer until after ECA_NORMAL is returned from ca_pend_io. If a connection is lost
517 // outstanding get requests are not automatically reissued following reconnect.
518 auto r = ca_get(DBR_DOUBLE, m_epicsNameToChID[keyname], (void*)&value);
519 if (r == ECA_NORMAL) r = ca_pend_io(5.0); // this is needed!
520 if (r == ECA_NORMAL) {
521 return value;
522 } else {
523 CheckEpicsError(r, "Read PV failed in ca_get or ca_pend_io failure", keyname);
524 }
525#endif
526 return NAN;
527}

◆ getEpicsPVChID() [1/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 616 of file DQMHistAnalysis.cc.

617{
618#ifdef _BELLE2_EPICS
619 if (m_useEpics) {
620 if (index >= 0 && index < (int)m_epicsChID.size()) {
621 return m_epicsChID[index];
622 } else {
623 B2ERROR("Epics PV with " << index << " not registered!");
624 }
625 }
626#endif
627 return nullptr;
628}

◆ getEpicsPVChID() [2/2]

chid getEpicsPVChID ( 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 602 of file DQMHistAnalysis.cc.

603{
604#ifdef _BELLE2_EPICS
605 if (m_useEpics) {
606 if (m_epicsNameToChID[keyname] != nullptr) {
607 return m_epicsNameToChID[keyname];
608 } else {
609 B2ERROR("Epics PV " << keyname << " not registered!");
610 }
611 }
612#endif
613 return nullptr;
614}

◆ getEpicsStringPV() [1/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 577 of file DQMHistAnalysis.cc.

578{
579 status = false;
580 char value[40] = "";
581 if (!m_useEpics) return std::string(value);
582#ifdef _BELLE2_EPICS
583 if (index < 0 || index >= (int)m_epicsChID.size()) {
584 B2ERROR("Epics PV with " << index << " not registered!");
585 return std::string(value);
586 }
587 // From EPICS doc. When ca_get or ca_array_get are invoked the returned channel value cant be assumed to be stable
588 // in the application supplied buffer until after ECA_NORMAL is returned from ca_pend_io. If a connection is lost
589 // outstanding get requests are not automatically reissued following reconnect.
590 auto r = ca_get(DBR_DOUBLE, m_epicsChID[index], value);
591 if (r == ECA_NORMAL) r = ca_pend_io(5.0); // this is needed!
592 if (r == ECA_NORMAL) {
593 status = true;
594 return std::string(value);
595 } else {
596 CheckEpicsError(r, "Read PV (string) failed in ca_get or ca_pend_io failure", m_epicsChID[index]);
597 }
598#endif
599 return std::string(value);
600}

◆ getEpicsStringPV() [2/2]

std::string getEpicsStringPV ( 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 552 of file DQMHistAnalysis.cc.

553{
554 status = false;
555 char value[40] = "";
556 if (!m_useEpics) return std::string(value);
557#ifdef _BELLE2_EPICS
558 if (m_epicsNameToChID[keyname] == nullptr) {
559 B2ERROR("Epics PV " << keyname << " not registered!");
560 return std::string(value);
561 }
562 // From EPICS doc. When ca_get or ca_array_get are invoked the returned channel value cant be assumed to be stable
563 // in the application supplied buffer until after ECA_NORMAL is returned from ca_pend_io. If a connection is lost
564 // outstanding get requests are not automatically reissued following reconnect.
565 auto r = ca_get(DBR_STRING, m_epicsNameToChID[keyname], value);
566 if (r == ECA_NORMAL) r = ca_pend_io(5.0); // this is needed!
567 if (r == ECA_NORMAL) {
568 status = true;
569 return std::string(value);
570 } else {
571 CheckEpicsError(r, "Read PV (string) failed in ca_get or ca_pend_io failure", keyname);
572 }
573#endif
574 return std::string(value);
575}

◆ getEventProcessed()

static int getEventProcessed ( void  )
inlinestaticinherited

Get the number of processed events.

(Attention, asynch histogram updates!)

Returns
Processed events.

Definition at line 211 of file DQMHistAnalysis.h.

211{ 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, StorageRootOutputModule, and RootOutputModule.

Definition at line 134 of file Module.h.

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

◆ getHistList()

static HistList & getHistList ( )
inlinestaticinherited

Get the list of the histograms.

Returns
The list of the histograms.

Definition at line 175 of file DQMHistAnalysis.h.

175{ return s_histList;};

◆ getLogConfig()

LogConfig & getLogConfig ( )
inlineinherited

Returns the log system configuration.

Definition at line 225 of file Module.h.

225{return m_logConfig;}

◆ getModules()

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

no submodules, return empty list

Implements PathElement.

Definition at line 506 of file Module.h.

506{ 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 140 of file DQMHistAnalysis.cc.

141{
142 auto obj = &s_monObjList[objName];
143 obj->SetName(objName.c_str());
144 return obj;
145}

◆ getMonObjList()

static MonObjList & getMonObjList ( )
inlinestaticinherited

Get the list of MonitoringObjects.

Returns
The list of the MonitoringObjects.

Definition at line 181 of file DQMHistAnalysis.h.

181{ 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 187 of file Module.h.

187{return m_name;}
std::string m_name
The name of the module, saved as a string (user-modifiable)
Definition: Module.h:508

◆ getPackage()

const std::string & getPackage ( ) const
inlineinherited

Returns the package this module is in.

Definition at line 197 of file Module.h.

197{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.
ModuleParamList m_moduleParamList
List storing and managing all parameter of the module.
Definition: Module.h:516

◆ getParamList()

const ModuleParamList & getParamList ( ) const
inlineinherited

Return module param list.

Definition at line 363 of file Module.h.

363{ 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()

std::string & getPVPrefix ( void  )
inlineinherited

get global Prefix for EPICS PVs

Returns
prefix in use

Definition at line 600 of file DQMHistAnalysis.h.

600{return m_PVPrefix;};
static std::string m_PVPrefix
The Prefix for EPICS PVs.

◆ getRefList()

static RefList & getRefList ( )
inlinestaticinherited

Get the list of the reference histograms.

Returns
The list of the reference histograms.

Definition at line 199 of file DQMHistAnalysis.h.

199{ return s_refList;};

◆ 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 381 of file Module.h.

381{ return m_returnValue; }

◆ getRunType()

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

Get the Run Type.

Returns
Run type string.

Definition at line 205 of file DQMHistAnalysis.h.

205{ return s_runType;};

◆ getSigma68()

double getSigma68 ( TH1 *  h) const
inherited

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 293 of file DQMHistAnalysis.cc.

294{
295 double probs[2] = {0.16, 1 - 0.16};
296 double quant[2] = {0, 0};
297 h->GetQuantiles(2, quant, probs);
298 const double sigma68 = (-quant[0] + quant[1]) / 2;
299 return sigma68;
300}

◆ getStatusColor()

DQMHistAnalysisModule::EStatusColor getStatusColor ( EStatus  status)
inherited

Return color for canvas state.

Parameters
statuscanvas status
Returns
alarm color

Definition at line 722 of file DQMHistAnalysis.cc.

723{
724 // white color is the default, if no colorize
726 switch (stat) {
727 case c_StatusTooFew:
728 color = c_ColorTooFew; // Magenta or Gray
729 break;
730 case c_StatusDefault:
731 color = c_ColorDefault; // default no colors
732 break;
733 case c_StatusGood:
734 color = c_ColorGood; // Good
735 break;
736 case c_StatusWarning:
737 color = c_ColorWarning; // Warning
738 break;
739 case c_StatusError:
740 color = c_ColorError; // Severe
741 break;
742 default:
743 color = c_ColorDefault; // default no colors
744 break;
745 }
746 return color;
747}
EStatusColor
Status colors of histogram/canvas (corresponding to status)

◆ 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:509

◆ getUseEpics()

bool getUseEpics ( void  )
inlineinherited

Getter for EPICS usage.

Returns
flag is in use

Definition at line 583 of file DQMHistAnalysis.h.

583{return m_useEpics;};

◆ getUseEpicsReadOnly()

bool getUseEpicsReadOnly ( void  )
inlineinherited

Getter EPICS flag in read only mode.

Returns
flag if read only

Definition at line 589 of file DQMHistAnalysis.h.

589{return m_epicsReadOnly;};
static bool m_epicsReadOnly
Flag if to use EPICS in ReadOnly mode (for reading limits) do not set by yourself,...

◆ hasCondition()

bool hasCondition ( ) const
inlineinherited

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

Definition at line 311 of file Module.h.

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

◆ hasDeltaPar()

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

Check if Delta histogram parameters exist for histogram.

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

Definition at line 108 of file DQMHistAnalysis.cc.

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

◆ 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 378 of file Module.h.

378{ 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://confluence.desy.de/display/BI/Software+ModCondTut 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 323 of file DQMHistAnalysis.cc.

324{
325 for (auto& it : s_histList) {
326 // attention, we must use reference, otherwise we work on a copy
327 it.second.resetBeforeEvent();
328 }
329 for (auto& it : s_deltaList) {
330 // attention, we must use reference, otherwise we work on a copy
331 it.second.setNotUpdated();
332 }
333
334 s_canvasUpdatedList.clear();
335}

◆ initialize()

void initialize ( void  )
finaloverridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 37 of file DQMHistAnalysisMiraBelle.cc.

38{
39 gROOT->cd();
40
41 //mon_mumu = new Belle2::MonitoringObject("mumu");
44 //bhabha,hadrons
46 mon_hadron = getMonitoringObject("hadronb2");
47
48 // make cavases to be added to MonitoringObject
49 mumu_main = new TCanvas("mumu_main", "mumu_main", 0, 0, 800, 600);
50 mumu_resolution = new TCanvas("mumu_resolution", "mumu_resolution", 0, 0, 800, 600);
51 mumu_muon_val = new TCanvas("mumu_muon_val", "mumu_muon_val", 0, 0, 400, 400);
52 dst_mass = new TCanvas("dst_mass", "dst_mass", 0, 0, 1200, 400);
53 dst_pi_val = new TCanvas("dst_pi_val", "dst_pi_val", 0, 0, 800, 400);
54 dst_k_val = new TCanvas("dst_k_val", "dst_k_val", 0, 0, 800, 400);
55 //bhabha,hadrons
56 bhabha_main = new TCanvas("bhabha_main", "bhabha_main", 0, 0, 800, 600);
57 bhabha_resolution = new TCanvas("bhabha_resolution", "bhabha_resolution", 0, 0, 800, 600);
58 hadron_main = new TCanvas("hadron_main", "hadron_main", 0, 0, 800, 600);
59
60 // add canvases to MonitoringObject
67 //bhabha,hadrons
71
72 B2DEBUG(20, "DQMHistAnalysisMiraBelle: initialized.");
73
74}
static MonitoringObject * getMonitoringObject(const std::string &name)
Get MonitoringObject with given name (new object is created if non-existing)
void addCanvas(TCanvas *canv)
Add Canvas to monitoring object.

◆ makeStatus()

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

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 704 of file DQMHistAnalysis.cc.

705{
706 // white color is the default, if no colorize
707 if (!enough) {
708 return (c_StatusTooFew);
709 } else {
710 if (error_flag) {
711 return (c_StatusError);
712 } else if (warn_flag) {
713 return (c_StatusWarning);
714 } else {
715 return (c_StatusGood);
716 }
717 }
718
719 return (c_StatusDefault); // default, but should not be reached
720}

◆ printPVStatus()

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

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 772 of file DQMHistAnalysis.cc.

773{
774 if (pv == nullptr) {
775 B2WARNING("PV chid was nullptr");
776 return;
777 }
778 auto state = ca_state(pv);
779 switch (state) {
780 case cs_never_conn: /* valid chid, server not found or unavailable */
781 B2WARNING("Channel never connected " << ca_name(pv));
782 break;
783 case cs_prev_conn: /* valid chid, previously connected to server */
784 B2WARNING("Channel was connected, but now is not " << ca_name(pv));
785 break;
786 case cs_closed: /* channel deleted by user */
787 B2WARNING("Channel deleted already " << ca_name(pv));
788 break;
789 case cs_conn: /* valid chid, connected to server */
790 if (!onlyError) B2INFO("Channel connected and OK " << ca_name(pv));
791 break;
792 default:
793 B2WARNING("Undefined status for channel " << ca_name(pv));
794 break;
795 }
796}

◆ registerEpicsPV()

int registerEpicsPV ( std::string  pvname,
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 388 of file DQMHistAnalysis.cc.

389{
390 return registerEpicsPVwithPrefix(m_PVPrefix, pvname, keyname);
391}
int registerEpicsPVwithPrefix(std::string prefix, std::string pvname, std::string keyname="")
Register a PV with its name and a key name.

◆ registerEpicsPVwithPrefix()

int registerEpicsPVwithPrefix ( std::string  prefix,
std::string  pvname,
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 398 of file DQMHistAnalysis.cc.

399{
400 if (!m_useEpics) return -1;
401#ifdef _BELLE2_EPICS
402 if (m_epicsNameToChID[pvname] != nullptr) {
403 B2ERROR("Epics PV " << pvname << " already registered!");
404 return -1;
405 }
406 if (keyname != "" && m_epicsNameToChID[keyname] != nullptr) {
407 B2ERROR("Epics PV with key " << keyname << " already registered!");
408 return -1;
409 }
410
411 m_epicsChID.emplace_back();
412 auto ptr = &m_epicsChID.back();
413 if (!ca_current_context()) SEVCHK(ca_context_create(ca_disable_preemptive_callback), "ca_context_create");
414 // the subscribed name includes the prefix, the map below does *not*
415 CheckEpicsError(ca_create_channel((prefix + pvname).data(), NULL, NULL, 10, ptr), "ca_create_channel failure", pvname);
416
417 m_epicsNameToChID[pvname] = *ptr;
418 if (keyname != "") m_epicsNameToChID[keyname] = *ptr;
419 return m_epicsChID.size() - 1; // return index to last added item
420#else
421 return -1;
422#endif
423}

◆ registerExternalEpicsPV()

int registerExternalEpicsPV ( std::string  pvname,
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 393 of file DQMHistAnalysis.cc.

394{
395 return registerEpicsPVwithPrefix(std::string(""), pvname, keyname);
396}

◆ 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 669 of file DQMHistAnalysis.cc.

671{
672 // get warn and error limit only if pv exists
673 // overwrite only if limit is defined (not NaN)
674 // user should initilize with NaN before calling, unless
675 // some "default" values should be set otherwise
676 if (pv != nullptr) {
677 struct dbr_ctrl_double tPvData;
678 // From EPICS doc. When ca_get or ca_array_get are invoked the returned channel value cant be assumed to be stable
679 // in the application supplied buffer until after ECA_NORMAL is returned from ca_pend_io. If a connection is lost
680 // outstanding get requests are not automatically reissued following reconnect.
681 auto r = ca_get(DBR_CTRL_DOUBLE, pv, &tPvData);
682 if (r == ECA_NORMAL) r = ca_pend_io(5.0); // this is needed!
683 if (r == ECA_NORMAL) {
684 if (!std::isnan(tPvData.lower_alarm_limit)) {
685 lowerAlarm = tPvData.lower_alarm_limit;
686 }
687 if (!std::isnan(tPvData.lower_warning_limit)) {
688 lowerWarn = tPvData.lower_warning_limit;
689 }
690 if (!std::isnan(tPvData.upper_warning_limit)) {
691 upperWarn = tPvData.upper_warning_limit;
692 }
693 if (!std::isnan(tPvData.upper_alarm_limit)) {
694 upperAlarm = tPvData.upper_alarm_limit;
695 }
696 return true;
697 } else {
698 CheckEpicsError(r, "Reading PV Limits failed in ca_get or ca_pend_io failure", pv);
699 }
700 }
701 return false;
702}

◆ requestLimitsFromEpicsPVs() [2/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 663 of file DQMHistAnalysis.cc.

665{
666 return requestLimitsFromEpicsPVs(getEpicsPVChID(index), lowerAlarm, lowerWarn, upperWarn, upperAlarm);
667}
chid getEpicsPVChID(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 ( 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 657 of file DQMHistAnalysis.cc.

659{
660 return requestLimitsFromEpicsPVs(getEpicsPVChID(name), lowerAlarm, lowerWarn, upperWarn, upperAlarm);
661}

◆ resetDeltaList()

void resetDeltaList ( void  )
inherited

Reset Delta.

Definition at line 347 of file DQMHistAnalysis.cc.

348{
349 for (auto& d : s_deltaList) {
350 d.second.reset();
351 }
352}

◆ scaleReference()

TH1 * scaleReference ( int  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 183 of file DQMHistAnalysis.cc.

184{
185 // if hist/ref is nullptr, nothing to do
186 if (!hist || !ref)
187 return ref;
188
189 switch (scaling) {
190 // default: do nothing
191 // case 0: do nothing
192 case 1: // Integral
193 // only if we have entries in reference
194 if (hist->Integral() != 0 and ref->Integral() != 0) {
195 ref->Scale(hist->Integral() / ref->Integral());
196 }
197 break;
198 case 2: // Maximum
199 // only if we have entries in reference
200 if (hist->GetMaximum() != 0 and ref->GetMaximum() != 0) {
201 ref->Scale(hist->GetMaximum() / ref->GetMaximum());
202 }
203 break;
204 }
205 return ref;
206}

◆ 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}

◆ setEpicsPV() [1/4]

void setEpicsPV ( int  index,
double  value 
)
inherited

Write value to a EPICS PV.

Parameters
indexindex of PV
valuevalue to write

Definition at line 467 of file DQMHistAnalysis.cc.

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

◆ setEpicsPV() [2/4]

void setEpicsPV ( int  index,
int  value 
)
inherited

Write value to a EPICS PV.

Parameters
indexindex of PV
valuevalue to write

Definition at line 479 of file DQMHistAnalysis.cc.

480{
481 if (!m_useEpics || m_epicsReadOnly) return;
482#ifdef _BELLE2_EPICS
483 if (index < 0 || index >= (int)m_epicsChID.size()) {
484 B2ERROR("Epics PV with " << index << " not registered!");
485 return;
486 }
487 CheckEpicsError(ca_put(DBR_SHORT, m_epicsChID[index], (void*)&value), "ca_set failure", m_epicsChID[index]);
488#endif
489}

◆ setEpicsPV() [3/4]

void setEpicsPV ( 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 425 of file DQMHistAnalysis.cc.

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

◆ setEpicsPV() [4/4]

void setEpicsPV ( 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 437 of file DQMHistAnalysis.cc.

438{
439 if (!m_useEpics || m_epicsReadOnly) return;
440#ifdef _BELLE2_EPICS
441 if (m_epicsNameToChID[keyname] == nullptr) {
442 B2ERROR("Epics PV " << keyname << " not registered!");
443 return;
444 }
445 CheckEpicsError(ca_put(DBR_SHORT, m_epicsNameToChID[keyname], (void*)&value), "ca_set failure", keyname);
446#endif
447}

◆ setEpicsStringPV() [1/2]

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

Write string to a EPICS PV.

Parameters
indexindex of PV
valuestring to write

Definition at line 491 of file DQMHistAnalysis.cc.

492{
493 if (!m_useEpics || m_epicsReadOnly) return;
494#ifdef _BELLE2_EPICS
495 if (index < 0 || index >= (int)m_epicsChID.size()) {
496 B2ERROR("Epics PV with " << index << " not registered!");
497 return;
498 }
499 char text[41];
500 strncpy(text, value.c_str(), 40);
501 text[40] = 0;
502 CheckEpicsError(ca_put(DBR_STRING, m_epicsChID[index], text), "ca_set failure", m_epicsChID[index]);
503#endif
504}

◆ setEpicsStringPV() [2/2]

void setEpicsStringPV ( std::string  keyname,
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 449 of file DQMHistAnalysis.cc.

450{
451 if (!m_useEpics || m_epicsReadOnly) return;
452#ifdef _BELLE2_EPICS
453 if (m_epicsNameToChID[keyname] == nullptr) {
454 B2ERROR("Epics PV " << keyname << " not registered!");
455 return;
456 }
457 if (value.length() > 40) {
458 B2ERROR("Epics string PV " << keyname << " too long (>40 characters)!");
459 return;
460 }
461 char text[40];
462 strcpy(text, value.c_str());
463 CheckEpicsError(ca_put(DBR_STRING, m_epicsNameToChID[keyname], text), "ca_set failure", keyname);
464#endif
465}

◆ setEventProcessed()

void setEventProcessed ( int  e)
inlineinherited

Set the number of processed events.

(Attention, asynch histogram updates!)

e Processed events.

Definition at line 223 of file DQMHistAnalysis.h.

223{s_eventProcessed = e;};

◆ setLogConfig()

void setLogConfig ( const LogConfig logConfig)
inlineinherited

Set the log system configuration.

Definition at line 230 of file Module.h.

230{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 214 of file Module.h.

214{ m_name = name; };

◆ setParamList()

void setParamList ( const ModuleParamList params)
inlineprotectedinherited

Replace existing parameter list.

Definition at line 501 of file Module.h.

501{ 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}
Class for logging debug, info and error messages.
Definition: LogSystem.h:46
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:191
static LogSystem & Instance()
Static method to get a reference to the LogSystem instance.
Definition: LogSystem.cc:31
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()

void setPVPrefix ( std::string &  prefix)
inlineinherited

set global Prefix for EPICS PVs

Parameters
prefixPrefix to set

Definition at line 606 of file DQMHistAnalysis.h.

606{ 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()

void setRunType ( std::string &  t)
inlineinherited

Set the Run Type.

t Run type string.

Definition at line 217 of file DQMHistAnalysis.h.

217{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()

void setUseEpics ( bool  flag)
inlineinherited

Setter for EPICS usage.

Parameters
flagset in use

Definition at line 571 of file DQMHistAnalysis.h.

571{m_useEpics = flag;};

◆ setUseEpicsReadOnly()

void setUseEpicsReadOnly ( bool  flag)
inlineinherited

Setter EPICS flag in read only mode.

Parameters
flagset read only

Definition at line 577 of file DQMHistAnalysis.h.

577{m_epicsReadOnly = flag;};

◆ StringSplit()

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

Helper function for string token split.

Parameters
sString to split
delimdelimiter
Returns
vector of strings

Definition at line 302 of file DQMHistAnalysis.cc.

303{
304 std::vector <std::string> out;
305 boost::split(out, in, [delim](char c) {return c == delim;});
306 return out;
307}

◆ terminate()

void terminate ( void  )
finaloverridevirtual

Termination action.

Clean-up, close files, summarize statistics, etc.

Reimplemented from Module.

Definition at line 1088 of file DQMHistAnalysisMiraBelle.cc.

1089{
1090
1091 B2DEBUG(20, "terminate called");
1092}

◆ UpdateCanvas() [1/2]

void UpdateCanvas ( std::string  name,
bool  updated = true 
)
inherited

Mark canvas as updated (or not)

Parameters
namename of Canvas
updatedwas updated

Definition at line 354 of file DQMHistAnalysis.cc.

355{
356 s_canvasUpdatedList[name] = updated;
357}

◆ UpdateCanvas() [2/2]

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

Mark canvas as updated (or not)

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

Definition at line 359 of file DQMHistAnalysis.cc.

360{
361 if (c) UpdateCanvas(c->GetName(), updated);
362}
void UpdateCanvas(std::string name, bool updated=true)
Mark canvas as updated (or not)

◆ 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 630 of file DQMHistAnalysis.cc.

631{
632 int state = ECA_NORMAL;
633 if (!m_useEpics) return state;
634#ifdef _BELLE2_EPICS
635 if (wait > 0.) {
636 state = ca_pend_io(wait);
637 SEVCHK(state, "ca_pend_io failure");
638 }
639#endif
640 return state;
641}

Member Data Documentation

◆ bhabha_main

TCanvas* bhabha_main = nullptr
protected

TCanvas object for main display.

Definition at line 85 of file DQMHistAnalysisMiraBelle.h.

◆ bhabha_resolution

TCanvas* bhabha_resolution = nullptr
protected

TCanvas object for resolution display.

Definition at line 86 of file DQMHistAnalysisMiraBelle.h.

◆ dst_k_val

TCanvas* dst_k_val = nullptr
protected

TCanvas object for PID distributions of K.

Definition at line 83 of file DQMHistAnalysisMiraBelle.h.

◆ dst_mass

TCanvas* dst_mass = nullptr
protected

TCanvas object for D0 mass, delta mass, and pi0 mass.

Definition at line 81 of file DQMHistAnalysisMiraBelle.h.

◆ dst_pi_val

TCanvas* dst_pi_val = nullptr
protected

TCanvas object for PID distributions of pi.

Definition at line 82 of file DQMHistAnalysisMiraBelle.h.

◆ hadron_main

TCanvas* hadron_main = nullptr
protected

TCanvas object for main display.

Definition at line 88 of file DQMHistAnalysisMiraBelle.h.

◆ m_conditions

std::vector<ModuleCondition> m_conditions
privateinherited

Module condition, only non-null if set.

Definition at line 521 of file Module.h.

◆ m_description

std::string m_description
privateinherited

The description of the module.

Definition at line 511 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 146 of file DQMHistAnalysis.h.

◆ m_hasReturnValue

bool m_hasReturnValue
privateinherited

True, if the return value is set.

Definition at line 518 of file Module.h.

◆ m_logConfig

LogConfig m_logConfig
privateinherited

The log system configuration of the module.

Definition at line 514 of file Module.h.

◆ m_moduleParamList

ModuleParamList m_moduleParamList
privateinherited

List storing and managing all parameter of the module.

Definition at line 516 of file Module.h.

◆ m_name

std::string m_name
privateinherited

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

Definition at line 508 of file Module.h.

◆ m_package

std::string m_package
privateinherited

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

Definition at line 510 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 512 of file Module.h.

◆ m_PVPrefix

std::string m_PVPrefix = "TEST:"
staticprivateinherited

The Prefix for EPICS PVs.

Definition at line 151 of file DQMHistAnalysis.h.

◆ m_returnValue

int m_returnValue
privateinherited

The return value.

Definition at line 519 of file Module.h.

◆ m_scale_dst

double m_scale_dst
protected

Scale factor "signal region" / "sideband", assuming uniform events.

Definition at line 70 of file DQMHistAnalysisMiraBelle.h.

◆ m_type

std::string m_type
privateinherited

The type of the module, saved as a string.

Definition at line 509 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 140 of file DQMHistAnalysis.h.

◆ mon_bhabha

Belle2::MonitoringObject* mon_bhabha = nullptr
protected

MonitoringObject for bhabha events.

Definition at line 73 of file DQMHistAnalysisMiraBelle.h.

◆ mon_dst

Belle2::MonitoringObject* mon_dst = nullptr
protected

MonitoringObject for D* events.

Definition at line 72 of file DQMHistAnalysisMiraBelle.h.

◆ mon_hadron

Belle2::MonitoringObject* mon_hadron = nullptr
protected

MonitoringObject for hadronb2 tight events.

Definition at line 74 of file DQMHistAnalysisMiraBelle.h.

◆ mon_mumu

Belle2::MonitoringObject* mon_mumu = nullptr
protected

MonitoringObject for mumu events.

Definition at line 71 of file DQMHistAnalysisMiraBelle.h.

◆ mumu_main

TCanvas* mumu_main = nullptr
protected

TCanvas object for main display.

Definition at line 77 of file DQMHistAnalysisMiraBelle.h.

◆ mumu_muon_val

TCanvas* mumu_muon_val = nullptr
protected

TCanvas object for mumu values display.

Definition at line 79 of file DQMHistAnalysisMiraBelle.h.

◆ mumu_resolution

TCanvas* mumu_resolution = nullptr
protected

TCanvas object for resolution display.

Definition at line 78 of file DQMHistAnalysisMiraBelle.h.

◆ s_canvasUpdatedList

DQMHistAnalysisModule::CanvasUpdatedList s_canvasUpdatedList
staticprivateinherited

The list of canvas updated status.

Definition at line 115 of file DQMHistAnalysis.h.

◆ s_deltaList

DQMHistAnalysisModule::DeltaList s_deltaList
staticinherited

The list of Delta Histograms and settings.

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

◆ s_histList

DQMHistAnalysisModule::HistList s_histList
staticprivateinherited

The list of Histograms.

Definition at line 99 of file DQMHistAnalysis.h.

◆ s_monObjList

DQMHistAnalysisModule::MonObjList s_monObjList
staticprivateinherited

The list of MonitoringObjects.

Definition at line 103 of file DQMHistAnalysis.h.

◆ s_refList

DQMHistAnalysisModule::RefList s_refList
staticprivateinherited

The list of references.

Definition at line 120 of file DQMHistAnalysis.h.

◆ s_runType

std::string s_runType = ""
inlinestaticprivateinherited

The Run type.

Definition at line 134 of file DQMHistAnalysis.h.


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