Belle II Software  release-08-01-10
AlignDQMModule Class Reference

DQM of Alignment for off line residuals per sensor, layer, keep also On-Line DQM from tracking: their momentum, Number of hits in tracks, Number of tracks. More...

#include <AlignDQMModule.h>

Inheritance diagram for AlignDQMModule:
Collaboration diagram for AlignDQMModule:

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

 AlignDQMModule ()
 Constructor.
 
virtual void event () override
 Module function event.
 
virtual void endRun () override
 Module function endRun.
 
virtual void defineHisto () override
 Histogram definitions such as TH1(), TH2(), TNtuple(), TTree().... More...
 
virtual TH1F * Create (std::string name, std::string title, int nbinsx, double xlow, double xup, std::string xTitle, std::string yTitle) override
 Function to create TH1F and add it to the vector of histograms (m_histograms). More...
 
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) override
 Same as above but for TH2F.
 
virtual void initialize () override
 Initializer.
 
virtual void beginRun () override
 Called when entering a new run.
 
void runningOnHLT ()
 function called when the module is run on HLT
 
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. More...
 
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. More...
 
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 terminate () override
 Function to terminate module.
 
virtual std::vector< std::string > getFileNames (bool outputFiles)
 Return a list of output filenames for this modules. More...
 
const std::string & getName () const
 Returns the name of the module. More...
 
const std::string & getType () const
 Returns the type of the module (i.e. More...
 
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. More...
 
void setPropertyFlags (unsigned int propertyFlags)
 Sets the flags for the module properties. More...
 
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. More...
 
void if_value (const std::string &expression, const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 Add a condition to the module. More...
 
void if_false (const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 A simplified version to add a condition to the module. More...
 
void if_true (const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 A simplified version to set the condition of the module. More...
 
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. More...
 
std::shared_ptr< PathgetConditionPath () const
 Returns the path of the last true condition (if there is at least one, else reaturn a null pointer). More...
 
Module::EAfterConditionPath getAfterConditionPath () const
 What to do after the conditional path is finished. More...
 
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. More...
 
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. More...
 
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. More...
 
std::shared_ptr< PathElementclone () const override
 Create an independent copy of this module. More...
 
std::shared_ptr< boost::python::list > getParamInfoListPython () const
 Returns a python list of all parameters. More...
 
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 FillHelixParametersAndCorrelations (const TrackFitResult *tfr) override
 Fill histograms with helix parameters and their correlations.
 
virtual void FillPositionSensors (ROOT::Math::XYZVector residual_um, ROOT::Math::XYZVector position, int sensorIndex)
 Fill histograms which depend on position for individual sensors.
 
virtual void FillLayers (ROOT::Math::XYZVector residual_um, float phi_deg, float theta_deg, int layerIndex)
 Fill histograms which depend on layerIndex.
 
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. More...
 
virtual void FillMomentumCoordinates (const TrackFitResult *tfr)
 Fill histograms with track momentum Pt. More...
 
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. More...
 
void EditHistogramParameter (TH1 *histogram, const std::string &parameter, std::string value)
 On given histogram sets given parameter to given value. More...
 
virtual void def_initialize ()
 Wrappers to make the methods without "def_" prefix callable from Python. More...
 
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. More...
 
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. More...
 
void setType (const std::string &type)
 Set the module type. More...
 
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. More...
 
template<typename T >
void addParam (const std::string &name, T &paramVariable, const std::string &description)
 Adds a new enforced parameter to the module. More...
 
void setReturnValue (int value)
 Sets the return value for this module as integer. More...
 
void setReturnValue (bool value)
 Sets the return value for this module as bool. More...
 
void setParamList (const ModuleParamList &params)
 Replace existing parameter list.
 
virtual void DefineHelixParametersAndCorrelations () override
 All the following Define- functions should be used in the defineHisto() function to define histograms. More...
 
void DefineSensors ()
 Define histograms which depend on position for individual sensors.
 
virtual void DefineLayers ()
 Define histograms which depend on layerIndex.
 
virtual void DefineTracks ()
 All the following Define- functions should be used in the defineHisto() function to define histograms. More...
 
virtual void DefineHits ()
 Define histograms with numbers of hits.
 
virtual void DefineMomentumAngles ()
 Define histograms with track momentum Pt. More...
 
virtual void DefineMomentumCoordinates ()
 Define histograms with track momentum Pt. More...
 
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. More...
 
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. More...
 
static std::string SensorTitleDescription (VxdID sensorID)
 Creates string description of the sensor from given sensor ID to be used in a histogram title. More...
 
static void ComputeMean (TH1F *output, TH2F *input, bool onX=true)
 Creates a graph of means by given axis from given TH2F histogram. More...
 

Protected Attributes

TH2F ** m_ResMeanPosUVSensCounts = nullptr
 Special Alignment related: Sensor level. More...
 
TH2F ** m_ResMeanUPosUVSens = nullptr
 ResidaulMeanU vs U vs V for sensor.
 
TH2F ** m_ResMeanVPosUVSens = nullptr
 ResidaulMeanU vs U vs V for sensor.
 
TH2F ** m_ResUPosUSens = nullptr
 ResidaulU vs U for sensor.
 
TH2F ** m_ResUPosVSens = nullptr
 ResidaulU vs V for sensor.
 
TH2F ** m_ResVPosUSens = nullptr
 ResidaulV vs U for sensor.
 
TH2F ** m_ResVPosVSens = nullptr
 ResidaulV vs V for sensor.
 
TH1F ** m_ResMeanUPosUSens = nullptr
 ResidaulMeanU vs U for sensor.
 
TH1F ** m_ResMeanUPosVSens = nullptr
 ResidaulMeanU vs V for sensor.
 
TH1F ** m_ResMeanVPosUSens = nullptr
 ResidaulMeanV vs U for sensor.
 
TH1F ** m_ResMeanVPosVSens = nullptr
 ResidaulMeanV vs V for sensor.
 
TH2F ** m_ResMeanPhiThetaLayerCounts = nullptr
 Special Alignment related: Layer level. More...
 
TH2F ** m_ResMeanUPhiThetaLayer = nullptr
 ResidaulMeanU vs Phi vs Theta for Layer.
 
TH2F ** m_ResMeanVPhiThetaLayer = nullptr
 ResidaulMeanU vs Phi vs Theta for Layer.
 
TH2F ** m_ResUPhiLayer = nullptr
 ResidaulU vs Phi for Layer.
 
TH2F ** m_ResUThetaLayer = nullptr
 ResidaulU vs Theta for Layer.
 
TH2F ** m_ResVPhiLayer = nullptr
 ResidaulV vs Phi for Layer.
 
TH2F ** m_ResVThetaLayer = nullptr
 ResidaulV vs Theta for Layer.
 
TH1F ** m_ResMeanUPhiLayer = nullptr
 ResidaulMeanU vs Phi for Layer.
 
TH1F ** m_ResMeanUThetaLayer = nullptr
 ResidaulMeanU vs Theta for Layer.
 
TH1F ** m_ResMeanVPhiLayer = nullptr
 ResidaulMeanV vs Phi for Layer.
 
TH1F ** m_ResMeanVThetaLayer = nullptr
 ResidaulMeanV vs Theta for Layer.
 
TH2F * m_PhiZ0 = nullptr
 helix parameters and their corellations More...
 
TH2F * m_PhiMomPt = nullptr
 Phi - the angle of the transverse momentum in the r-phi plane vs. More...
 
TH2F * m_PhiOmega = nullptr
 Phi - the angle of the transverse momentum in the r-phi plane vs. More...
 
TH2F * m_PhiTanLambda = nullptr
 Phi - the angle of the transverse momentum in the r-phi plane vs. More...
 
TH2F * m_D0MomPt = nullptr
 d0 - signed distance to the IP in r-phi vs. More...
 
TH2F * m_D0Omega = nullptr
 d0 - signed distance to the IP in r-phi vs. More...
 
TH2F * m_D0TanLambda = nullptr
 d0 - signed distance to the IP in r-phi vs. More...
 
TH2F * m_Z0MomPt = nullptr
 z0 - the z0 coordinate of the perigee vs. More...
 
TH2F * m_Z0Omega = nullptr
 z0 - the z0 coordinate of the perigee vs. More...
 
TH2F * m_Z0TanLambda = nullptr
 z0 - the z0 coordinate of the perigee vs. More...
 
TH2F * m_MomPtOmega = nullptr
 Track momentum Pt vs. More...
 
TH2F * m_MomPtTanLambda = nullptr
 Track momentum Pt vs. More...
 
TH2F * m_OmegaTanLambda = nullptr
 Omega - the curvature of the track vs. More...
 
std::vector< TH1 * > m_histograms
 All histograms created via the Create- functions are automatically added to this set. More...
 
bool histogramsDefined = false
 True if the defineHisto() was called. More...
 
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. More...
 
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 More...
 
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 corelations 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. More...
 
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. More...
 
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. More...
 
void setParamPythonDict (const boost::python::dict &dictionary)
 Implements a method for reading the parameter values from a boost::python dictionary. More...
 

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

DQM of Alignment for off line residuals per sensor, layer, keep also On-Line DQM from tracking: their momentum, Number of hits in tracks, Number of tracks.

Definition at line 29 of file AlignDQMModule.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.

Member Function Documentation

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

◆ ComputeMean()

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

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

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

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). This function calls base function but wirh "Alig_" prefix to the name parameter

Reimplemented from DQMHistoModuleBase.

Definition at line 406 of file AlignDQMModule.cc.

407 {
408  return DQMHistoModuleBase::Create("Alig_" + name, title, nbinsx, xlow, xup, xTitle, yTitle);
409 }
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).

◆ CreateLayers()

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

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.

◆ CreateSensors()

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

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.

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

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

◆ DefineHelixParametersAndCorrelations()

void DefineHelixParametersAndCorrelations ( )
overrideprotectedvirtual

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 helix parameters and their correlations.

Reimplemented from DQMHistoModuleBase.

Definition at line 120 of file AlignDQMModule.cc.

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

Definition at line 45 of file AlignDQMModule.cc.

◆ DefineMomentumAngles()

void DefineMomentumAngles ( )
protectedvirtualinherited

Define histograms with track momentum Pt.

angles.

Definition at line 208 of file DQMHistoModuleBase.cc.

◆ DefineMomentumCoordinates()

void DefineMomentumCoordinates ( )
protectedvirtualinherited

Define histograms with track momentum Pt.

coordinates.

Definition at line 294 of file DQMHistoModuleBase.cc.

◆ DefineTracks()

void DefineTracks ( )
protectedvirtualinherited

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.

◆ DefineTRClusters()

void DefineTRClusters ( )
protectedvirtualinherited

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 corelations in Phi

Track related clusters - neighbor corelations in Theta

Definition at line 370 of file DQMHistoModuleBase.cc.

◆ EditHistogramParameter()

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

On given histogram sets given parameter to given value.

Used in the function above.

Definition at line 665 of file DQMHistoModuleBase.cc.

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

◆ FillMomentumAngles()

void FillMomentumAngles ( const TrackFitResult tfr)
virtualinherited

Fill histograms with track momentum Pt.

angles.

Definition at line 461 of file DQMHistoModuleBase.cc.

◆ FillMomentumCoordinates()

void FillMomentumCoordinates ( const TrackFitResult tfr)
virtualinherited

Fill histograms with track momentum Pt.

coordinates.

Definition at line 479 of file DQMHistoModuleBase.cc.

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

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

◆ 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 RootOutputModule, StorageRootOutputModule, and RootInputModule.

Definition at line 134 of file Module.h.

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

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

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

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

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

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

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

◆ if_value()

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

Add a condition to the module.

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

See https://confluence.desy.de/display/BI/Software+ModCondTut or ModuleCondition for a description of the syntax.

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

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

Definition at line 79 of file Module.cc.

◆ ProcessHistogramParameterChange()

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

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.

◆ SensorNameDescription()

std::string SensorNameDescription ( VxdID  sensorID)
staticprotectedinherited

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.

◆ SensorTitleDescription()

std::string SensorTitleDescription ( VxdID  sensorID)
staticprotectedinherited

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.

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

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

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

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

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

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

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

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

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

Member Data Documentation

◆ histogramsDefined

bool histogramsDefined = false
protectedinherited

True if the defineHisto() was called.

If false, the event() function does nothing.

Definition at line 191 of file DQMHistoModuleBase.h.

◆ m_D0MomPt

TH2F* m_D0MomPt = nullptr
protected

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

Track momentum Pt

Definition at line 138 of file AlignDQMModule.h.

◆ m_D0Omega

TH2F* m_D0Omega = nullptr
protected

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

Omega - the curvature of the track

Definition at line 140 of file AlignDQMModule.h.

◆ m_D0TanLambda

TH2F* m_D0TanLambda = nullptr
protected

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

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

Definition at line 142 of file AlignDQMModule.h.

◆ m_D0Z0

TH2F* m_D0Z0 = nullptr
protectedinherited

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_histogramParameterChanges

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

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
protectedinherited

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_MomPtOmega

TH2F* m_MomPtOmega = nullptr
protected

Track momentum Pt vs.

Omega - the curvature of the track

Definition at line 150 of file AlignDQMModule.h.

◆ m_MomPtTanLambda

TH2F* m_MomPtTanLambda = nullptr
protected

Track momentum Pt vs.

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

Definition at line 152 of file AlignDQMModule.h.

◆ m_Omega

TH1F* m_Omega = nullptr
protectedinherited

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_OmegaTanLambda

TH2F* m_OmegaTanLambda = nullptr
protected

Omega - the curvature of the track vs.

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

Definition at line 154 of file AlignDQMModule.h.

◆ m_PhiMomPt

TH2F* m_PhiMomPt = nullptr
protected

Phi - the angle of the transverse momentum in the r-phi plane vs.

Track momentum Pt

Definition at line 132 of file AlignDQMModule.h.

◆ m_PhiOmega

TH2F* m_PhiOmega = nullptr
protected

Phi - the angle of the transverse momentum in the r-phi plane vs.

Omega - the curvature of the track

Definition at line 134 of file AlignDQMModule.h.

◆ m_PhiTanLambda

TH2F* m_PhiTanLambda = nullptr
protected

Phi - the angle of the transverse momentum in the r-phi plane vs.

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

Definition at line 136 of file AlignDQMModule.h.

◆ m_PhiZ0

TH2F* m_PhiZ0 = nullptr
protected

helix parameters and their corellations

Phi - the angle of the transverse momentum in the r-phi plane vs. z0 of the perigee (to see primary vertex shifts along R or z)

Definition at line 130 of file AlignDQMModule.h.

◆ m_ResMeanPhiThetaLayerCounts

TH2F** m_ResMeanPhiThetaLayerCounts = nullptr
protected

Special Alignment related: Layer level.

ResidaulMean vs Phi vs Theta counter for Layer

Definition at line 106 of file AlignDQMModule.h.

◆ m_ResMeanPosUVSensCounts

TH2F** m_ResMeanPosUVSensCounts = nullptr
protected

Special Alignment related: Sensor level.

ResidaulMean vs U vs V counter for sensor

Definition at line 82 of file AlignDQMModule.h.

◆ m_UBResidualsPXDX_Yin

TH1F* m_UBResidualsPXDX_Yin = nullptr
protectedinherited

half-shells

Unbiased residuals in X for PXD for Yin

Definition at line 229 of file DQMHistoModuleBase.h.

◆ m_Z0MomPt

TH2F* m_Z0MomPt = nullptr
protected

z0 - the z0 coordinate of the perigee vs.

Track momentum Pt

Definition at line 144 of file AlignDQMModule.h.

◆ m_Z0Omega

TH2F* m_Z0Omega = nullptr
protected

z0 - the z0 coordinate of the perigee vs.

Omega - the curvature of the track

Definition at line 146 of file AlignDQMModule.h.

◆ m_Z0TanLambda

TH2F* m_Z0TanLambda = nullptr
protected

z0 - the z0 coordinate of the perigee vs.

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

Definition at line 148 of file AlignDQMModule.h.


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