9#include <pxd/modules/pxdHelper/PXDROIPlotModule.h>
14#include <boost/format.hpp>
32 setDescription(
"Plot ROIs on PXD Hit/Charge Maps and write pictures");
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__"));
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);
68 list[it.getSensorID()].push_back(it);
69 flag[it.getSensorID()] =
true;
72 listDC[it.getSensorID()].push_back(it);
73 flag[it.getSensorID()] =
true;
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());
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());
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...
void initialize() override final
Initialize.
StoreArray< ROIid > m_storeROIs
Storearray for ROIs
std::string m_prefix
prefix for plot names
std::string m_DCROIsName
DC ROIs StoreArray name.
std::string m_storeRawHitsName
PXDRawHits StoreArray name.
PXDROIPlotModule()
Constructor defining the parameters.
StoreObjPtr< EventMetaData > m_eventMetaData
Event Metadata StorePtr.
void event() override final
Event.
std::string m_ROIsName
ROIs StoreArray name.
StoreArray< ROIid > m_storeDCROIs
Storearray for ROIs (DC)
StoreArray< PXDRawHit > m_storeRawHits
Storearray for raw pixels
std::string m_HLTROIsName
HLT ROIs StoreArray name.
StoreArray< ROIid > m_storeHLTROIs
Storearray for ROIs (HLT)
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.
Abstract base class for different kinds of events.