Belle II Software development
DQMHistoModuleBase Class Reference

This class serves as a base for the TrackDQMModule and AlignDQMModule (and possibly other DQM histogram modules). More...

#include <DQMHistoModuleBase.h>

Inheritance diagram for DQMHistoModuleBase:
HistoModule Module PathElement AlignDQMModule TrackDQMModule TrackingExpressRecoDQMModule TrackingHLTDQMModule

Public Types

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

 DQMHistoModuleBase ()
 Constructor.
 
 ~DQMHistoModuleBase ()
 Destructor.
 
virtual void initialize () override
 Initializer.
 
virtual void beginRun () override
 Called when entering a new run.
 
virtual void event () override
 This method is called for each event.
 
virtual void defineHisto () override
 Histogram definitions such as TH1(), TH2(), TNtuple(), TTree()....
 
void runningOnHLT ()
 function called when the module is run on HLT
 
virtual TH1F * Create (std::string name, std::string title, int nbinsx, double xlow, double xup, std::string xTitle, std::string yTitle)
 Function to create TH1F and add it to the vector of histograms (m_histograms).
 
virtual TH2F * Create (std::string name, std::string title, int nbinsx, double xlow, double xup, int nbinsy, double ylow, double yup, std::string xTitle, std::string yTitle, std::string zTitle)
 Same as above but for TH2F.
 
virtual TH1F ** CreateLayers (boost::format nameTemplate, boost::format titleTemplate, int nbinsx, double xlow, double xup, std::string xTitle, std::string yTitle)
 Function to create array of TH1F histograms, one for each layer.
 
virtual TH2F ** CreateLayers (boost::format nameTemplate, boost::format titleTemplate, int nbinsx, double xlow, double xup, int nbinsy, double ylow, double yup, std::string xTitle, std::string yTitle, std::string zTitle)
 Same as above but for TH2F.
 
virtual TH1F ** CreateSensors (boost::format nameTemplate, boost::format titleTemplate, int nbinsx, double xlow, double xup, std::string xTitle, std::string yTitle)
 Function to create array of TH1F histograms, one for each sensor.
 
virtual TH2F ** CreateSensors (boost::format nameTemplate, boost::format titleTemplate, int nbinsx, double xlow, double xup, int nbinsy, double ylow, double yup, std::string xTitle, std::string yTitle, std::string zTitle)
 Same as above but for TH2F.
 
virtual void endRun () override
 Function to process end_run record.
 
virtual void terminate () override
 Function to terminate module.
 
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.
 
Fill- functions

All the following Fill- functions are used by DQMEventProcessorBase or derived classes to fill histograms.

They are supposed not to contain any computations need for more than one of them. All computations should be moved to the DQMEventProcessorBase or derived classes.

virtual void FillTrackIndexes (int iTrack, int iTrackVXD, int iTrackCDC, int iTrackVXDCDC)
 Fill histograms with track indexes.
 
virtual void FillHitNumbers (int nPXD, int nSVD, int nCDC)
 Fill histograms with numbers of hits.
 
virtual void FillMomentumAngles (const TrackFitResult *tfr)
 Fill histograms with track momentum Pt.
 
virtual void FillMomentumCoordinates (const TrackFitResult *tfr)
 Fill histograms with track momentum Pt.
 
virtual void FillHelixParametersAndCorrelations (const TrackFitResult *tfr)
 Fill histograms with helix parameters and their correlations.
 
virtual void FillTrackFitStatus (const genfit::FitStatus *tfs)
 Fill histograms which require FitStatus.
 
virtual void FillTRClusterCorrelations (float phi_deg, float phiPrev_deg, float theta_deg, float thetaPrev_deg, int correlationIndex)
 Fill histograms with correlations between neighbor layers.
 
virtual void FillTRClusterHitmap (float phi_deg, float theta_deg, int layerIndex)
 Fill cluster hitmap in IP angle range.
 
virtual void FillUBResidualsPXD (const B2Vector3D &residual_um)
 Fill histograms with unbiased residuals in PXD sensors.
 
virtual void FillUBResidualsSVD (const B2Vector3D &residual_um)
 Fill histograms with unbiased residuals in SVD sensors.
 
virtual void FillHalfShellsPXD (const B2Vector3D &globalResidual_um, bool isNotYang)
 Fill histograms with unbiased residuals for half-shells for PXD sensors.
 
virtual void FillHalfShellsSVD (const B2Vector3D &globalResidual_um, bool isNotMat)
 Fill histograms with unbiased residuals for half-shells for SVD sensors.
 
virtual void FillUB1DResidualsSensor (const B2Vector3D &residual_um, int sensorIndex)
 Fill 1D histograms with unbiased residuals for individual sensors.
 
virtual void FillUB2DResidualsSensor (const B2Vector3D &residual_um, int sensorIndex)
 Fill 2D histograms with unbiased residuals for individual sensors.
 

Static Public Member Functions

static void exposePythonAPI ()
 Exposes methods of the Module class to Python.
 

Protected Member Functions

void ProcessHistogramParameterChange (const std::string &name, const std::string &parameter, const std::string &value)
 Process one change in histogram parameters.
 
void EditHistogramParameter (TH1 *histogram, const std::string &parameter, std::string value)
 On given histogram sets given parameter to given value.
 
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.
 
virtual void DefineTracks ()
 All the following Define- functions should be used in the defineHisto() function to define histograms.
 
virtual void DefineHits ()
 Define histograms with numbers of hits.
 
virtual void DefineMomentumAngles ()
 Define histograms with track momentum Pt.
 
virtual void DefineMomentumCoordinates ()
 Define histograms with track momentum Pt.
 
virtual void DefineHelixParametersAndCorrelations ()
 Define histograms with helix parameters and their correlations.
 
virtual void DefineTrackFitStatus ()
 Define histograms which require FitStatus.
 
virtual void DefineTRClusters ()
 Define histograms with correlations between neighbor layers and cluster hitmap in IP angle range.
 
virtual void DefineUBResidualsVXD ()
 Define histograms with unbiased residuals in PXD and SVD sensors.
 
virtual void DefineHalfShellsVXD ()
 Define histograms with unbiased residuals for half-shells for PXD and SVD sensors.
 
virtual void Define1DSensors ()
 Define 1D histograms with unbiased residuals for individual sensors.
 
virtual void Define2DSensors ()
 Define 2D histograms with unbiased residuals for individual sensors.
 

Static Protected Member Functions

static std::string SensorNameDescription (VxdID sensorID)
 Creates string description of the sensor from given sensor ID to be used in a histogram name.
 
static std::string SensorTitleDescription (VxdID sensorID)
 Creates string description of the sensor from given sensor ID to be used in a histogram title.
 
static void ComputeMean (TH1F *output, TH2F *input, bool onX=true)
 Creates a graph of means by given axis from given TH2F histogram.
 

Protected Attributes

std::vector< TH1 * > m_histograms
 All histograms created via the Create- functions are automatically added to this set.
 
bool histogramsDefined = false
 True if the defineHisto() was called.
 
bool m_hltDQM = false
 True if the DQM module is run on HLT.
 
std::vector< std::tuple< std::string, std::string, std::string > > m_histogramParameterChanges
 Used for changing parameters of histograms via the ProcessHistogramParameterChange function.
 
std::string m_tracksStoreArrayName
 StoreArray name where Tracks are written.
 
std::string m_recoTracksStoreArrayName
 StoreArray name where RecoTracks are written.
 
TH1F * m_PValue = nullptr
 p Value
 
TH1F * m_Chi2 = nullptr
 Chi2.
 
TH1F * m_NDF = nullptr
 NDF.
 
TH1F * m_Chi2NDF = nullptr
 Chi2 / NDF.
 
TH2F * m_UBResidualsPXD = nullptr
 Unbiased residuals for PXD u vs v.
 
TH2F * m_UBResidualsSVD = nullptr
 Unbiased residuals for SVD u vs v.
 
TH2F ** m_UBResidualsSensor = nullptr
 Unbiased residuals for PXD and SVD u vs v per sensor.
 
TH1F * m_UBResidualsPXDU = nullptr
 Unbiased residuals for PXD u.
 
TH1F * m_UBResidualsSVDU = nullptr
 Unbiased residuals for SVD u.
 
TH1F ** m_UBResidualsSensorU = nullptr
 Unbiased residuals for PXD and SVD u per sensor.
 
TH1F * m_UBResidualsPXDV = nullptr
 Unbiased residuals for PXD v.
 
TH1F * m_UBResidualsSVDV = nullptr
 Unbiased residuals for SVD v.
 
TH1F * m_UBResidualsPXDX_Yin = nullptr
 half-shells
 
TH1F * m_UBResidualsPXDX_Yang = nullptr
 Unbiased residuals in X for PXD for Yang.
 
TH1F * m_UBResidualsSVDX_Pat = nullptr
 Unbiased residuals in X for PXD for Pat.
 
TH1F * m_UBResidualsSVDX_Mat = nullptr
 Unbiased residuals in X for PXD for Mat.
 
TH1F * m_UBResidualsPXDY_Yin = nullptr
 Unbiased residuals in Y for PXD for Yin.
 
TH1F * m_UBResidualsPXDY_Yang = nullptr
 Unbiased residuals in Y for PXD for Yang.
 
TH1F * m_UBResidualsSVDY_Pat = nullptr
 Unbiased residuals in Y for PXD for Pat.
 
TH1F * m_UBResidualsSVDY_Mat = nullptr
 Unbiased residuals in Y for PXD for Mat.
 
TH1F * m_UBResidualsPXDZ_Yin = nullptr
 Unbiased residuals in Z for PXD for Yin.
 
TH1F * m_UBResidualsPXDZ_Yang = nullptr
 Unbiased residuals in Z for PXD for Yang.
 
TH1F * m_UBResidualsSVDZ_Pat = nullptr
 Unbiased residuals in Z for PXD for Pat.
 
TH1F * m_UBResidualsSVDZ_Mat = nullptr
 Unbiased residuals in Z for PXD for Mat.
 
TH1F ** m_UBResidualsSensorV = nullptr
 Unbiased residuals for PXD and SVD v per sensor.
 
TH2F ** m_TRClusterHitmap = nullptr
 Track related clusters - hitmap in IP angle range.
 
TH2F ** m_TRClusterCorrelationsPhi = nullptr
 Track related clusters - neighbor correlations in Phi.
 
TH2F ** m_TRClusterCorrelationsTheta = nullptr
 Track related clusters - neighbor correlations in Theta.
 
TH1F * m_MomPhi = nullptr
 Track momentum Pt.Phi.
 
TH1F * m_MomTheta = nullptr
 Track momentum Pt.Theta.
 
TH1F * m_MomCosTheta = nullptr
 Track momentum Pt.CosTheta.
 
TH1F * m_MomX = nullptr
 Track momentum Pt.X.
 
TH1F * m_MomY = nullptr
 Track momentum Pt.Y.
 
TH1F * m_MomZ = nullptr
 Track momentum Pt.Z.
 
TH1F * m_MomPt = nullptr
 Track momentum Pt.
 
TH1F * m_Mom = nullptr
 Track momentum Magnitude.
 
TH1F * m_D0 = nullptr
 d0 - the signed distance to the IP in the r-phi plane
 
TH2F * m_PhiD0 = nullptr
 d0 vs Phi - the signed distance to the IP in the r-phi plane
 
TH1F * m_Z0 = nullptr
 z0 - the z0 coordinate of the perigee (beam spot position)
 
TH2F * m_D0Z0 = nullptr
 z0 vs d0 - signed distance to the IP in r-phi vs.
 
TH1F * m_Phi = nullptr
 Phi - the angle of the transverse momentum in the r-phi plane, with CDF naming convention.
 
TH1F * m_TanLambda = nullptr
 TanLambda - the slope of the track in the r-z plane.
 
TH1F * m_Omega = nullptr
 Omega - the curvature of the track.
 
TH1F * m_HitsPXD = nullptr
 Number of hits on PXD.
 
TH1F * m_HitsSVD = nullptr
 Number of hits on SVD.
 
TH1F * m_HitsCDC = nullptr
 Number of hits on CDC.
 
TH1F * m_Hits = nullptr
 Number of all hits in tracks.
 
TH1F * m_TracksVXD = nullptr
 Number of tracks only with VXD.
 
TH1F * m_TracksCDC = nullptr
 Number of tracks only with CDC.
 
TH1F * m_TracksVXDCDC = nullptr
 Number of full tracks with VXD+CDC.
 
TH1F * m_Tracks = nullptr
 Number of all finding tracks.
 

Private Member Functions

bool checkVariableForNANOrINF (const double var)
 Check a variable for whether or not it is NAN or INF.
 
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.
 

Detailed Description

This class serves as a base for the TrackDQMModule and AlignDQMModule (and possibly other DQM histogram modules).

Most of the functions of this class are supposed to be virtual so they can be overridden in derived classes.

Definition at line 29 of file DQMHistoModuleBase.h.

Member Typedef Documentation

◆ EAfterConditionPath

Forward the EAfterConditionPath definition from the ModuleCondition.

Definition at line 88 of file Module.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

Constructor & Destructor Documentation

◆ DQMHistoModuleBase()

Constructor.

Definition at line 26 of file DQMHistoModuleBase.cc.

26 : HistoModule()
27{
29
30 addParam("tracksStoreArrayName", m_tracksStoreArrayName, "StoreArray name where the merged Tracks are written.",
32 addParam("recoTracksStoreArrayName", m_recoTracksStoreArrayName, "StoreArray name where the merged RecoTracks are written.",
34 addParam("histogramParameterChanges", m_histogramParameterChanges, "Changes of default parameters of histograms.",
36}
std::vector< std::tuple< std::string, std::string, std::string > > m_histogramParameterChanges
Used for changing parameters of histograms via the ProcessHistogramParameterChange function.
std::string m_tracksStoreArrayName
StoreArray name where Tracks are written.
std::string m_recoTracksStoreArrayName
StoreArray name where RecoTracks are written.
HistoModule()
Constructor.
Definition: HistoModule.h:32
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

◆ ~DQMHistoModuleBase()

Destructor.

Definition at line 38 of file DQMHistoModuleBase.cc.

39{
40
41}

Member Function Documentation

◆ beginRun()

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Reimplemented from HistoModule.

Definition at line 70 of file DQMHistoModuleBase.cc.

71{
73 if (!recoTracks.isOptional()) {
74 B2DEBUG(22, "Missing recoTracks array in beginRun() for " + getName());
75 return;
76 }
78 if (!tracks.isOptional()) {
79 B2DEBUG(22, "Missing recoTracks array in beginRun() for " + getName());
80 return;
81 }
82
83 for (TH1* histogram : m_histograms)
84 histogram->Reset();
85}
std::vector< TH1 * > m_histograms
All histograms created via the Create- functions are automatically added to this set.
const std::string & getName() const
Returns the name of the module.
Definition: Module.h:187
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113

◆ checkVariableForNANOrINF()

bool checkVariableForNANOrINF ( const double  var)
inlineprivate

Check a variable for whether or not it is NAN or INF.

Definition at line 314 of file DQMHistoModuleBase.h.

315 {
316 return std::isnan(var) or std::isinf(var);
317 }

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

◆ ComputeMean()

void ComputeMean ( TH1F *  output,
TH2F *  input,
bool  onX = true 
)
staticprotected

Creates a graph of means by given axis from given TH2F histogram.

Parameters
output- value of every bin of this histogram is set to be the mean of all bins from input with the same x (or y) coordinate.
input- any TH2F histogram which NBinsX (or NBinsY) has the same value as the NBinsX of the input.
onX- if true, use "x" and "NBinsX" options in the statements above. If false, use "y" and "NBinsY" instead.

Definition at line 618 of file DQMHistoModuleBase.cc.

619{
620 output->Reset();
621 int nbinsi = onX ? input->GetNbinsX() : input->GetNbinsY();
622 int nbinsy = onX ? input->GetNbinsY() : input->GetNbinsX();
623 TAxis* axis = onX ? input->GetYaxis() : input->GetXaxis();
624
625 for (int i = 1; i <= nbinsi; i++) {
626 float sum = 0;
627 float count = 0;
628
629 for (int j = 1; j <= nbinsy; j++) {
630 float value = onX ? input->GetBinContent(i, j) : input->GetBinContent(j, i);
631 sum += value * axis->GetBinCenter(j);
632 count += value;
633 }
634
635 output->SetBinContent(i, count != 0 ? sum / count : 0);
636 }
637}

◆ Create() [1/2]

TH2F * Create ( std::string  name,
std::string  title,
int  nbinsx,
double  xlow,
double  xup,
int  nbinsy,
double  ylow,
double  yup,
std::string  xTitle,
std::string  yTitle,
std::string  zTitle 
)
virtual

Same as above but for TH2F.

Reimplemented in AlignDQMModule.

Definition at line 108 of file DQMHistoModuleBase.cc.

110{
111 TH2F* histogram = new TH2F(name.c_str(), title.c_str(), nbinsx, xlow, xup, nbinsy, ylow, yup);
112 histogram->GetXaxis()->SetTitle(xTitle.c_str());
113 histogram->GetYaxis()->SetTitle(yTitle.c_str());
114 histogram->GetZaxis()->SetTitle(zTitle.c_str());
115
116 m_histograms.push_back(histogram);
117
118 return histogram;
119}

◆ Create() [2/2]

TH1F * Create ( std::string  name,
std::string  title,
int  nbinsx,
double  xlow,
double  xup,
std::string  xTitle,
std::string  yTitle 
)
virtual

Function to create TH1F and add it to the vector of histograms (m_histograms).

All histograms in the module should be created via this function (or following Create- functions).

Reimplemented in AlignDQMModule.

Definition at line 96 of file DQMHistoModuleBase.cc.

98{
99 TH1F* histogram = new TH1F(name.c_str(), title.c_str(), nbinsx, xlow, xup);
100 histogram->GetXaxis()->SetTitle(xTitle.c_str());
101 histogram->GetYaxis()->SetTitle(yTitle.c_str());
102
103 m_histograms.push_back(histogram);
104
105 return histogram;
106}

◆ CreateLayers() [1/2]

TH2F ** CreateLayers ( boost::format  nameTemplate,
boost::format  titleTemplate,
int  nbinsx,
double  xlow,
double  xup,
int  nbinsy,
double  ylow,
double  yup,
std::string  xTitle,
std::string  yTitle,
std::string  zTitle 
)
virtual

Same as above but for TH2F.

Definition at line 151 of file DQMHistoModuleBase.cc.

153{
155 auto gTools = geo.getGeoTools();
156
157 TH2F** output = new TH2F*[gTools->getNumberOfLayers()];
158
159 for (VxdID layer : geo.getLayers()) {
160 int layerNumber = layer.getLayerNumber();
161 int layerIndex = gTools->getLayerIndex(layerNumber);
162 std::string name = str(nameTemplate % layerNumber);
163 std::string title = str(titleTemplate % layerNumber);
164 output[layerIndex] = Create(name, title, nbinsx, xlow, xup, nbinsy, ylow, yup, xTitle, yTitle, zTitle);
165 }
166
167 return output;
168}
virtual TH1F * Create(std::string name, std::string title, int nbinsx, double xlow, double xup, std::string xTitle, std::string yTitle)
Function to create TH1F and add it to the vector of histograms (m_histograms).
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
Definition: GeoCache.h:39
const std::set< Belle2::VxdID > getLayers(SensorInfoBase::SensorType sensortype=SensorInfoBase::VXD)
Return a set of all known Layers.
Definition: GeoCache.cc:176
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
const GeoTools * getGeoTools()
Return a raw pointer to a GeoTools object.
Definition: GeoCache.h:142
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33

◆ CreateLayers() [2/2]

TH1F ** CreateLayers ( boost::format  nameTemplate,
boost::format  titleTemplate,
int  nbinsx,
double  xlow,
double  xup,
std::string  xTitle,
std::string  yTitle 
)
virtual

Function to create array of TH1F histograms, one for each layer.

Parameters
nameTemplate- format() of string with exactly one %1% which is then replaced by the layer number and then used as a name for the histogram.
titleTemplate- same as nameTemplate but for title.
nbinsx- number of bins.
xlow- range x-axis (low boundary).
xup- range x-axis (high boundary).
xTitle- title x-axis.
yTitle- title y-axis

Definition at line 132 of file DQMHistoModuleBase.cc.

134{
136 auto gTools = geo.getGeoTools();
137
138 TH1F** output = new TH1F*[gTools->getNumberOfLayers()];
139
140 for (VxdID layer : geo.getLayers()) {
141 int layerNumber = layer.getLayerNumber();
142 int layerIndex = gTools->getLayerIndex(layerNumber);
143 std::string name = str(nameTemplate % layerNumber);
144 std::string title = str(titleTemplate % layerNumber);
145 output[layerIndex] = Create(name, title, nbinsx, xlow, xup, xTitle, yTitle);
146 }
147
148 return output;
149}

◆ CreateSensors() [1/2]

TH2F ** CreateSensors ( boost::format  nameTemplate,
boost::format  titleTemplate,
int  nbinsx,
double  xlow,
double  xup,
int  nbinsy,
double  ylow,
double  yup,
std::string  xTitle,
std::string  yTitle,
std::string  zTitle 
)
virtual

Same as above but for TH2F.

Definition at line 189 of file DQMHistoModuleBase.cc.

191{
193 auto gTools = geo.getGeoTools();
194 int nVXDSensors = gTools->getNumberOfSensors();
195
196 TH2F** output = new TH2F*[nVXDSensors];
197
198 for (int sensorIndex = 0; sensorIndex < nVXDSensors; sensorIndex++) {
199 VxdID sensorID = gTools->getSensorIDFromIndex(sensorIndex);
200 std::string name = str(nameTemplate % SensorNameDescription(sensorID));
201 std::string title = str(titleTemplate % SensorTitleDescription(sensorID));
202 output[sensorIndex] = Create(name, title, nbinsx, xlow, xup, nbinsy, ylow, yup, xTitle, yTitle, zTitle);
203 }
204
205 return output;
206}
static std::string SensorTitleDescription(VxdID sensorID)
Creates string description of the sensor from given sensor ID to be used in a histogram title.
static std::string SensorNameDescription(VxdID sensorID)
Creates string description of the sensor from given sensor ID to be used in a histogram name.
unsigned short getNumberOfSensors() const
Get total number of sensors.
Definition: GeoTools.h:128

◆ CreateSensors() [2/2]

TH1F ** CreateSensors ( boost::format  nameTemplate,
boost::format  titleTemplate,
int  nbinsx,
double  xlow,
double  xup,
std::string  xTitle,
std::string  yTitle 
)
virtual

Function to create array of TH1F histograms, one for each sensor.

Parameters
nameTemplate- format() of string with exactly one %1% which is then replaced by the output of the SensorNameDescription function and then used as a name for the histogram.
titleTemplate- same as nameTemplate but for title and with the SensorTitleDescription function.
nbinsx- number of bins.
xlow- range x-axis (low boundary).
xup- range x-axis (high boundary).
xTitle- title x-axis.
yTitle- title y-axis

Definition at line 170 of file DQMHistoModuleBase.cc.

172{
174 auto gTools = geo.getGeoTools();
175 int nVXDSensors = gTools->getNumberOfSensors();
176
177 TH1F** output = new TH1F*[nVXDSensors];
178
179 for (int sensorIndex = 0; sensorIndex < nVXDSensors; sensorIndex++) {
180 VxdID sensorID = gTools->getSensorIDFromIndex(sensorIndex);
181 std::string name = str(nameTemplate % SensorNameDescription(sensorID));
182 std::string title = str(titleTemplate % SensorTitleDescription(sensorID));
183 output[sensorIndex] = Create(name, title, nbinsx, xlow, xup, xTitle, yTitle);
184 }
185
186 return output;
187}

◆ 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

◆ Define1DSensors()

void Define1DSensors ( )
protectedvirtual

Define 1D histograms with unbiased residuals for individual sensors.

Definition at line 410 of file DQMHistoModuleBase.cc.

411{
412
413 double residualRange = 400; // in um
414
415 auto residualU = Axis(200, -residualRange, residualRange, "residual U [#mum]");
416 auto residualV = Axis(residualU).title("residual V [#mum]");
417
418 auto factory = Factory(this);
419
420 factory.yTitleDefault("counts");
421
422 m_UBResidualsSensorU = factory.xAxis(residualU).CreateSensorsTH1F(format("UBResidualsU_%1%"),
423 format("VXD Unbiased U Residuals for sensor %1%"));
424 m_UBResidualsSensorV = factory.xAxis(residualV).CreateSensorsTH1F(format("UBResidualsV_%1%"),
425 format("VXD Unbiased V Residuals for sensor %1%"));
426
427}
TH1F ** m_UBResidualsSensorU
Unbiased residuals for PXD and SVD u per sensor.
TH1F ** m_UBResidualsSensorV
Unbiased residuals for PXD and SVD v per sensor.
This class unites some parameters for Factory which describe one axis of histogram.
Axis & title(std::string title)
Set value of title.
This class is used for creating TH1F and TH2F objects.

◆ Define2DSensors()

void Define2DSensors ( )
protectedvirtual

Define 2D histograms with unbiased residuals for individual sensors.

Definition at line 429 of file DQMHistoModuleBase.cc.

430{
431
432 double residualRange = 400; // in um
433
434 auto residualU = Axis(200, -residualRange, residualRange, "residual U [#mum]");
435 auto residualV = Axis(residualU).title("residual V [#mum]");
436
437 auto factory = Factory(this);
438
439 m_UBResidualsSensor = factory.xAxis(residualU).yAxis(residualV).zTitle("counts").CreateSensorsTH2F(format("UBResiduals_%1%"),
440 format("VXD Unbiased Residuals for sensor %1%"));
441}
TH2F ** m_UBResidualsSensor
Unbiased residuals for PXD and SVD u vs v per sensor.

◆ DefineHalfShellsVXD()

void DefineHalfShellsVXD ( )
protectedvirtual

Define histograms with unbiased residuals for half-shells for PXD and SVD sensors.

Definition at line 340 of file DQMHistoModuleBase.cc.

341{
342
343 double residualRange = 400; // in um
344 auto residual = Axis(200, -residualRange, residualRange, "residual [#mum]");
345 auto factory = Factory(this).xAxisDefault(residual).yTitleDefault("counts");
346
347 if (! m_hltDQM) {
348 m_UBResidualsPXDX_Yin = factory.CreateTH1F("UBResidualsPXDX_Yin", "PXD-Yin Unbiased Residuals in X");
349 m_UBResidualsPXDX_Yang = factory.CreateTH1F("UBResidualsPXDX_Yang", "PXD-Yang Unbiased Residuals in X");
350 }
351 m_UBResidualsSVDX_Pat = factory.CreateTH1F("UBResidualsSVDX_Pat", "SVD-Pat Unbiased Residuals in X");
352 m_UBResidualsSVDX_Mat = factory.CreateTH1F("UBResidualsSVDX_Mat", "SVD-Mat Unbiased Residuals in X");
353
354 if (! m_hltDQM) {
355 m_UBResidualsPXDY_Yin = factory.CreateTH1F("UBResidualsPXDY_Yin", "PXD-Yin Unbiased Residuals in Y");
356 m_UBResidualsPXDY_Yang = factory.CreateTH1F("UBResidualsPXDY_Yang", "PXD-Yang Unbiased Residuals in Y");
357 }
358 m_UBResidualsSVDY_Pat = factory.CreateTH1F("UBResidualsSVDY_Pat", "SVD-Pat Unbiased Residuals in Y");
359 m_UBResidualsSVDY_Mat = factory.CreateTH1F("UBResidualsSVDY_Mat", "SVD-Mat Unbiased Residuals in Y");
360
361 if (! m_hltDQM) {
362 m_UBResidualsPXDZ_Yin = factory.CreateTH1F("UBResidualsPXDZ_Yin", "PXD-Yin Unbiased Residuals in Z");
363 m_UBResidualsPXDZ_Yang = factory.CreateTH1F("UBResidualsPXDZ_Yang", "PXD-Yang Unbiased Residuals in Z");
364 }
365 m_UBResidualsSVDZ_Pat = factory.CreateTH1F("UBResidualsSVDZ_Pat", "SVD-Pat Unbiased Residuals in Z");
366 m_UBResidualsSVDZ_Mat = factory.CreateTH1F("UBResidualsSVDZ_Mat", "SVD-Mat Unbiased Residuals in Z");
367
368}
TH1F * m_UBResidualsPXDY_Yang
Unbiased residuals in Y for PXD for Yang.
TH1F * m_UBResidualsPXDZ_Yang
Unbiased residuals in Z for PXD for Yang.
TH1F * m_UBResidualsSVDY_Pat
Unbiased residuals in Y for PXD for Pat.
TH1F * m_UBResidualsSVDZ_Mat
Unbiased residuals in Z for PXD for Mat.
TH1F * m_UBResidualsSVDX_Mat
Unbiased residuals in X for PXD for Mat.
TH1F * m_UBResidualsPXDX_Yang
Unbiased residuals in X for PXD for Yang.
TH1F * m_UBResidualsPXDX_Yin
half-shells
TH1F * m_UBResidualsSVDX_Pat
Unbiased residuals in X for PXD for Pat.
TH1F * m_UBResidualsSVDZ_Pat
Unbiased residuals in Z for PXD for Pat.
bool m_hltDQM
True if the DQM module is run on HLT.
TH1F * m_UBResidualsPXDY_Yin
Unbiased residuals in Y for PXD for Yin.
TH1F * m_UBResidualsSVDY_Mat
Unbiased residuals in Y for PXD for Mat.
TH1F * m_UBResidualsPXDZ_Yin
Unbiased residuals in Z for PXD for Yin.
Factory & yTitleDefault(std::string yTitle)
Sets yTitle permanently.
Factory & xAxisDefault(const Axis &axis)
Permanently copies parameters for x axis from given Axis.

◆ DefineHelixParametersAndCorrelations()

void DefineHelixParametersAndCorrelations ( )
protectedvirtual

Define histograms with helix parameters and their correlations.

Reimplemented in AlignDQMModule.

Definition at line 250 of file DQMHistoModuleBase.cc.

251{
252
253 int iZ0Range = 200;
254 double fZ0Range = 10.0; // Half range in cm
255 int iD0Range = 200;
256 double fD0Range = 2.0; // Half range in cm
257 int iPhiRange = 72;
258 double fPhiRange = 180.0; // Half range in deg
259 int iLambdaRange = 400;
260 double fLambdaRange = 4.0;
261 int iOmegaRange = 400;
262 double fOmegaRange = 0.1;
263
264 auto phi = Axis(iPhiRange, -fPhiRange, fPhiRange, "#phi [deg]");
265 auto D0 = Axis(iD0Range, -fD0Range, fD0Range, "d0 [cm]");
266 auto D0_2d = Axis(50, -0.5, 0.5, "d0 [cm]");
267 auto Z0 = Axis(iZ0Range, -fZ0Range, fZ0Range, "z0 [cm]");
268 auto Z0_2d = Axis(100, -2, 2, "z0 [cm]");
269 auto tanLambda = Axis(iLambdaRange, -fLambdaRange, fLambdaRange, "Tan Lambda");
270 auto omega = Axis(iOmegaRange, -fOmegaRange, fOmegaRange, "Omega");
271
272 auto factory = Factory(this);
273
274 factory.yTitleDefault("Arb. Units");
275
276 m_Z0 = factory.xAxis(Z0).CreateTH1F("HelixZ0", "z0, the z coordinate of the perigee");
277 m_D0 = factory.xAxis(D0).CreateTH1F("HelixD0", "d0, the signed distance of the perigee in the r-phi plane");
278 m_Phi = factory.xAxis(phi).CreateTH1F("HelixPhi",
279 "Phi0, momentum azymuthal angle at the perigee");
280 m_Omega = factory.xAxis(omega).CreateTH1F("HelixOmega",
281 "Omega, the curvature of the track, sign defined by the charge of the particle");
282 m_TanLambda = factory.xAxis(tanLambda).CreateTH1F("HelixTanLambda", "TanLambda, the slope of the track in the r-z plane");
283
284
285 factory.zTitleDefault("Arb. Units");
286
287 m_PhiD0 = factory.xAxis(phi).yAxis(D0_2d).CreateTH2F("Helix2dPhiD0",
288 "d0 vs Phi0, the signed distance of the perigee in the r-phi plane vs. momentum azymuthal angle at the perigee");
289 m_D0Z0 = factory.xAxis(Z0_2d).yAxis(D0_2d).CreateTH2F("Helix2dD0Z0",
290 "d0 vs z0, the signed distance of the perigee in r-phi vs. z0 of the perigee");
291
292}
TH1F * m_TanLambda
TanLambda - the slope of the track in the r-z plane.
TH1F * m_Omega
Omega - the curvature of the track.
TH2F * m_PhiD0
d0 vs Phi - the signed distance to the IP in the r-phi plane
TH1F * m_Phi
Phi - the angle of the transverse momentum in the r-phi plane, with CDF naming convention.
TH2F * m_D0Z0
z0 vs d0 - signed distance to the IP in r-phi vs.
TH1F * m_D0
d0 - the signed distance to the IP in the r-phi plane
TH1F * m_Z0
z0 - the z0 coordinate of the perigee (beam spot position)

◆ defineHisto()

void defineHisto ( )
overridevirtual

Histogram definitions such as TH1(), TH2(), TNtuple(), TTree()....

are supposed to be placed in this function. Also at the end function all m_histogramParameterChanges should be processed via the ProcessHistogramParameterChange function.

Reimplemented from HistoModule.

Reimplemented in AlignDQMModule, TrackDQMModule, TrackingExpressRecoDQMModule, and TrackingHLTDQMModule.

Definition at line 65 of file DQMHistoModuleBase.cc.

66{
67 histogramsDefined = true;
68}
bool histogramsDefined
True if the defineHisto() was called.

◆ DefineHits()

void DefineHits ( )
protectedvirtual

Define histograms with numbers of hits.

Definition at line 310 of file DQMHistoModuleBase.cc.

311{
312 int iHitsInSVD = 20;
313 int iHitsInCDC = 200;
314 int iHits = 200;
315
316 auto factory = Factory(this).xlowDefault(0).xTitleDefault("# hits").yTitleDefault("counts");
317
318 if (! m_hltDQM) {
319 int iHitsInPXD = 10;
320 m_HitsPXD = factory.nbinsx(iHitsInPXD).xup(iHitsInPXD).CreateTH1F("NoOfHitsInTrack_PXD", "Number of PXD Hits per Track");
321 }
322 m_HitsSVD = factory.nbinsx(iHitsInSVD).xup(iHitsInSVD).CreateTH1F("NoOfHitsInTrack_SVD", "Number of SVD Hits per Track");
323 m_HitsCDC = factory.nbinsx(iHitsInCDC).xup(iHitsInCDC).CreateTH1F("NoOfHitsInTrack_CDC", "Number of CDC Hits per Track");
324 m_Hits = factory.nbinsx(iHits).xup(iHits).CreateTH1F("NoOfHitsInTrack", "Number of Hits per Track");
325}
TH1F * m_Hits
Number of all hits in tracks.
TH1F * m_HitsSVD
Number of hits on SVD.
TH1F * m_HitsCDC
Number of hits on CDC.
TH1F * m_HitsPXD
Number of hits on PXD.
Factory & xTitleDefault(std::string xTitle)
Sets xTitle permanently.
Factory & xlowDefault(double xlow)
Sets xlow permanently.

◆ DefineMomentumAngles()

void DefineMomentumAngles ( )
protectedvirtual

Define histograms with track momentum Pt.

angles.

Definition at line 208 of file DQMHistoModuleBase.cc.

209{
210 m_MomPhi = Create("MomPhi", "Track Azimuthal Angle", 180, -180, 180, "Mom Phi", "counts");
211 m_MomTheta = Create("MomTheta", "Track Polar Angle", 90, 0, 180, "Mom Theta", "counts");
212 m_MomCosTheta = Create("MomCosTheta", "Cosine of the Track Polar Angle", 100, -1, 1, "Mom CosTheta", "counts");
213}
TH1F * m_MomTheta
Track momentum Pt.Theta.
TH1F * m_MomPhi
Track momentum Pt.Phi.
TH1F * m_MomCosTheta
Track momentum Pt.CosTheta.

◆ DefineMomentumCoordinates()

void DefineMomentumCoordinates ( )
protectedvirtual

Define histograms with track momentum Pt.

coordinates.

Definition at line 294 of file DQMHistoModuleBase.cc.

295{
296 int iMomRange = 100;
297 double fMomRange = 6.0;
298
299 auto momentum = Axis(2 * iMomRange, -fMomRange, fMomRange, "Momentum [GeV/c]");
300 auto pt_momentum = Axis(iMomRange, 0, fMomRange, "Momentum [GeV/c]");
301 auto factory = Factory(this).xAxisDefault(momentum).yTitleDefault("counts");
302
303 m_MomX = factory.CreateTH1F("TrackMomentumX", "Track Momentum X");
304 m_MomY = factory.CreateTH1F("TrackMomentumY", "Track Momentum Y");
305 m_MomZ = factory.CreateTH1F("TrackMomentumZ", "Track Momentum Z");
306 m_MomPt = factory.xAxis(pt_momentum).yTitle("counts").CreateTH1F("TrackMomentumPt", "Track Momentum pT");
307 m_Mom = factory.xlow(.0).CreateTH1F("TrackMomentumMag", "Track Momentum Magnitude");
308}
TH1F * m_MomPt
Track momentum Pt.
TH1F * m_Mom
Track momentum Magnitude.
TH1F * m_MomX
Track momentum Pt.X.
TH1F * m_MomY
Track momentum Pt.Y.
TH1F * m_MomZ
Track momentum Pt.Z.

◆ DefineTrackFitStatus()

void DefineTrackFitStatus ( )
protectedvirtual

Define histograms which require FitStatus.

Definition at line 215 of file DQMHistoModuleBase.cc.

216{
217 m_PValue = Create("PValue", "Track Fit P value", 100, 0, 1, "p-value", "counts");
218 m_Chi2 = Create("Chi2", "Track Fit Chi2", 200, 0, 150, "Chi2", "counts");
219 m_NDF = Create("NDF", "Track Fit NDF", 200, 0, 200, "NDF", "counts");
220 m_Chi2NDF = Create("Chi2NDF", "Track Fit Chi2/NDF", 200, 0, 10, "Chi2/NDF", "counts");
221}

◆ DefineTracks()

void DefineTracks ( )
protectedvirtual

All the following Define- functions should be used in the defineHisto() function to define histograms.

The convention is that every Define- function is responsible for creating its own TDirectory (if it's needed). In any case the function must then return to the original gDirectory. For the creation of histograms the THFFactory or the Create- functions should be used. Define histograms with track indexes.

Definition at line 327 of file DQMHistoModuleBase.cc.

328{
329 int iTracks = 30;
330
331 auto tracks = Axis(iTracks, 0, iTracks, "# tracks");
332 auto factory = Factory(this).xAxisDefault(tracks).yTitleDefault("counts");
333
334 m_TracksVXD = factory.CreateTH1F("NoOfTracksInVXDOnly", "Number of VXD-Only Tracks per Event");
335 m_TracksCDC = factory.CreateTH1F("NoOfTracksInCDCOnly", "Number of CDC-Only Tracks per Event");
336 m_TracksVXDCDC = factory.CreateTH1F("NoOfTracksInVXDCDC", "Number of VXD+CDC Tracks per Event");
337 m_Tracks = factory.CreateTH1F("NoOfTracks", "Number of Tracks per Event");
338}
TH1F * m_Tracks
Number of all finding tracks.
TH1F * m_TracksCDC
Number of tracks only with CDC.
TH1F * m_TracksVXD
Number of tracks only with VXD.
TH1F * m_TracksVXDCDC
Number of full tracks with VXD+CDC.

◆ DefineTRClusters()

void DefineTRClusters ( )
protectedvirtual

Define histograms with correlations between neighbor layers and cluster hitmap in IP angle range.

Track related clusters - hitmap in IP angle range

Track related clusters - neighbor correlations in Phi

Track related clusters - neighbor correlations in Theta

Definition at line 370 of file DQMHistoModuleBase.cc.

371{
372 double range = 180; // in um
373 int nbins = 360;
374
375 auto gTools = VXD::GeoCache::getInstance().getGeoTools();
376
377 int nVXDLayers = gTools->getNumberOfLayers();
379
380 m_TRClusterCorrelationsPhi = new TH2F*[nVXDLayers - 1];
381 m_TRClusterCorrelationsTheta = new TH2F*[nVXDLayers - 1];
382
384 m_TRClusterHitmap = CreateLayers(format("TRClusterHitmapLayer%1%"), format("Cluster Hitmap for layer %1%"), nbins, -range, range,
385 nbins / 2, .0, range, "Phi angle [deg]", "Theta angle [deg]", "counts");
386
387 for (VxdID layer : geo.getLayers()) {
388 int layerNumber = layer.getLayerNumber();
389 if (layerNumber == gTools->getLastLayer())
390 continue;
391
392 int layerIndex = gTools->getLayerIndex(layerNumber);
393
395 std::string name = str(format("CorrelationsPhiLayers_%1%_%2%") % layerNumber % (layerNumber + 1));
396 std::string title = str(format("Correlations in Phi for Layers %1% %2%") % layerNumber % (layerNumber + 1));
397 std::string xTitle = str(format("angle layer %1% [deg]") % layerNumber);
398 std::string yTitle = str(format("angle layer %1% [deg]") % (layerNumber + 1));
399 m_TRClusterCorrelationsPhi[layerIndex] = Create(name, title, nbins, -range, range, nbins, -range, range,
400 xTitle, yTitle, "counts");
401
403 name = str(format("CorrelationsThetaLayers_%1%_%2%") % layerNumber % (layerNumber + 1));
404 title = str(format("Correlations in Theta for Layers %1% %2%") % layerNumber % (layerNumber + 1));
405 m_TRClusterCorrelationsTheta[layerIndex] = Create(name, title, nbins / 2, .0, range, nbins / 2, .0, range,
406 xTitle, yTitle, "counts");
407 }
408}
TH2F ** m_TRClusterHitmap
Track related clusters - hitmap in IP angle range.
TH2F ** m_TRClusterCorrelationsPhi
Track related clusters - neighbor correlations in Phi.
virtual TH1F ** CreateLayers(boost::format nameTemplate, boost::format titleTemplate, int nbinsx, double xlow, double xup, std::string xTitle, std::string yTitle)
Function to create array of TH1F histograms, one for each layer.
TH2F ** m_TRClusterCorrelationsTheta
Track related clusters - neighbor correlations in Theta.
unsigned short getNumberOfLayers() const
Get number of VXD layers.
Definition: GeoTools.h:41

◆ DefineUBResidualsVXD()

void DefineUBResidualsVXD ( )
protectedvirtual

Define histograms with unbiased residuals in PXD and SVD sensors.

Definition at line 223 of file DQMHistoModuleBase.cc.

224{
225 double residualRange = 400; // in um
226
227 auto residualU = Axis(200, -residualRange, residualRange, "residual U [#mum]");
228 auto residualV = Axis(residualU).title("residual V [#mum]");
229
230 auto factory = Factory(this);
231 factory.xAxisDefault(residualU).yAxisDefault(residualV).zTitleDefault("counts");
232
233 if (! m_hltDQM)
234 m_UBResidualsPXD = factory.CreateTH2F("UBResidualsPXD", "PXD Unbiased Residuals");
235 m_UBResidualsSVD = factory.CreateTH2F("UBResidualsSVD", "SVD Unbiased Residuals");
236
237 factory.xAxisDefault(residualU).yTitleDefault("counts");
238
239 if (! m_hltDQM)
240 m_UBResidualsPXDU = factory.CreateTH1F("UBResidualsPXDU", "PXD Unbiased residuals in U");
241 m_UBResidualsSVDU = factory.CreateTH1F("UBResidualsSVDU", "SVD Unbiased residuals in U");
242
243 factory.xAxisDefault(residualV);
244
245 if (! m_hltDQM)
246 m_UBResidualsPXDV = factory.CreateTH1F("UBResidualsPXDV", "PXD Unbiased residuals in V");
247 m_UBResidualsSVDV = factory.CreateTH1F("UBResidualsSVDV", "SVD Unbiased residuals in V");
248}
TH1F * m_UBResidualsSVDV
Unbiased residuals for SVD v.
TH1F * m_UBResidualsPXDU
Unbiased residuals for PXD u.
TH2F * m_UBResidualsPXD
Unbiased residuals for PXD u vs v.
TH1F * m_UBResidualsSVDU
Unbiased residuals for SVD u.
TH2F * m_UBResidualsSVD
Unbiased residuals for SVD u vs v.
TH1F * m_UBResidualsPXDV
Unbiased residuals for PXD v.

◆ EditHistogramParameter()

void EditHistogramParameter ( TH1 *  histogram,
const std::string &  parameter,
std::string  value 
)
protected

On given histogram sets given parameter to given value.

Used in the function above.

Definition at line 665 of file DQMHistoModuleBase.cc.

666{
667 if (parameter == "title") {
668 histogram->SetTitle(value.c_str());
669 return;
670 }
671 if (parameter == "nbinsx") {
672 auto axis = histogram->GetXaxis();
673 axis->Set(stoi(value), axis->GetXmin(), axis->GetXmax());
674 return;
675 }
676 if (parameter == "xlow") {
677 auto axis = histogram->GetXaxis();
678 axis->Set(axis->GetNbins(), stod(value), axis->GetXmax());
679 return;
680 }
681 if (parameter == "xup") {
682 auto axis = histogram->GetXaxis();
683 axis->Set(axis->GetNbins(), axis->GetXmin(), stod(value));
684 return;
685 }
686 if (parameter == "xTitle") {
687 histogram->GetXaxis()->SetTitle(value.c_str());
688 return;
689 }
690 if (parameter == "yTitle") {
691 histogram->GetYaxis()->SetTitle(value.c_str());
692 return;
693 }
694
695 if (dynamic_cast<TH2F*>(histogram) == nullptr) {
696 B2WARNING("Parameter " + parameter + " not found in histogram " + histogram->GetName() + ", parameter change is skipped in " +
697 getName() + ".");
698 return;
699 }
700
701 if (parameter == "nbinsy") {
702 auto axis = histogram->GetYaxis();
703 axis->Set(stoi(value), axis->GetXmin(), axis->GetXmax());
704 return;
705 }
706 if (parameter == "ylow") {
707 auto axis = histogram->GetYaxis();
708 axis->Set(axis->GetNbins(), stod(value), axis->GetXmax());
709 return;
710 }
711 if (parameter == "yup") {
712 auto axis = histogram->GetYaxis();
713 axis->Set(axis->GetNbins(), axis->GetXmin(), stod(value));
714 return;
715 }
716 if (parameter == "zTitle") {
717 histogram->GetZaxis()->SetTitle(value.c_str());
718 return;
719 }
720
721 B2WARNING("Parameter " + parameter + " not found in histogram " + histogram->GetName() + ", parameter change is skipped in " +
722 getName() + ".");
723}

◆ endRun()

◆ 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  )
overridevirtual

This method is called for each event.

Reimplemented from HistoModule.

Reimplemented in AlignDQMModule, TrackDQMModule, TrackingExpressRecoDQMModule, and TrackingHLTDQMModule.

Definition at line 88 of file DQMHistoModuleBase.cc.

89{
90 if (!histogramsDefined) {
91 B2ERROR("Histograms not defined in " + this->getName() + " module, event processing is skipped!");
92 return;
93 }
94}

◆ 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://xwiki.desy.de/xwiki/rest/p/f4fa4/#HModuleDevelopment
396
397)");
398 module
399 .def("__str__", &Module::getPathString)
400 .def("name", &Module::getName, return_value_policy<copy_const_reference>(),
401 "Returns the name of the module. Can be changed via :func:`set_name() <Module.set_name()>`, use :func:`type() <Module.type()>` for identifying a particular module class.")
402 .def("type", &Module::getType, return_value_policy<copy_const_reference>(),
403 "Returns the type of the module (i.e. class name minus 'Module')")
404 .def("set_name", &Module::setName, args("name"), R"(
405Set custom name, e.g. to distinguish multiple modules of the same type.
406
407>>> path.add_module('EventInfoSetter')
408>>> ro = path.add_module('RootOutput', branchNames=['EventMetaData'])
409>>> ro.set_name('RootOutput_metadata_only')
410>>> print(path)
411[EventInfoSetter -> RootOutput_metadata_only]
412
413)")
414 .def("description", &Module::getDescription, return_value_policy<copy_const_reference>(),
415 "Returns the description of this module.")
416 .def("package", &Module::getPackage, return_value_policy<copy_const_reference>(),
417 "Returns the package this module belongs to.")
418 .def("available_params", &_getParamInfoListPython,
419 "Return list of all module parameters as `ModuleParamInfo` instances")
420 .def("has_properties", &Module::hasProperties, (bp::arg("properties")),
421 R"DOCSTRING(Allows to check if the module has the given properties out of `ModulePropFlags` set.
422
423>>> if module.has_properties(ModulePropFlags.PARALLELPROCESSINGCERTIFIED):
424>>> ...
425
426Parameters:
427 properties (int): bitmask of `ModulePropFlags` to check for.
428)DOCSTRING")
429 .def("set_property_flags", &Module::setPropertyFlags, args("property_mask"),
430 "Set module properties in the form of an OR combination of `ModulePropFlags`.");
431 {
432 // python signature is too crowded, make ourselves
433 docstring_options subOptions(true, false, false); //userdef, py sigs, c++ sigs
434 module
435 .def("if_value", &Module::if_value,
436 (bp::arg("expression"), bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
437 R"DOCSTRING(if_value(expression, condition_path, after_condition_path=AfterConditionPath.END)
438
439Sets a conditional sub path which will be executed after this
440module if the return value set in the module passes the given ``expression``.
441
442Modules can define a return value (int or bool) using ``setReturnValue()``,
443which can be used in the steering file to split the Path based on this value, for example
444
445>>> module_with_condition.if_value("<1", another_path)
446
447In case the return value of the ``module_with_condition`` for a given event is
448less than 1, the execution will be diverted into ``another_path`` for this event.
449
450You could for example set a special return value if an error occurs, and divert
451the execution into a path containing :b2:mod:`RootOutput` if it is found;
452saving only the data producing/produced by the error.
453
454After a conditional path has executed, basf2 will by default stop processing
455the path for this event. This behaviour can be changed by setting the
456``after_condition_path`` argument.
457
458Parameters:
459 expression (str): Expression to determine if the conditional path should be executed.
460 This should be one of the comparison operators ``<``, ``>``, ``<=``,
461 ``>=``, ``==``, or ``!=`` followed by a numerical value for the return value
462 condition_path (Path): path to execute in case the expression is fulfilled
463 after_condition_path (AfterConditionPath): What to do once the ``condition_path`` has been executed.
464)DOCSTRING")
465 .def("if_false", &Module::if_false,
466 (bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
467 R"DOC(if_false(condition_path, after_condition_path=AfterConditionPath.END)
468
469Sets a conditional sub path which will be executed after this module if
470the return value of the module evaluates to False. This is equivalent to
471calling `if_value` with ``expression=\"<1\"``)DOC")
472 .def("if_true", &Module::if_true,
473 (bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
474 R"DOC(if_true(condition_path, after_condition_path=AfterConditionPath.END)
475
476Sets a conditional sub path which will be executed after this module if
477the return value of the module evaluates to True. It is equivalent to
478calling `if_value` with ``expression=\">=1\"``)DOC");
479 }
480 module
481 .def("has_condition", &Module::hasCondition,
482 "Return true if a conditional path has been set for this module "
483 "using `if_value`, `if_true` or `if_false`")
484 .def("get_all_condition_paths", &_getAllConditionPathsPython,
485 "Return a list of all conditional paths set for this module using "
486 "`if_value`, `if_true` or `if_false`")
487 .def("get_all_conditions", &_getAllConditionsPython,
488 "Return a list of all conditional path expressions set for this module using "
489 "`if_value`, `if_true` or `if_false`")
490 .add_property("logging", make_function(&Module::getLogConfig, return_value_policy<reference_existing_object>()),
@ 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

◆ FillHalfShellsPXD()

void FillHalfShellsPXD ( const B2Vector3D globalResidual_um,
bool  isNotYang 
)
virtual

Fill histograms with unbiased residuals for half-shells for PXD sensors.

Definition at line 560 of file DQMHistoModuleBase.cc.

561{
562 if (checkVariableForNANOrINF(globalResidual_um.X()) or
563 checkVariableForNANOrINF(globalResidual_um.Y()) or
564 checkVariableForNANOrINF(globalResidual_um.Z())) {
565 return;
566 }
567 if (isNotYang) {
568 m_UBResidualsPXDX_Yin->Fill(globalResidual_um.x());
569 m_UBResidualsPXDY_Yin->Fill(globalResidual_um.y());
570 m_UBResidualsPXDZ_Yin->Fill(globalResidual_um.z());
571 } else {
572 m_UBResidualsPXDX_Yang->Fill(globalResidual_um.x());
573 m_UBResidualsPXDY_Yang->Fill(globalResidual_um.y());
574 m_UBResidualsPXDZ_Yang->Fill(globalResidual_um.z());
575 }
576}
DataType Z() const
access variable Z (= .at(2) without boundary check)
Definition: B2Vector3.h:435
DataType y() const
access variable Y (= .at(1) without boundary check)
Definition: B2Vector3.h:427
DataType z() const
access variable Z (= .at(2) without boundary check)
Definition: B2Vector3.h:429
DataType X() const
access variable X (= .at(0) without boundary check)
Definition: B2Vector3.h:431
DataType Y() const
access variable Y (= .at(1) without boundary check)
Definition: B2Vector3.h:433
DataType x() const
access variable X (= .at(0) without boundary check)
Definition: B2Vector3.h:425
bool checkVariableForNANOrINF(const double var)
Check a variable for whether or not it is NAN or INF.

◆ FillHalfShellsSVD()

void FillHalfShellsSVD ( const B2Vector3D globalResidual_um,
bool  isNotMat 
)
virtual

Fill histograms with unbiased residuals for half-shells for SVD sensors.

Definition at line 578 of file DQMHistoModuleBase.cc.

579{
580 if (checkVariableForNANOrINF(globalResidual_um.X()) or
581 checkVariableForNANOrINF(globalResidual_um.Y()) or
582 checkVariableForNANOrINF(globalResidual_um.Z())) {
583 return;
584 }
585 if (isNotMat) {
586 m_UBResidualsSVDX_Pat->Fill(globalResidual_um.x());
587 m_UBResidualsSVDY_Pat->Fill(globalResidual_um.y());
588 m_UBResidualsSVDZ_Pat->Fill(globalResidual_um.z());
589 } else {
590 m_UBResidualsSVDX_Mat->Fill(globalResidual_um.x());
591 m_UBResidualsSVDY_Mat->Fill(globalResidual_um.y());
592 m_UBResidualsSVDZ_Mat->Fill(globalResidual_um.z());
593 }
594}

◆ FillHelixParametersAndCorrelations()

void FillHelixParametersAndCorrelations ( const TrackFitResult tfr)
virtual

Fill histograms with helix parameters and their correlations.

Reimplemented in AlignDQMModule.

Definition at line 496 of file DQMHistoModuleBase.cc.

497{
498 // don't fill NAN or INF
501 return;
502 }
503
504 m_D0->Fill(tfr->getD0());
505 m_Z0->Fill(tfr->getZ0());
506 m_Phi->Fill(tfr->getPhi() / Unit::deg);
507 m_Omega->Fill(tfr->getOmega());
508 m_TanLambda->Fill(tfr->getTanLambda());
509
510 m_PhiD0->Fill(tfr->getPhi0() / Unit::deg, tfr->getD0());
511 m_D0Z0->Fill(tfr->getZ0(), tfr->getD0());
512}
double getPhi() const
Getter for phi0 with CDF naming convention.
double getOmega() const
Getter for omega.
double getD0() const
Getter for d0.
double getTanLambda() const
Getter for tanLambda.
double getZ0() const
Getter for z0.
double getPhi0() const
Getter for phi0.
static const double deg
degree to radians
Definition: Unit.h:109

◆ FillHitNumbers()

void FillHitNumbers ( int  nPXD,
int  nSVD,
int  nCDC 
)
virtual

Fill histograms with numbers of hits.

Definition at line 451 of file DQMHistoModuleBase.cc.

452{
453 if (! m_hltDQM)
454 m_HitsPXD->Fill(nPXD);
455 else nPXD = 0;
456 m_HitsSVD->Fill(nSVD);
457 m_HitsCDC->Fill(nCDC);
458 m_Hits->Fill(nPXD + nSVD + nCDC);
459}

◆ FillMomentumAngles()

void FillMomentumAngles ( const TrackFitResult tfr)
virtual

Fill histograms with track momentum Pt.

angles.

Definition at line 461 of file DQMHistoModuleBase.cc.

462{
463 const ROOT::Math::XYZVector mom = tfr->getMomentum();
464
465 // don't fill NAN or INF
467 checkVariableForNANOrINF(mom.Phi()) or checkVariableForNANOrINF(mom.Theta())) {
468 return;
469 }
470
471 float Phi = mom.Phi();
472 float Theta = mom.Theta();
473
474 m_MomPhi->Fill(Phi / Unit::deg);
475 m_MomTheta->Fill(Theta / Unit::deg);
476 m_MomCosTheta->Fill(cos(Theta));
477}
ROOT::Math::XYZVector getMomentum() const
Getter for vector of momentum at closest approach of track in r/phi projection.

◆ FillMomentumCoordinates()

void FillMomentumCoordinates ( const TrackFitResult tfr)
virtual

Fill histograms with track momentum Pt.

coordinates.

Definition at line 479 of file DQMHistoModuleBase.cc.

480{
481 const ROOT::Math::XYZVector& mom = tfr->getMomentum();
482
483 // don't fill NAN or INF, Mag is NAN/INF if any component is, no need to check
484 if (checkVariableForNANOrINF(mom.X()) or checkVariableForNANOrINF(mom.Y()) or
485 checkVariableForNANOrINF(mom.Z()) or checkVariableForNANOrINF(mom.Rho())) {
486 return;
487 }
488
489 m_MomX->Fill(mom.X());
490 m_MomY->Fill(mom.Y());
491 m_MomZ->Fill(mom.Z());
492 m_Mom->Fill(mom.R());
493 m_MomPt->Fill(mom.Rho());
494}

◆ FillTrackFitStatus()

void FillTrackFitStatus ( const genfit::FitStatus *  tfs)
virtual

Fill histograms which require FitStatus.

Definition at line 514 of file DQMHistoModuleBase.cc.

515{
516 // don't fill NAN or INF
517 if (checkVariableForNANOrINF(tfs->getChi2()) or checkVariableForNANOrINF(tfs->getNdf())) {
518 return;
519 }
520
521 float NDF = tfs->getNdf();
522 m_NDF->Fill(NDF);
523 float chi2 = tfs->getChi2();
524 m_Chi2->Fill(chi2);
525 if (NDF > 0) {
526 float Chi2NDF = chi2 / NDF;
527 m_Chi2NDF->Fill(Chi2NDF);
528 }
529
530 m_PValue->Fill(tfs->getPVal());
531}

◆ FillTrackIndexes()

void FillTrackIndexes ( int  iTrack,
int  iTrackVXD,
int  iTrackCDC,
int  iTrackVXDCDC 
)
virtual

Fill histograms with track indexes.

Definition at line 443 of file DQMHistoModuleBase.cc.

444{
445 m_Tracks->Fill(iTrack);
446 m_TracksVXD->Fill(iTrackVXD);
447 m_TracksCDC->Fill(iTrackCDC);
448 m_TracksVXDCDC->Fill(iTrackVXDCDC);
449}

◆ FillTRClusterCorrelations()

void FillTRClusterCorrelations ( float  phi_deg,
float  phiPrev_deg,
float  theta_deg,
float  thetaPrev_deg,
int  correlationIndex 
)
virtual

Fill histograms with correlations between neighbor layers.

Definition at line 533 of file DQMHistoModuleBase.cc.

535{
536 m_TRClusterCorrelationsPhi[correlationIndex]->Fill(phiPrev_deg, phi_deg);
537 m_TRClusterCorrelationsTheta[correlationIndex]->Fill(thetaPrev_deg, theta_deg);
538}

◆ FillTRClusterHitmap()

void FillTRClusterHitmap ( float  phi_deg,
float  theta_deg,
int  layerIndex 
)
virtual

Fill cluster hitmap in IP angle range.

Definition at line 613 of file DQMHistoModuleBase.cc.

614{
615 m_TRClusterHitmap[layerIndex]->Fill(phi_deg, theta_deg);
616}

◆ FillUB1DResidualsSensor()

void FillUB1DResidualsSensor ( const B2Vector3D residual_um,
int  sensorIndex 
)
virtual

Fill 1D histograms with unbiased residuals for individual sensors.

Definition at line 596 of file DQMHistoModuleBase.cc.

597{
598 if (checkVariableForNANOrINF(residual_um.X()) or checkVariableForNANOrINF(residual_um.Y())) {
599 return;
600 }
601 m_UBResidualsSensorU[sensorIndex]->Fill(residual_um.x());
602 m_UBResidualsSensorV[sensorIndex]->Fill(residual_um.y());
603}

◆ FillUB2DResidualsSensor()

void FillUB2DResidualsSensor ( const B2Vector3D residual_um,
int  sensorIndex 
)
virtual

Fill 2D histograms with unbiased residuals for individual sensors.

Definition at line 605 of file DQMHistoModuleBase.cc.

606{
607 if (checkVariableForNANOrINF(residual_um.X()) or checkVariableForNANOrINF(residual_um.Y())) {
608 return;
609 }
610 m_UBResidualsSensor[sensorIndex]->Fill(residual_um.x(), residual_um.y());
611}

◆ FillUBResidualsPXD()

void FillUBResidualsPXD ( const B2Vector3D residual_um)
virtual

Fill histograms with unbiased residuals in PXD sensors.

Definition at line 540 of file DQMHistoModuleBase.cc.

541{
542 if (checkVariableForNANOrINF(residual_um.X()) or checkVariableForNANOrINF(residual_um.Y())) {
543 return;
544 }
545 m_UBResidualsPXD->Fill(residual_um.x(), residual_um.y());
546 m_UBResidualsPXDU->Fill(residual_um.x());
547 m_UBResidualsPXDV->Fill(residual_um.y());
548}

◆ FillUBResidualsSVD()

void FillUBResidualsSVD ( const B2Vector3D residual_um)
virtual

Fill histograms with unbiased residuals in SVD sensors.

Definition at line 550 of file DQMHistoModuleBase.cc.

551{
552 if (checkVariableForNANOrINF(residual_um.X()) or checkVariableForNANOrINF(residual_um.Y())) {
553 return;
554 }
555 m_UBResidualsSVD->Fill(residual_um.x(), residual_um.y());
556 m_UBResidualsSVDU->Fill(residual_um.x());
557 m_UBResidualsSVDV->Fill(residual_um.y());
558}

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

◆ 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

◆ 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

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

◆ 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>(); }

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

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

◆ 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

◆ 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(); };

◆ 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://xwiki.desy.de/xwiki/rest/p/a94f2 or ModuleCondition for a description of the syntax.

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

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

Definition at line 79 of file Module.cc.

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

◆ initialize()

void initialize ( void  )
overridevirtual

Initializer.

Reimplemented from HistoModule.

Reimplemented in TrackDQMModule, TrackingExpressRecoDQMModule, and TrackingHLTDQMModule.

Definition at line 43 of file DQMHistoModuleBase.cc.

44{
46 if (!recoTracks.isOptional()) {
47 B2WARNING("Missing recoTracks array, " + getName() + " is skipped.");
48 return;
49 }
50
52 if (!Tracks.isOptional()) {
53 B2WARNING("Missing Tracks array, " + getName() + " is skipped.");
54 return;
55 }
56
57 // Register histograms (calls back defineHisto)
58 REG_HISTOGRAM
59}

◆ ProcessHistogramParameterChange()

void ProcessHistogramParameterChange ( const std::string &  name,
const std::string &  parameter,
const std::string &  value 
)
protected

Process one change in histogram parameters.

Should be applied to all items from m_histogramParameterChanges at the end of the defineHisto() function.

Parameters
name- name of the histogram whose parameter we want to change.
parameter- name of the parameter we want to change. Possible values are: name, title, nbinsx, xlow, xup, xTitle, yTitle (for both TH1F and TH2F) and nbinsy, ylow, yup, zTitle (only for TH2F).
value- new value we wish the parameter of the histogram to have. Int and double values are parsed from string so they must be given correctly.

Definition at line 639 of file DQMHistoModuleBase.cc.

641{
642 TH1* histogram = nullptr;
643
644 for (auto adept : m_histograms)
645 if (adept->GetName() == name) {
646 histogram = adept;
647 break;
648 }
649
650 if (!histogram) {
651 B2WARNING("Histogram " + name + " not found, parameter change is skipped in " + getName() + ".");
652 } else {
653 try {
654 EditHistogramParameter(histogram, parameter, value);
655 } catch (const std::invalid_argument& e) {
656 B2WARNING("Value " + value + " of parameter " + parameter + " for histogram " + histogram->GetName() +
657 " could not be parsed, parameter change is skipped in " + getName() + ".");
658 } catch (const std::out_of_range& e) {
659 B2WARNING("Value " + value + " of parameter " + parameter + " for histogram " + histogram->GetName() +
660 " is out of range, parameter change is skipped in " + getName() + ".");
661 }
662 }
663}
void EditHistogramParameter(TH1 *histogram, const std::string &parameter, std::string value)
On given histogram sets given parameter to given value.

◆ runningOnHLT()

void runningOnHLT ( )
inline

function called when the module is run on HLT

Definition at line 63 of file DQMHistoModuleBase.h.

63{m_hltDQM = true;};

◆ SensorNameDescription()

std::string SensorNameDescription ( VxdID  sensorID)
staticprotected

Creates string description of the sensor from given sensor ID to be used in a histogram name.

Its used in the CreateSensors functions.

Definition at line 121 of file DQMHistoModuleBase.cc.

122{
123 return str(format("%1%_%2%_%3%") % sensorID.getLayerNumber() % sensorID.getLadderNumber() % sensorID.getSensorNumber());
124}
baseType getSensorNumber() const
Get the sensor id.
Definition: VxdID.h:100
baseType getLadderNumber() const
Get the ladder id.
Definition: VxdID.h:98
baseType getLayerNumber() const
Get the layer id.
Definition: VxdID.h:96

◆ SensorTitleDescription()

std::string SensorTitleDescription ( VxdID  sensorID)
staticprotected

Creates string description of the sensor from given sensor ID to be used in a histogram title.

Its used in the CreateSensors functions.

Definition at line 126 of file DQMHistoModuleBase.cc.

127{
128 return str(format("Layer %1% Ladder %2% Sensor %3%") % sensorID.getLayerNumber() % sensorID.getLadderNumber() %
129 sensorID.getSensorNumber());
130}

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

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

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

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

◆ terminate()

Member Data Documentation

◆ histogramsDefined

bool histogramsDefined = false
protected

True if the defineHisto() was called.

If false, the event() function does nothing.

Definition at line 191 of file DQMHistoModuleBase.h.

◆ m_Chi2

TH1F* m_Chi2 = nullptr
protected

Chi2.

Definition at line 205 of file DQMHistoModuleBase.h.

◆ m_Chi2NDF

TH1F* m_Chi2NDF = nullptr
protected

Chi2 / NDF.

Definition at line 209 of file DQMHistoModuleBase.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_D0

TH1F* m_D0 = nullptr
protected

d0 - the signed distance to the IP in the r-phi plane

Definition at line 281 of file DQMHistoModuleBase.h.

◆ m_D0Z0

TH2F* m_D0Z0 = nullptr
protected

z0 vs d0 - signed distance to the IP in r-phi vs.

z0 of the perigee (to see primary vertex shifts along R or z)

Definition at line 287 of file DQMHistoModuleBase.h.

◆ m_description

std::string m_description
privateinherited

The description of the module.

Definition at line 511 of file Module.h.

◆ m_hasReturnValue

bool m_hasReturnValue
privateinherited

True, if the return value is set.

Definition at line 518 of file Module.h.

◆ m_histogramParameterChanges

std::vector<std::tuple<std::string, std::string, std::string> > m_histogramParameterChanges
protected

Used for changing parameters of histograms via the ProcessHistogramParameterChange function.


Definition at line 196 of file DQMHistoModuleBase.h.

◆ m_histograms

std::vector<TH1*> m_histograms
protected

All histograms created via the Create- functions are automatically added to this set.

Its used to easy call Reset() on all histograms in beginRun() and also for changing parameters of histograms via the ProcessHistogramParameterChange function.

Definition at line 189 of file DQMHistoModuleBase.h.

◆ m_Hits

TH1F* m_Hits = nullptr
protected

Number of all hits in tracks.

Definition at line 302 of file DQMHistoModuleBase.h.

◆ m_HitsCDC

TH1F* m_HitsCDC = nullptr
protected

Number of hits on CDC.

Definition at line 300 of file DQMHistoModuleBase.h.

◆ m_HitsPXD

TH1F* m_HitsPXD = nullptr
protected

Number of hits on PXD.

Definition at line 296 of file DQMHistoModuleBase.h.

◆ m_HitsSVD

TH1F* m_HitsSVD = nullptr
protected

Number of hits on SVD.

Definition at line 298 of file DQMHistoModuleBase.h.

◆ m_hltDQM

bool m_hltDQM = false
protected

True if the DQM module is run on HLT.

Definition at line 193 of file DQMHistoModuleBase.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_Mom

TH1F* m_Mom = nullptr
protected

Track momentum Magnitude.

Definition at line 279 of file DQMHistoModuleBase.h.

◆ m_MomCosTheta

TH1F* m_MomCosTheta = nullptr
protected

Track momentum Pt.CosTheta.

Definition at line 269 of file DQMHistoModuleBase.h.

◆ m_MomPhi

TH1F* m_MomPhi = nullptr
protected

Track momentum Pt.Phi.

Definition at line 265 of file DQMHistoModuleBase.h.

◆ m_MomPt

TH1F* m_MomPt = nullptr
protected

Track momentum Pt.

Definition at line 277 of file DQMHistoModuleBase.h.

◆ m_MomTheta

TH1F* m_MomTheta = nullptr
protected

Track momentum Pt.Theta.

Definition at line 267 of file DQMHistoModuleBase.h.

◆ m_MomX

TH1F* m_MomX = nullptr
protected

Track momentum Pt.X.

Definition at line 271 of file DQMHistoModuleBase.h.

◆ m_MomY

TH1F* m_MomY = nullptr
protected

Track momentum Pt.Y.

Definition at line 273 of file DQMHistoModuleBase.h.

◆ m_MomZ

TH1F* m_MomZ = nullptr
protected

Track momentum Pt.Z.

Definition at line 275 of file DQMHistoModuleBase.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_NDF

TH1F* m_NDF = nullptr
protected

NDF.

Definition at line 207 of file DQMHistoModuleBase.h.

◆ m_Omega

TH1F* m_Omega = nullptr
protected

Omega - the curvature of the track.

It's sign is defined by the charge of the particle

Definition at line 293 of file DQMHistoModuleBase.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_Phi

TH1F* m_Phi = nullptr
protected

Phi - the angle of the transverse momentum in the r-phi plane, with CDF naming convention.

Definition at line 289 of file DQMHistoModuleBase.h.

◆ m_PhiD0

TH2F* m_PhiD0 = nullptr
protected

d0 vs Phi - the signed distance to the IP in the r-phi plane

Definition at line 283 of file DQMHistoModuleBase.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_PValue

TH1F* m_PValue = nullptr
protected

p Value

Definition at line 203 of file DQMHistoModuleBase.h.

◆ m_recoTracksStoreArrayName

std::string m_recoTracksStoreArrayName
protected

StoreArray name where RecoTracks are written.

Definition at line 200 of file DQMHistoModuleBase.h.

◆ m_returnValue

int m_returnValue
privateinherited

The return value.

Definition at line 519 of file Module.h.

◆ m_TanLambda

TH1F* m_TanLambda = nullptr
protected

TanLambda - the slope of the track in the r-z plane.

Definition at line 291 of file DQMHistoModuleBase.h.

◆ m_Tracks

TH1F* m_Tracks = nullptr
protected

Number of all finding tracks.

Definition at line 310 of file DQMHistoModuleBase.h.

◆ m_TracksCDC

TH1F* m_TracksCDC = nullptr
protected

Number of tracks only with CDC.

Definition at line 306 of file DQMHistoModuleBase.h.

◆ m_tracksStoreArrayName

std::string m_tracksStoreArrayName
protected

StoreArray name where Tracks are written.

Definition at line 198 of file DQMHistoModuleBase.h.

◆ m_TracksVXD

TH1F* m_TracksVXD = nullptr
protected

Number of tracks only with VXD.

Definition at line 304 of file DQMHistoModuleBase.h.

◆ m_TracksVXDCDC

TH1F* m_TracksVXDCDC = nullptr
protected

Number of full tracks with VXD+CDC.

Definition at line 308 of file DQMHistoModuleBase.h.

◆ m_TRClusterCorrelationsPhi

TH2F** m_TRClusterCorrelationsPhi = nullptr
protected

Track related clusters - neighbor correlations in Phi.

Definition at line 260 of file DQMHistoModuleBase.h.

◆ m_TRClusterCorrelationsTheta

TH2F** m_TRClusterCorrelationsTheta = nullptr
protected

Track related clusters - neighbor correlations in Theta.

Definition at line 262 of file DQMHistoModuleBase.h.

◆ m_TRClusterHitmap

TH2F** m_TRClusterHitmap = nullptr
protected

Track related clusters - hitmap in IP angle range.

Definition at line 258 of file DQMHistoModuleBase.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_UBResidualsPXD

TH2F* m_UBResidualsPXD = nullptr
protected

Unbiased residuals for PXD u vs v.

Definition at line 211 of file DQMHistoModuleBase.h.

◆ m_UBResidualsPXDU

TH1F* m_UBResidualsPXDU = nullptr
protected

Unbiased residuals for PXD u.

Definition at line 217 of file DQMHistoModuleBase.h.

◆ m_UBResidualsPXDV

TH1F* m_UBResidualsPXDV = nullptr
protected

Unbiased residuals for PXD v.

Definition at line 223 of file DQMHistoModuleBase.h.

◆ m_UBResidualsPXDX_Yang

TH1F* m_UBResidualsPXDX_Yang = nullptr
protected

Unbiased residuals in X for PXD for Yang.

Definition at line 231 of file DQMHistoModuleBase.h.

◆ m_UBResidualsPXDX_Yin

TH1F* m_UBResidualsPXDX_Yin = nullptr
protected

half-shells

Unbiased residuals in X for PXD for Yin

Definition at line 229 of file DQMHistoModuleBase.h.

◆ m_UBResidualsPXDY_Yang

TH1F* m_UBResidualsPXDY_Yang = nullptr
protected

Unbiased residuals in Y for PXD for Yang.

Definition at line 240 of file DQMHistoModuleBase.h.

◆ m_UBResidualsPXDY_Yin

TH1F* m_UBResidualsPXDY_Yin = nullptr
protected

Unbiased residuals in Y for PXD for Yin.

Definition at line 238 of file DQMHistoModuleBase.h.

◆ m_UBResidualsPXDZ_Yang

TH1F* m_UBResidualsPXDZ_Yang = nullptr
protected

Unbiased residuals in Z for PXD for Yang.

Definition at line 249 of file DQMHistoModuleBase.h.

◆ m_UBResidualsPXDZ_Yin

TH1F* m_UBResidualsPXDZ_Yin = nullptr
protected

Unbiased residuals in Z for PXD for Yin.

Definition at line 247 of file DQMHistoModuleBase.h.

◆ m_UBResidualsSensor

TH2F** m_UBResidualsSensor = nullptr
protected

Unbiased residuals for PXD and SVD u vs v per sensor.

Definition at line 215 of file DQMHistoModuleBase.h.

◆ m_UBResidualsSensorU

TH1F** m_UBResidualsSensorU = nullptr
protected

Unbiased residuals for PXD and SVD u per sensor.

Definition at line 221 of file DQMHistoModuleBase.h.

◆ m_UBResidualsSensorV

TH1F** m_UBResidualsSensorV = nullptr
protected

Unbiased residuals for PXD and SVD v per sensor.

Definition at line 256 of file DQMHistoModuleBase.h.

◆ m_UBResidualsSVD

TH2F* m_UBResidualsSVD = nullptr
protected

Unbiased residuals for SVD u vs v.

Definition at line 213 of file DQMHistoModuleBase.h.

◆ m_UBResidualsSVDU

TH1F* m_UBResidualsSVDU = nullptr
protected

Unbiased residuals for SVD u.

Definition at line 219 of file DQMHistoModuleBase.h.

◆ m_UBResidualsSVDV

TH1F* m_UBResidualsSVDV = nullptr
protected

Unbiased residuals for SVD v.

Definition at line 225 of file DQMHistoModuleBase.h.

◆ m_UBResidualsSVDX_Mat

TH1F* m_UBResidualsSVDX_Mat = nullptr
protected

Unbiased residuals in X for PXD for Mat.

Definition at line 235 of file DQMHistoModuleBase.h.

◆ m_UBResidualsSVDX_Pat

TH1F* m_UBResidualsSVDX_Pat = nullptr
protected

Unbiased residuals in X for PXD for Pat.

Definition at line 233 of file DQMHistoModuleBase.h.

◆ m_UBResidualsSVDY_Mat

TH1F* m_UBResidualsSVDY_Mat = nullptr
protected

Unbiased residuals in Y for PXD for Mat.

Definition at line 244 of file DQMHistoModuleBase.h.

◆ m_UBResidualsSVDY_Pat

TH1F* m_UBResidualsSVDY_Pat = nullptr
protected

Unbiased residuals in Y for PXD for Pat.

Definition at line 242 of file DQMHistoModuleBase.h.

◆ m_UBResidualsSVDZ_Mat

TH1F* m_UBResidualsSVDZ_Mat = nullptr
protected

Unbiased residuals in Z for PXD for Mat.

Definition at line 253 of file DQMHistoModuleBase.h.

◆ m_UBResidualsSVDZ_Pat

TH1F* m_UBResidualsSVDZ_Pat = nullptr
protected

Unbiased residuals in Z for PXD for Pat.

Definition at line 251 of file DQMHistoModuleBase.h.

◆ m_Z0

TH1F* m_Z0 = nullptr
protected

z0 - the z0 coordinate of the perigee (beam spot position)

Definition at line 285 of file DQMHistoModuleBase.h.


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