CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HGCalMouseBite Class Reference

#include <HGCalMouseBite.h>

Public Member Functions

template<class T >
bool exclude (const T &id)
 
 HGCalMouseBite (const HGCalDDDConstants &hgc, bool waferRotate=false)
 

Private Attributes

std::vector< int > rejectCoarse_
 
std::vector< int > rejectFine_
 

Detailed Description

Definition at line 13 of file HGCalMouseBite.h.

Constructor & Destructor Documentation

◆ HGCalMouseBite()

HGCalMouseBite::HGCalMouseBite ( const HGCalDDDConstants hgc,
bool  waferRotate = false 
)

Definition at line 7 of file HGCalMouseBite.cc.

7  {
8  bool modeUV =
9  ((hgc.geomMode() == HGCalGeometryMode::Hexagon8) || (hgc.geomMode() == HGCalGeometryMode::Hexagon8Full));
10  if (modeUV) {
11  const std::vector<double> angle = {90._deg, 30._deg};
12  std::vector<std::pair<double, double> > projXY;
13  for (auto ang : angle)
14  projXY.emplace_back(std::make_pair(cos(ang), sin(ang)));
15  const double mousebite(hgc.mouseBite(true));
16  const double wafersize(hgc.waferSize(true));
17  double cut = wafersize * tan(angle[1]) - mousebite;
18 #ifdef EDM_ML_DEBUG
19  edm::LogVerbatim("HGCalGeom") << "Creating HGCMosueBite with cut at " << cut << " along " << angle.size()
20  << " axes in wafers of size " << wafersize;
21  for (unsigned int k = 0; k < angle.size(); ++k)
22  edm::LogVerbatim("HGCalGeom") << "Axis[" << k << "] " << convertRadToDeg(angle[k]) << " with projections "
23  << projXY[k].first << ":" << projXY[k].second;
24 #endif
25  static const double sqrt3 = std::sqrt(3.0);
27  int nf2 = nf / 2;
28  double Rf = wafersize / (3.0 * nf);
29  double rf = 0.5 * Rf * sqrt3;
30  for (int u = 0; u < 2 * nf; ++u) {
31  for (int v = 0; v < 2 * nf; ++v) {
32  if (((v - u) < nf) && ((u - v) <= nf)) {
33  double yp = std::abs((u - 0.5 * v - nf2) * 2 * rf);
34  double xp = std::abs((1.5 * (v - nf) + 1.0) * Rf);
35  for (auto proj : projXY) {
36  double dist = (rot ? (yp * proj.first + xp * proj.second) : (xp * proj.first + yp * proj.second));
37  if (dist > cut) {
38  rejectFine_.emplace_back(100 * u + v);
39  break;
40  }
41  }
42  }
43  }
44  }
45 #ifdef EDM_ML_DEBUG
46  edm::LogVerbatim("HGCalGeom") << "HGCalMouseBite:: " << rejectFine_.size()
47  << " masked u, v's among the fine grain wafers:";
48  for (unsigned int k = 0; k < rejectFine_.size(); ++k)
49  edm::LogVerbatim("HGCalGeom") << "[" << k << "] = (" << rejectFine_[k] / 100 << ", " << rejectFine_[k] % 100
50  << ")";
51 #endif
53  int nc2 = nc / 2;
54  double Rc = hgc.getParameter()->waferSize_ / (3.0 * nc);
55  double rc = 0.5 * Rc * sqrt3;
56  for (int u = 0; u < 2 * nc; ++u) {
57  for (int v = 0; v < 2 * nc; ++v) {
58  if (((v - u) < nc) && ((u - v) <= nc)) {
59  double yp = (u - 0.5 * v - nc2) * 2 * rc;
60  double xp = (1.5 * (v - nc) + 1.0) * Rc;
61  for (auto proj : projXY) {
62  double dist = (rot ? (yp * proj.first + xp * proj.second) : (xp * proj.first + yp * proj.second));
63  if (dist > cut)
64  rejectCoarse_.emplace_back(100 * u + v);
65  break;
66  }
67  }
68  }
69  }
70 #ifdef EDM_ML_DEBUG
71  edm::LogVerbatim("HGCalGeom") << "HGCalMouseBite:: " << rejectCoarse_.size()
72  << " masked u, v's among the coarse grain wafers:";
73  for (unsigned int k = 0; k < rejectCoarse_.size(); ++k)
74  edm::LogVerbatim("HGCalGeom") << "[" << k << "] = (" << rejectCoarse_[k] / 100 << ", " << rejectCoarse_[k] % 100
75  << ")";
76 #endif
77  }
78 }

References funct::abs(), angle(), angle_units::operators::convertRadToDeg(), funct::cos(), TkAlMuonSelectors_cfi::cut, HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, HGCSiliconDetId::HGCalCoarseN, HGCSiliconDetId::HGCalFineN, dqmdumpme::k, amptDefault_cfi::proj, hcal_runs::rf, makeMuonMisalignmentScenario::rot, funct::sin(), mathSSE::sqrt(), funct::tan(), and findQualityFiles::v.

Member Function Documentation

◆ exclude()

template<class T >
bool HGCalMouseBite::exclude ( const T id)
inline

Definition at line 17 of file HGCalMouseBite.h.

17  {
18  int iuv = (100 * id.cellU() + id.cellV());
19  bool check = ((id.type() == 0) ? (std::binary_search(rejectFine_.begin(), rejectFine_.end(), iuv))
20  : (std::binary_search(rejectCoarse_.begin(), rejectCoarse_.end(), iuv)));
21 #ifdef EDM_ML_DEBUG
22  edm::LogVerbatim("HGCalGeom") << "HGCalMouseBite:: DetId " << id
23  << " is checked to be in the list of masked ID's with flag " << check;
24 #endif
25  return check;
26  }

References RPCNoise_example::check, rejectCoarse_, and rejectFine_.

Member Data Documentation

◆ rejectCoarse_

std::vector<int> HGCalMouseBite::rejectCoarse_
private

Definition at line 29 of file HGCalMouseBite.h.

Referenced by exclude().

◆ rejectFine_

std::vector<int> HGCalMouseBite::rejectFine_
private

Definition at line 29 of file HGCalMouseBite.h.

Referenced by exclude().

TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
HGCalMouseBite::rejectFine_
std::vector< int > rejectFine_
Definition: HGCalMouseBite.h:29
angle_units::operators::convertRadToDeg
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
HGCSiliconDetId::HGCalCoarseN
static const int HGCalCoarseN
Definition: HGCSiliconDetId.h:26
findQualityFiles.v
v
Definition: findQualityFiles.py:179
HGCSiliconDetId::HGCalFineN
static const int HGCalFineN
Definition: HGCSiliconDetId.h:25
hgc_digi
Definition: HGCDigitizerTypes.h:10
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
RPCNoise_example.check
check
Definition: RPCNoise_example.py:71
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
dqmdumpme.k
k
Definition: dqmdumpme.py:60
amptDefault_cfi.proj
proj
Definition: amptDefault_cfi.py:13
HGCalGeometryMode::Hexagon8Full
Definition: HGCalGeometryMode.h:25
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
edm::LogVerbatim
Definition: MessageLogger.h:297
hcal_runs.rf
rf
Definition: hcal_runs.py:75
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
angle
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
HGCalGeometryMode::Hexagon8
Definition: HGCalGeometryMode.h:25
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HGCalMouseBite::rejectCoarse_
std::vector< int > rejectCoarse_
Definition: HGCalMouseBite.h:29