9#include <svd/modules/svdCalibration/SVDClusterCalibrationsMonitorModule.h>
10#include <vxd/geometry/GeoCache.h>
11#include <framework/datastore/StoreObjPtr.h>
12#include <framework/dataobjects/EventMetaData.h>
28 setDescription(
"Module to produce a list of histograms showing the uploaded calibration constants");
31 addParam(
"outputFileName",
m_rootFileName,
"Name of output root file.", std::string(
"SVDClusterCalibrationMonitor_output.root"));
39 m_tree =
new TTree(
"calibCls",
"RECREATE");
58 B2WARNING(
"No valid SVDClustering for the requested IoV");
62 TH1F hClsSNR(
"clusterMinSNR__L@layerL@ladderS@sensor@view",
63 "Cluster minimum SNR in @layer.@ladder.@sensor @view/@side",
65 hClsSNR.GetXaxis()->SetTitle(
"cls min SNR");
68 TH1F hClsSeedSNR(
"clusterSeedSNR__L@layerL@ladderS@sensor@view",
69 "Cluster Seed minimum SNR in @layer.@ladder.@sensor @view/@side",
71 hClsSeedSNR.GetXaxis()->SetTitle(
"cls seed SNR");
76 TH1F hClsAdjSNR(
"clusterAdjSNR__L@layerL@ladderS@sensor@view",
77 "Cluster Adj minimum SNR in @layer.@ladder.@sensor @view/@side",
79 hClsAdjSNR.GetXaxis()->SetTitle(
"cls adj SNR");
84 TH1F hClsScaleErr1(
"clusterScaleErr1__L@layerL@ladderS@sensor@view",
85 "Cluster Position Error Scale Factor for Size 1 in @layer.@ladder.@sensor @view/@side",
87 hClsScaleErr1.GetXaxis()->SetTitle(
"scale factor");
90 TH1F hClsScaleErr2(
"clusterScaleErr2__L@layerL@ladderS@sensor@view",
91 "Cluster Position Error Scale Factor for Size 2 in @layer.@ladder.@sensor @view/@side",
93 hClsScaleErr2.GetXaxis()->SetTitle(
"scale factor");
96 TH1F hClsScaleErr3(
"clusterScaleErr3__L@layerL@ladderS@sensor@view",
97 "Cluster Position Error Scale Factor for Size 3 in @layer.@ladder.@sensor @view/@side",
99 hClsScaleErr3.GetXaxis()->SetTitle(
"scale factor");
102 TH1F hClsScaleErr4(
"clusterScaleErr4__L@layerL@ladderS@sensor@view",
103 "Cluster Position Error Scale Factor for Size 4 in @layer.@ladder.@sensor @view/@side",
105 hClsScaleErr4.GetXaxis()->SetTitle(
"scale factor");
108 TH1F hClsScaleErr5(
"clusterScaleErr5__L@layerL@ladderS@sensor@view",
109 "Cluster Position Error Scale Factor for Size > 4 in @layer.@ladder.@sensor @view/@side",
111 hClsScaleErr5.GetXaxis()->SetTitle(
"scale factor");
116 TH1F hClsTimeFuncVersion(
"clusterTimeSelFunction__L@layerL@ladderS@sensor@view",
117 "Cluster Time Selection Function Version in @layer.@ladder.@sensor @view/@side",
119 hClsTimeFuncVersion.GetXaxis()->SetTitle(
"cls time selection function ID");
123 TH1F hClsTimeMin(
"clusterMinTimeS__L@layerL@ladderS@sensor@view",
124 "Cluster Minimum Time in @layer.@ladder.@sensor @view/@side",
126 hClsTimeMin.GetXaxis()->SetTitle(
"cls min time (ns)");
137 m_run = meta->getRun();
145 std::set<Belle2::VxdID>::iterator itSvdLayers = svdLayers.begin();
147 while ((itSvdLayers != svdLayers.end()) && (itSvdLayers->getLayerNumber() != 7)) {
149 std::set<Belle2::VxdID> svdLadders = aGeometry.
getLadders(*itSvdLayers);
150 std::set<Belle2::VxdID>::iterator itSvdLadders = svdLadders.begin();
152 while (itSvdLadders != svdLadders.end()) {
154 std::set<Belle2::VxdID> svdSensors = aGeometry.
getSensors(*itSvdLadders);
155 std::set<Belle2::VxdID>::iterator itSvdSensors = svdSensors.begin();
156 B2DEBUG(1,
" svd sensor info " << * (svdSensors.begin()));
158 while (itSvdSensors != svdSensors.end()) {
159 B2DEBUG(1,
" svd sensor info " << *itSvdSensors);
161 m_layer = itSvdSensors->getLayerNumber();
162 m_ladder = itSvdSensors->getLadderNumber();
163 m_sensor = itSvdSensors->getSensorNumber();
210 B2RESULT(
"******************************************");
211 B2RESULT(
"** UNIQUE IDs of calibration DB objects **");
216 B2WARNING(
"No valid SVDClusterCalibrations for the requested IoV");
233 for (
auto ladder : geoCache.getLadders(layer))
260 B2RESULT(
"The rootfile containing the list of histograms has been filled and closed [Cluster].");
void setDescription(const std::string &description)
Sets the description of the module.
std::string m_rootFileName
root file name
TBranch * b_run
run number
float m_clsSNR
cluster SNR
TBranch * b_clsSNR
cluster SNR
TTree * m_tree
pointer at tree containing the mean and RMS of calibration constants
TBranch * b_layer
layer number
float m_clsScaleErr1
cluster size 1 pos err scale factor SNR
int m_ladder
ladder number
TBranch * b_side
sensor side
SVDHistograms< TH1F > * m_hClsSeedSNR
cluster seed SNR histo
TBranch * b_clsScaleErr1
cluster size 1 pos err scale factor SNR
TBranch * b_clsAdjSNR
cluster adj SNR
SVDHistograms< TH1F > * m_hClsScaleErr3
cluster size 3, position error scale factor histo
SVDHitTimeSelection m_HitTimeCut
hit time cuts payload
int m_clsTimeFunc
cluster cut time function version
virtual void event() override
fill trees and histograms
TBranch * b_clsScaleErr5
cluster size 5 pos err scale factor SNR
virtual void endRun() override
print the payloads uniqueID and write tree and histograms to the rootfile
int m_sensor
sensor number
TBranch * b_clsScaleErr4
cluster size 4 pos err scale factor SNR
SVDHistograms< TH1F > * m_hClsTimeMin
cluster cut minimum time histo
float m_clsScaleErr4
cluster size 4 pos err scale factor SNR
SVDClustering m_ClusterCal
cluster calibrations payload
float m_clsTimeMin
cluster cut min time
SVDHistograms< TH1F > * m_hClsScaleErr1
cluster size 1, position error scale factor histo
TBranch * b_sensor
sensor number
TBranch * b_clsScaleErr2
cluster size 2 pos err scale factor SNR
float m_clsSeedSNR
cluster seed SNR
TBranch * b_clsTimeMin
cluster cut min time
float m_clsAdjSNR
cluster adj SNR
SVDClusterCalibrationsMonitorModule()
Constructor: Sets the description, the properties and the parameters of the module.
virtual void beginRun() override
initialize the TTrees and check validities of payloads
float m_clsScaleErr5
cluster size 5 pos err scale factor SNR
TBranch * b_clsTimeFunc
cluster cut time function ID
SVDHistograms< TH1F > * m_hClsScaleErr2
cluster size 2, position error scale factor histo
SVDCoGOnlyErrorScaleFactors m_CoGOnlySF
scale factors for the CoGOnly algorithm
float m_clsScaleErr2
cluster size 2 pos err scale factor SNR
TBranch * b_clsSeedSNR
cluster seed SNR
TBranch * b_clsScaleErr3
cluster size 3 pos err scale factor SNR
SVDHistograms< TH1F > * m_hClsSNR
cluster SNR histo
SVDHistograms< TH1F > * m_hClsScaleErr5
cluster size 5, position error scale factor histo
SVDHistograms< TH1F > * m_hClsScaleErr4
cluster size 4, position error scale factor histo
TBranch * b_ladder
ladder number
TFile * m_rootFilePtr
pointer at root file used for storing histograms
SVDHistograms< TH1F > * m_hClsTimeFuncVersion
cluster cut time function version histo
float m_clsScaleErr3
cluster size 3 pos err scale factor SNR
SVDHistograms< TH1F > * m_hClsAdjSNR
cluster adj SNR histo
double getMinClusterSNR(const Belle2::VxdID &sensorID, const bool &isU) const
Return the minimum SNR for the cluster.
double getMinSeedSNR(const Belle2::VxdID &sensorID, const bool &isU) const
Return the minimum SNR for the seed.
double getMinAdjSNR(const Belle2::VxdID &sensorID, const bool &isU) const
Return the minimum SNR for the adjacent.
TString getUniqueID()
returns the unique ID of the payload
bool isValid()
returns true if the m_aDBObtPtr is valid in the requested IoV
double getCorrectedClusterPositionError(const Belle2::VxdID &sensorID, const bool &isU, const int &size, const double &raw_error) const
Return the corrected cluster position error.
template class for SVd histograms
void fill(const VxdID &vxdID, int view, Types ... args)
fill the histogram for
H * getHistogram(const VxdID &vxdID, int view)
get a reference to the histogram for
float getMinClusterTime(const Belle2::VxdID &sensorID, const bool &isU) const
Return the min value of the cluster time to use it for reconstruction.
int getTimeSelectionFunction(const Belle2::VxdID &sensorID, const bool &isU) const
Return the version of the function used to determine whether the cluster time is acceptable at the SP...
Type-safe access to single objects in the data store.
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
const std::set< Belle2::VxdID > getLayers(SensorInfoBase::SensorType sensortype=SensorInfoBase::VXD)
Return a set of all known Layers.
const std::set< Belle2::VxdID > & getSensors(Belle2::VxdID ladder) const
Return a set of all sensor IDs belonging to a given ladder.
static GeoCache & getInstance()
Return a reference to the singleton instance.
const std::set< Belle2::VxdID > & getLadders(Belle2::VxdID layer) const
Return a set of all ladder IDs belonging to a given layer.
Class to uniquely identify a any structure of the PXD and SVD.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.