9#include <top/modules/collectors/TOPAsicShiftsBS13dCollectorModule.h>
10#include <top/geometry/TOPGeometryPar.h>
39 setDescription(
"A collector for calibration of carrier shifts of BS13d.");
44 addParam(
"nx",
m_nx,
"number of histogram bins (bin size ~8 ns)", 50);
46 "if True, require reconstructed bunch (to be used on cdst files only!)",
64 double xmi = -
m_nx * timeStep / 2;
65 double xma =
m_nx * timeStep / 2;
67 auto time_vs_BS =
new TH2F(
"time_vs_BS",
"time vs BS, slot 13",
68 16, 0.0, 512.0,
m_nx, xmi, xma);
69 time_vs_BS->SetXTitle(
"channel number");
70 time_vs_BS->SetYTitle(
"time [ns]");
71 registerObject<TH2F>(
"time_vs_BS", time_vs_BS);
73 auto timeReference =
new TH1F(
"time_reference",
"time, slot 13(a, b, c)",
75 timeReference->SetXTitle(
"time [ns]");
76 timeReference->SetYTitle(
"entries per bin [arbitrary]");
77 registerObject<TH1F>(
"time_reference", timeReference);
79 for (
unsigned i = 0; i < 4; i++) {
80 string name =
"time_carr_" + to_string(i);
81 string title =
"time, slot 13d, carrier " + to_string(i);
82 auto h =
new TH1F(name.c_str(), title.c_str(),
m_nx, xmi, xma);
83 h->SetXTitle(
"time [ns]");
84 h->SetYTitle(
"entries per bin [arbitrary]");
85 registerObject<TH1F>(name, h);
99 auto time_vs_BS = getObjectPtr<TH2F>(
"time_vs_BS");
100 auto timeReference = getObjectPtr<TH1F>(
"time_reference");
101 std::vector<TH1F*> timeCarriers;
102 for (
unsigned i = 0; i < 4; i++) {
103 string name =
"time_carr_" + to_string(i);
104 auto h = getObjectPtr<TH1F>(name);
105 timeCarriers.push_back(h);
109 if (digit.getModuleID() != 13)
continue;
110 if (digit.getHitQuality() != TOPDigit::c_Good)
continue;
112 time_vs_BS->Fill(digit.getChannel(), time);
113 if (digit.getBoardstackNumber() < 3) {
114 timeReference->Fill(time);
116 auto c = digit.getCarrierNumber();
117 timeCarriers[c]->Fill(time);
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...
StoreObjPtr< TOPRecBunch > m_recBunch
reconstructed bunch
int m_nx
number of histogram bins
bool m_requireRecBunch
if true, require reconstructed bunch
double m_timeOffset
time offset
StoreArray< TOPDigit > m_topDigits
collection of TOP digits
const TOPNominalTDC & getNominalTDC() const
Returns nominal time-to-digit conversion parameters.
double getSyncTimeBase() const
Returns synchonization time base (time width of c_syncWindows)
const TOPGeometry * getGeometry() const
Returns pointer to geometry object using basf2 units.
static TOPGeometryPar * Instance()
Static method to obtain the pointer to its instance.
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().
TOPAsicShiftsBS13dCollectorModule()
Constructor.
virtual void prepare() final
Replacement for initialize().
Abstract base class for different kinds of events.