8 #include <hlt/softwaretrigger/modules/dqm/CosmicRayHLTDQMModule.h>
11 #include <framework/datastore/StoreArray.h>
13 #include <mdst/dataobjects/Track.h>
14 #include <ecl/dataobjects/ECLShower.h>
15 #include <mdst/dataobjects/ECLCluster.h>
16 #include <mdst/dataobjects/TrackFitResult.h>
17 #include <mdst/dataobjects/HitPatternCDC.h>
18 #include <klm/dataobjects/bklm/BKLMHit2d.h>
20 #include <TDirectory.h>
25 using namespace SoftwareTrigger;
41 setDescription(
"Monitor recontruction of cosmic ray on HLT");
42 setPropertyFlags(c_ParallelProcessingCertified);
44 addParam(
"histogramDirectoryName", m_param_histogramDirectoryName,
45 "Cosmic Ray DQM histograms on HLT will be put into this directory", std::string(
"CosmicRay_HLT"));
49 CosmicRayHLTDQMModule::~CosmicRayHLTDQMModule()
56 TDirectory* oldDir = gDirectory;
59 h_d0 =
new TH1F(
"r0",
"Signed distance to the POCA in the r-phi plane", 100, -100, 100);
60 h_d0->SetXTitle(
"r0 (cm)");
61 h_z0 =
new TH1F(
"z0",
"z coordinate of the POCA", 100, -500, 500);
62 h_z0->SetXTitle(
"z0 (cm)");
63 h_phi0 =
new TH1F(
"phi0",
"Angle of the transverse momentum in the r-phi plane", 100, -1, 1);
64 h_phi0->SetXTitle(
"#phi0 (rad.)");
65 h_ncdchits =
new TH1F(
"ncdchits",
"Number of CDC hits associated to CDC track", 100, 0, 100);
67 h_pValue =
new TH1F(
"pValue",
"chi2 probability of the track fit", 100, 0, 1);
68 h_pValue->SetXTitle(
"chi2 Probability");
69 h_ntrk =
new TH1F(
"ntrk",
"number of charged tracks", 10, 0, 10);
71 h_p[0] =
new TH1F(
"px",
"track momentum in X direction", 100, -10, 10);
72 h_p[0]->SetXTitle(
"Px (GeV)");
73 h_p[1] =
new TH1F(
"py",
"track momentum in Y direction", 100, -10, 10);
74 h_p[1]->SetXTitle(
"Py (GeV)");
75 h_p[2] =
new TH1F(
"pz",
"track momentum in Z direction", 100, -10, 10);
76 h_p[2]->SetXTitle(
"Pz (GeV)");
77 h_p[3] =
new TH1F(
"p",
"track momentum", 100, 0, 20);
78 h_p[3]->SetXTitle(
"P (GeV)");
79 h_p[4] =
new TH1F(
"pt",
"transverse momentum of track", 100, 0, 20);
80 h_p[4]->SetXTitle(
"Pt (GeV)");
81 h_charge =
new TH1F(
"charge",
"the charge of track", 8, -1.5, 2.5);
85 h_ncluster =
new TH1F(
"neclcluster",
"number of ECL cluster", 30, 0, 30);
86 h_ncluster->SetXTitle(
"Number of ECL N1 Clusters");
87 h_e_eclcluster =
new TH1F(
"e_ecluster",
"energy of ECL cluster", 100, 0, 1.0);
89 h_phi_eclcluster =
new TH1F(
"phi_eclcluster",
"phi angle of ECLCluster position", 100, -3.2, 3.2);
91 h_theta_eclcluster =
new TH1F(
"theta_eclcluster",
"theta angle of ECLCluster position", 100, 0, 3.2);
93 h_E1oE9_eclcluster =
new TH1F(
"e1v9_eclcluster",
"the E1/E9 energy ratio", 100, 0., 1.);
95 h_Time_eclcluster =
new TH1F(
"Time_eclcluster",
"the ecl cluster time", 100, -1000., 1000.);
99 h_nshower =
new TH1F(
"neclshower",
"number of ECL showers", 30, 0, 30);
100 h_nshower->SetXTitle(
"Number of ECL N1 Showers");
101 h_time_eclshower =
new TH1F(
"time_eclshoer",
"the ECL shower time", 100, -1000., 1000.);
103 h_e_eclshower =
new TH1F(
"e_eshower",
"energy of ECL shower", 100, 0, 1.0);
107 h_nbklmhit =
new TH1F(
"nbklmhit",
"number of 2D hits on barrel KLM", 30, 0, 30);
109 h_layerId_bklmhit =
new TH1F(
"layerId_bklmhit",
"layer ID of 2D hits on barrel KLM", 18, 0, 18);
111 h_sectorId_bklmhit =
new TH1F(
"sectorId_bklmhit",
"sector ID of 2D hits on barrel KLM", 10, 0, 10);
113 h_neklmhit =
new TH1F(
"neklmhit",
"number of 2D hits on endcap KLM", 30, 0, 30);
115 h_layerId_eklmhit =
new TH1F(
"layerId_eklmhit",
"layer ID of 2D hits on endcap KLM", 18, 0, 18);
117 h_sectorId_eklmhit =
new TH1F(
"sectorId_eklmhit",
"sector ID of 2D hits on endcap KLM", 10, 0, 10);
134 if (tracks.isValid()) {
135 h_ntrk->Fill(tracks.getEntries());
136 for (
const auto& track : tracks) {
137 const auto* trackFit = track.getTrackFitResult(
Const::muon);
138 if (!trackFit)
continue;
139 h_d0->Fill(trackFit->getD0());
140 h_z0->Fill(trackFit->getZ0());
141 h_phi0->Fill(trackFit->getPhi0());
142 h_ncdchits->Fill(trackFit->getHitPatternCDC().getNHits());
143 h_p[0]->Fill((trackFit->getMomentum()).Px());
144 h_p[1]->Fill((trackFit->getMomentum()).Py());
145 h_p[2]->Fill((trackFit->getMomentum()).Pz());
146 h_p[3]->Fill((trackFit->getMomentum()).Mag());
147 h_p[4]->Fill((trackFit->getMomentum()).Pt());
148 h_pValue->Fill(trackFit->getPValue());
149 h_charge->Fill(trackFit->getChargeSign());
156 int nECLClusters = 0;
157 for (
const auto& eclCluster : eclClusters) {
174 for (
const auto& eclShower : eclShowers) {
189 for (
const auto& bklmhit : bklmhits) {