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 82 of file Phase1PixelROCMaps.h.

Constructor & Destructor Documentation

◆ Phase1PixelROCMaps()

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

Definition at line 84 of file Phase1PixelROCMaps.h.

References fileinputsource_cfi::option.

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

◆ ~Phase1PixelROCMaps()

Phase1PixelROCMaps::~Phase1PixelROCMaps ( )
inline

Definition at line 122 of file Phase1PixelROCMaps.h.

122 {}

Member Function Documentation

◆ drawBarrelMaps()

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

Definition at line 622 of file Phase1PixelROCMaps.cc.

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

Referenced by gainCalibHelper::SiPixelGainCalibrationMap< myType, PayloadType, myDetType >::fill().

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  h_bpix_maps[lay - 1]->SetStats(false);
649  PixelROCMapHelper::dress_plot(bottomPad, h_bpix_maps[lay - 1].get(), lay, 0, 1, found == std::string::npos);
650  }
651 }
static constexpr int n_layers
std::array< std::shared_ptr< TH2D >, n_layers > h_bpix_maps
def canvas(sub, attr)
Definition: svgfig.py:482
void dress_plot(TPad *&canv, TH2 *h, int lay, int ring, int phase, bool half_shift, bool mark_zero, bool standard_palette)

◆ drawForwardMaps()

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

Definition at line 654 of file Phase1PixelROCMaps.cc.

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

Referenced by gainCalibHelper::SiPixelGainCalibrationMap< myType, PayloadType, myDetType >::fill().

656 {
657  canvas.cd();
658  canvas.Modified();
659 
660  auto topPad = new TPad("pad1", "upper pad", 0.005, 0.94, 0.995, 0.995);
661  topPad->Draw();
662  topPad->cd();
663  auto ltx = TLatex();
664  ltx.SetTextFont(62);
665 
666  std::size_t found = text.find("Delta");
667  if (found != std::string::npos) {
668  ltx.SetTextSize(0.7);
669  } else {
670  ltx.SetTextSize(1.);
671  }
672  ltx.DrawLatexNDC(0.02, 0.3, text.c_str());
673 
674  canvas.cd();
675  auto bottomPad = new TPad("pad2", "lower pad", 0.005, 0.005, 0.995, 0.935);
676  bottomPad->Draw();
677  bottomPad->cd();
678  bottomPad->Divide(2, 1);
679  for (unsigned int ring = 1; ring <= n_rings; ring++) {
680  h_fpix_maps[ring - 1]->SetStats(false);
681  PixelROCMapHelper::dress_plot(bottomPad, h_fpix_maps[ring - 1].get(), 0, ring, 1, found == std::string::npos);
682  }
683 }
static constexpr int n_rings
int ring(const DetId &detid, bool phase_)
std::array< std::shared_ptr< TH2D >, n_rings > h_fpix_maps
def canvas(sub, attr)
Definition: svgfig.py:482
void dress_plot(TPad *&canv, TH2 *h, int lay, int ring, int phase, bool half_shift, bool mark_zero, bool standard_palette)

◆ drawMaps()

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

Definition at line 686 of file Phase1PixelROCMaps.cc.

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

Referenced by gainCalibHelper::SiPixelGainCalibrationMap< myType, PayloadType, myDetType >::fill().

688 {
689  canvas.cd();
690  canvas.Modified();
691 
692  auto topPad = new TPad("pad1", "upper pad", 0.005, 0.97, 0.995, 0.995);
693  topPad->Draw();
694  topPad->cd();
695  auto ltx = TLatex();
696  ltx.SetTextFont(62);
697 
698  std::size_t found = text.find("Delta");
699  if (found != std::string::npos) {
700  ltx.SetTextSize(0.7);
701  } else {
702  ltx.SetTextSize(1.);
703  }
704  ltx.DrawLatexNDC(0.02, 0.2, text.c_str());
705 
706  canvas.cd();
707  auto bottomPad = new TPad("pad2", "lower pad", 0.005, 0.005, 0.995, 0.97);
708  bottomPad->Draw();
709  bottomPad->cd();
710  bottomPad->Divide(2, 3);
711 
712  // dress the plots
713  for (unsigned int lay = 1; lay <= n_layers; lay++) {
714  h_bpix_maps[lay - 1]->SetStats(false);
715  PixelROCMapHelper::dress_plot(bottomPad, h_bpix_maps[lay - 1].get(), lay, 0, 1, found == std::string::npos);
716  }
717 
718  bottomPad->Update();
719  bottomPad->Modified();
720  bottomPad->cd();
721 
722  for (unsigned int ring = 1; ring <= n_rings; ring++) {
723  h_fpix_maps[ring - 1]->SetStats(false);
725  bottomPad, h_fpix_maps[ring - 1].get(), 0, n_layers + ring, 1, found == std::string::npos);
726  }
727 }
static constexpr int n_layers
std::array< std::shared_ptr< TH2D >, n_layers > h_bpix_maps
static constexpr int n_rings
int ring(const DetId &detid, bool phase_)
std::array< std::shared_ptr< TH2D >, n_rings > h_fpix_maps
def canvas(sub, attr)
Definition: svgfig.py:482
void dress_plot(TPad *&canv, TH2 *h, int lay, int ring, int phase, bool half_shift, bool mark_zero, bool standard_palette)

◆ fillSelectedRocs()

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

Definition at line 255 of file Phase1PixelROCMaps.cc.

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

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 }
DetCoordinates findDetCoordinates(const uint32_t &t_detid)
std::vector< std::pair< int, int > > maskedForwardRocsToBins(DetCoordinates coord)
std::array< std::shared_ptr< TH2D >, n_layers > h_bpix_maps
std::vector< std::pair< int, int > > maskedBarrelRocsToBins(DetCoordinates coord)
Definition: value.py:1
std::array< std::shared_ptr< TH2D >, n_rings > h_fpix_maps

◆ fillWholeModule()

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

Definition at line 232 of file Phase1PixelROCMaps.cc.

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

Referenced by gainCalibHelper::SiPixelGainCalibrationMap< myType, PayloadType, myDetType >::fill().

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 }
DetCoordinates findDetCoordinates(const uint32_t &t_detid)
std::vector< std::pair< int, int > > maskedForwardRocsToBins(DetCoordinates coord)
std::array< std::shared_ptr< TH2D >, n_layers > h_bpix_maps
std::vector< std::pair< int, int > > maskedBarrelRocsToBins(DetCoordinates coord)
Definition: value.py:1
std::array< std::shared_ptr< TH2D >, n_rings > h_fpix_maps

◆ findDetCoordinates()

DetCoordinates Phase1PixelROCMaps::findDetCoordinates ( const uint32_t &  t_detid)

Definition at line 8 of file Phase1PixelROCMaps.cc.

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().

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 }
static constexpr const char * kVerbose
int signed_blade(const DetId &detid, bool phase_)
unsigned int pxbLayer(const DetId &id) const
int signed_module(const DetId &detid, bool phase_)
bool isBPixOuterLadder(const DetId &detid, bool isPhase0)
int signed_disk(const DetId &detid, bool phase_)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
int ring(const DetId &detid, bool phase_)
unsigned int pxfPanel(const DetId &id) const
Definition: DetId.h:17
TrackerTopology m_trackerTopo
int signed_ladder(const DetId &detid, bool phase_)

◆ getLayerMaps()

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

Definition at line 132 of file Phase1PixelROCMaps.h.

References h_bpix_maps.

Referenced by gainCalibHelper::SiPixelGainCalibrationMap< myType, PayloadType, myDetType >::fill().

132 { return h_bpix_maps; }
std::array< std::shared_ptr< TH2D >, n_layers > h_bpix_maps

◆ getRingMaps()

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

Definition at line 133 of file Phase1PixelROCMaps.h.

References h_fpix_maps.

Referenced by gainCalibHelper::SiPixelGainCalibrationMap< myType, PayloadType, myDetType >::fill().

133 { return h_fpix_maps; }
std::array< std::shared_ptr< TH2D >, n_rings > h_fpix_maps

◆ isBPixOuterLadder()

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

Definition at line 252 of file Phase1PixelROCMaps.h.

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

Referenced by findDetCoordinates().

252  {
253  bool isOuter = false;
254  int layer = m_trackerTopo.pxbLayer(detid.rawId());
255  bool odd_ladder = m_trackerTopo.pxbLadder(detid.rawId()) % 2;
256  if (isPhase0) {
257  if (layer == 2)
258  isOuter = !odd_ladder;
259  else
260  isOuter = odd_ladder;
261  } else {
262  if (layer == 4)
263  isOuter = odd_ladder;
264  else
265  isOuter = !odd_ladder;
266  }
267  return isOuter;
268  }
unsigned int pxbLayer(const DetId &id) const
unsigned int pxbLadder(const DetId &id) const
constexpr std::array< uint8_t, layerIndexSize > layer
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
TrackerTopology m_trackerTopo

◆ maskedBarrelRocsToBins() [1/2]

modBins Phase1PixelROCMaps::maskedBarrelRocsToBins ( DetCoordinates  coord)
private

Definition at line 48 of file Phase1PixelROCMaps.cc.

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

Referenced by fillSelectedRocs(), and fillWholeModule().

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 }
std::vector< std::pair< int, int > > modBins
const int nlad_list[n_layers]
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ maskedBarrelRocsToBins() [2/2]

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

Definition at line 73 of file Phase1PixelROCMaps.cc.

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

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 }
std::vector< std::tuple< int, int, int > > rocBins
const int nlad_list[n_layers]
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ maskedForwardRocsToBins() [1/2]

modBins Phase1PixelROCMaps::maskedForwardRocsToBins ( DetCoordinates  coord)
private

Definition at line 140 of file Phase1PixelROCMaps.cc.

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().

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 }
std::vector< std::pair< int, int > > modBins
const int nybins_list[n_rings]
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ maskedForwardRocsToBins() [2/2]

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

Definition at line 165 of file Phase1PixelROCMaps.cc.

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.

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 }
std::vector< std::tuple< int, int, int > > rocBins
const int nybins_list[n_rings]
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ quadrant()

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

Definition at line 167 of file Phase1PixelROCMaps.h.

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

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

167  {
168  if (detid.subdetId() == PixelSubdetector::PixelBarrel) {
169  return PixelBarrelName(detid, &m_trackerTopo, phase_).shell();
170  } else {
171  return PixelEndcapName(detid, &m_trackerTopo, phase_).halfCylinder();
172  }
173  }
HalfCylinder halfCylinder() const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Shell shell() const
TrackerTopology m_trackerTopo

◆ ring()

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

Definition at line 206 of file Phase1PixelROCMaps.h.

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

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

206  {
208  return -9999;
209  int ring = -9999;
210  if (phase_ == 0) {
211  ring = 1 + (m_trackerTopo.pxfPanel(detid) + m_trackerTopo.pxfModule(detid) > 3);
212  } else if (phase_ == 1) {
213  ring = PixelEndcapName(detid, &m_trackerTopo, phase_).ringName();
214  }
215  return ring;
216  }
int ringName() const
ring Id
unsigned int pxfModule(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
int ring(const DetId &detid, bool phase_)
unsigned int pxfPanel(const DetId &id) const
TrackerTopology m_trackerTopo

◆ signed_blade()

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

Definition at line 221 of file Phase1PixelROCMaps.h.

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

Referenced by findDetCoordinates(), and signed_blade_panel().

221  {
223  return -9999;
224  int signed_blade = PixelEndcapName(detid, &m_trackerTopo, phase_).bladeName();
225  if (quadrant(detid, phase_) % 2)
226  signed_blade *= -1;
227  return signed_blade;
228  }
int signed_blade(const DetId &detid, bool phase_)
int bladeName() const
blade id
int quadrant(const DetId &detid, bool phase_)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
TrackerTopology m_trackerTopo

◆ signed_blade_panel()

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

Definition at line 231 of file Phase1PixelROCMaps.h.

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

231  {
233  return -9999;
234  int signed_blade_panel = signed_blade(detid, phase_) + (m_trackerTopo.pxfPanel(detid) - 1);
235  return signed_blade_panel;
236  }
int signed_blade(const DetId &detid, bool phase_)
int signed_blade_panel(const DetId &detid, bool phase_)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
unsigned int pxfPanel(const DetId &id) const
TrackerTopology m_trackerTopo

◆ signed_disk()

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

Definition at line 241 of file Phase1PixelROCMaps.h.

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

Referenced by findDetCoordinates().

241  {
243  return -9999;
244  int signed_disk = m_trackerTopo.pxfDisk(DetId(detid));
245  if (quadrant(detid, phase_) < 3)
246  signed_disk *= -1;
247  return signed_disk;
248  }
int quadrant(const DetId &detid, bool phase_)
unsigned int pxfDisk(const DetId &id) const
int signed_disk(const DetId &detid, bool phase_)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Definition: DetId.h:17
TrackerTopology m_trackerTopo

◆ signed_ladder()

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

Definition at line 178 of file Phase1PixelROCMaps.h.

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

Referenced by findDetCoordinates().

178  {
180  return -9999;
181  int signed_ladder = PixelBarrelName(detid, &m_trackerTopo, phase_).ladderName();
182  if (quadrant(detid, phase_) % 2)
183  signed_ladder *= -1;
184  return signed_ladder;
185  }
int quadrant(const DetId &detid, bool phase_)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
TrackerTopology m_trackerTopo
int signed_ladder(const DetId &detid, bool phase_)
int ladderName() const
ladder id (index in phi)

◆ signed_module()

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

Definition at line 190 of file Phase1PixelROCMaps.h.

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

Referenced by findDetCoordinates().

190  {
192  return -9999;
193  int signed_module = PixelBarrelName(detid, &m_trackerTopo, phase_).moduleName();
194  if (quadrant(detid, phase_) < 3)
195  signed_module *= -1;
196  return signed_module;
197  }
int moduleName() const
module id (index in z)
int signed_module(const DetId &detid, bool phase_)
int quadrant(const DetId &detid, bool phase_)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
TrackerTopology m_trackerTopo

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"
staticprivate

Definition at line 155 of file Phase1PixelROCMaps.h.

Referenced by findDetCoordinates().

◆ m_option

Option_t* Phase1PixelROCMaps::m_option
private

Definition at line 136 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 137 of file Phase1PixelROCMaps.h.

◆ n_layers

constexpr int Phase1PixelROCMaps::n_layers = 4
staticprivate

Definition at line 144 of file Phase1PixelROCMaps.h.

Referenced by drawBarrelMaps(), and drawMaps().

◆ n_rings

constexpr int Phase1PixelROCMaps::n_rings = 2
staticprivate

Definition at line 143 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 146 of file Phase1PixelROCMaps.h.

Referenced by maskedBarrelRocsToBins().

◆ numColumns

constexpr int Phase1PixelROCMaps::numColumns = 416
staticprivate

Definition at line 141 of file Phase1PixelROCMaps.h.

◆ numRows

constexpr int Phase1PixelROCMaps::numRows = 160
staticprivate

Definition at line 142 of file Phase1PixelROCMaps.h.

◆ nxbins_list

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

Definition at line 148 of file Phase1PixelROCMaps.h.

◆ nybins_list

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

Definition at line 147 of file Phase1PixelROCMaps.h.

Referenced by maskedForwardRocsToBins().