8#include <svd/modules/svdTimeValidationCollector/SVDTimeValidationCollectorModule.h>
26 setDescription(
"Collector module used to create the histograms needed for the SVD 6-Sample CoG, 3-Sample CoG and 3-Sample ELS Time calibration");
39 auto hEventT0 =
new TH1F(
"hEventT0",
"EventT0", 300, -150, 150);
40 registerObject<TH1F>(
"hEventT0", hEventT0);
49 std::vector<Belle2::VxdID> allSensors;
51 for (
auto ladder : geoCache.getLadders(layer))
53 allSensors.push_back(sensor);
55 int numberOfSensorBin = 2 * int(allSensors.size());
56 B2INFO(
"Number of SensorBin: " << numberOfSensorBin);
58 TH2F* __hClsTimeOnTracks__ =
new TH2F(
"__hClsTimeOnTracks__",
"clsTimeOnTracks",
60 numberOfSensorBin, + 0.5, numberOfSensorBin + 0.5);
61 TH2F* __hClsTimeAll__ =
new TH2F(
"__hClsTimeAll__",
"clsTimeAll",
63 numberOfSensorBin, + 0.5, numberOfSensorBin + 0.5);
64 TH2F* __hClsDiffTimeOnTracks__ =
new TH2F(
"__hClsDiffTimeOnTracks__",
"clsDiffTimeOnTracks",
66 numberOfSensorBin, + 0.5, numberOfSensorBin + 0.5);
67 TH3F* __hClusterSizeVsTimeResidual__ =
new TH3F(
"__hClusterSizeVsTimeResidual__",
68 "ClusterSize vs Time Residual",
69 100, -25., 25., 10, 0.5, + 10.5,
70 numberOfSensorBin, + 0.5, numberOfSensorBin + 0.5);
71 TH1F* __hBinToSensorMap__ =
new TH1F(
"__hBinToSensorMap__",
"__BinToSensorMap__",
72 numberOfSensorBin, + 0.5, numberOfSensorBin + 0.5);
73 __hClsTimeOnTracks__->GetYaxis()->SetTitle(
"sensor");
74 __hClsTimeOnTracks__->GetXaxis()->SetTitle(
"clsTime_onTracks (ns)");
75 __hClsTimeAll__->GetYaxis()->SetTitle(
"sensor");
76 __hClsTimeAll__->GetXaxis()->SetTitle(
"clsTime_all (ns)");
77 __hClsDiffTimeOnTracks__->GetYaxis()->SetTitle(
"sensor");
78 __hClsDiffTimeOnTracks__->GetXaxis()->SetTitle(
"clsDiffTime_onTracks (ns)");
79 __hClusterSizeVsTimeResidual__->GetZaxis()->SetTitle(
"Sensor");
80 __hClusterSizeVsTimeResidual__->GetYaxis()->SetTitle(
"Cluster Size");
81 __hClusterSizeVsTimeResidual__->GetXaxis()->SetTitle(
"Cluster Time - EventT0 (ns)");
84 for (
auto sensor : allSensors) {
85 for (
auto view : {
'U',
'V'}) {
87 TString binLabel = TString::Format(
"L%iL%iS%i%c",
88 sensor.getLayerNumber(),
89 sensor.getLadderNumber(),
90 sensor.getSensorNumber(),
92 __hBinToSensorMap__->GetXaxis()->SetBinLabel(tmpBinCnt, binLabel);
95 registerObject<TH2F>(__hClsTimeOnTracks__->GetName(), __hClsTimeOnTracks__);
96 registerObject<TH2F>(__hClsTimeAll__->GetName(), __hClsTimeAll__);
97 registerObject<TH2F>(__hClsDiffTimeOnTracks__->GetName(), __hClsDiffTimeOnTracks__);
98 registerObject<TH1F>(__hBinToSensorMap__->GetName(), __hBinToSensorMap__);
99 registerObject<TH3F>(__hClusterSizeVsTimeResidual__->GetName(), __hClusterSizeVsTimeResidual__);
104 getObjectPtr<TH1F>(
"hEventT0")->Reset();
105 getObjectPtr<TH2F>(
"__hClsTimeOnTracks__")->Reset();
106 getObjectPtr<TH2F>(
"__hClsTimeAll__")->Reset();
107 getObjectPtr<TH2F>(
"__hClsDiffTimeOnTracks__")->Reset();
108 getObjectPtr<TH3F>(
"__hClusterSizeVsTimeResidual__")->Reset();
109 getObjectPtr<TH1F>(
"__hBinToSensorMap__")->Reset();
116 getObjectPtr<TH1F>(
"hEventT0")->Fill(eventT0);
121 float clusterTime = svdCluster.getClsTime();
122 int clusterSize = svdCluster.getSize();
124 TString binLabel = TString::Format(
"L%iL%iS%i%c",
125 svdCluster.getSensorID().getLayerNumber(),
126 svdCluster.getSensorID().getLadderNumber(),
127 svdCluster.getSensorID().getSensorNumber(),
128 svdCluster.isUCluster() ?
'U' :
'V');
129 int sensorBin = getObjectPtr<TH1F>(
"__hBinToSensorMap__")->GetXaxis()->FindBin(binLabel.Data());
130 double sensorBinCenter = getObjectPtr<TH1F>(
"__hBinToSensorMap__")->GetXaxis()->GetBinCenter(sensorBin);
132 getObjectPtr<TH2F>(
"__hClsTimeOnTracks__")->Fill(clusterTime, sensorBinCenter);
133 getObjectPtr<TH2F>(
"__hClsDiffTimeOnTracks__")->Fill(clusterTime - eventT0, sensorBinCenter);
134 getObjectPtr<TH3F>(
"__hClusterSizeVsTimeResidual__")->Fill(clusterTime - eventT0, clusterSize, sensorBinCenter);
138 for (
const auto& svdCluster :
m_svdCls) {
140 float clusterTime = svdCluster.getClsTime();
142 TString binLabel = TString::Format(
"L%iL%iS%i%c",
143 svdCluster.getSensorID().getLayerNumber(),
144 svdCluster.getSensorID().getLadderNumber(),
145 svdCluster.getSensorID().getSensorNumber(),
146 svdCluster.isUCluster() ?
'U' :
'V');
147 int sensorBin = getObjectPtr<TH1F>(
"__hBinToSensorMap__")->GetXaxis()->FindBin(binLabel.Data());
148 double sensorBinCenter = getObjectPtr<TH1F>(
"__hBinToSensorMap__")->GetXaxis()->GetBinCenter(sensorBin);
150 getObjectPtr<TH2F>(
"__hClsTimeAll__")->Fill(clusterTime, 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...
StoreArray< SVDCluster > m_svdClsOnTrk
SVDClusters store array.
void prepare() override final
Initialize the module.
StoreObjPtr< EventT0 > m_eventT0
EventT0 store object pointer.
std::string m_recotrack
RecoTracks.
StoreArray< SVDCluster > m_svdCls
SVDClusters store array.
std::string m_svdClusters
SVDCluster.
StoreArray< Track > m_trk
Tracks store object pointer.
std::string m_eventTime
EventT0.
SVDTimeValidationCollectorModule()
Constructor.
void collect() override final
Event processor.
std::string m_svdClustersOnTracks
SVDClusterOnTracks.
std::string m_track
Tracks.
StoreArray< RecoTrack > m_recoTrk
RecoTracks store object pointer.
void startRun() override final
Called when entering a new run.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
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.