9 #include <pxd/modules/pxdDQM/PXDTrackClusterDQMModule.h>
10 #include <pxd/unpacking/PXDMappingLookup.h>
11 #include <pxd/geometry/SensorInfo.h>
12 #include <TDirectory.h>
30 setDescription(
"DQM for PXD Cluster matched to a Track");
31 setPropertyFlags(c_ParallelProcessingCertified);
33 addParam(
"histogramDirectoryName", m_histogramDirectoryName,
"Name of the directory where histograms will be placed",
34 std::string(
"PXDER"));
35 addParam(
"moreHistos", m_moreHistos,
"Fill additional histograms (not for ereco)",
false);
36 addParam(
"ASICHistos", m_ASICHistos,
"Fill additional histograms ASIC combination",
true);
46 m_recoTracks.isOptional(m_RecoTracksStoreArrayName);
47 m_tracks.isOptional(m_TracksStoreArrayName);
57 TDirectory* oldDir = gDirectory;
58 if (m_histogramDirectoryName !=
"") {
59 oldDir->mkdir(m_histogramDirectoryName.c_str());
60 oldDir->cd(m_histogramDirectoryName.c_str());
63 std::vector<VxdID> sensors = m_vxdGeometry.getListOfSensors();
64 for (
VxdID& avxdid : sensors) {
69 TString buff = (std::string)avxdid;
70 buff.ReplaceAll(
".",
"_");
72 m_trackClusterCharge[avxdid] =
new TH1F(
"PXD_Track_Cluster_Charge_" + buff,
"PXD Track Cluster Charge " + buff +
";Charge/ADU;",
75 m_trackClusterChargeUC[avxdid] =
new TH1F(
"PXD_Track_Cluster_Charge_UC_" + buff,
76 "PXD Track Cluster Charge (uncorrected)" + buff +
";Charge/ADU;", 100, 0, 100);
80 if (avxdid ==
VxdID(
"1.5.1")) {
81 for (
int s = 0; s < 6; s++) {
82 for (
int d = 0; d < 4; d++) {
83 m_trackASICClusterCharge[avxdid][s][d] =
new TH1F(
"PXD_Track_Cluster_Charge_" + buff + Form(
"_sw%d_dcd%d", s + 1, d + 1),
84 "PXD Track Cluster Charge " + buff + Form(
" sw%d dcd%d ", s + 1, d + 1) +
";Charge/ADU;", 100, 0, 100);
91 m_trackedClusters =
new TH1F(
"PXD_Tracked_Clusters",
"PXD_Tracked_Clusters", 64, 0, 64);
93 for (
auto i = 0; i < 64; i++) {
94 auto layer = (((i >> 5) & 0x1) + 1);
95 auto ladder = ((i >> 1) & 0xF);
96 auto sensor = ((i & 0x1) + 1);
101 m_vxd_to_dhe[id] = i;
111 for (
auto& it : m_trackClusterCharge)
if (it.second) it.second->Reset();
112 for (
auto& it : m_trackClusterChargeUC)
if (it.second) it.second->Reset();
113 if (m_trackedClusters) m_trackedClusters->Reset();
114 for (
const auto& it1 : m_trackASICClusterCharge) {
115 for (
const auto& it2 : it1.second) {
116 for (
const auto& it3 : it2) {
117 if (it3) it3->Reset();
126 if (m_trackedClusters) m_trackedClusters->Fill(-1);
127 for (
const Track& track : m_tracks) {
132 if (!recoTrack.
size())
continue;
136 double correction = 1.0;
137 if (tfr) correction = sin(tfr->
getMomentum().Theta());
138 for (
auto& cluster : pxdClustersTrack) {
139 m_trackedClusters->Fill(m_vxd_to_dhe[cluster.getSensorID()]);
140 if (m_trackClusterChargeUC[cluster.getSensorID()]) m_trackClusterChargeUC[cluster.getSensorID()]->Fill(cluster.getCharge());
141 if (tfr && m_trackClusterCharge[cluster.getSensorID()]) m_trackClusterCharge[cluster.getSensorID()]->Fill(
142 cluster.getCharge()*correction);
143 if (m_ASICHistos && tfr) {
145 if (cluster.getSensorID() ==
VxdID(
"1.5.1")) {
148 cluster.getSensorID());
153 h = m_trackASICClusterCharge[cluster.getSensorID()].at(s - 1).at(d - 1);
156 if (h) h->Fill(cluster.getCharge()*correction);
static const ChargedStable pion
charged pion particle
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
DQM of cluster in matched tracks.
void initialize() override final
Initialize.
void defineHisto() override final
Define histograms.
void event() override final
Event.
void beginRun() override final
Begin run.
static int getDCDID(const int u, const int v, const VxdID sensorID)
get ID of DCD for giving pixel, range: 1..4.
static int getSWBID(const int v)
get ID of SWB for giving pixel, range: 1..6.
Specific implementation of SensorInfo for PXD Sensors which provides additional pixel specific inform...
This is the Reconstruction Event-Data Model Track.
Class for type safe access to objects that are referred to in relations.
size_t size() const
Get number of relations.
Values of the result of a track fit with a given particle hypothesis.
TVector3 getMomentum() const
Getter for vector of momentum at closest approach of track in r/phi projection.
Class that bundles various TrackFitResults.
static GeoCache & getInstance()
Return a reference to the singleton instance.
static const SensorInfoBase & get(Belle2::VxdID id)
Return a reference to the SensorInfo of a given SensorID.
Base class to provide Sensor Information for PXD and SVD.
int getVCellID(double v, bool clamp=false) const
Return the corresponding pixel/strip ID of a given v coordinate.
int getUCellID(double u, double v=0, bool clamp=false) const
Return the corresponding pixel/strip ID of a given u coordinate.
Class to uniquely identify a any structure of the PXD and SVD.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Namespace to encapsulate code needed for simulation and reconstrucion of the PXD.
Abstract base class for different kinds of events.