9#include <svd/modules/svdCalibration/SVDTimeCalibrationsMonitorModule.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(
"SVDTimeCalibrationMonitor_output.root"));
33 addParam(
"timeAlgo",
m_timeAlgo,
"Name of the time algorithm: CoG6, CoG3, ELS3.", std::string(
"CoG3"));
41 m_tree =
new TTree(
"calibTime",
"RECREATE");
56 B2WARNING(
"No valid SVDCoGTimeCalibrations for the requested IoV");
59 B2WARNING(
"No valid SVD3SampleCoGTimeCalibrations for the requested IoV");
63 B2WARNING(
"No valid SVD3SampleELSTimeCalibrations for the requested IoV");
72 m_run = meta->getRun();
73 m_exp = meta->getExperiment();
91 std::set<Belle2::VxdID>::iterator itSvdLayers = svdLayers.begin();
93 while ((itSvdLayers != svdLayers.end()) && (itSvdLayers->getLayerNumber() != 7)) {
95 std::set<Belle2::VxdID> svdLadders = aGeometry.
getLadders(*itSvdLayers);
96 std::set<Belle2::VxdID>::iterator itSvdLadders = svdLadders.begin();
98 while (itSvdLadders != svdLadders.end()) {
100 std::set<Belle2::VxdID> svdSensors = aGeometry.
getSensors(*itSvdLadders);
101 std::set<Belle2::VxdID>::iterator itSvdSensors = svdSensors.begin();
102 B2DEBUG(1,
" svd sensor info " << * (svdSensors.begin()));
104 while (itSvdSensors != svdSensors.end()) {
105 B2DEBUG(1,
" svd sensor info " << *itSvdSensors);
107 m_layer = itSvdSensors->getLayerNumber();
108 m_ladder = itSvdSensors->getLadderNumber();
109 m_sensor = itSvdSensors->getSensorNumber();
130 m_c1 = 1. / 12 * (-21 * f0 + 32 * f1 - 12 * f2 + f4);
131 m_c2 = 1. / 8 * (7 * f0 - 16 * f1 + 10 * f2 - f4);
132 m_c3 = 1. / 24 * (-3 * f0 + 8 * f1 - 6 * f2 + f4);
158 B2RESULT(
"******************************************");
159 B2RESULT(
"** UNIQUE IDs of calibration DB objects **");
165 B2WARNING(
"No valid SVDCoGTimeCalibrations for the requested IoV");
172 B2WARNING(
"No valid SVD3SampleCoGTimeCalibrations for the requested IoV");
179 B2WARNING(
"No valid SVD3SampleELSTimeCalibrations for the requested IoV");
190 B2RESULT(
"The rootfile containing the list of histograms has been filled and closed [Time].");
void setDescription(const std::string &description)
Sets the description of the module.
TString getUniqueID()
returns the unique ID of the payload
double getCorrectedTime(const Belle2::VxdID &sensorID, const bool &isU, const unsigned short &strip, const double &raw_time, const int &bin) const
Return the charge (number of electrons/holes) collected on a specific strip, given the number of ADC ...
bool isValid()
returns true if the m_aDBObtPtr is valid in the requested IoV
TString getUniqueID()
returns the unique ID of the payload
double getCorrectedTime(const Belle2::VxdID &sensorID, const bool &isU, const unsigned short &strip, const double &raw_time, const int &bin) const
Return the charge (number of electrons/holes) collected on a specific strip, given the number of ADC ...
bool isValid()
returns true if the m_aDBObtPtr is valid in the requested IoV
TString getUniqueID()
returns the unique ID of the payload
double getCorrectedTime(const Belle2::VxdID &sensorID, const bool &isU, const unsigned short &strip, const double &raw_time, const int &bin) const
Return the strip time, given the raw strip time.
bool isValid()
returns true if the m_aDBObtPtr is valid in the requested IoV
std::string m_rootFileName
root file name
TBranch * b_run
run number
TTree * m_tree
pointer at tree containing the mean and RMS of calibration constants
SVDTimeCalibrationsMonitorModule()
Constructor: Sets the description, the properties and the parameters of the module.
TBranch * b_layer
layer number
int m_ladder
ladder number
TBranch * b_side
sensor side
float m_c2
calibration function c2
virtual void event() override
fill trees and histograms
virtual void endRun() override
print the payloads uniqueID and write tree and histograms to the rootfile
TBranch * b_exp
exp number
int m_sensor
sensor number
SVD3SampleCoGTimeCalibrations m_CoG3TimeCal
CoG3 time calibrations payload.
std::string m_timeAlgo
time algorithms
TBranch * b_sensor
sensor number
SVDCoGTimeCalibrations m_CoG6TimeCal
CoG6 time calibrations payload.
virtual void beginRun() override
initialize the TTrees and check validities of payloads
TBranch * b_c1
calibration function c1
float m_c0
calibration function c0
SVD3SampleELSTimeCalibrations m_ELS3TimeCal
ELS3 time calibrations payload.
TBranch * b_triggerBin
trigger bin
int m_triggerBin
trigger bin
TBranch * b_c0
calibration function c0
TBranch * b_c3
calibration function c3
float m_c1
calibration function c1
float m_c3
calibration function c3
TBranch * b_c2
calibration function c2
TBranch * b_ladder
ladder number
TFile * m_rootFilePtr
pointer at root file used for storing histograms
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.