10#include <trg/gdl/modules/trggdlDQM/TRGEFFDQMModule.h>
14#include <Math/Vector3D.h>
16#include <TDirectory.h>
19#include <mdst/dataobjects/HitPatternCDC.h>
43 TDirectory* oldDir = gDirectory;
44 oldDir->mkdir(
"TRGEFF");
47 m_hPhi =
new TH1F(
"hPhi",
"", 36, -180.0, 180.0);
48 m_hPhi_psnecl =
new TH1F(
"hPhi_psnecl",
"", 36, -180.0, 180.0);
51 m_hPt =
new TH1F(
"hPt",
"", 50, 0, 5);
52 m_hPt_psnecl =
new TH1F(
"hPt_psnecl",
"", 50, 0, 5);
53 m_hPt_psnecl_ftdf =
new TH1F(
"hPt_psnecl_ftdf",
"", 50, 0, 5);
55 m_nobha_f_phi =
new TH1F(
"nobha_f_phi",
"", 36, -180., 180.);
56 m_nobha_f_phi_psnecl =
new TH1F(
"nobha_f_phi_psnecl",
"", 36, -180., 180.);
57 m_nobha_f_phi_psnecl_ftdf =
new TH1F(
"nobha_f_phi_psnecl_ftdf",
"", 36, -180., 180.);
59 m_nobha_hPt =
new TH1F(
"nobha_hPt",
"", 50, 0, 5);
60 m_nobha_hPt_psnecl =
new TH1F(
"nobha_hPt_psnecl",
"", 50, 0, 5);
61 m_nobha_hPt_psnecl_ftdf =
new TH1F(
"nobha_hPt_psnecl_ftdf",
"", 50, 0, 5);
63 m_hP3_y =
new TH1F(
"hP3_y",
"", 50, 0, 5);
64 m_hP3_y_psnecl =
new TH1F(
"hP3_y_psnecl",
"", 50, 0, 5);
65 m_hP3_y_psnecl_ftdf =
new TH1F(
"hP3_y_psnecl_ftdf",
"", 50, 0, 5);
67 m_hP3_z =
new TH1F(
"hP3_z",
"", 50, 0, 5);
68 m_hP3_z_psnecl =
new TH1F(
"hP3_z_psnecl",
"", 50, 0, 5);
69 m_hP3_z_psnecl_ftdf =
new TH1F(
"hP3_z_psnecl_ftdf",
"", 50, 0, 5);
71 m_nobha_hP3_y =
new TH1F(
"nobha_hP3_y",
"", 50, 0, 5);
72 m_nobha_hP3_y_psnecl =
new TH1F(
"nobha_hP3_y_psnecl",
"", 50, 0, 5);
73 m_nobha_hP3_y_psnecl_ftdf =
new TH1F(
"nobha_hP3_y_psnecl_ftdf",
"", 50, 0, 5);
75 m_nobha_hP3_z =
new TH1F(
"nobha_hP3_z",
"", 50, 0, 5);
76 m_nobha_hP3_z_psnecl =
new TH1F(
"nobha_hP3_z_psnecl",
"", 50, 0, 5);
77 m_nobha_hP3_z_psnecl_ftdf =
new TH1F(
"nobha_hP3_z_psnecl_ftdf",
"", 50, 0, 5);
79 m_nobha_phi_y =
new TH1F(
"nobha_phi_y",
"", 36, -180., 180.);
80 m_nobha_phi_y_psnecl =
new TH1F(
"nobha_phi_y_psnecl",
"", 36, -180., 180.);
81 m_nobha_phi_y_psnecl_ftdf =
new TH1F(
"nobha_phi_y_psnecl_ftdf",
"", 36, -180., 180.);
83 m_nobha_phi_z =
new TH1F(
"nobha_phi_z",
"", 36, -180., 180.);
84 m_nobha_phi_z_psnecl =
new TH1F(
"nobha_phi_z_psnecl",
"", 36, -180., 180.);
85 m_nobha_phi_z_psnecl_ftdf =
new TH1F(
"nobha_phi_z_psnecl_ftdf",
"", 36, -180., 180.);
87 m_fyo_dphi =
new TH1F(
"fyo_dphi",
"", 18, 0., 180.);
88 m_fyo_dphi_psnecl =
new TH1F(
"fyo_dphi_psnecl",
"", 18, 0., 180.);
89 m_fyo_dphi_psnecl_ftdf =
new TH1F(
"fyo_dphi_psnecl_ftdf",
"", 18, 0., 180.);
91 m_nobha_fyo_dphi =
new TH1F(
"nobha_fyo_dphi",
"", 18, 0., 180.);
92 m_nobha_fyo_dphi_psnecl =
new TH1F(
"nobha_fyo_dphi_psnecl",
"", 18, 0., 180.);
93 m_nobha_fyo_dphi_psnecl_ftdf =
new TH1F(
"nobha_fyo_dphi_psnecl_ftdf",
"", 18, 0., 180.);
95 m_stt_phi =
new TH1F(
"stt_phi",
"", 36, -180., 180.);
96 m_stt_phi_psnecl =
new TH1F(
"stt_phi_psnecl",
"", 36, -180., 180.);
97 m_stt_phi_psnecl_ftdf =
new TH1F(
"stt_phi_psnecl_ftdf",
"", 36, -180., 180.);
99 m_stt_P3 =
new TH1F(
"stt_P3",
"", 50, 0, 5);
100 m_stt_P3_psnecl =
new TH1F(
"stt_P3_psnecl",
"", 50, 0, 5);
101 m_stt_P3_psnecl_ftdf =
new TH1F(
"stt_P3_psnecl_ftdf",
"", 50, 0, 5);
103 m_stt_theta =
new TH1F(
"stt_theta",
"", 18, 0, 180);
104 m_stt_theta_psnecl =
new TH1F(
"stt_theta_psnecl",
"", 18, 0, 180);
105 m_stt_theta_psnecl_ftdf =
new TH1F(
"stt_theta_psnecl_ftdf",
"", 18, 0, 180);
107 m_nobha_stt_phi =
new TH1F(
"nobha_stt_phi",
"", 36, -180., 180.);
108 m_nobha_stt_phi_psnecl =
new TH1F(
"nobha_stt_phi_psnecl",
"", 36, -180., 180.);
109 m_nobha_stt_phi_psnecl_ftdf =
new TH1F(
"nobha_stt_phi_psnecl_ftdf",
"", 36, -180., 180.);
111 m_nobha_stt_P3 =
new TH1F(
"nobha_stt_P3",
"", 50, 0, 5);
112 m_nobha_stt_P3_psnecl =
new TH1F(
"nobha_stt_P3_psnecl",
"", 50, 0, 5);
113 m_nobha_stt_P3_psnecl_ftdf =
new TH1F(
"nobha_stt_P3_psnecl_ftdf",
"", 50, 0, 5);
115 m_nobha_stt_theta =
new TH1F(
"nobha_stt_theta",
"", 18, 0, 180);
116 m_nobha_stt_theta_psnecl =
new TH1F(
"nobha_stt_theta_psnecl",
"", 18, 0, 180);
117 m_nobha_stt_theta_psnecl_ftdf =
new TH1F(
"nobha_stt_theta_psnecl_ftdf",
"", 18, 0, 180);
119 m_hie_E =
new TH1F(
"hie_E",
"", 60, 0, 12);
120 m_hie_E_psnecl =
new TH1F(
"hie_E_psnecl",
"", 60, 0, 12);
121 m_hie_E_psnecl_ftdf =
new TH1F(
"hie_E_psnecl_ftdf",
"", 60, 0, 12);
123 m_nobha_hie_E =
new TH1F(
"nobha_hie_E",
"", 60, 0, 12);
124 m_nobha_hie_E_psnecl =
new TH1F(
"nobha_hie_E_psnecl",
"", 60, 0, 12);
125 m_nobha_hie_E_psnecl_ftdf =
new TH1F(
"nobha_hie_E_psnecl_ftdf",
"", 60, 0, 12);
127 m_ecltiming_E =
new TH1F(
"ecltiming_E",
"", 60, 0, 12);
128 m_ecltiming_E_psnecl =
new TH1F(
"ecltiming_E_psnecl",
"", 60, 0, 12);
129 m_ecltiming_E_psnecl_ftdf =
new TH1F(
"ecltiming_E_psnecl_ftdf",
"", 60, 0, 12);
131 m_ecltiming_theta =
new TH1F(
"ecltiming_theta",
"", 18, 0, 180);
132 m_ecltiming_theta_psnecl =
new TH1F(
"ecltiming_theta_psnecl",
"", 18, 0, 180);
133 m_ecltiming_theta_psnecl_ftdf =
new TH1F(
"ecltiming_theta_psnecl_ftdf",
"", 18, 0, 180);
135 m_ecltiming_phi =
new TH1F(
"ecltiming_phi",
"", 36, -180., 180.);
136 m_ecltiming_phi_psnecl =
new TH1F(
"ecltiming_phi_psnecl",
"", 36, -180., 180.);
137 m_ecltiming_phi_psnecl_ftdf =
new TH1F(
"ecltiming_phi_psnecl_ftdf",
"", 36, -180., 180.);
139 m_klmhit_phi =
new TH1F(
"klmhit_phi",
"", 18, -180., 180.);
140 m_klmhit_phi_psnecl =
new TH1F(
"klmhit_phi_psnecl",
"", 18, -180., 180.);
141 m_klmhit_phi_psnecl_ftdf =
new TH1F(
"klmhit_phi_psnecl_ftdf",
"", 18, -180., 180.);
143 m_klmhit_theta =
new TH1F(
"klmhit_theta",
"", 18, 0, 180);
144 m_klmhit_theta_psnecl =
new TH1F(
"klmhit_theta_psnecl",
"", 18, 0, 180);
145 m_klmhit_theta_psnecl_ftdf =
new TH1F(
"klmhit_theta_psnecl_ftdf",
"", 18, 0, 180);
147 m_eklmhit_phi =
new TH1F(
"eklmhit_phi",
"", 18, -180., 180.);
148 m_eklmhit_phi_psnecl =
new TH1F(
"eklmhit_phi_psnecl",
"", 18, -180., 180.);
149 m_eklmhit_phi_psnecl_ftdf =
new TH1F(
"eklmhit_phi_psnecl_ftdf",
"", 18, -180., 180.);
151 m_eklmhit_theta =
new TH1F(
"eklmhit_theta",
"", 18, 0, 180);
152 m_eklmhit_theta_psnecl =
new TH1F(
"eklmhit_theta_psnecl",
"", 18, 0, 180);
153 m_eklmhit_theta_psnecl_ftdf =
new TH1F(
"eklmhit_theta_psnecl_ftdf",
"", 18, 0, 180);
169 B2WARNING(
"Missing Tracks array");
173 B2WARNING(
"Missing ECLCLuster array");
177 B2WARNING(
"Missing KLMCLuster array");
181 B2WARNING(
"Missing TRGSummary");
189 B2DEBUG(22,
"Missing recoTracks array in beginRun() ");
198 B2WARNING(
"TRGSummary object not available but require to estimate trg efficiency");
203 B2WARNING(
"SoftwareTriggerResult object not available but require to select bhabha/mumu/hadron events skim");
207 const std::map<std::string, int>& fresults =
m_TrgResult->getResults();
208 if ((fresults.find(
"software_trigger_cut&skim&accept_bhabha") == fresults.end())
209 || (fresults.find(
"software_trigger_cut&skim&accept_hadron") == fresults.end())) {
210 B2WARNING(
"TRGEFFDQMModule: Can't find required bhabha or mumu or hadron trigger identifier");
311 int nlayer = b2klmcluster.getLayers();
318 double theta = b2klmcluster.getMomentum().Theta() /
Unit::deg;
319 double phiDegree = b2klmcluster.getMomentum().Phi() /
Unit::deg;
328 }
catch (
const std::exception&) {
335 m_klmhit_phi->Fill(phiDegree);
336 m_klmhit_theta->Fill(theta);
337 m_eklmhit_phi->Fill(phiDegree);
338 m_eklmhit_theta->Fill(theta);
342 m_klmhit_theta_psnecl->Fill(theta);
344 m_eklmhit_theta_psnecl->Fill(theta);
346 if (trg_KLMecl && trg_klmhit) {
348 m_klmhit_theta_psnecl_ftdf->Fill(theta);
350 if (trg_KLMecl && trg_eklmhit) {
352 m_eklmhit_theta_psnecl_ftdf->Fill(theta);
356 if (trg_KLMecl && theta > 50 && theta < 120) {
357 m_klmhit_phi_psnecl->Fill(phiDegree);
359 if (trg_KLMecl && ((theta > 20 && theta < 40) || (theta > 120 && theta < 160))) {
360 m_eklmhit_phi_psnecl->Fill(phiDegree);
362 if (trg_KLMecl && trg_klmhit && theta > 50 && theta < 120) {
363 m_klmhit_phi_psnecl_ftdf->Fill(phiDegree);
365 if (trg_KLMecl && trg_eklmhit && ((theta > 20 && theta < 40) || (theta > 120 && theta < 160))) {
366 m_eklmhit_phi_psnecl_ftdf->Fill(phiDegree);
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...
void initialize() override
Initialize the Module.
TH1F * m_hPhi_psnecl_ftdf
Histogram of cdc phi of IP tracks with ecl and f bit.
virtual ~TRGEFFDQMModule()
Destructor.
void event() override
Event processor.
StoreObjPtr< TRGSummary > m_trgSummary
Trigger summary.
TH1F * m_hPhi_psnecl
Histogram of cdc phi of IP tracks with ecl bit.
void beginRun() override
Called when entering a new run.
StoreArray< ECLCluster > m_ECLClusters
ECL Clusters.
TH1F * m_hPhi
Histogram of cdc phi of IP tracks.
StoreArray< KLMCluster > m_KLMClusters
KLM Clusters.
StoreArray< RecoTrack > m_RecoTracks
RecoTracks.
StoreArray< Track > m_Tracks
Tracks.
TRGEFFDQMModule()
Constructor.
StoreObjPtr< SoftwareTriggerResult > m_TrgResult
Store array for Trigger selection.
void defineHisto() override
Histogram definitions.
static const double deg
degree to radians
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.