9#include <trg/ecl/modules/trgeclDQM/TRGECLEventTimingDQMModule.h>
10#include <framework/core/HistoModule.h>
11#include <framework/datastore/StoreArray.h>
35 }
else if (iii <= 5) {
56 TDirectory* oldDir = gDirectory;
57 oldDir->mkdir(
"TRGECLEventTiming")->cd();
61 "[TRGECL] Most Energetic TC Energy ; max TC Energy (ADC) ; Entries / 10 ADC",
65 "[TRGECL] Most Energetic TC ID ; max TC ID ; Entries",
68 new TH1F(
"h_MaxTCThetaId",
69 "[TRGECL] Most Energetic TC Theta ID ; max TC #theta ID ; Entries",
72 new TH1F(
"h_EventTimingQuality",
73 "[TRGECL] Event timing quality ; Event timing quality ; Entries",
77 new TH1F(
"h_EventT0Coarse",
78 "[TRGECL] EventT0 with coarse event timing ; EventT0 (ns) ; Entries / 2 ns",
81 new TH1F(
"h_EventT0Fine",
82 "[TRGECL] EventT0 with fine event timing ; EventT0 (ns) ; Entries / 2 ns",
92 for (
int energyBin = 0; energyBin <
c_NBinEventT0; energyBin++) {
95 std::stringstream ss1, ss2;
96 ss1 << std::setfill(
'0') << std::setw(3) << std::to_string(10 + 20 * energyBin);
97 ss2 << std::setfill(
'0') << std::setw(3) << std::to_string(10 + 20 * (energyBin + 1));
98 TString ECUT1 = ss1.str() +
"to" + ss2.str();
99 TString ECUT2 = ss1.str() +
"-" + ss2.str();
103 new TH1F(
"h_EventT0_MaxTCE_" + ECUT1 +
"",
104 "[TRGECL] EventT0 MaxTCE (" + ECUT2 +
" ADC) ; EventT0 (ns); Entries / 2 ns",
123 B2DEBUG(20,
"No EventT0 is found.");
128 B2DEBUG(20,
"No TRGSummary is found.");
139 for (
int energyBin = 0; energyBin <
c_NBinEventT0; energyBin++) {
150 B2DEBUG(20,
"TRGSummary object not available");
158 if (m_L1TimingSrc != 0) {
159 B2DEBUG(20,
"This event is not deternied by ECL trigger.");
165 B2DEBUG(20,
"No EventT0 is found.");
171 B2DEBUG(20,
"No valid EventT0 is found.");
177 int evt_time_win = -1000;
179 evt_win = iii.getEvtWin();
180 evt_time_win = iii.getEvtTimeWin();
185 if (evt_time_win == -1) {
192 }
else if (evt_win == 4) {
193 if (evt_time_win == -1) {
201 B2DEBUG(20,
"L1 timing is out of ETM hit window");
208 int MaxTCThetaId = 0;
211 int hit_win = iii.getHitWin();
212 if (!(hit_win == flag_win_a ||
213 hit_win == flag_win_b)) {
continue; }
214 int TCId = iii.getTCId();
215 int TCEnergy = iii.getTCEnergy();
216 if (TCId < 1 || TCId > 576 || TCEnergy == 0) {
continue; }
218 if (TCEnergy > MaxTCEnergy) {
219 MaxTCEnergy = TCEnergy;
224 if (MaxTCId == -1000) {
225 B2DEBUG(20,
"No max TC is found.");
238 const double eventT0 =
243 if (gdlTimQuality == 1) {
249 }
else if (gdlTimQuality >= 2) {
259 int EnergyBinWidth = 20;
261 if (MaxTCEnergy >= 10 + EnergyBinWidth * idx &&
262 MaxTCEnergy <= 10 + EnergyBinWidth * (idx + 1)) {
263 IsMaxTCEnergy[idx] =
true;
269 if (IsMaxTCEnergy[binADC] ==
true) {
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
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...
double m_histEventT0FineXMin
x-axis minimum for EventT0 with fine event timing
TH1F * m_histMaxTCId
Max TC ID.
StoreObjPtr< EventT0 > m_eventT0
EventT0 data object.
double m_histEventT0FineXMax
x-axis maximum for EventT0 with fine event timing
TH1F * m_histEventTimingQuality
Event Timing Quality from TRGSummary.
TH1F * m_histMaxTCE
Max TC E.
std::vector< double > m_histEventT0XMin
x axis minimum for EventT0 histogram
virtual void initialize() override
Initialize the module.
virtual void event() override
This method is called for each event.
StoreArray< TRGECLUnpackerStore > m_trgeclUnpackerStores
Trg ECL UnpakcerStore.
virtual ~TRGECLEventTimingDQMModule()
Destructor.
TH1F * m_histEventT0Coarse
EventT0 with coarse event timing.
TH1F * m_histMaxTCThetaId
Max TC theta ID.
StoreObjPtr< TRGSummary > m_objTrgSummary
Trigger Summary data object.
virtual void beginRun() override
This method is called for each run.
TH1F * m_histEventT0Fine
EventT0 with fine event timing.
TrgEclMapping * m_trgecl_map
ecl trigger map
std::vector< int > m_histEventT0NBin
the number of bin for EventT0 histogram
TRGECLEventTimingDQMModule()
Default constructor.
StoreArray< TRGECLUnpackerEvtStore > m_trgeclUnpackerEvtStores
Trg ECL UnpakcerEvtStore.
TH1F * m_histEventT0[c_NBinEventT0]
EventT0 for different max TC E region.
double m_histEventT0CoarseXMin
x-axis minimum for EventT0 with coarse event timing
double m_histEventT0CoarseXMax
x-axis maximum for EventT0 with coarse event timing
static const int c_NBinEventT0
The number of EventT0 histogram for different max TC E region.
std::vector< double > m_histEventT0XMax
x axis maximum for EventT0 histogram
virtual void defineHisto() override
Defination of histograms.
int getTCThetaIdFromTCId(int)
get [TC Theta ID] from [TC ID]
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.