13#include <hlt/softwaretrigger/modules/dqm/CosmicRayHLTDQMModule.h>
16#include <framework/datastore/StoreArray.h>
18#include <mdst/dataobjects/Track.h>
19#include <ecl/dataobjects/ECLShower.h>
20#include <mdst/dataobjects/ECLCluster.h>
21#include <mdst/dataobjects/TrackFitResult.h>
22#include <mdst/dataobjects/HitPatternCDC.h>
23#include <klm/dataobjects/KLMHit2d.h>
25#include <TDirectory.h>
30using namespace SoftwareTrigger;
50 "Cosmic Ray DQM histograms on HLT will be put into this directory", std::string(
"CosmicRay_HLT"));
54CosmicRayHLTDQMModule::~CosmicRayHLTDQMModule()
61 TDirectory* oldDir = gDirectory;
64 h_d0 =
new TH1F(
"r0",
"Signed distance to the POCA in the r-phi plane", 100, -100, 100);
65 h_d0->SetXTitle(
"r0 (cm)");
66 h_z0 =
new TH1F(
"z0",
"z coordinate of the POCA", 100, -500, 500);
67 h_z0->SetXTitle(
"z0 (cm)");
68 h_phi0 =
new TH1F(
"phi0",
"Angle of the transverse momentum in the r-phi plane", 100, -1, 1);
69 h_phi0->SetXTitle(
"#phi0 (rad.)");
70 h_ncdchits =
new TH1F(
"ncdchits",
"Number of CDC hits associated to CDC track", 100, 0, 100);
72 h_pValue =
new TH1F(
"pValue",
"chi2 probability of the track fit", 100, 0, 1);
73 h_pValue->SetXTitle(
"chi2 Probability");
74 h_ntrk =
new TH1F(
"ntrk",
"number of charged tracks", 10, 0, 10);
76 h_p[0] =
new TH1F(
"px",
"track momentum in X direction", 100, -10, 10);
77 h_p[0]->SetXTitle(
"Px (GeV)");
78 h_p[1] =
new TH1F(
"py",
"track momentum in Y direction", 100, -10, 10);
79 h_p[1]->SetXTitle(
"Py (GeV)");
80 h_p[2] =
new TH1F(
"pz",
"track momentum in Z direction", 100, -10, 10);
81 h_p[2]->SetXTitle(
"Pz (GeV)");
82 h_p[3] =
new TH1F(
"p",
"track momentum", 100, 0, 20);
83 h_p[3]->SetXTitle(
"P (GeV)");
84 h_p[4] =
new TH1F(
"pt",
"transverse momentum of track", 100, 0, 20);
85 h_p[4]->SetXTitle(
"Pt (GeV)");
86 h_charge =
new TH1F(
"charge",
"the charge of track", 8, -1.5, 2.5);
90 h_ncluster =
new TH1F(
"neclcluster",
"number of ECL cluster", 30, 0, 30);
91 h_ncluster->SetXTitle(
"Number of ECL N1 Clusters");
92 h_e_eclcluster =
new TH1F(
"e_ecluster",
"energy of ECL cluster", 100, 0, 1.0);
94 h_phi_eclcluster =
new TH1F(
"phi_eclcluster",
"phi angle of ECLCluster position", 100, -3.2, 3.2);
96 h_theta_eclcluster =
new TH1F(
"theta_eclcluster",
"theta angle of ECLCluster position", 100, 0, 3.2);
98 h_E1oE9_eclcluster =
new TH1F(
"e1v9_eclcluster",
"the E1/E9 energy ratio", 100, 0., 1.);
100 h_Time_eclcluster =
new TH1F(
"Time_eclcluster",
"the ecl cluster time", 100, -1000., 1000.);
104 h_nshower =
new TH1F(
"neclshower",
"number of ECL showers", 30, 0, 30);
105 h_nshower->SetXTitle(
"Number of ECL N1 Showers");
106 h_time_eclshower =
new TH1F(
"time_eclshoer",
"the ECL shower time", 100, -1000., 1000.);
108 h_e_eclshower =
new TH1F(
"e_eshower",
"energy of ECL shower", 100, 0, 1.0);
112 h_nbklmhit =
new TH1F(
"nbklmhit",
"number of 2D hits on barrel KLM", 30, 0, 30);
114 h_layerId_bklmhit =
new TH1F(
"layerId_bklmhit",
"layer ID of 2D hits on barrel KLM", 18, 0, 18);
116 h_sectorId_bklmhit =
new TH1F(
"sectorId_bklmhit",
"sector ID of 2D hits on barrel KLM", 10, 0, 10);
118 h_neklmhit =
new TH1F(
"neklmhit",
"number of 2D hits on endcap KLM", 30, 0, 30);
120 h_layerId_eklmhit =
new TH1F(
"layerId_eklmhit",
"layer ID of 2D hits on endcap KLM", 18, 0, 18);
122 h_sectorId_eklmhit =
new TH1F(
"sectorId_eklmhit",
"sector ID of 2D hits on endcap KLM", 10, 0, 10);
139 if (tracks.isValid()) {
140 h_ntrk->Fill(tracks.getEntries());
141 for (
const auto& track : tracks) {
142 const auto* trackFit = track.getTrackFitResult(
Const::muon);
143 if (!trackFit)
continue;
144 h_d0->Fill(trackFit->getD0());
145 h_z0->Fill(trackFit->getZ0());
146 h_phi0->Fill(trackFit->getPhi0());
147 h_ncdchits->Fill(trackFit->getHitPatternCDC().getNHits());
148 h_p[0]->Fill((trackFit->getMomentum()).X());
149 h_p[1]->Fill((trackFit->getMomentum()).Y());
150 h_p[2]->Fill((trackFit->getMomentum()).Z());
151 h_p[3]->Fill((trackFit->getMomentum()).R());
152 h_p[4]->Fill((trackFit->getMomentum()).Rho());
153 h_pValue->Fill(trackFit->getPValue());
154 h_charge->Fill(trackFit->getChargeSign());
161 int nECLClusters = 0;
162 for (
const auto& eclCluster : eclClusters) {
179 for (
const auto& eclShower : eclShowers) {
195 for (
const auto& klmHit : klmHits) {
static const ChargedStable muon
muon particle
@ c_nPhotons
CR is split into n photons (N1)
@ c_nPhotons
CR is split into n photons (N1)
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 * h_pValue
chi2 probalility of the track fit
TH1F * h_sectorId_eklmhit
sector ID of hits in eKLM
TH1F * h_sectorId_bklmhit
sector ID of hits in bKLM
TH1F * h_ncdchits
Number of CDC hits associated to CDC track.
virtual void initialize() override
Module functions to be called from main process.
virtual void event() override
Module functions to be called from event process.
TH1F * h_layerId_eklmhit
layer ID of hits in eKLM
TH1F * h_d0
Signed distance to the POCA in the r-phi plane.
TH1F * h_theta_eclcluster
theta angle of ECLCluster position
TH1F * h_phi_eclcluster
phi angle of ECLCluster position
TH1F * h_phi0
Angle of the transverse momentum in the r-phi plane.
TH1F * h_charge
charge of track
CosmicRayHLTDQMModule()
Constructor / Destructor.
TH1F * h_layerId_bklmhit
layer ID of hits in bKLM
TH1F * h_e_eclcluster
energy of ECL cluster
TH1F * h_z0
z coordinate of the POCA
TH1F * h_nshower
number of ECL showers
TH1F * h_neklmhit
number of eKLM Hit
TH1F * h_ncluster
number of ecl clusters
TH1F * h_time_eclshower
time of ECL shower
TH1F * h_E1oE9_eclcluster
the E1/E9 energy ratio
std::string m_param_histogramDirectoryName
Directory to put the generated histograms.
TH1F * h_e_eclshower
energy of ECL shower
TH1F * h_ntrk
number of traks
TH1F * h_nbklmhit
number of bKLM Hit
TH1F * h_p[5]
momentum information of track
TH1F * h_Time_eclcluster
the ecl cluster time
virtual void defineHisto() override
Histogram definition.
Accessor to arrays stored in the data store.
bool isValid() const
Check wether the array was registered.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.