8 #ifndef TRCGDLDQMMODULE_h
9 #define TRCGDLDQMMODULE_h
11 #include <framework/core/HistoModule.h>
12 #include <trg/gdl/dataobjects/TRGGDLUnpackerStore.h>
13 #include <trg/gdl/modules/trggdlUnpacker/trggdlUnpackerModule.h>
14 #include <trg/gdl/TrgBit.h>
15 #include <framework/database/DBObjPtr.h>
16 #include <trg/gdl/dbobjects/TRGGDLDBUnpacker.h>
17 #include <mdst/dbobjects/TRGGDLDBInputBits.h>
18 #include <mdst/dbobjects/TRGGDLDBFTDLBits.h>
23 #include "trg/ecl/TrgEclMapping.h"
24 #include <ecl/dataobjects/ECLDigit.h>
25 #include <ecl/dataobjects/ECLCalDigit.h>
26 #include <mdst/dataobjects/SoftwareTriggerResult.h>
27 #include <mdst/dataobjects/Track.h>
28 #include <mdst/dataobjects/HitPatternCDC.h>
29 #include <mdst/dataobjects/ECLCluster.h>
30 #include "trg/ecl/dataobjects/TRGECLCluster.h"
54 virtual void event()
override;
56 virtual void endRun()
override;
64 static const int nskim_gdldqm = 11;
65 int start_skim_gdldqm = 0;
66 int end_skim_gdldqm = 0;
105 TH1I*
h_itd[nskim_gdldqm] = {
nullptr};
106 TH1I* h_itd_rise[N_BITS_RESERVED][nskim_gdldqm] = {{
nullptr}};
107 TH1I* h_itd_fall[N_BITS_RESERVED][nskim_gdldqm] = {{
nullptr}};
109 TH1I*
h_ftd[nskim_gdldqm] = {
nullptr};
110 TH1I* h_ftd_rise[N_BITS_RESERVED][nskim_gdldqm] = {{
nullptr}};
111 TH1I* h_ftd_fall[N_BITS_RESERVED][nskim_gdldqm] = {{
nullptr}};
113 TH1I*
h_psn[nskim_gdldqm] = {
nullptr};
114 TH1I* h_psn_rise[N_BITS_RESERVED][nskim_gdldqm] = {{
nullptr}};
115 TH1I* h_psn_fall[N_BITS_RESERVED][nskim_gdldqm] = {{
nullptr}};
116 TH1I* h_psn_extra[nskim_gdldqm] = {
nullptr};
117 TH1I* h_psn_extra_fast[nskim_gdldqm] = {
nullptr};
118 TH1I* h_psn_effect_to_l1[nskim_gdldqm] = {
nullptr};
119 TH1I* h_psn_raw_rate[nskim_gdldqm] = {
nullptr};
120 TH1I* h_psn_pure_extra[nskim_gdldqm] = {
nullptr};
123 std::vector<int> h_0_vec;
125 std::vector<int> h_p_vec;
127 std::vector<int> h_f_vec;
129 std::vector<int> h_i_vec;
131 TDirectory* oldDir =
nullptr;
132 TDirectory* dirDQM =
nullptr;
134 bool m_eventByEventTimingHistRecord;
136 bool m_bitNameOnBinLabel;
137 bool m_generatePostscript;
138 unsigned m_vcdEventStart = 0;
139 unsigned m_vcdNumberOfEvents = 0;
140 std::string m_bitConditionToDumpVcd;
141 std::string m_postScriptName;
142 void fillRiseFallTimings(
void);
143 void fillOutputExtra(
void);
144 void fillOutputOverlap(
void);
145 void fillOutputPureExtra(
void);
148 bool anaBitCondition(
void);
149 bool isFired(std::string bitname);
150 bool isFired_quick(
const std::string& bitname,
const bool& isPsnm);
151 int getinbitnum(
const char* c)
const;
152 int getoutbitnum(
const char* c)
const;
153 unsigned n_clocks = 0;
157 std::vector<int> skim;
159 static const int n_output_extra = 105;
160 static const char* output_extra[n_output_extra];
161 static const int n_output_overlap = 130;
162 static const char* output_overlap[n_output_overlap];
163 static const int n_output_pure_extra = 13;
164 static const char* output_pure_extra[n_output_pure_extra];
165 static const int nsample_fast = 500;
166 int array_psn_extra_fast[nskim_gdldqm][nsample_fast][n_output_extra] = {{{0}}};
169 DBObjPtr<TRGGDLDBUnpacker> m_unpacker;
170 int LeafBitMap[320] = {0};
171 char LeafNames[320][100] = {{0}};
175 int _e_toptiming = 0;
176 int _e_ecltiming = 0;
177 int _e_cdctiming = 0;
181 int ee_psn[10] = {0};
182 int ee_ftd[10] = {0};
183 int ee_itd[10] = {0};
185 int n_leafsExtra = 0;
188 int nword_output = 0;
191 DBObjPtr<TRGGDLDBInputBits>m_dbinput;
192 unsigned n_inbit = 0;
193 char inbitname[320][100] = {
""};
196 DBObjPtr<TRGGDLDBFTDLBits> m_dbftdl;
197 unsigned n_outbit = 0;
198 char outbitname[320][100] = {
""};
202 std::string skim_menu[nskim_gdldqm] = {
204 "software_trigger_cut&skim&accept_hadron",
205 "software_trigger_cut&skim&accept_tau_tau",
206 "software_trigger_cut&skim&accept_mumu_1trk",
207 "software_trigger_cut&skim&accept_mumu_2trk",
208 "software_trigger_cut&skim&accept_gamma_gamma",
209 "software_trigger_cut&skim&accept_bhabha",
210 "software_trigger_cut&skim&accept_hadronb",
211 "software_trigger_cut&skim&accept_hadronb1",
212 "software_trigger_cut&skim&accept_hadronb2",
213 "software_trigger_cut&skim&accept_mumutight"
217 std::string skim_smap[nskim_gdldqm] = {
234 TrgEclMapping* trgeclmap =
nullptr;
237 StoreArray<TRGGDLUnpackerStore> entAry;
240 StoreObjPtr<EventMetaData> bevt;
243 StoreObjPtr<SoftwareTriggerResult> result_soft;
246 StoreArray<Track> Tracks;
250 StoreArray<ECLCalDigit> m_ECLCalDigitData;
251 StoreArray<ECLDigit> m_ECLDigitData;
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
virtual ~TRGGDLDQMModule()
Destrunctor.
TH1I * h_c8_cdcTogdlL1[nskim_gdldqm]
timestamp diff from t0(cdc) to gdlL1 in LSB8nsec
TH1I * h_c8_eclTogdlL1[nskim_gdldqm]
timestamp diff from t0(ecl) to gdlL1 in LSB8nsec
virtual void terminate() override
terminate
TH1I * h_c8_topTogdlL1[nskim_gdldqm]
timestamp diff from t0(top) to gdlL1 in LSB8nsec
virtual void initialize() override
initialize
TH1I * h_c8_eclToGDL[nskim_gdldqm]
timestamp diff from t0(ecl) to GDL in LSB8nsec
TRGGDLDQMModule()
Costructor.
virtual void event() override
Event.
TH1D * h_ns_topTocdc[nskim_gdldqm]
timestamp diff from top_timing to cdc_timing in nsec
TH1I * h_ftd[nskim_gdldqm]
ftd bits
virtual void endRun() override
End Run.
TH1D * h_ns_cdcToecl[nskim_gdldqm]
timestamp diff from cdc_timing to ecl_timing in nsec
TH1I * h_c8_ecl8mToGDL[nskim_gdldqm]
timestamp diff from fit on fam to GDL in LSB8nsec
TH1I * h_c2_cdcToecl[nskim_gdldqm]
timestamp from cdc_timing to ecl_timing to L1 in LSB2nsec
TH1I * h_c8_gdlL1TocomL1[nskim_gdldqm]
timestamp diff from gdlL1 to comL1 in LSB8nsec
TH1D * h_ns_cdcTocomL1[nskim_gdldqm]
timestamp diff from cdc_timing to comL1 in nsec
virtual void beginRun() override
begin Run
TH1I * h_c2_cdcTocomL1[nskim_gdldqm]
timestamp diff from cdc_timing to comL1 in LSB2nsec
TH1I * h_c8_topToGDL[nskim_gdldqm]
timestamp diff from t0(top) to GDL in LSB8nsec
TH1I * h_psn[nskim_gdldqm]
psn bits
TH1D * h_ns_topToecl[nskim_gdldqm]
timestamp diff from top_timing to ecl_timing in nsec
TH1I * h_itd[nskim_gdldqm]
input bits
TH1D * h_ns_cdcTogdlL1[nskim_gdldqm]
timestamp diff from cdc_timing to gdlL1 in nsec
TH1I * h_timtype[nskim_gdldqm]
timtype
TH1I * h_c8_cdcToGDL[nskim_gdldqm]
timestamp diff from t0(cdc) to GDL in LSB8nsec
virtual void defineHisto() override
Define Histogram.
Abstract base class for different kinds of events.