CMS 3D CMS Logo

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

#include <HGCMouseBite.h>

Public Member Functions

bool exclude (G4ThreeVector &point, int zside, int layer, int waferU, int waferV)
 
 HGCMouseBite (const HGCalDDDConstants &hgc, const std::vector< double > &angle, double maxLength, bool waferRotate)
 
 HGCMouseBite (const HGCalTBDDDConstants &hgc, const std::vector< double > &angle, double maxLength, bool waferRotate)
 

Private Member Functions

void init (const std::vector< double > &angle)
 

Private Attributes

double cut_
 
const HGCalDDDConstantshgcons_
 
const HGCalTBDDDConstantshgTBcons_
 
const bool ifTB_
 
bool modeUV_
 
std::vector< std::pair< double, double > > projXY_
 
bool rot_
 

Detailed Description

Definition at line 10 of file HGCMouseBite.h.

Constructor & Destructor Documentation

◆ HGCMouseBite() [1/2]

HGCMouseBite::HGCMouseBite ( const HGCalDDDConstants hgc,
const std::vector< double > &  angle,
double  maxLength,
bool  waferRotate 
)

Definition at line 9 of file HGCMouseBite.cc.

References angle(), hgcons_, init(), modeUV_, and HGCalDDDConstants::waferHexagon8().

10  : hgcons_(&hgc), hgTBcons_(nullptr), ifTB_(false), cut_(maxL), rot_(rot) {
12  init(angle);
13 }
const HGCalTBDDDConstants * hgTBcons_
Definition: HGCMouseBite.h:20
void init(const std::vector< double > &angle)
Definition: HGCMouseBite.cc:21
bool waferHexagon8() const
const bool ifTB_
Definition: HGCMouseBite.h:21
const HGCalDDDConstants * hgcons_
Definition: HGCMouseBite.h:19
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11

◆ HGCMouseBite() [2/2]

HGCMouseBite::HGCMouseBite ( const HGCalTBDDDConstants hgc,
const std::vector< double > &  angle,
double  maxLength,
bool  waferRotate 
)

Definition at line 15 of file HGCMouseBite.cc.

References angle(), init(), and modeUV_.

16  : hgcons_(nullptr), hgTBcons_(&hgc), ifTB_(true), cut_(maxL), rot_(rot) {
17  modeUV_ = false;
18  init(angle);
19 }
const HGCalTBDDDConstants * hgTBcons_
Definition: HGCMouseBite.h:20
void init(const std::vector< double > &angle)
Definition: HGCMouseBite.cc:21
const bool ifTB_
Definition: HGCMouseBite.h:21
const HGCalDDDConstants * hgcons_
Definition: HGCMouseBite.h:19
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11

Member Function Documentation

◆ exclude()

bool HGCMouseBite::exclude ( G4ThreeVector &  point,
int  zside,
int  layer,
int  waferU,
int  waferV 
)

Definition at line 34 of file HGCMouseBite.cc.

References funct::abs(), RPCNoise_example::check, cut_, PVValHelper::dx, PVValHelper::dy, hgcons_, hgTBcons_, ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets::if(), ifTB_, modeUV_, point, amptDefault_cfi::proj, projXY_, rot_, HGCalTBDDDConstants::waferPosition(), HGCalDDDConstants::waferPosition(), HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), geometryCSVtoXML::xx, geometryCSVtoXML::xy, and ecaldqm::zside().

Referenced by HGCalMouseBiteTester::analyze().

34  {
35  bool check(false);
36  double dx(0), dy(0);
37  if (point == G4ThreeVector()) {
38  std::pair<double, double> xy;
39  if (ifTB_)
40  xy = hgTBcons_->waferPosition(waferU, false);
41  else
42  xy =
43  (modeUV_ ? hgcons_->waferPosition(lay, waferU, waferV, false, false) : hgcons_->waferPosition(waferU, false));
44  double xx = (zside > 0) ? xy.first : -xy.first;
45  if (rot_) {
46  dx = std::abs(point.y() - xy.second);
47  dy = std::abs(point.x() - xx);
48  } else {
49  dx = std::abs(point.x() - xx);
50  dy = std::abs(point.y() - xy.second);
51  }
52  } else {
53  dx = std::abs(point.x());
54  dy = std::abs(point.y());
55  }
56  for (auto proj : projXY_) {
57  double dist = dx * proj.first + dy * proj.second;
58  if (dist > cut_) {
59  check = true;
60  break;
61  }
62  }
63 #ifdef EDM_ML_DEBUG
64  edm::LogVerbatim("HGCSim") << "HGCMouseBite:: Point " << point << " zside " << zside << " wafer " << waferU << ":"
65  << waferV << " position " << dx << ":" << dy << " check " << check;
66 #endif
67  return check;
68 }
Log< level::Info, true > LogVerbatim
const HGCalTBDDDConstants * hgTBcons_
Definition: HGCMouseBite.h:20
int32_t waferU(const int32_t index)
int zside(DetId const &)
const bool ifTB_
Definition: HGCMouseBite.h:21
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::pair< double, double > waferPosition(int wafer, bool reco) const
std::pair< double, double > waferPosition(int wafer, bool reco) const
const HGCalDDDConstants * hgcons_
Definition: HGCMouseBite.h:19
int32_t waferV(const int32_t index)
std::vector< std::pair< double, double > > projXY_
Definition: HGCMouseBite.h:25
if(threadIdxLocalY==0 &&threadIdxLocalX==0)
*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

◆ init()

void HGCMouseBite::init ( const std::vector< double > &  angle)
private

Definition at line 21 of file HGCMouseBite.cc.

References angle(), funct::cos(), cut_, ifTB_, dqmdumpme::k, modeUV_, projXY_, rot_, and funct::sin().

Referenced by HGCMouseBite().

21  {
22  for (auto ang : angle) {
23  projXY_.push_back(std::pair<double, double>(cos(ang * CLHEP::deg), sin(ang * CLHEP::deg)));
24  }
25 #ifdef EDM_ML_DEBUG
26  edm::LogVerbatim("HGCSim") << "Creating HGCMosueBite with cut at " << cut_ << " with mode " << modeUV_ << " along "
27  << angle.size() << " axes TB Flag " << ifTB_ << " Rot " << rot_;
28  for (unsigned int k = 0; k < angle.size(); ++k)
29  edm::LogVerbatim("HGCSim") << "Axis[" << k << "] " << angle[k] << " with projections " << projXY_[k].first << ":"
30  << projXY_[k].second;
31 #endif
32 }
Log< level::Info, true > LogVerbatim
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
const bool ifTB_
Definition: HGCMouseBite.h:21
std::vector< std::pair< double, double > > projXY_
Definition: HGCMouseBite.h:25
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11

Member Data Documentation

◆ cut_

double HGCMouseBite::cut_
private

Definition at line 22 of file HGCMouseBite.h.

Referenced by exclude(), and init().

◆ hgcons_

const HGCalDDDConstants* HGCMouseBite::hgcons_
private

Definition at line 19 of file HGCMouseBite.h.

Referenced by exclude(), and HGCMouseBite().

◆ hgTBcons_

const HGCalTBDDDConstants* HGCMouseBite::hgTBcons_
private

Definition at line 20 of file HGCMouseBite.h.

Referenced by exclude().

◆ ifTB_

const bool HGCMouseBite::ifTB_
private

Definition at line 21 of file HGCMouseBite.h.

Referenced by exclude(), and init().

◆ modeUV_

bool HGCMouseBite::modeUV_
private

Definition at line 24 of file HGCMouseBite.h.

Referenced by exclude(), HGCMouseBite(), and init().

◆ projXY_

std::vector<std::pair<double, double> > HGCMouseBite::projXY_
private

Definition at line 25 of file HGCMouseBite.h.

Referenced by exclude(), and init().

◆ rot_

bool HGCMouseBite::rot_
private

Definition at line 23 of file HGCMouseBite.h.

Referenced by exclude(), and init().