CMS 3D CMS Logo

Functions
payloadPlotting Namespace Reference

Functions

std::vector< std::tuple< int, int, int > > maskedBarrelRocsToBins (int layer, int ladder, int module, std::bitset< 16 > bad_rocs, bool isFlipped)
 
std::vector< std::tuple< int, int, int > > maskedForwardRocsToBins (int ring, int blade, int panel, int disk, std::bitset< 16 > bad_rocs, bool isFlipped)
 

Function Documentation

◆ maskedBarrelRocsToBins()

std::vector<std::tuple<int, int, int> > payloadPlotting::maskedBarrelRocsToBins ( int  layer,
int  ladder,
int  module,
std::bitset< 16 >  bad_rocs,
bool  isFlipped 
)

Definition at line 56 of file SiPixelQualityPlotter.cc.

References funct::abs(), heavyIonCSV_trainingSettings::idx, and PVValHelper::ladder.

Referenced by SiPixelQualityPlotter::analyze().

59  {
60  std::vector<std::tuple<int, int, int>> rocsToMask;
61 
62  int nlad_list[4] = {6, 14, 22, 32};
63  int nlad = nlad_list[layer - 1];
64 
65  int start_x = module > 0 ? ((module + 4) * 8) + 1 : ((4 - (std::abs(module))) * 8) + 1;
66  int start_y = ladder > 0 ? ((ladder + nlad) * 2) + 1 : ((nlad - (std::abs(ladder))) * 2) + 1;
67 
68  int roc0_x = ((layer == 1) || (layer > 1 && module > 0)) ? start_x + 7 : start_x;
69  int roc0_y = start_y - 1;
70 
71  size_t idx = 0;
72  while (idx < bad_rocs.size()) {
73  if (bad_rocs.test(idx)) {
74  int roc_x(0), roc_y(0);
75 
76  if ((layer == 1) || (layer > 1 && module > 0)) {
77  if (!isFlipped) {
78  roc_x = idx < 8 ? roc0_x - idx : (start_x - 8) + idx;
79  roc_y = idx < 8 ? roc0_y + 1 : roc0_y + 2;
80  } else {
81  roc_x = idx < 8 ? roc0_x - idx : (start_x - 8) + idx;
82  roc_y = idx < 8 ? roc0_y + 2 : roc0_y + 1;
83  }
84  } else {
85  if (!isFlipped) {
86  roc_x = idx < 8 ? roc0_x + idx : (roc0_x + 7) - (idx - 8);
87  roc_y = idx < 8 ? roc0_y + 1 : roc0_y + 2;
88  } else {
89  roc_x = idx < 8 ? roc0_x + idx : (roc0_x + 7) - (idx - 8);
90  roc_y = idx < 8 ? roc0_y + 2 : roc0_y + 1;
91  }
92  }
93 
94  edm::LogInfo("payloadPlotting") << bad_rocs << " : (idx)= " << idx << std::endl;
95  edm::LogInfo("payloadPlotting") << " layer: " << layer << std::endl;
96  edm::LogInfo("payloadPlotting") << "module: " << module << " roc_x:" << roc_x << std::endl;
97  edm::LogInfo("payloadPlotting") << "ladder: " << ladder << " roc_y:" << roc_y << std::endl;
98  edm::LogInfo("payloadPlotting") << "=================================================================="
99  << std::endl;
100 
101  rocsToMask.push_back(std::make_tuple(roc_x, roc_y, idx));
102  }
103  ++idx;
104  }
105  return rocsToMask;
106  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Log< level::Info, false > LogInfo

◆ maskedForwardRocsToBins()

std::vector<std::tuple<int, int, int> > payloadPlotting::maskedForwardRocsToBins ( int  ring,
int  blade,
int  panel,
int  disk,
std::bitset< 16 >  bad_rocs,
bool  isFlipped 
)

Definition at line 109 of file SiPixelQualityPlotter.cc.

References funct::abs(), heavyIonCSV_trainingSettings::idx, and relativeConstraints::ring.

Referenced by SiPixelQualityPlotter::analyze().

112  {
113  std::vector<std::tuple<int, int, int>> rocsToMask;
114  int nybins_list[2] = {92, 140};
115  int nybins = nybins_list[ring - 1];
116 
117  int start_x = disk > 0 ? ((disk + 3) * 8) + 1 : ((3 - (std::abs(disk))) * 8) + 1;
118  int start_y = blade > 0 ? (nybins / 2) + (blade * 4) - (panel * 2) + 3
119  : ((nybins / 2) - (std::abs(blade) * 4) - panel * 2) + 3;
120 
121  int roc0_x = disk > 0 ? start_x + 7 : start_x;
122  int roc0_y = start_y - 1;
123 
124  size_t idx = 0;
125  while (idx < bad_rocs.size()) {
126  if (bad_rocs.test(idx)) {
127  int roc_x(0), roc_y(0);
128 
129  if (disk > 0) {
130  if (!isFlipped) {
131  roc_x = idx < 8 ? roc0_x - idx : (start_x - 8) + idx;
132  roc_y = idx < 8 ? roc0_y + 1 : roc0_y + 2;
133  } else {
134  roc_x = idx < 8 ? roc0_x - idx : (start_x - 8) + idx;
135  roc_y = idx < 8 ? roc0_y + 2 : roc0_y + 1;
136  }
137  } else {
138  if (!isFlipped) {
139  roc_x = idx < 8 ? roc0_x + idx : (roc0_x + 7) - (idx - 8);
140  roc_y = idx < 8 ? roc0_y + 1 : roc0_y + 2;
141  } else {
142  roc_x = idx < 8 ? roc0_x + idx : (roc0_x + 7) - (idx - 8);
143  roc_y = idx < 8 ? roc0_y + 2 : roc0_y + 1;
144  }
145  }
146 
147  edm::LogInfo("payloadPlotting") << bad_rocs << " : (idx)= " << idx << std::endl;
148  edm::LogInfo("payloadPlotting") << " panel: " << panel << " isFlipped: " << isFlipped << std::endl;
149  edm::LogInfo("payloadPlotting") << " disk: " << disk << " roc_x:" << roc_x << std::endl;
150  edm::LogInfo("payloadPlotting") << " blade: " << blade << " roc_y:" << roc_y << std::endl;
151  edm::LogInfo("payloadPlotting") << "===============================" << std::endl;
152 
153  rocsToMask.push_back(std::make_tuple(roc_x, roc_y, idx));
154  }
155  ++idx;
156  }
157  return rocsToMask;
158  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Log< level::Info, false > LogInfo