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 
10  const std::vector<double>& angle, double maxL,
11  bool rot) : hgcons_(hgc), cut_(maxL), rot_(rot) {
12 
15  for (auto ang : angle) {
16  projXY_.push_back(std::pair<double,double>(cos(ang*CLHEP::deg),sin(ang*CLHEP::deg)));
17  }
18 #ifdef EDM_ML_DEBUG
19  edm::LogVerbatim("HGCSim") << "Creating HGCMosueBite with cut at " << cut_
20  << " with mode " << modeUV_ << " along "
21  << angle.size() << " axes";
22  for (unsigned int k=0; k<angle.size(); ++k)
23  edm::LogVerbatim("HGCSim") << "Axis[" << k << "] " << angle[k]
24  << " with projections " << projXY_[k].first
25  << ":" << projXY_[k].second;
26 #endif
27 }
28 
29 bool HGCMouseBite::exclude(G4ThreeVector& point, int zside, int waferU,
30  int waferV) {
31  bool check(false);
32  std::pair<double,double> xy = (modeUV_ ?
33  hgcons_.waferPosition(waferU,waferV,false) :
34  hgcons_.waferPosition(waferU,false));
35  double xx = (zside > 0) ? xy.first : -xy.first;
36  double dx(0), dy(0);
37  if (rot_) {
38  dx = std::abs(point.y() - xy.second);
39  dy = std::abs(point.x() - xx);
40  } else {
41  dx = std::abs(point.x() - xx);
42  dy = std::abs(point.y() - xy.second);
43  }
44  for (auto proj : projXY_) {
45  double dist = dx*proj.first + dy*proj.second;
46  if (dist > cut_) {check = true; break;}
47  }
48 #ifdef EDM_ML_DEBUG
49  edm::LogVerbatim("HGCSim") << "HGCMouseBite:: Point " << point << " zside "
50  << zside << " wafer " << waferU << ":" << waferV
51  << " position " << xy.first << ":" << xx << ":"
52  << xy.second << " dxy " << dx << ":" << dy
53  << " check " << check;
54 #endif
55  return check;
56 }
std::vector< std::pair< double, double > > projXY_
Definition: HGCMouseBite.h:24
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
int zside(DetId const &)
bool exclude(G4ThreeVector &point, int zside, int waferU, int waferV)
Definition: HGCMouseBite.cc:29
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HGCalGeometryMode::GeometryMode geomMode() const
const HGCalDDDConstants & hgcons_
Definition: HGCMouseBite.h:20
int k[5][pyjets_maxn]
std::pair< double, double > waferPosition(int wafer, bool reco) const
def check(config)
Definition: trackerTree.py:14
*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
HGCMouseBite(const HGCalDDDConstants &hgc, const std::vector< double > &angle, double maxLength, bool waferRotate)
Definition: HGCMouseBite.cc:9
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11