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>
20#include <unordered_map>
26#include "trg/ecl/TrgEclMapping.h"
27#include <ecl/dataobjects/ECLDigit.h>
28#include <ecl/dataobjects/ECLCalDigit.h>
29#include <mdst/dataobjects/SoftwareTriggerResult.h>
30#include <mdst/dataobjects/Track.h>
31#include <mdst/dataobjects/HitPatternCDC.h>
32#include <mdst/dataobjects/ECLCluster.h>
33#include "trg/ecl/dataobjects/TRGECLCluster.h"
57 virtual void event()
override;
59 virtual void endRun()
override;
68 int start_skim_gdldqm = 0;
69 int end_skim_gdldqm = 0;
109 TH1I* h_itd_rise[N_BITS_RESERVED][
nskim_gdldqm] = {{
nullptr}};
110 TH1I* h_itd_fall[N_BITS_RESERVED][
nskim_gdldqm] = {{
nullptr}};
113 TH1I* h_ftd_rise[N_BITS_RESERVED][
nskim_gdldqm] = {{
nullptr}};
114 TH1I* h_ftd_fall[N_BITS_RESERVED][
nskim_gdldqm] = {{
nullptr}};
117 TH1I* h_psn_rise[N_BITS_RESERVED][
nskim_gdldqm] = {{
nullptr}};
118 TH1I* h_psn_fall[N_BITS_RESERVED][
nskim_gdldqm] = {{
nullptr}};
126 std::vector<int> h_0_vec;
128 std::vector<int> h_p_vec;
134 TDirectory* oldDir =
nullptr;
135 TDirectory* dirDQM =
nullptr;
137 bool m_eventByEventTimingHistRecord;
139 bool m_bitNameOnBinLabel;
140 bool m_generatePostscript;
141 unsigned m_vcdEventStart = 0;
142 unsigned m_vcdNumberOfEvents = 0;
143 std::string m_bitConditionToDumpVcd;
144 std::string m_postScriptName;
145 void fillRiseFallTimings(
void);
146 void fillOutputExtra(
void);
147 void fillOutputOverlap(
void);
148 void fillOutputPureExtra(
void);
151 bool anaBitCondition(
void);
152 bool isFired(std::string bitname);
153 bool isFired_quick(
const std::string& bitname,
const bool& isPsnm);
154 int getinbitnum(
const char* c)
const;
155 int getoutbitnum(
const char* c)
const;
167 unsigned n_clocks = 0;
171 std::vector<int> skim;
173 static const int n_output_extra = 105;
174 static const char* output_extra[n_output_extra];
175 static const int n_output_overlap = 130;
176 static const char* output_overlap[n_output_overlap];
177 static const int n_output_pure_extra = 13;
178 static const char* output_pure_extra[n_output_pure_extra];
190 int LeafBitMap[320] = {0};
191 char LeafNames[320][100] = {{0}};
195 int _e_toptiming = 0;
196 int _e_ecltiming = 0;
197 int _e_cdctiming = 0;
201 int ee_psn[10] = {0};
202 int ee_ftd[10] = {0};
203 int ee_itd[10] = {0};
205 int n_leafsExtra = 0;
208 int nword_output = 0;
212 unsigned n_inbit = 0;
213 char inbitname[320][100] = {
""};
217 unsigned n_outbit = 0;
218 char outbitname[320][100] = {
""};
224 "software_trigger_cut&skim&accept_hadron",
225 "software_trigger_cut&skim&accept_tau_tau",
226 "software_trigger_cut&skim&accept_mumu_1trk",
227 "software_trigger_cut&skim&accept_mumu_2trk",
228 "software_trigger_cut&skim&accept_gamma_gamma",
229 "software_trigger_cut&skim&accept_bhabha",
230 "software_trigger_cut&skim&accept_hadronb",
231 "software_trigger_cut&skim&accept_hadronb1",
232 "software_trigger_cut&skim&accept_hadronb2",
233 "software_trigger_cut&skim&accept_mumutight"
Class for accessing objects in the database.
HistoModule()
Constructor.
Accessor to arrays stored in the data store.
Type-safe access to single objects in the data store.
std::string skim_menu[nskim_gdldqm]
name of skim from hlt/softwaretrigger/scripts/softwaretrigger/db_access.py
virtual ~TRGGDLDQMModule()
Destrunctor.
int m_evtLeaf
position of the "evt" leaf in m_unpackername, -1 if absent
TH1I * h_c8_cdcTogdlL1[nskim_gdldqm]
timestamp diff from t0(cdc) to gdlL1 in LSB8nsec
std::vector< char > m_firedFtdl
per-event cache: ftdl output bit fired in at least one clock cycle
std::vector< char > m_firedInput
per-event cache: input bit fired in at least one clock cycle
StoreObjPtr< SoftwareTriggerResult > result_soft
Input store array of HLT.
int m_fastPos[nskim_gdldqm]
ring-buffer index of the newest slot of array_psn_extra_fast
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()
Constructor.
static const int nskim_gdldqm
number of skims
virtual void event() override
Event.
TH1D * h_ns_topTocdc[nskim_gdldqm]
timestamp diff from top_timing to cdc_timing in nsec
StoreArray< Track > Tracks
Input store array of track.
TH1I * h_ftd[nskim_gdldqm]
ftd bits
DBObjPtr< TRGGDLDBFTDLBits > m_dbftdl
condition database for output bits
virtual void endRun() override
End Run.
static const int nsample_fast
number of sample for fast efficiency monitor
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
int array_psn_extra_fast[nskim_gdldqm][nsample_fast][n_output_extra]
array to store past nsample events
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
std::vector< int > h_i_vec
event by event input timing distribution
std::string skim_smap[nskim_gdldqm]
name of histograms
StoreObjPtr< EventMetaData > bevt
Input store array of metadata.
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
std::vector< int > h_f_vec
event by event ftdl timing distribution
int m_fastSum[nskim_gdldqm][n_output_extra]
running sum of array_psn_extra_fast over the whole ring
int m_clkLeaf
position of the "clk" leaf in m_unpackername
std::vector< std::pair< int, int > > m_leafMap
(position in m_unpacker, leaf number) for every mapped leaf
std::unordered_map< std::string, int > m_outbitIndex
bit name -> output bit number, built once in initialize()
TrgEclMapping * trgeclmap
ecltrg<->ecl mappint
std::unordered_map< std::string, int > m_inbitIndex
bit name -> input bit number, built once in initialize()
DBObjPtr< TRGGDLDBInputBits > m_dbinput
condition database for input bits
StoreArray< TRGGDLUnpackerStore > entAry
Input store array of GDL data.
TH1I * h_psn[nskim_gdldqm]
psn bits
DBObjPtr< TRGGDLDBUnpacker > m_unpacker
condition database for unpacker
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
bool m_leavesResolved
whether the leaf positions below are valid for the current run
TH1I * h_timtype[nskim_gdldqm]
timtype
std::vector< char > m_firedPsnm
per-event cache: psnm output bit fired in at least one clock cycle
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.