9#include <pxd/modules/pxdDQM/PXDGatedModeDQMModule.h>
10#include "TDirectory.h"
32 std::string(
"PXDINJ"));
46 TDirectory* oldDir = gDirectory;
50 hBunchInjHER =
new TH1F(
"hBunchInjHER",
"Last Inj Bunch HER;Counts;BunchNr/4", 1280, 0, 1280);
51 hBunchInjLER =
new TH1F(
"hBunchInjLER",
"Last Inj Bunch LER;Counts;BunchNr/4", 1280, 0, 1280);
52 hBunchTrg =
new TH1F(
"hBunchTrg",
"Triggered Bunch;Counts;BunchNr/4", 1280, 0, 1280);
56 for (
VxdID& avxdid : sensors) {
61 TString buff = (std::string)avxdid;
62 TString bufful = buff;
63 bufful.ReplaceAll(
".",
"_");
65 for (
int rgate =
m_perGate ? 0 : 96; rgate <= 96; rgate++) {
66 hGatedModeMapLER[std::make_pair(avxdid, rgate)] =
new TH2F(Form(
"PXDGatedModeMapLER_%d_", rgate) + bufful,
67 Form(
"PXDGatedModeMapLER %d ", rgate) + buff +
";U;V", 25, 0, 250, 192, 0, 768);
68 hGatedModeMapHER[std::make_pair(avxdid, rgate)] =
new TH2F(Form(
"PXDGatedModeMapHER_%d_", rgate) + bufful,
69 Form(
"PXDGatedModeMapHER %d ", rgate) + buff +
";U;V", 25, 0, 250, 192, 0, 768);
70 hGatedModeMapCutLER[std::make_pair(avxdid, rgate)] =
new TH2F(Form(
"PXDGatedModeMapCutLER_%d_", rgate) + bufful,
71 Form(
"PXDGatedModeMapCutLER %d ", rgate) + buff +
";U;V", 25, 0, 250, 192, 0, 768);
72 hGatedModeMapCutHER[std::make_pair(avxdid, rgate)] =
new TH2F(Form(
"PXDGatedModeMapCutHER_%d_", rgate) + bufful,
73 Form(
"PXDGatedModeMapCutHER %d ", rgate) + buff +
";U;V", 25, 0, 250, 192, 0, 768);
75 hGatedModeMapADCLER[std::make_pair(avxdid, rgate)] =
new TH2F(Form(
"PXDGatedModeMapADCLER_%d_", rgate) + bufful,
76 Form(
"PXDGatedModeMapADCLER %d ", rgate) + buff +
";U;V", 25, 0, 250, 192, 0, 768);
77 hGatedModeMapADCHER[std::make_pair(avxdid, rgate)] =
new TH2F(Form(
"PXDGatedModeMapADCHER_%d_", rgate) + bufful,
78 Form(
"PXDGatedModeMapADCHER %d ", rgate) + buff +
";U;V", 25, 0, 250, 192, 0, 768);
79 hGatedModeMapCutADCLER[std::make_pair(avxdid, rgate)] =
new TH2F(Form(
"PXDGatedModeMapCutADCLER_%d_", rgate) + bufful,
80 Form(
"PXDGatedModeMapCutADCLER %d ", rgate) + buff +
";U;V", 25, 0, 250, 192, 0, 768);
81 hGatedModeMapCutADCHER[std::make_pair(avxdid, rgate)] =
new TH2F(Form(
"PXDGatedModeMapCutADCHER_%d_", rgate) + bufful,
82 Form(
"PXDGatedModeMapCutADCHER %d ", rgate) + buff +
";U;V", 25, 0, 250, 192, 0, 768);
85 "PXDGatedModeProjLER " + buff +
";Gate;V", 96, 0, 96, 192, 0, 768);
87 "PXDGatedModeProjHER " + buff +
";Gate;V", 96, 0, 96, 192, 0, 768);
90 "PXDGatedModeMapSubLER " + buff +
";U;V-G", 25, 0, 250, 192, 0, 768);
92 "PXDGatedModeMapSubHER " + buff +
";U;V-G", 25, 0, 250, 192, 0, 768);
94 "PXDGatedModeMapAddLER " + buff +
";U;V+G", 25, 0, 250, 192, 0, 768);
96 "PXDGatedModeMapAddHER " + buff +
";U;V+G", 25, 0, 250, 192, 0, 768);
99 "PXDGatedModeProjADCLER " + buff +
";Gate;V", 96, 0, 96, 192, 0, 768);
101 "PXDGatedModeProjADCHER " + buff +
";Gate;V", 96, 0, 96, 192, 0, 768);
104 "PXDGatedModeMapSubADCLER " + buff +
";U;V-G", 25, 0, 250, 192, 0, 768);
106 "PXDGatedModeMapSubADCHER " + buff +
";U;V-G", 25, 0, 250, 192, 0, 768);
108 "PXDGatedModeMapAddADCLER " + buff +
";U;V+G", 25, 0, 250, 192, 0, 768);
110 "PXDGatedModeMapAddADCHER " + buff +
";U;V+G", 25, 0, 250, 192, 0, 768);
166 int bunch_inj = (bunch_trg - time_inj) % 1280;
167 if (bunch_inj < 0) bunch_inj += 1280;
168 int rgate = bunch_inj / (1280. / 96.);
176 auto charge = p.getCharge();
178 int v = int(p.getVCellID()) - rgate * 4;
180 int v2 = int(p.getVCellID()) + rgate * 4;
181 if (v2 >= 768) v2 -= 768;
185 h->Fill(p.getUCellID(), p.getVCellID());
189 h2->Fill(rgate, p.getVCellID());
193 h3->Fill(p.getUCellID(), v);
197 h4->Fill(p.getUCellID(), v2);
201 h5->Fill(p.getUCellID(), p.getVCellID(), p.getCharge());
205 h6->Fill(rgate, p.getVCellID(), p.getCharge());
209 h7->Fill(p.getUCellID(), v, p.getCharge());
213 h8->Fill(p.getUCellID(), v2, p.getCharge());
218 h->Fill(p.getUCellID(), p.getVCellID());
222 h2->Fill(rgate, p.getVCellID());
226 h3->Fill(p.getUCellID(), v);
230 h4->Fill(p.getUCellID(), v2);
234 h5->Fill(p.getUCellID(), p.getVCellID(), p.getCharge());
238 h6->Fill(rgate, p.getVCellID(), p.getCharge());
242 h7->Fill(p.getUCellID(), v, p.getCharge());
246 h8->Fill(p.getUCellID(), v2, p.getCharge());
255 h->Fill(p.getUCellID(), p.getVCellID());
259 h2->Fill(p.getUCellID(), p.getVCellID(), p.getCharge());
264 h->Fill(p.getUCellID(), p.getVCellID());
268 h2->Fill(p.getUCellID(), p.getVCellID(), p.getCharge());
279 h->Fill(p.getUCellID(), p.getVCellID());
283 h2->Fill(p.getUCellID(), p.getVCellID(), p.getCharge());
288 h->Fill(p.getUCellID(), p.getVCellID());
292 h2->Fill(p.getUCellID(), p.getVCellID(), p.getCharge());
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...
std::map< VxdID, TH2F * > hGatedModeProjLER
Histogram Occupancy after LER injection.
std::string m_PXDRawHitsName
The name of the StoreArray of PXDRawHits to be generated.
std::map< VxdID, TH2F * > hGatedModeProjHER
Histogram Occupancy after HER injection.
void initialize() override final
initialize function
bool m_perGate
make one plot per possible gate
PXDGatedModeDQMModule()
Constructor defining the parameters.
std::map< std::pair< VxdID, int >, TH2F * > hGatedModeMapHER
Histogram Occupancy after HER injection.
std::map< std::pair< VxdID, int >, TH2F * > hGatedModeMapADCLER
Histogram Occupancy after LER injection.
int m_minTimeCutLER
minimum time cut in us after LER kick
std::map< VxdID, TH2F * > hGatedModeMapSubHER
Histogram Occupancy after HER injection.
std::map< std::pair< VxdID, int >, TH2F * > hGatedModeMapLER
Histogram Occupancy after LER injection.
std::map< VxdID, TH2F * > hGatedModeMapAddADCHER
Histogram Occupancy after HER injection.
int m_outsideTimeCut
outside GM time cut in us after kick
void defineHisto() override final
defineHisto function
std::map< std::pair< VxdID, int >, TH2F * > hGatedModeMapADCHER
Histogram Occupancy after HER injection.
std::map< VxdID, TH2F * > hGatedModeMapSubADCLER
Histogram Occupancy after LER injection.
std::map< VxdID, TH2F * > hGatedModeMapAddLER
Histogram Occupancy after LER injection.
int m_maxTimeCutLER
maximum time cut in us after LER kick
int m_maxTimeCutHER
maximum time cut in us after HER kick
int m_chargeCut
minimum charge cut in ADU
void event() override final
event function
int m_minTimeCutHER
minimum time cut in us after HER kick
std::map< VxdID, TH2F * > hGatedModeProjADCLER
Histogram Occupancy after LER injection.
std::string m_histogramDirectoryName
Name of the histogram directory in ROOT file.
TH1F * hBunchInjLER
Histo for last LER injected bunches.
int m_chargeCutHigh
minimum charge cut for second set of histograms in ADU
std::map< VxdID, TH2F * > hGatedModeMapSubLER
Histogram Occupancy after LER injection.
std::map< std::pair< VxdID, int >, TH2F * > hGatedModeMapCutLER
Histogram Occupancy after LER injection.
std::map< VxdID, TH2F * > hGatedModeMapSubADCHER
Histogram Occupancy after HER injection.
void beginRun() override final
beginRun function
std::map< VxdID, TH2F * > hGatedModeMapAddADCLER
Histogram Occupancy after LER injection.
VXD::GeoCache & m_vxdGeometry
the VXD geometry
std::map< VxdID, TH2F * > hGatedModeMapAddHER
Histogram Occupancy after HER injection.
TH1F * hBunchTrg
Histo for triggered bunches.
std::map< VxdID, TH2F * > hGatedModeProjADCHER
Histogram Occupancy after HER injection.
StoreObjPtr< EventLevelTriggerTimeInfo > m_EventLevelTriggerTimeInfo
Object for TTD mdst object.
StoreArray< PXDRawHit > m_storeRawHits
Input array for PXD Raw Hits.
TH1F * hBunchInjHER
Histo for last HER injected bunches.
std::map< std::pair< VxdID, int >, TH2F * > hGatedModeMapCutHER
Histogram Occupancy after HER injection.
std::map< std::pair< VxdID, int >, TH2F * > hGatedModeMapCutADCLER
Histogram Occupancy after LER injection.
std::map< std::pair< VxdID, int >, TH2F * > hGatedModeMapCutADCHER
Histogram Occupancy after HER injection.
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
const std::vector< VxdID > getListOfSensors() const
Get list of all sensors.
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
Base class to provide Sensor Information for PXD and SVD.
Class to uniquely identify a any structure of the PXD and SVD.
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.
Namespace to encapsulate code needed for simulation and reconstrucion of the PXD.
Namespace to provide code needed by both Vertex Detectors, PXD and SVD, and also testbeam telescopes.
Abstract base class for different kinds of events.