9 #include <pxd/modules/pxdHelper/PXDROIPlotModule.h>
14 #include <boost/format.hpp>
32 setDescription(
"Plot ROIs on PXD Hit/Charge Maps and write pictures");
33 setPropertyFlags(c_ParallelProcessingCertified);
34 addParam(
"PXDRawHitsName", m_storeRawHitsName,
"The name of the StoreArray of PXDRawHits to be processed",
string(
""));
36 addParam(
"ROIsName", m_ROIsName,
"name of the list of ROIs (plotted in red)",
string(
"__unusedROIs__"));
37 addParam(
"DCROIsName", m_DCROIsName,
"name of the list of DatCon ROIs (optional, plotted in blue)",
string(
"__unusedROIs__"));
38 addParam(
"HLTROIsName", m_HLTROIsName,
"name of the list of HLT ROIs (optional, plotted in green)",
string(
"__unusedROIs__"));
39 addParam(
"Prefix", m_prefix,
"prefix for plots",
string(
""));
42 void PXDROIPlotModule::initialize()
44 m_eventMetaData.isRequired();
45 m_storeRawHits.isRequired(m_storeRawHitsName);
47 m_storeROIs.isOptional(m_ROIsName);
48 m_storeDCROIs.isOptional(m_DCROIsName);
49 m_storeHLTROIs.isOptional(m_HLTROIsName);
52 void PXDROIPlotModule::event()
54 unsigned int evtNr = m_eventMetaData->getEvent();
55 unsigned int evtRun = m_eventMetaData->getRun();
56 map <VxdID, bool> flag;
57 map <VxdID, vector <ROIid>> list;
58 map <VxdID, vector <ROIid>> listDC;
59 map <VxdID, vector <ROIid>> listHLT;
62 gStyle->SetPalette(55);
63 gStyle->SetOptStat(0);
64 c1 =
new TCanvas(
"c1",
"c1", 1200, 600);
65 TH2F* h =
new TH2F(
"ChargemapWithROIs",
"PXD Module Chargemap;VCell;UCell", 768, 0, 768, 250, 0, 250);
67 for (
auto& it : m_storeROIs) {
68 list[it.getSensorID()].push_back(it);
69 flag[it.getSensorID()] =
true;
71 for (
auto& it : m_storeDCROIs) {
72 listDC[it.getSensorID()].push_back(it);
73 flag[it.getSensorID()] =
true;
75 for (
auto& it : m_storeHLTROIs) {
76 listHLT[it.getSensorID()].push_back(it);
77 flag[it.getSensorID()] =
true;
80 for (
auto& f : flag) {
85 VxdID currentVxdId = f.first;
86 histoname = m_prefix + boost::str(boost::format(
"Run_%d_Evt_%d_") % evtRun % evtNr) + string(currentVxdId);
87 h->SetTitle(histoname.data());
89 for (
auto& pix : m_storeRawHits) {
91 if (currentVxdId != pix.getSensorID())
continue;
92 h->Fill(pix.getRow(), pix.getColumn(), pix.getCharge());
100 for (
auto& it : list[currentVxdId]) {
102 b =
new TBox(it.getMinVid(), it.getMinUid(), it.getMaxVid(), it.getMaxUid());
103 b->SetLineColorAlpha(kRed, 0.3);
109 for (
auto& it : listDC[currentVxdId]) {
111 b =
new TBox(it.getMinVid() + 0.7, it.getMinUid() + 0.7, it.getMaxVid() + 0.7, it.getMaxUid() + 0.7);
112 b->SetLineColorAlpha(kBlue, 0.3);
120 for (
auto& it : listHLT[currentVxdId]) {
122 b =
new TBox(it.getMinVid() - 0.7, it.getMinUid() - 0.7, it.getMaxVid() - 0.7, it.getMaxUid() - 0.7);
123 b->SetLineColorAlpha(kGreen, 0.3);
129 c1->Print((histoname +
".png").data());
130 c1->Print((histoname +
".root").data());
Plot each event with ROI and Pixels.
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.