1 #ifndef CONDCORE_SIPIXELPLUGINS_PIXELREGIONCONTAINERS_H 2 #define CONDCORE_SIPIXELPLUGINS_PIXELREGIONCONTAINERS_H 11 #include <boost/range/adaptor/indexed.hpp> 20 sprintf(
temp,
"%d",
i);
62 const std::vector<std::string>
IDlabels = {
"Barrel Pixel L1",
66 "FPIX(-) Disk 1 inner ring",
67 "FPIX(-) Disk 1 outer ring",
68 "FPIX(-) Disk 2 inner ring",
69 "FPIX(-) Disk 2 outer ring",
70 "FPIX(-) Disk 3 inner ring",
71 "FPIX(-) Disk 3 outer ring",
72 "FPIX(+) Disk 1 inner ring",
73 "FPIX(+) Disk 1 outer ring",
74 "FPIX(+) Disk 2 inner ring",
75 "FPIX(+) Disk 2 outer ring",
76 "FPIX(+) Disk 3 inner ring",
77 "FPIX(+) Disk 3 outer ring",
100 std::vector<std::string>
out;
103 if (
label.find(
"Barrel") != std::string::npos) {
108 if (
label.find(
"Ring") != std::string::npos) {
112 if (
label.find(
"ring") != std::string::npos) {
130 const unsigned int side,
131 const unsigned int disk,
132 const unsigned int ring) {
135 unsigned int prefix(2000);
136 unsigned int disk_(0);
156 unsigned int subid =
detId.subdetId();
157 unsigned int pixid = 0;
178 throw cms::Exception(
"LogicalError") <<
" there is not such phase as " <<
ph;
191 std::vector<uint32_t>
out = {};
197 m_fp =
edm::FileInPath(
"CalibTracker/SiPixelESProducers/data/PixelSkimmedGeometry.txt");
201 m_fp =
edm::FileInPath(
"SLHCUpgradeSimulations/Geometry/data/PhaseI/PixelSkimmedGeometry_phase1.txt");
204 m_fp =
edm::FileInPath(
"SLHCUpgradeSimulations/Geometry/data/PhaseII/Tilted/PixelSkimmedGeometryT14.txt");
207 throw cms::Exception(
"LogicalError") <<
" there is not such phase as " <<
ph;
211 const std::vector<uint32_t>& pxldetids = pxlreader.
getAllDetIds();
212 for (
const auto&
d : pxldetids) {
223 out.push_back(0xFFFFFFFF);
226 COUT <<
"ID:" << theId <<
" ";
270 for (
const auto& pixelId :
PixelIDs | boost::adaptors::indexed(0)) {
278 m_theMap[pixelId.value()] = std::make_shared<TH1F>((title_label +
itoa(pixelId.value())).c_str(),
280 (
IDlabels.at(pixelId.index())).c_str(),
291 void fill(
const unsigned int detid,
const float value) {
300 throw cms::Exception(
"LogicError") << detid <<
" :=> " << myId <<
" is not a recongnized PixelId enumerator! \n" 306 void draw(TCanvas& canv,
bool isBarrel,
const char*
option =
"bar2",
bool isPhase1Comparison =
false) {
309 if (canv.GetListOfPrimitives()->GetSize() == 0) {
313 for (
int j = 1;
j <= 4;
j++) {
317 canv.cd(
j)->SetLogy();
319 if ((
j == 4) && (
m_Phase < 1) && !isPhase1Comparison) {
326 t2.SetTextColor(kBlack);
327 t2.DrawLatexNDC(0.5, 0.5,
"Not in Phase-0!");
335 const std::array<int, 18> phase2Pattern = {{1, 2, 3, 4,
338 16, 17, 18, 19, 20}};
341 if (canv.GetListOfPrimitives()->GetSize() == 0) {
345 for (
int j = 1;
j <= maxPads;
j++) {
346 unsigned int mapIndex =
m_Phase == 2 ?
j + 15 :
j + 3;
351 canv.cd(
j)->SetLogy();
353 if ((
j % 6 == 5 ||
j % 6 == 0) && (
m_Phase < 1) && !isPhase1Comparison) {
360 t2.SetTextColor(kBlack);
361 t2.DrawLatexNDC(0.5, 0.5,
"Not in Phase-0!");
370 void beautify(
const int linecolor = kBlack,
const int fillcolor = kRed) {
372 plot.second->SetTitle(
"");
374 plot.second->GetYaxis()->SetRangeUser(0.,
plot.second->GetMaximum() * 1.30);
376 plot.second->GetYaxis()->SetRangeUser(0.1,
plot.second->GetMaximum() * 100.);
378 plot.second->SetLineColor(linecolor);
380 plot.second->SetFillColor(fillcolor);
382 plot.second->SetMarkerStyle(20);
383 plot.second->SetMarkerSize(1);
385 plot.second->SetStats(
true);
395 TPaveStats* st = (TPaveStats*)
plot.second->FindObject(
"stats");
397 st->SetTextSize(0.03);
398 st->SetLineColor(10);
399 if (
plot.second->GetFillColor() != 0) {
400 st->SetTextColor(
plot.second->GetFillColor());
402 st->SetTextColor(
plot.second->GetLineColor());
416 <<
"PixelRegionContainer::getHistoFromMap(): No histogram is available for PixelId: " << theId <<
"\n";
423 auto thePixId =
plot.first;
425 plot.second->GetYaxis()->SetRangeUser(extrema.first, extrema.second);
426 the2ndContainer.
getHistoFromMap(thePixId)->GetYaxis()->SetRangeUser(extrema.first, extrema.second);
std::map< PixelId, std::shared_ptr< TH1F > > m_theMap
unsigned int pxbLayer(const DetId &id) const
bool m_isTrackerTopologySet
std::string fullPath() const
unsigned int pxfBlade(const DetId &id) const
const std::vector< std::string > IDlabels
void rescaleMax(PixelRegionContainers &the2ndContainer)
std::string print(DetId detid) const
void beautify(const int linecolor=kBlack, const int fillcolor=kRed)
const TrackerTopology * m_trackerTopo
std::pair< float, float > getExtrema(TH1 *h1, TH1 *h2)
std::shared_ptr< TH1F > & getHistoFromMap(const PixelRegions::PixelId &theId)
void draw(TCanvas &canv, bool isBarrel, const char *option="bar2", bool isPhase1Comparison=false)
void setTheTopo(const TrackerTopology *t_topo)
unsigned int pxfDisk(const DetId &id) const
const std::vector< PixelId > PixelIDs
void fill(const unsigned int detid, const float value)
void adjustStats(TPaveStats *stats, float X1, float Y1, float X2, float Y2)
void bookAll(std::string title_label, std::string x_label, std::string y_label, const int nbins, const float xmin, const float xmax)
int ring(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
unsigned int pxfSide(const DetId &id) const
void makeNicePlotStyle(TH1 *hist)
static const std::vector< std::string > getIDLabels(const SiPixelPI::phase &ph, bool isBarrel)
const std::vector< uint32_t > & getAllDetIds() const
static const PixelId calculateFPixID(const SiPixelPI::phase &ph, const unsigned int side, const unsigned int disk, const unsigned int ring)
const TrackerTopology * getTheTopo()
static const PixelId detIdToPixelId(const unsigned int detid, const TrackerTopology *trackTopo, const SiPixelPI::phase &ph)
static const char disk_[]
static const std::vector< uint32_t > attachedDets(const PixelRegions::PixelId theId, const TrackerTopology *trackTopo, const SiPixelPI::phase &ph)
PixelRegionContainers(const TrackerTopology *t_topo, const SiPixelPI::phase &ph)
static const PixelId calculateBPixID(const unsigned int layer)