9 #include "pxd/modules/pxdDQM/PXDRawDQMCorrModule.h"
11 #include <framework/core/HistoModule.h>
13 #include <framework/datastore/StoreArray.h>
16 #include <boost/format.hpp>
20 #include "TDirectory.h"
39 setDescription(
"PXD DQM Correlation module");
40 setPropertyFlags(c_ParallelProcessingCertified);
41 addParam(
"PXDRawHitsName", m_storeRawHitsName,
"The name of the StoreArray of PXDRawHits to be processed",
string(
""));
42 addParam(
"histogramDirectoryName", m_histogramDirectoryName,
"Name of the directory where histograms will be placed",
43 std::string(
"pxdrawcorr"));
51 void PXDRawDQMCorrModule::defineHisto()
54 TDirectory* oldDir = gDirectory;
55 if (m_histogramDirectoryName !=
"") {
56 oldDir->mkdir(m_histogramDirectoryName.c_str());
57 oldDir->cd(m_histogramDirectoryName.c_str());
65 m_CorrelationU =
new TH2F(
"RawCorrelationU",
"Raw Correlation of U;U1/cells;U2/cells", nPixelsU1 + nPixelsU2, nPixelsU1, nPixelsU2,
66 nPixelsU1 + nPixelsU2, nPixelsU1, nPixelsU2);
67 m_CorrelationV =
new TH2F(
"RawCorrelationV",
"Raw Correlation of V;V1/cells;V2/cells", nPixelsV1 + nPixelsV2, nPixelsV1, nPixelsV2,
68 nPixelsV1 + nPixelsV2, nPixelsV1, nPixelsV2);
69 m_DeltaU =
new TH1F(
"RawDeltaU",
"Raw Correlation of U2-U1;Udiff/cells", 2 * nPixelsU1 + 2 * nPixelsU2, -nPixelsU2 + nPixelsU1,
70 nPixelsU2 - nPixelsU1);
71 m_DeltaV =
new TH1F(
"RawDeltaV",
"Raw Correlation of V2-V1;Vdiff/cells", 2 * nPixelsV1 + 2 * nPixelsV2, -nPixelsV2 + nPixelsV1,
72 nPixelsV2 - nPixelsV1);
74 m_In1CorrelationU =
new TH2F(
"RawIn1CorrelationU",
"Raw In1 Correlation of U;U1/cells;U2/cells", nPixelsU1 + nPixelsU2, nPixelsU1,
75 nPixelsU2, nPixelsU1 + nPixelsU2, nPixelsU1, nPixelsU2);
76 m_In1CorrelationV =
new TH2F(
"RawIn1CorrelationV",
"Raw In1 Correlation of V;V1/cells;V2/cells", nPixelsV1 + nPixelsV2, nPixelsV1,
77 nPixelsV2, nPixelsV1 + nPixelsV2, nPixelsV1, nPixelsV2);
78 m_In1DeltaU =
new TH1F(
"RawIn1DeltaU",
"Raw In1 Correlation of U2-U1;Udiff/cells", 2 * nPixelsU1 + 2 * nPixelsU2,
79 -nPixelsU2 + nPixelsU1, nPixelsU2 - nPixelsU1);
80 m_In1DeltaV =
new TH1F(
"RawIn1DeltaV",
"Raw In1 Correlation of V2-V1;Vdiff/cells", 2 * nPixelsV1 + 2 * nPixelsV2,
81 -nPixelsV2 + nPixelsV1, nPixelsV2 - nPixelsV1);
83 m_In2CorrelationU =
new TH2F(
"RawIn2CorrelationU",
"Raw In2 Correlation of U;U1/cells;U2/cells", nPixelsU1 + nPixelsU2, nPixelsU1,
84 nPixelsU2, nPixelsU1 + nPixelsU2, nPixelsU1, nPixelsU2);
85 m_In2CorrelationV =
new TH2F(
"RawIn2CorrelationV",
"Raw In2 Correlation of V;V1/cells;V2/cells", nPixelsV1 + nPixelsV2, nPixelsV1,
86 nPixelsV2, nPixelsV1 + nPixelsV2, nPixelsV1, nPixelsV2);
87 m_In2DeltaU =
new TH1F(
"RawIn2DeltaU",
"Raw In2 Correlation of U2-U1;Udiff/cells", 2 * nPixelsU1 + 2 * nPixelsU2,
88 -nPixelsU2 + nPixelsU1, nPixelsU2 - nPixelsU1);
89 m_In2DeltaV =
new TH1F(
"RawIn2DeltaV",
"Raw In2 Correlation of V2-V1;Vdiff/cells", 2 * nPixelsV1 + 2 * nPixelsV2,
90 -nPixelsV2 + nPixelsV1, nPixelsV2 - nPixelsV1);
97 void PXDRawDQMCorrModule::initialize()
102 m_storeRawHits.isRequired(m_storeRawHitsName);
105 void PXDRawDQMCorrModule::beginRun()
108 m_CorrelationU->Reset();
109 m_CorrelationV->Reset();
113 m_In1CorrelationU->Reset();
114 m_In1CorrelationV->Reset();
115 m_In1DeltaU->Reset();
116 m_In1DeltaV->Reset();
118 m_In2CorrelationU->Reset();
119 m_In2CorrelationV->Reset();
120 m_In2DeltaU->Reset();
121 m_In2DeltaV->Reset();
126 void PXDRawDQMCorrModule::event()
128 for (
auto& hit1 : m_storeRawHits) {
129 int iPlane1 = hit1.getSensorID().getLayerNumber();
131 for (
auto& hit2 : m_storeRawHits) {
132 int iPlane2 = hit2.getSensorID().getLayerNumber();
134 m_CorrelationU->Fill(hit1.getColumn(), hit2.getColumn());
135 m_CorrelationV->Fill(hit1.getRow(), hit2.getRow());
136 m_DeltaU->Fill(hit2.getColumn() - hit1.getColumn());
137 m_DeltaV->Fill(hit2.getRow() - hit1.getRow());
139 if (hit1.getColumn() != hit2.getColumn()) {
140 m_In1CorrelationU->Fill(hit1.getColumn(), hit2.getColumn());
141 m_In1DeltaU->Fill(hit2.getColumn() - hit1.getColumn());
143 if (hit1.getRow() != hit2.getRow()) {
144 m_In1CorrelationV->Fill(hit1.getRow(), hit2.getRow());
145 m_In1DeltaV->Fill(hit2.getRow() - hit1.getRow());
150 for (
auto& hit2 : m_storeRawHits) {
151 int iPlane2 = hit2.getSensorID().getLayerNumber();
153 if (hit1.getColumn() != hit2.getColumn()) {
154 m_In2CorrelationU->Fill(hit1.getColumn(), hit2.getColumn());
155 m_In2DeltaU->Fill(hit2.getColumn() - hit1.getColumn());
157 if (hit1.getRow() != hit2.getRow()) {
158 m_In2CorrelationV->Fill(hit1.getRow(), hit2.getRow());
159 m_In2DeltaV->Fill(hit2.getRow() - hit1.getRow());
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.