9#include <top/modules/collectors/TOPModuleT0DeltaTCollectorModule.h>
35 setDescription(
"A collector for module T0 calibration with chi2 minimization of "
36 "time differences between slots (method DeltaT). Useful for initial "
37 "(rough) calibration, since the results are found slightly biased. "
38 "For the final (precise) calibration one has to use LL method.");
43 "number of bins of histograms of time difference", 400);
45 "time range [ns] of histograms of time difference", 20.0);
55 auto slotPairs =
new TH2F(
"slots",
"slot pairs: number of events",
56 16, 0.5, 16.5, 16, 0.5, 16.5);
57 slotPairs->SetXTitle(
"first slot number");
58 slotPairs->SetYTitle(
"second slot number");
59 registerObject<TH2F>(
"slots", slotPairs);
63 for (
int slot1 = 1; slot1 <= 9; slot1++) {
64 for (
int slot2 = slot1 + 7; slot2 <= slot1 + 9; slot2++) {
65 if (slot2 > 16)
continue;
66 string name =
"deltaT0_" + to_string(slot1) +
"-" + to_string(slot2);
67 string title =
"time difference: slot " + to_string(slot1) +
" - slot "
69 auto h =
new TH1F(name.c_str(), title.c_str(),
m_numBins, xmin, xmax);
70 h->SetXTitle(
"time difference [ns]");
71 registerObject<TH1F>(name, h);
85 if (timeZero1->getModuleID() > timeZero2->getModuleID()) {
90 int slot1 = timeZero1->getModuleID();
91 int slot2 = timeZero2->getModuleID();
92 if (slot1 > 9 or slot2 - slot1 < 7 or slot2 - slot1 > 9)
return;
93 string name =
"deltaT0_" + to_string(slot1) +
"-" + to_string(slot2);
94 auto h = getObjectPtr<TH1F>(name);
97 double t1 = timeZero1->getTime();
99 double t2 = timeZero2->getTime();
103 auto slotPairs = getObjectPtr<TH2F>(
"slots");
104 slotPairs->Fill(slot1, slot2);
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...
int m_numBins
number of histogram bins
double m_timeRange
histogram time range [ns] (symmetric around zero)
DBObjPtr< TOPCalModuleT0 > m_moduleT0
module T0 calibration constants
StoreArray< TOPTimeZero > m_timeZeros
collection of TOP time zero's
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.
virtual void collect() final
Replacement for event().
virtual void prepare() final
Replacement for initialize().
TOPModuleT0DeltaTCollectorModule()
Constructor.
Abstract base class for different kinds of events.