12 #include <pxd/modules/pxdDQM/PXDTrackClusterDQMModule.h>
13 #include <pxd/unpacking/PXDMappingLookup.h>
14 #include <pxd/geometry/SensorInfo.h>
15 #include <TDirectory.h>
33 setDescription(
"DQM for PXD Cluster matched to a Track");
34 setPropertyFlags(c_ParallelProcessingCertified);
36 addParam(
"histogramDirectoryName", m_histogramDirectoryName,
"Name of the directory where histograms will be placed",
37 std::string(
"PXDER"));
38 addParam(
"moreHistos", m_moreHistos,
"Fill additional histograms (not for ereco)",
false);
39 addParam(
"ASICHistos", m_ASICHistos,
"Fill additional histograms ASIC combination",
true);
49 m_recoTracks.isOptional(m_RecoTracksStoreArrayName);
50 m_tracks.isOptional(m_TracksStoreArrayName);
60 TDirectory* oldDir = gDirectory;
61 if (m_histogramDirectoryName !=
"") {
62 oldDir->mkdir(m_histogramDirectoryName.c_str());
63 oldDir->cd(m_histogramDirectoryName.c_str());
66 std::vector<VxdID> sensors = m_vxdGeometry.getListOfSensors();
67 for (
VxdID& avxdid : sensors) {
72 TString buff = (std::string)avxdid;
73 buff.ReplaceAll(
".",
"_");
75 m_trackClusterCharge[avxdid] =
new TH1F(
"PXD_Track_Cluster_Charge_" + buff,
"PXD Track Cluster Charge " + buff +
";Charge/ADU;",
78 m_trackClusterChargeUC[avxdid] =
new TH1F(
"PXD_Track_Cluster_Charge_UC_" + buff,
79 "PXD Track Cluster Charge (uncorrected)" + buff +
";Charge/ADU;", 100, 0, 100);
83 if (avxdid ==
VxdID(
"1.5.1")) {
84 for (
int s = 0; s < 6; s++) {
85 for (
int d = 0; d < 4; d++) {
86 m_trackASICClusterCharge[avxdid][s][d] =
new TH1F(
"PXD_Track_Cluster_Charge_" + buff + Form(
"_sw%d_dcd%d", s + 1, d + 1),
87 "PXD Track Cluster Charge " + buff + Form(
" sw%d dcd%d ", s + 1, d + 1) +
";Charge/ADU;", 100, 0, 100);
94 m_trackedClusters =
new TH1F(
"PXD_Tracked_Clusters",
"PXD_Tracked_Clusters", 64, 0, 64);
96 for (
auto i = 0; i < 64; i++) {
97 auto layer = (((i >> 5) & 0x1) + 1);
98 auto ladder = ((i >> 1) & 0xF);
99 auto sensor = ((i & 0x1) + 1);
104 m_vxd_to_dhe[id] = i;
114 for (
auto& it : m_trackClusterCharge)
if (it.second) it.second->Reset();
115 for (
auto& it : m_trackClusterChargeUC)
if (it.second) it.second->Reset();
116 if (m_trackedClusters) m_trackedClusters->Reset();
117 for (
const auto& it1 : m_trackASICClusterCharge) {
118 for (
const auto& it2 : it1.second) {
119 for (
const auto& it3 : it2) {
120 if (it3) it3->Reset();
129 if (m_trackedClusters) m_trackedClusters->Fill(-1);
130 for (
const Track& track : m_tracks) {
135 if (!recoTrack.
size())
continue;
139 double correction = 1.0;
140 if (tfr) correction = sin(tfr->
getMomentum().Theta());
141 for (
auto& cluster : pxdClustersTrack) {
142 m_trackedClusters->Fill(m_vxd_to_dhe[cluster.getSensorID()]);
143 if (m_trackClusterChargeUC[cluster.getSensorID()]) m_trackClusterChargeUC[cluster.getSensorID()]->Fill(cluster.getCharge());
144 if (tfr && m_trackClusterCharge[cluster.getSensorID()]) m_trackClusterCharge[cluster.getSensorID()]->Fill(
145 cluster.getCharge()*correction);
146 if (m_ASICHistos && tfr) {
148 if (cluster.getSensorID() ==
VxdID(
"1.5.1")) {
151 cluster.getSensorID());
156 h = m_trackASICClusterCharge[cluster.getSensorID()].at(s - 1).at(d - 1);
159 if (h) h->Fill(cluster.getCharge()*correction);