8#include <svd/modules/svdTimeCalibrationCollector/SVDClusterTimeShifterCollectorModule.h>
25 setDescription(
"Collector module used to create the histograms needed for the SVD 6-Sample CoG, 3-Sample CoG and 3-Sample ELS Time calibration. "
26 "This is for the cluster-size dependent correction of the calibrated time.");
47 std::vector<Belle2::VxdID> allSensors;
49 for (
auto ladder : geoCache.getLadders(layer)) {
51 allSensors.push_back(sensor);
55 int numberOfSensorBin = 2 * int(allSensors.size());
56 B2INFO(
"Number of SensorBin: " << numberOfSensorBin);
59 TH3F* __hClusterSizeVsTimeResidual__ =
new TH3F((
"__hClusterSizeVsTimeResidual__" + alg).data(),
60 (
"ClusterSize vs " + alg +
" Time Residual").data(),
62 numberOfSensorBin, + 0.5, numberOfSensorBin + 0.5);
63 __hClusterSizeVsTimeResidual__->GetZaxis()->SetTitle(
"Sensor");
64 __hClusterSizeVsTimeResidual__->GetYaxis()->SetTitle(
"Cluster Size");
65 __hClusterSizeVsTimeResidual__->GetXaxis()->SetTitle(
"Cluster Time - EventT0 (ns)");
66 registerObject<TH3F>(__hClusterSizeVsTimeResidual__->GetName(), __hClusterSizeVsTimeResidual__);
69 TH1F* __hBinToSensorMap__ =
new TH1F(
"__hBinToSensorMap__",
"__BinToSensorMap__",
70 numberOfSensorBin, + 0.5, numberOfSensorBin + 0.5);
72 for (
auto sensor : allSensors) {
73 for (
auto view : {
'U',
'V'}) {
75 TString binLabel = TString::Format(
"L%iS%iS%c", sensor.getLayerNumber(), sensor.getSensorNumber(), view);
76 __hBinToSensorMap__->GetXaxis()->SetBinLabel(tmpBinCnt, binLabel);
79 registerObject<TH1F>(__hBinToSensorMap__->GetName(), __hBinToSensorMap__);
85 getObjectPtr<TH3F>((
"__hClusterSizeVsTimeResidual__" + alg).data())->Reset();
86 getObjectPtr<TH1F>(
"__hBinToSensorMap__")->Reset();
93 if (
m_eventT0->hasTemporaryEventT0(Const::EDetector::CDC)) {
94 const auto evtT0CDC =
m_eventT0->getBestCDCTemporaryEventT0();
95 eventT0 = evtT0CDC->eventT0;
108 float clusterTime = svdCluster.getClsTime();
109 int clusterSize = svdCluster.getSize();
112 TString binLabel = TString::Format(
"L%iS%iS%c",
113 svdCluster.getSensorID().getLayerNumber(),
114 svdCluster.getSensorID().getSensorNumber(),
115 svdCluster.isUCluster() ?
'U' :
'V');
116 int sensorBin = getObjectPtr<TH1F>(
"__hBinToSensorMap__")->GetXaxis()->FindBin(binLabel.Data());
117 double sensorBinCenter = getObjectPtr<TH1F>(
"__hBinToSensorMap__")->GetXaxis()->GetBinCenter(sensorBin);
118 getObjectPtr<TH3F>((
"__hClusterSizeVsTimeResidual__" + alg).data())->Fill(clusterTime - eventT0, clusterSize, sensorBinCenter);
Calibration collector module base class.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
void prepare() override final
Initialize the module.
SVDClusterTimeShifterCollectorModule()
Constructor.
StoreObjPtr< EventT0 > m_eventT0
EventT0 store object pointer.
std::string m_svdClustersOnTrackPrefix
Name Prefix of the SVDClustersOnTracks store array.
void collect() override final
Event processor.
std::string m_eventT0Name
Name of the EventT0 store object pointer used as parameter of the module.
int m_maxClusterSize
Maximum size of SVD clusters.
void startRun() override final
Called when entering a new run.
std::vector< std::string > m_timeAlgorithms
List of time algorithms to calibrate.
std::map< TString, StoreArray< SVDCluster > > m_svdClustersOnTrack
SVDClusters store array.
Accessor to arrays stored in the data store.
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
static GeoCache & getInstance()
Return a reference to the singleton instance.
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.