CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
Phase1PixelROCMaps Class Reference

#include <Phase1PixelROCMaps.h>

Public Member Functions

void drawBarrelMaps (TCanvas &canvas, const std::string &text="")
 
void drawForwardMaps (TCanvas &canvas, const std::string &text="")
 
void drawMaps (TCanvas &canvas, const std::string &text="")
 
void fillSelectedRocs (const uint32_t &detid, const std::bitset< 16 > &theROCs, double value)
 
void fillWholeModule (const uint32_t &detid, double value)
 
DetCoordinates findDetCoordinates (const uint32_t &t_detid)
 
std::array< std::shared_ptr< TH2D >, 4 > getLayerMaps ()
 
std::array< std::shared_ptr< TH2D >, 2 > getRingMaps ()
 
 Phase1PixelROCMaps (const char *option, const std::string &zAxisTitle="")
 
 ~Phase1PixelROCMaps ()
 

Protected Member Functions

bool isBPixOuterLadder (const DetId &detid, bool isPhase0)
 
int quadrant (const DetId &detid, bool phase_)
 
int ring (const DetId &detid, bool phase_)
 
int signed_blade (const DetId &detid, bool phase_)
 
int signed_blade_panel (const DetId &detid, bool phase_)
 
int signed_disk (const DetId &detid, bool phase_)
 
int signed_ladder (const DetId &detid, bool phase_)
 
int signed_module (const DetId &detid, bool phase_)
 

Private Member Functions

std::vector< std::pair< int, int > > maskedBarrelRocsToBins (DetCoordinates coord)
 
std::vector< std::tuple< int, int, int > > maskedBarrelRocsToBins (DetCoordinates coord, std::bitset< 16 > myRocs)
 
std::vector< std::pair< int, int > > maskedForwardRocsToBins (DetCoordinates coord)
 
std::vector< std::tuple< int, int, int > > maskedForwardRocsToBins (DetCoordinates coord, std::bitset< 16 > myRocs)
 

Private Attributes

std::array< std::shared_ptr< TH2D >, n_layersh_bpix_maps
 
std::array< std::shared_ptr< TH2D >, n_ringsh_fpix_maps
 
Option_t * m_option
 
TrackerTopology m_trackerTopo
 
std::string m_zAxisTitle
 
const int nlad_list [n_layers] = {6, 14, 22, 32}
 
const int nxbins_list [n_rings] = {11, 17}
 
const int nybins_list [n_rings] = {92, 140}
 

Static Private Attributes

static constexpr const char * kVerbose = "verbose"
 
static constexpr int n_layers = 4
 
static constexpr int n_rings = 2
 
static constexpr int numColumns = 416
 
static constexpr int numRows = 160
 

Detailed Description

Definition at line 81 of file Phase1PixelROCMaps.h.

Constructor & Destructor Documentation

◆ Phase1PixelROCMaps()

Phase1PixelROCMaps::Phase1PixelROCMaps ( const char *  option,
const std::string &  zAxisTitle = "" 
)
inline

Definition at line 83 of file Phase1PixelROCMaps.h.

84  : m_option{option},
85  m_zAxisTitle{zAxisTitle},
87  edm::FileInPath("Geometry/TrackerCommonData/data/PhaseI/trackerParameters.xml").fullPath())} {
88  // --------------------- BOOK HISTOGRAMS
89  // barrel
90  for (unsigned int lay = 1; lay <= n_layers; lay++) {
91  int nlad = nlad_list[lay - 1];
92  std::string name = "occ_Layer_" + std::to_string(lay);
93  std::string title = "; Module # ; Ladder #";
94 
95  // if a z-axis title is specified, add the z-axis title
96  if (!m_zAxisTitle.empty()) {
97  title += fmt::sprintf(" ;%s", m_zAxisTitle.c_str());
98  }
99 
100  h_bpix_maps[lay - 1] = std::make_shared<TH2D>(
101  name.c_str(), title.c_str(), 72, -n_layers - 0.5, n_layers + 0.5, (nlad * 4 + 2), -nlad - 0.5, nlad + 0.5);
102  }
103 
104  // endcaps
105  for (unsigned int ring = 1; ring <= n_rings; ring++) {
106  int n = nybins_list[ring - 1];
107  float y = nxbins_list[ring - 1] + 0.5;
108  std::string name = "occ_ring_" + std::to_string(ring);
109  std::string title = "; Disk # ; Blade/Panel #";
110 
111  // if a z-axis title is specified, add the z-axis title
112  if (!m_zAxisTitle.empty()) {
113  title += fmt::sprintf(" ;%s", m_zAxisTitle.c_str());
114  }
115 
116  h_fpix_maps[ring - 1] =
117  std::make_shared<TH2D>(name.c_str(), title.c_str(), 56, -n_rings - 1.5, n_rings + 1.5, n, -y, y);
118  }
119  }

References fileinputsource_cfi::option.

◆ ~Phase1PixelROCMaps()

Phase1PixelROCMaps::~Phase1PixelROCMaps ( )
inline

Definition at line 121 of file Phase1PixelROCMaps.h.

121 {}

Member Function Documentation

◆ drawBarrelMaps()

void Phase1PixelROCMaps::drawBarrelMaps ( TCanvas &  canvas,
const std::string &  text = "" 
)

Definition at line 622 of file Phase1PixelROCMaps.cc.

624 {
625  canvas.cd();
626  canvas.Modified();
627 
628  auto topPad = new TPad("pad1", "upper pad", 0.005, 0.96, 0.995, 0.995);
629  topPad->Draw();
630  topPad->cd();
631  auto ltx = TLatex();
632  ltx.SetTextFont(62);
633 
634  std::size_t found = text.find("Delta");
635  if (found != std::string::npos) {
636  ltx.SetTextSize(0.7);
637  } else {
638  ltx.SetTextSize(1.);
639  }
640  ltx.DrawLatexNDC(0.02, 0.3, text.c_str());
641 
642  canvas.cd();
643  auto bottomPad = new TPad("pad2", "lower pad", 0.005, 0.005, 0.995, 0.955);
644  bottomPad->Draw();
645  bottomPad->cd();
646  bottomPad->Divide(2, 2);
647  for (unsigned int lay = 1; lay <= n_layers; lay++) {
648  PixelROCMapHelper::dress_plot(bottomPad, h_bpix_maps[lay - 1].get(), lay, 0, 1, found == std::string::npos);
649  }
650 }

References svgfig::canvas(), PixelROCMapHelper::dress_plot(), newFWLiteAna::found, get, h_bpix_maps, n_layers, and runonSM::text.

◆ drawForwardMaps()

void Phase1PixelROCMaps::drawForwardMaps ( TCanvas &  canvas,
const std::string &  text = "" 
)

Definition at line 653 of file Phase1PixelROCMaps.cc.

655 {
656  canvas.cd();
657  canvas.Modified();
658 
659  auto topPad = new TPad("pad1", "upper pad", 0.005, 0.94, 0.995, 0.995);
660  topPad->Draw();
661  topPad->cd();
662  auto ltx = TLatex();
663  ltx.SetTextFont(62);
664 
665  std::size_t found = text.find("Delta");
666  if (found != std::string::npos) {
667  ltx.SetTextSize(0.7);
668  } else {
669  ltx.SetTextSize(1.);
670  }
671  ltx.DrawLatexNDC(0.02, 0.3, text.c_str());
672 
673  canvas.cd();
674  auto bottomPad = new TPad("pad2", "lower pad", 0.005, 0.005, 0.995, 0.935);
675  bottomPad->Draw();
676  bottomPad->cd();
677  bottomPad->Divide(2, 1);
678  for (unsigned int ring = 1; ring <= n_rings; ring++) {
679  PixelROCMapHelper::dress_plot(bottomPad, h_fpix_maps[ring - 1].get(), 0, ring, 1, found == std::string::npos);
680  }
681 }

References svgfig::canvas(), PixelROCMapHelper::dress_plot(), newFWLiteAna::found, get, h_fpix_maps, n_rings, ring(), and runonSM::text.

◆ drawMaps()

void Phase1PixelROCMaps::drawMaps ( TCanvas &  canvas,
const std::string &  text = "" 
)

Definition at line 684 of file Phase1PixelROCMaps.cc.

686 {
687  canvas.cd();
688  canvas.Modified();
689 
690  auto topPad = new TPad("pad1", "upper pad", 0.005, 0.97, 0.995, 0.995);
691  topPad->Draw();
692  topPad->cd();
693  auto ltx = TLatex();
694  ltx.SetTextFont(62);
695 
696  std::size_t found = text.find("Delta");
697  if (found != std::string::npos) {
698  ltx.SetTextSize(0.7);
699  } else {
700  ltx.SetTextSize(1.);
701  }
702  ltx.DrawLatexNDC(0.02, 0.2, text.c_str());
703 
704  canvas.cd();
705  auto bottomPad = new TPad("pad2", "lower pad", 0.005, 0.005, 0.995, 0.97);
706  bottomPad->Draw();
707  bottomPad->cd();
708  bottomPad->Divide(2, 3);
709 
710  // dress the plots
711  for (unsigned int lay = 1; lay <= n_layers; lay++) {
712  PixelROCMapHelper::dress_plot(bottomPad, h_bpix_maps[lay - 1].get(), lay, 0, 1, found == std::string::npos);
713  }
714 
715  bottomPad->Update();
716  bottomPad->Modified();
717  bottomPad->cd();
718 
719  for (unsigned int ring = 1; ring <= n_rings; ring++) {
721  bottomPad, h_fpix_maps[ring - 1].get(), 0, n_layers + ring, 1, found == std::string::npos);
722  }
723 }

References svgfig::canvas(), PixelROCMapHelper::dress_plot(), newFWLiteAna::found, get, h_bpix_maps, h_fpix_maps, n_layers, n_rings, ring(), and runonSM::text.

◆ fillSelectedRocs()

void Phase1PixelROCMaps::fillSelectedRocs ( const uint32_t &  detid,
const std::bitset< 16 > &  theROCs,
double  value 
)

Definition at line 255 of file Phase1PixelROCMaps.cc.

257 {
258  auto coord = findDetCoordinates(detid);
259  auto rocsToMark =
260  coord.isBarrel() ? this->maskedBarrelRocsToBins(coord, theROCs) : this->maskedForwardRocsToBins(coord, theROCs);
261 
262  if (coord.isBarrel()) {
263  for (const auto& bin : rocsToMark) {
264  double x = h_bpix_maps[coord.m_layer - 1]->GetXaxis()->GetBinCenter(std::get<0>(bin));
265  double y = h_bpix_maps[coord.m_layer - 1]->GetYaxis()->GetBinCenter(std::get<1>(bin));
266  h_bpix_maps[coord.m_layer - 1]->Fill(x, y, value);
267  }
268  } else {
269  for (const auto& bin : rocsToMark) {
270  double x = h_fpix_maps[coord.m_ring - 1]->GetXaxis()->GetBinCenter(std::get<0>(bin));
271  double y = h_fpix_maps[coord.m_ring - 1]->GetYaxis()->GetBinCenter(std::get<1>(bin));
272  h_fpix_maps[coord.m_ring - 1]->Fill(x, y, value);
273  }
274  }
275 
276  return;
277 }

References newFWLiteAna::bin, findDetCoordinates(), h_bpix_maps, h_fpix_maps, maskedBarrelRocsToBins(), maskedForwardRocsToBins(), x, and y.

◆ fillWholeModule()

void Phase1PixelROCMaps::fillWholeModule ( const uint32_t &  detid,
double  value 
)

Definition at line 232 of file Phase1PixelROCMaps.cc.

234 {
235  auto coord = findDetCoordinates(detid);
236  auto rocsToMark = coord.isBarrel() ? this->maskedBarrelRocsToBins(coord) : this->maskedForwardRocsToBins(coord);
237 
238  if (coord.isBarrel()) {
239  for (const auto& bin : rocsToMark) {
240  double x = h_bpix_maps[coord.m_layer - 1]->GetXaxis()->GetBinCenter(bin.first);
241  double y = h_bpix_maps[coord.m_layer - 1]->GetYaxis()->GetBinCenter(bin.second);
242  h_bpix_maps[coord.m_layer - 1]->Fill(x, y, value);
243  }
244  } else {
245  for (const auto& bin : rocsToMark) {
246  double x = h_fpix_maps[coord.m_ring - 1]->GetXaxis()->GetBinCenter(bin.first);
247  double y = h_fpix_maps[coord.m_ring - 1]->GetYaxis()->GetBinCenter(bin.second);
248  h_fpix_maps[coord.m_ring - 1]->Fill(x, y, value);
249  }
250  }
251  return;
252 }

References newFWLiteAna::bin, findDetCoordinates(), h_bpix_maps, h_fpix_maps, maskedBarrelRocsToBins(), maskedForwardRocsToBins(), x, and y.

◆ findDetCoordinates()

DetCoordinates Phase1PixelROCMaps::findDetCoordinates ( const uint32_t &  t_detid)

Definition at line 8 of file Phase1PixelROCMaps.cc.

10 {
11  DetCoordinates coord;
12 
13  auto myDetId = DetId(t_detid);
14  int subid = DetId(t_detid).subdetId();
15 
16  if (subid == PixelSubdetector::PixelBarrel) {
17  coord.m_layer = m_trackerTopo.pxbLayer(myDetId);
18  coord.m_s_ladder = this->signed_ladder(myDetId, true);
19  coord.m_s_module = this->signed_module(myDetId, true);
20 
21  bool isFlipped = this->isBPixOuterLadder(myDetId, false);
22  if ((coord.m_layer > 1 && coord.m_s_module < 0))
23  isFlipped = !isFlipped;
24 
25  coord.m_isFlipped = isFlipped;
26 
27  } // if it's barrel
28  else if (subid == PixelSubdetector::PixelEndcap) {
29  coord.m_ring = this->ring(myDetId, true);
30  coord.m_s_blade = this->signed_blade(myDetId, true);
31  coord.m_s_disk = this->signed_disk(myDetId, true);
32  coord.m_panel = m_trackerTopo.pxfPanel(t_detid);
33  coord.m_isFlipped = (coord.m_s_disk > 0) ? (coord.m_panel == 1) : (coord.m_panel == 2);
34  } // it it's endcap
35  else {
36  throw cms::Exception("LogicError") << "Unknown Pixel SubDet ID " << std::endl;
37  }
38 
39  if (std::strcmp(m_option, kVerbose) == 0) {
40  coord.printCoordinates();
41  }
42 
43  return coord;
44 }

References Exception, isBPixOuterLadder(), kVerbose, DetCoordinates::m_isFlipped, DetCoordinates::m_layer, m_option, DetCoordinates::m_panel, DetCoordinates::m_ring, DetCoordinates::m_s_blade, DetCoordinates::m_s_disk, DetCoordinates::m_s_ladder, DetCoordinates::m_s_module, m_trackerTopo, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetCoordinates::printCoordinates(), TrackerTopology::pxbLayer(), TrackerTopology::pxfPanel(), ring(), signed_blade(), signed_disk(), signed_ladder(), signed_module(), and DetId::subdetId().

Referenced by fillSelectedRocs(), and fillWholeModule().

◆ getLayerMaps()

std::array<std::shared_ptr<TH2D>, 4> Phase1PixelROCMaps::getLayerMaps ( )
inline

Definition at line 131 of file Phase1PixelROCMaps.h.

131 { return h_bpix_maps; }

References h_bpix_maps.

◆ getRingMaps()

std::array<std::shared_ptr<TH2D>, 2> Phase1PixelROCMaps::getRingMaps ( )
inline

Definition at line 132 of file Phase1PixelROCMaps.h.

132 { return h_fpix_maps; }

References h_fpix_maps.

◆ isBPixOuterLadder()

bool Phase1PixelROCMaps::isBPixOuterLadder ( const DetId detid,
bool  isPhase0 
)
inlineprotected

Definition at line 251 of file Phase1PixelROCMaps.h.

251  {
252  bool isOuter = false;
253  int layer = m_trackerTopo.pxbLayer(detid.rawId());
254  bool odd_ladder = m_trackerTopo.pxbLadder(detid.rawId()) % 2;
255  if (isPhase0) {
256  if (layer == 2)
257  isOuter = !odd_ladder;
258  else
259  isOuter = odd_ladder;
260  } else {
261  if (layer == 4)
262  isOuter = odd_ladder;
263  else
264  isOuter = !odd_ladder;
265  }
266  return isOuter;
267  }

References phase1PixelTopology::layer, m_trackerTopo, TrackerTopology::pxbLadder(), TrackerTopology::pxbLayer(), and DetId::rawId().

Referenced by findDetCoordinates().

◆ maskedBarrelRocsToBins() [1/2]

modBins Phase1PixelROCMaps::maskedBarrelRocsToBins ( DetCoordinates  coord)
private

Definition at line 48 of file Phase1PixelROCMaps.cc.

50 {
51  modBins rocsToMask;
52  int nlad = nlad_list[coord.m_layer - 1];
53 
54  int start_x = coord.m_s_module > 0 ? ((coord.m_s_module + 4) * 8) + 1 : ((4 - (std::abs(coord.m_s_module))) * 8) + 1;
55  int start_y =
56  coord.m_s_ladder > 0 ? ((coord.m_s_ladder + nlad) * 2) + 1 : ((nlad - (std::abs(coord.m_s_ladder))) * 2) + 1;
57 
58  int end_x = start_x + 7;
59  int end_y = start_y + 1;
60 
61  for (int bin_x = 1; bin_x <= 72; bin_x++) {
62  for (int bin_y = 1; bin_y <= (nlad * 4 + 2); bin_y++) {
63  if (bin_x >= start_x && bin_x <= end_x && bin_y >= start_y && bin_y <= end_y) {
64  rocsToMask.push_back(std::make_pair(bin_x, bin_y));
65  }
66  }
67  }
68  return rocsToMask;
69 }

References funct::abs(), DetCoordinates::m_layer, DetCoordinates::m_s_ladder, DetCoordinates::m_s_module, and nlad_list.

Referenced by fillSelectedRocs(), and fillWholeModule().

◆ maskedBarrelRocsToBins() [2/2]

rocBins Phase1PixelROCMaps::maskedBarrelRocsToBins ( DetCoordinates  coord,
std::bitset< 16 >  myRocs 
)
private

Definition at line 73 of file Phase1PixelROCMaps.cc.

75 {
76  rocBins rocsToMask;
77  int nlad = nlad_list[coord.m_layer - 1];
78 
79  int start_x = coord.m_s_module > 0 ? ((coord.m_s_module + 4) * 8) + 1 : ((4 - (std::abs(coord.m_s_module))) * 8) + 1;
80  int start_y =
81  coord.m_s_ladder > 0 ? ((coord.m_s_ladder + nlad) * 2) + 1 : ((nlad - (std::abs(coord.m_s_ladder))) * 2) + 1;
82 
83  int roc0_x = ((coord.m_layer == 1) || (coord.m_layer > 1 && coord.m_s_module > 0)) ? start_x + 7 : start_x;
84  int roc0_y = start_y - 1;
85 
86  size_t idx = 0;
87  while (idx < myRocs.size()) {
88  if (myRocs.test(idx)) {
90  // | //
91  // In BPix Layer1 & module > 0 in L2,3,4 | In BPix Layer 2,3,4 module < 0 //
92  // | //
93  // ROCs are ordered in the following | ROCs are ordered in the following //
94  // fashion for unflipped modules | fashion for unflipped modules //
95  // | //
96  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
97  // | 8 |9 |10 |11 |12 |13 |14 |15 | | |15 |14 |13 |12 |11 |10 | 9 | 8 | //
98  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
99  // | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | | | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | //
100  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
101  // | //
102  // if the module is flipped the ordering | if the module is flipped the ordering //
103  // is reveresed | is reversed //
104  // | //
105  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
106  // | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | | | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | //
107  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
108  // | 8 | 9 |10 |11 |12 |13 |14 |15 | | |15 |14 |13 |12 |11 |10 | 9 | 8 | //
109  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
111 
112  int roc_x(0), roc_y(0);
113 
114  if ((coord.m_layer == 1) || (coord.m_layer > 1 && coord.m_s_module > 0)) {
115  if (!coord.m_isFlipped) {
116  roc_x = idx < 8 ? roc0_x - idx : (start_x - 8) + idx;
117  roc_y = idx < 8 ? roc0_y + 1 : roc0_y + 2;
118  } else {
119  roc_x = idx < 8 ? roc0_x - idx : (start_x - 8) + idx;
120  roc_y = idx < 8 ? roc0_y + 2 : roc0_y + 1;
121  }
122  } else {
123  if (!coord.m_isFlipped) {
124  roc_x = idx < 8 ? roc0_x + idx : (roc0_x + 7) - (idx - 8);
125  roc_y = idx < 8 ? roc0_y + 1 : roc0_y + 2;
126  } else {
127  roc_x = idx < 8 ? roc0_x + idx : (roc0_x + 7) - (idx - 8);
128  roc_y = idx < 8 ? roc0_y + 2 : roc0_y + 1;
129  }
130  }
131  rocsToMask.push_back(std::make_tuple(roc_x, roc_y, idx));
132  }
133  ++idx;
134  }
135  return rocsToMask;
136 }

References funct::abs(), heavyIonCSV_trainingSettings::idx, DetCoordinates::m_isFlipped, DetCoordinates::m_layer, DetCoordinates::m_s_ladder, DetCoordinates::m_s_module, and nlad_list.

◆ maskedForwardRocsToBins() [1/2]

modBins Phase1PixelROCMaps::maskedForwardRocsToBins ( DetCoordinates  coord)
private

Definition at line 140 of file Phase1PixelROCMaps.cc.

142 {
143  modBins rocsToMask;
144  int nybins = nybins_list[coord.m_ring - 1];
145 
146  int start_x = coord.m_s_disk > 0 ? ((coord.m_s_disk + 3) * 8) + 1 : ((3 - (std::abs(coord.m_s_disk))) * 8) + 1;
147  int start_y = coord.m_s_blade > 0 ? (nybins / 2) + (coord.m_s_blade * 4) - (coord.m_panel * 2) + 3
148  : ((nybins / 2) - (std::abs(coord.m_s_blade) * 4) - coord.m_panel * 2) + 3;
149 
150  int end_x = start_x + 7;
151  int end_y = start_y + 1;
152 
153  for (int bin_x = 1; bin_x <= 56; bin_x++) {
154  for (int bin_y = 1; bin_y <= nybins; bin_y++) {
155  if (bin_x >= start_x && bin_x <= end_x && bin_y >= start_y && bin_y <= end_y) {
156  rocsToMask.push_back(std::make_pair(bin_x, bin_y));
157  }
158  }
159  }
160  return rocsToMask;
161 }

References funct::abs(), DetCoordinates::m_panel, DetCoordinates::m_ring, DetCoordinates::m_s_blade, DetCoordinates::m_s_disk, and nybins_list.

Referenced by fillSelectedRocs(), and fillWholeModule().

◆ maskedForwardRocsToBins() [2/2]

rocBins Phase1PixelROCMaps::maskedForwardRocsToBins ( DetCoordinates  coord,
std::bitset< 16 >  myRocs 
)
private

Definition at line 165 of file Phase1PixelROCMaps.cc.

167 {
168  rocBins rocsToMask;
169  int nybins = nybins_list[coord.m_ring - 1];
170 
171  int start_x = coord.m_s_disk > 0 ? ((coord.m_s_disk + 3) * 8) + 1 : ((3 - (std::abs(coord.m_s_disk))) * 8) + 1;
172  int start_y = coord.m_s_blade > 0 ? (nybins / 2) + (coord.m_s_blade * 4) - (coord.m_panel * 2) + 3
173  : ((nybins / 2) - (std::abs(coord.m_s_blade) * 4) - coord.m_panel * 2) + 3;
174 
175  int roc0_x = coord.m_s_disk > 0 ? start_x + 7 : start_x;
176  int roc0_y = start_y - 1;
177 
178  size_t idx = 0;
179  while (idx < myRocs.size()) {
180  if (myRocs.test(idx)) {
181  int roc_x(0), roc_y(0);
182 
184  // | //
185  // In FPix + (Disk 1,2,3) | In FPix - (Disk -1,-2,-3) //
186  // | //
187  // ROCs are ordered in the following | ROCs are ordered in the following //
188  // fashion for unflipped modules | fashion for unflipped modules //
189  // | //
190  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
191  // | 8 |9 |10 |11 |12 |13 |14 |15 | | |15 |14 |13 |12 |11 |10 | 9 | 8 | //
192  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
193  // | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | | | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | //
194  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
195  // | //
196  // if the module is flipped the ordering | if the module is flipped the ordering //
197  // is reveresed | is reversed //
198  // | //
199  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
200  // | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | | | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | //
201  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
202  // | 8 | 9 |10 |11 |12 |13 |14 |15 | | |15 |14 |13 |12 |11 |10 | 9 | 8 | //
203  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
205 
206  if (coord.m_s_disk > 0) {
207  if (!coord.m_isFlipped) {
208  roc_x = idx < 8 ? roc0_x - idx : (start_x - 8) + idx;
209  roc_y = idx < 8 ? roc0_y + 1 : roc0_y + 2;
210  } else {
211  roc_x = idx < 8 ? roc0_x - idx : (start_x - 8) + idx;
212  roc_y = idx < 8 ? roc0_y + 2 : roc0_y + 1;
213  }
214  } else {
215  if (!coord.m_isFlipped) {
216  roc_x = idx < 8 ? roc0_x + idx : (roc0_x + 7) - (idx - 8);
217  roc_y = idx < 8 ? roc0_y + 1 : roc0_y + 2;
218  } else {
219  roc_x = idx < 8 ? roc0_x + idx : (roc0_x + 7) - (idx - 8);
220  roc_y = idx < 8 ? roc0_y + 2 : roc0_y + 1;
221  }
222  }
223 
224  rocsToMask.push_back(std::make_tuple(roc_x, roc_y, idx));
225  }
226  ++idx;
227  }
228  return rocsToMask;
229 }

References funct::abs(), heavyIonCSV_trainingSettings::idx, DetCoordinates::m_isFlipped, DetCoordinates::m_panel, DetCoordinates::m_ring, DetCoordinates::m_s_blade, DetCoordinates::m_s_disk, and nybins_list.

◆ quadrant()

int Phase1PixelROCMaps::quadrant ( const DetId detid,
bool  phase_ 
)
inlineprotected

Definition at line 166 of file Phase1PixelROCMaps.h.

166  {
167  if (detid.subdetId() == PixelSubdetector::PixelBarrel) {
168  return PixelBarrelName(detid, &m_trackerTopo, phase_).shell();
169  } else {
170  return PixelEndcapName(detid, &m_trackerTopo, phase_).halfCylinder();
171  }
172  }

References PixelEndcapName::halfCylinder(), m_trackerTopo, PixelSubdetector::PixelBarrel, PixelBarrelName::shell(), and DetId::subdetId().

Referenced by signed_blade(), signed_disk(), signed_ladder(), and signed_module().

◆ ring()

int Phase1PixelROCMaps::ring ( const DetId detid,
bool  phase_ 
)
inlineprotected

Definition at line 205 of file Phase1PixelROCMaps.h.

205  {
207  return -9999;
208  int ring = -9999;
209  if (phase_ == 0) {
210  ring = 1 + (m_trackerTopo.pxfPanel(detid) + m_trackerTopo.pxfModule(detid) > 3);
211  } else if (phase_ == 1) {
212  ring = PixelEndcapName(detid, &m_trackerTopo, phase_).ringName();
213  }
214  return ring;
215  }

References m_trackerTopo, PixelSubdetector::PixelEndcap, TrackerTopology::pxfModule(), TrackerTopology::pxfPanel(), PixelEndcapName::ringName(), and DetId::subdetId().

Referenced by drawForwardMaps(), drawMaps(), findDetCoordinates(), and geometryXMLparser.CSCAlignable::index().

◆ signed_blade()

int Phase1PixelROCMaps::signed_blade ( const DetId detid,
bool  phase_ 
)
inlineprotected

Definition at line 220 of file Phase1PixelROCMaps.h.

220  {
222  return -9999;
223  int signed_blade = PixelEndcapName(detid, &m_trackerTopo, phase_).bladeName();
224  if (quadrant(detid, phase_) % 2)
225  signed_blade *= -1;
226  return signed_blade;
227  }

References PixelEndcapName::bladeName(), m_trackerTopo, PixelSubdetector::PixelEndcap, quadrant(), and DetId::subdetId().

Referenced by findDetCoordinates(), and signed_blade_panel().

◆ signed_blade_panel()

int Phase1PixelROCMaps::signed_blade_panel ( const DetId detid,
bool  phase_ 
)
inlineprotected

Definition at line 230 of file Phase1PixelROCMaps.h.

230  {
232  return -9999;
233  int signed_blade_panel = signed_blade(detid, phase_) + (m_trackerTopo.pxfPanel(detid) - 1);
234  return signed_blade_panel;
235  }

References m_trackerTopo, PixelSubdetector::PixelEndcap, TrackerTopology::pxfPanel(), signed_blade(), and DetId::subdetId().

◆ signed_disk()

int Phase1PixelROCMaps::signed_disk ( const DetId detid,
bool  phase_ 
)
inlineprotected

Definition at line 240 of file Phase1PixelROCMaps.h.

240  {
242  return -9999;
243  int signed_disk = m_trackerTopo.pxfDisk(DetId(detid));
244  if (quadrant(detid, phase_) < 3)
245  signed_disk *= -1;
246  return signed_disk;
247  }

References m_trackerTopo, PixelSubdetector::PixelEndcap, TrackerTopology::pxfDisk(), quadrant(), and DetId::subdetId().

Referenced by findDetCoordinates().

◆ signed_ladder()

int Phase1PixelROCMaps::signed_ladder ( const DetId detid,
bool  phase_ 
)
inlineprotected

Definition at line 177 of file Phase1PixelROCMaps.h.

177  {
179  return -9999;
180  int signed_ladder = PixelBarrelName(detid, &m_trackerTopo, phase_).ladderName();
181  if (quadrant(detid, phase_) % 2)
182  signed_ladder *= -1;
183  return signed_ladder;
184  }

References PixelBarrelName::ladderName(), m_trackerTopo, PixelSubdetector::PixelBarrel, quadrant(), and DetId::subdetId().

Referenced by findDetCoordinates().

◆ signed_module()

int Phase1PixelROCMaps::signed_module ( const DetId detid,
bool  phase_ 
)
inlineprotected

Definition at line 189 of file Phase1PixelROCMaps.h.

189  {
191  return -9999;
192  int signed_module = PixelBarrelName(detid, &m_trackerTopo, phase_).moduleName();
193  if (quadrant(detid, phase_) < 3)
194  signed_module *= -1;
195  return signed_module;
196  }

References m_trackerTopo, PixelBarrelName::moduleName(), PixelSubdetector::PixelBarrel, quadrant(), and DetId::subdetId().

Referenced by findDetCoordinates().

Member Data Documentation

◆ h_bpix_maps

std::array<std::shared_ptr<TH2D>, n_layers> Phase1PixelROCMaps::h_bpix_maps
private

◆ h_fpix_maps

std::array<std::shared_ptr<TH2D>, n_rings> Phase1PixelROCMaps::h_fpix_maps
private

◆ kVerbose

constexpr const char* Phase1PixelROCMaps::kVerbose = "verbose"
staticconstexprprivate

Definition at line 154 of file Phase1PixelROCMaps.h.

Referenced by findDetCoordinates().

◆ m_option

Option_t* Phase1PixelROCMaps::m_option
private

Definition at line 135 of file Phase1PixelROCMaps.h.

Referenced by findDetCoordinates().

◆ m_trackerTopo

TrackerTopology Phase1PixelROCMaps::m_trackerTopo
private

◆ m_zAxisTitle

std::string Phase1PixelROCMaps::m_zAxisTitle
private

Definition at line 136 of file Phase1PixelROCMaps.h.

◆ n_layers

constexpr int Phase1PixelROCMaps::n_layers = 4
staticconstexprprivate

Definition at line 143 of file Phase1PixelROCMaps.h.

Referenced by drawBarrelMaps(), and drawMaps().

◆ n_rings

constexpr int Phase1PixelROCMaps::n_rings = 2
staticconstexprprivate

Definition at line 142 of file Phase1PixelROCMaps.h.

Referenced by drawForwardMaps(), and drawMaps().

◆ nlad_list

const int Phase1PixelROCMaps::nlad_list[n_layers] = {6, 14, 22, 32}
private

Definition at line 145 of file Phase1PixelROCMaps.h.

Referenced by maskedBarrelRocsToBins().

◆ numColumns

constexpr int Phase1PixelROCMaps::numColumns = 416
staticconstexprprivate

Definition at line 140 of file Phase1PixelROCMaps.h.

◆ numRows

constexpr int Phase1PixelROCMaps::numRows = 160
staticconstexprprivate

Definition at line 141 of file Phase1PixelROCMaps.h.

◆ nxbins_list

const int Phase1PixelROCMaps::nxbins_list[n_rings] = {11, 17}
private

Definition at line 147 of file Phase1PixelROCMaps.h.

◆ nybins_list

const int Phase1PixelROCMaps::nybins_list[n_rings] = {92, 140}
private

Definition at line 146 of file Phase1PixelROCMaps.h.

Referenced by maskedForwardRocsToBins().

Phase1PixelROCMaps::m_zAxisTitle
std::string m_zAxisTitle
Definition: Phase1PixelROCMaps.h:136
DetCoordinates::m_s_disk
int m_s_disk
Definition: Phase1PixelROCMaps.h:47
svgfig.canvas
def canvas(*sub, **attr)
Definition: svgfig.py:482
PixelROCMapHelper::dress_plot
void dress_plot(TPad *&canv, TH2 *h, int lay, int ring, int phase, bool half_shift, bool mark_zero, bool standard_palette)
Definition: Phase1PixelROCMaps.cc:293
DDAxes::y
Phase1PixelROCMaps::h_fpix_maps
std::array< std::shared_ptr< TH2D >, n_rings > h_fpix_maps
Definition: Phase1PixelROCMaps.h:151
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
Phase1PixelROCMaps::ring
int ring(const DetId &detid, bool phase_)
Definition: Phase1PixelROCMaps.h:205
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
modBins
std::vector< std::pair< int, int > > modBins
Definition: Phase1PixelROCMaps.cc:3
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
TrackerTopology::pxbLadder
unsigned int pxbLadder(const DetId &id) const
Definition: TrackerTopology.h:155
rocBins
std::vector< std::tuple< int, int, int > > rocBins
Definition: Phase1PixelROCMaps.cc:4
PixelBarrelName
Definition: PixelBarrelName.h:16
DetCoordinates::m_panel
int m_panel
Definition: Phase1PixelROCMaps.h:48
PixelEndcapName::halfCylinder
HalfCylinder halfCylinder() const
Definition: PixelEndcapName.h:42
DDAxes::x
Phase1PixelROCMaps::signed_blade
int signed_blade(const DetId &detid, bool phase_)
Definition: Phase1PixelROCMaps.h:220
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
fileinputsource_cfi.option
option
Definition: fileinputsource_cfi.py:94
PixelEndcapName::bladeName
int bladeName() const
blade id
Definition: PixelEndcapName.h:48
TrackerTopology::pxbLayer
unsigned int pxbLayer(const DetId &id) const
Definition: TrackerTopology.h:144
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
TrackerTopology::pxfPanel
unsigned int pxfPanel(const DetId &id) const
Definition: TrackerTopology.h:450
Phase1PixelROCMaps::nybins_list
const int nybins_list[n_rings]
Definition: Phase1PixelROCMaps.h:146
DetId
Definition: DetId.h:17
edm::FileInPath
Definition: FileInPath.h:61
DetCoordinates::m_isFlipped
bool m_isFlipped
Definition: Phase1PixelROCMaps.h:49
PixelEndcapName
Definition: PixelEndcapName.h:16
Phase1PixelROCMaps::m_trackerTopo
TrackerTopology m_trackerTopo
Definition: Phase1PixelROCMaps.h:137
DetCoordinates::m_s_blade
int m_s_blade
Definition: Phase1PixelROCMaps.h:46
Phase1PixelROCMaps::quadrant
int quadrant(const DetId &detid, bool phase_)
Definition: Phase1PixelROCMaps.h:166
Phase1PixelROCMaps::maskedForwardRocsToBins
std::vector< std::pair< int, int > > maskedForwardRocsToBins(DetCoordinates coord)
Definition: Phase1PixelROCMaps.cc:140
DetCoordinates::m_s_ladder
int m_s_ladder
Definition: Phase1PixelROCMaps.h:43
PixelBarrelName::ladderName
int ladderName() const
ladder id (index in phi)
Definition: PixelBarrelName.h:49
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
Phase1PixelROCMaps::signed_ladder
int signed_ladder(const DetId &detid, bool phase_)
Definition: Phase1PixelROCMaps.h:177
Phase1PixelROCMaps::h_bpix_maps
std::array< std::shared_ptr< TH2D >, n_layers > h_bpix_maps
Definition: Phase1PixelROCMaps.h:150
PixelBarrelName::shell
Shell shell() const
Definition: PixelBarrelName.h:40
Phase1PixelROCMaps::nxbins_list
const int nxbins_list[n_rings]
Definition: Phase1PixelROCMaps.h:147
TrackerTopology::pxfModule
unsigned int pxfModule(const DetId &id) const
Definition: TrackerTopology.h:163
value
Definition: value.py:1
TrackerTopology::pxfDisk
unsigned int pxfDisk(const DetId &id) const
Definition: TrackerTopology.h:446
Phase1PixelROCMaps::signed_module
int signed_module(const DetId &detid, bool phase_)
Definition: Phase1PixelROCMaps.h:189
DetCoordinates::printCoordinates
void printCoordinates()
Definition: Phase1PixelROCMaps.h:63
Phase1PixelROCMaps::n_layers
static constexpr int n_layers
Definition: Phase1PixelROCMaps.h:143
PixelBarrelName::moduleName
int moduleName() const
module id (index in z)
Definition: PixelBarrelName.h:46
get
#define get
Phase1PixelROCMaps::signed_disk
int signed_disk(const DetId &detid, bool phase_)
Definition: Phase1PixelROCMaps.h:240
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
Phase1PixelROCMaps::maskedBarrelRocsToBins
std::vector< std::pair< int, int > > maskedBarrelRocsToBins(DetCoordinates coord)
Definition: Phase1PixelROCMaps.cc:48
DetCoordinates::m_s_module
int m_s_module
Definition: Phase1PixelROCMaps.h:44
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
Exception
Definition: hltDiff.cc:245
Phase1PixelROCMaps::kVerbose
static constexpr const char * kVerbose
Definition: Phase1PixelROCMaps.h:154
Phase1PixelROCMaps::findDetCoordinates
DetCoordinates findDetCoordinates(const uint32_t &t_detid)
Definition: Phase1PixelROCMaps.cc:8
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DetCoordinates::m_ring
int m_ring
Definition: Phase1PixelROCMaps.h:45
Phase1PixelROCMaps::isBPixOuterLadder
bool isBPixOuterLadder(const DetId &detid, bool isPhase0)
Definition: Phase1PixelROCMaps.h:251
Phase1PixelROCMaps::m_option
Option_t * m_option
Definition: Phase1PixelROCMaps.h:135
runonSM.text
text
Definition: runonSM.py:43
DetCoordinates
Definition: Phase1PixelROCMaps.h:41
DetCoordinates::m_layer
int m_layer
Definition: Phase1PixelROCMaps.h:42
StandaloneTrackerTopology::fromTrackerParametersXMLFile
TrackerTopology fromTrackerParametersXMLFile(const std::string &xmlFileName)
Definition: StandaloneTrackerTopology.cc:168
Phase1PixelROCMaps::nlad_list
const int nlad_list[n_layers]
Definition: Phase1PixelROCMaps.h:145
Phase1PixelROCMaps::signed_blade_panel
int signed_blade_panel(const DetId &detid, bool phase_)
Definition: Phase1PixelROCMaps.h:230
PixelEndcapName::ringName
int ringName() const
ring Id
Definition: PixelEndcapName.h:57
Phase1PixelROCMaps::n_rings
static constexpr int n_rings
Definition: Phase1PixelROCMaps.h:142