CMS 3D CMS Logo

HGCMouseBite.cc
Go to the documentation of this file.
4 #include "CLHEP/Units/GlobalSystemOfUnits.h"
5 #include <iostream>
6 
7 //#define EDM_ML_DEBUG
8 
9 HGCMouseBite::HGCMouseBite(const HGCalDDDConstants& hgc, const std::vector<double>& angle, double maxL, bool rot)
10  : hgcons_(hgc), cut_(maxL), rot_(rot) {
11  modeUV_ =
13  for (auto ang : angle) {
14  projXY_.push_back(std::pair<double, double>(cos(ang * CLHEP::deg), sin(ang * CLHEP::deg)));
15  }
16 #ifdef EDM_ML_DEBUG
17  edm::LogVerbatim("HGCSim") << "Creating HGCMosueBite with cut at " << cut_ << " with mode " << modeUV_ << " along "
18  << angle.size() << " axes";
19  for (unsigned int k = 0; k < angle.size(); ++k)
20  edm::LogVerbatim("HGCSim") << "Axis[" << k << "] " << angle[k] << " with projections " << projXY_[k].first << ":"
21  << projXY_[k].second;
22 #endif
23 }
24 
25 bool HGCMouseBite::exclude(G4ThreeVector& point, int zside, int waferU, int waferV) {
26  bool check(false);
27  int lay = hgcons_.getLayer(point.z(), false);
28  std::pair<double, double> xy =
29  (modeUV_ ? hgcons_.waferPosition(lay, waferU, waferV, false) : hgcons_.waferPosition(waferU, false));
30  double xx = (zside > 0) ? xy.first : -xy.first;
31  double dx(0), dy(0);
32  if (rot_) {
33  dx = std::abs(point.y() - xy.second);
34  dy = std::abs(point.x() - xx);
35  } else {
36  dx = std::abs(point.x() - xx);
37  dy = std::abs(point.y() - xy.second);
38  }
39  for (auto proj : projXY_) {
40  double dist = dx * proj.first + dy * proj.second;
41  if (dist > cut_) {
42  check = true;
43  break;
44  }
45  }
46 #ifdef EDM_ML_DEBUG
47  edm::LogVerbatim("HGCSim") << "HGCMouseBite:: Point " << point << " zside " << zside << " wafer " << waferU << ":"
48  << waferV << " position " << xy.first << ":" << xx << ":" << xy.second << " dxy " << dx
49  << ":" << dy << " check " << check;
50 #endif
51  return check;
52 }
MessageLogger.h
HGCMouseBite::hgcons_
const HGCalDDDConstants & hgcons_
Definition: HGCMouseBite.h:15
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
HGCalDDDConstants::geomMode
HGCalGeometryMode::GeometryMode geomMode() const
Definition: HGCalDDDConstants.h:52
HGCMouseBite::rot_
bool rot_
Definition: HGCMouseBite.h:17
HGCMouseBite::cut_
double cut_
Definition: HGCMouseBite.h:16
HGCMouseBite::exclude
bool exclude(G4ThreeVector &point, int zside, int waferU, int waferV)
Definition: HGCMouseBite.cc:25
HGCMouseBite::modeUV_
bool modeUV_
Definition: HGCMouseBite.h:18
HGCalDDDConstants
Definition: HGCalDDDConstants.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
HGCMouseBite::projXY_
std::vector< std::pair< double, double > > projXY_
Definition: HGCMouseBite.h:19
HGCMouseBite::HGCMouseBite
HGCMouseBite(const HGCalDDDConstants &hgc, const std::vector< double > &angle, double maxLength, bool waferRotate)
Definition: HGCMouseBite.cc:9
dqmdumpme.k
k
Definition: dqmdumpme.py:60
geometryCSVtoXML.xy
xy
Definition: geometryCSVtoXML.py:19
amptDefault_cfi.proj
proj
Definition: amptDefault_cfi.py:13
HGCalGeometryMode::Hexagon8Full
Definition: HGCalGeometryMode.h:25
edm::LogVerbatim
Definition: MessageLogger.h:297
PVValHelper::dy
Definition: PVValidationHelpers.h:49
HGCalDetId.h
HGCMouseBite.h
HGCalDDDConstants::waferPosition
std::pair< double, double > waferPosition(int wafer, bool reco) const
Definition: HGCalDDDConstants.cc:1190
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
HGCalDDDConstants::getLayer
int getLayer(double z, bool reco) const
Definition: HGCalDDDConstants.cc:361
HGCalGeometryMode::Hexagon8
Definition: HGCalGeometryMode.h:25
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
PVValHelper::dx
Definition: PVValidationHelpers.h:48
geometryCSVtoXML.xx
xx
Definition: geometryCSVtoXML.py:19