9 #include <trg/ecl/modules/trgeclDQM/TRGECLEventTimingDQMModule.h>
10 #include <framework/core/HistoModule.h>
11 #include <framework/datastore/StoreArray.h>
35 TDirectory* oldDir = gDirectory;
36 oldDir->mkdir(
"TRGECLEventTiming")->cd();
40 "[TRGECL] Most Energetic TC Energy ; max TC Energy (ADC) ; Entries / 10 ADC",
44 "[TRGECL] Most Energetic TC ID ; max TC ID ; Entries",
47 new TH1F(
"h_MaxTCThetaId",
48 "[TRGECL] Most Energetic TC Theta ID ; max TC #theta ID ; Entries",
51 new TH1F(
"h_EventTimingQuality",
52 "[TRGECL] Event timing quality ; Event timing quality ; Entries",
55 new TH1F(
"h_EventT0Coarse",
56 "[TRGECL] EventT0 with coarse event timing ; EventT0 (ns) ; Entries / 2 ns",
59 new TH1F(
"h_EventT0Fine",
60 "[TRGECL] EventT0 with fine event timing ; EventT0 (ns) ; Entries / 2 ns",
73 for (
int energyBin = 0; energyBin <
NBinEventT0; energyBin++) {
79 }
else if (energyBin <= 5) {
90 std::stringstream ss1, ss2;
91 ss1 << std::setfill(
'0') << std::setw(3) << std::to_string(10 + 20 * energyBin);
92 ss2 << std::setfill(
'0') << std::setw(3) << std::to_string(10 + 20 * (energyBin + 1));
93 TString ECUT1 = ss1.str() +
"to" + ss2.str();
94 TString ECUT2 = ss1.str() +
"-" + ss2.str();
98 new TH1F(
"h_EventT0_MaxTCE_" + ECUT1 +
"",
99 "[TRGECL] EventT0 MaxTCE (" + ECUT2 +
" ADC) ; EventT0 (ns); Entries / 2 ns",
100 nBins, minT0, maxT0);
115 B2DEBUG(20,
"No EventT0 is found.");
120 B2DEBUG(20,
"No TRGSummary is found.");
131 for (
int energyBin = 0; energyBin <
NBinEventT0; energyBin++) {
142 B2DEBUG(20,
"TRGSummary object not available");
150 if (m_L1TimingSrc != 0) {
151 B2DEBUG(20,
"This event is not deternied by ECL trigger.");
157 B2DEBUG(20,
"No EventT0 is found.");
163 B2DEBUG(20,
"No valid EventT0 is found.");
169 int evt_time_win = -1000;
171 evt_win = iii.getEvtWin();
172 evt_time_win = iii.getEvtTimeWin();
177 if (evt_time_win == -1) {
184 }
else if (evt_win == 4) {
185 if (evt_time_win == -1) {
193 B2DEBUG(20,
"L1 timing is out of ETM hit window");
200 int MaxTCThetaId = 0;
203 int hit_win = iii.getHitWin();
204 if (!(hit_win == flag_win_a ||
205 hit_win == flag_win_b)) {
continue; }
206 int TCId = iii.getTCId();
207 int TCEnergy = iii.getTCEnergy();
208 if (TCId < 1 || TCId > 576 || TCEnergy == 0) {
continue; }
210 if (TCEnergy > MaxTCEnergy) {
211 MaxTCEnergy = TCEnergy;
216 if (MaxTCId == -1000) {
217 B2DEBUG(20,
"No max TC is found.");
230 const double eventT0 =
235 if (gdlTimQuality == 1) {
238 }
else if (gdlTimQuality >= 2) {
245 int EnergyBinWidth = 20;
247 if (MaxTCEnergy >= 10 + EnergyBinWidth * idx &&
248 MaxTCEnergy <= 10 + EnergyBinWidth * (idx + 1)) {
249 IsMaxTCEnergy[idx] =
true;
254 for (
int binADC = 0 ; binADC <
NBinEventT0; binADC++) {
255 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...
TH1F * m_histMaxTCId
Max TC ID.
StoreObjPtr< EventT0 > m_eventT0
EventT0 data object.
TH1F * m_histEventTimingQuality
Event Timing Quality from TRGSummary.
TH1F * m_histMaxTCE
Max TC E.
virtual void initialize() override
Initialize the module.
static const int NBinEventT0
The number of EventT0 histogram for different max TC E region.
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.
TrgEclMapping * trgecl_map
ecl trigger map
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.
TRGECLEventTimingDQMModule()
Default constructor.
StoreArray< TRGECLUnpackerEvtStore > m_trgeclUnpackerEvtStores
Trg ECL UnpakcerEvtStore.
TH1F * m_histEventT0[NBinEventT0]
EventT0 for different max TC E region.
virtual void defineHisto() override
Defination of histograms.
int getTCThetaIdFromTCId(int)
get [TC Theta ID] from [TC ID]
REG_MODULE(arichBtest)
Register the Module.
Abstract base class for different kinds of events.