CMS 3D CMS Logo

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

#include <HcalNumberingFromDDD.h>

Classes

struct  HcalID
 

Public Member Functions

 HcalNumberingFromDDD (const HcalDDDSimConstants *hcons)
 
HcalID unitID (double eta, double phi, int depth=1, int lay=-1) const
 
HcalID unitID (int det, const math::XYZVectorD &pos, int depth, int lay=-1) const
 
HcalID unitID (int det, double etaR, double phi, int depth, int lay=-1) const
 
HcalID unitID (int det, int zside, int depth, int etaR, int phi, int lay=-1) const
 
 ~HcalNumberingFromDDD ()
 

Private Attributes

const HcalDDDSimConstantshcalConstants
 

Detailed Description

Definition at line 16 of file HcalNumberingFromDDD.h.

Constructor & Destructor Documentation

◆ HcalNumberingFromDDD()

HcalNumberingFromDDD::HcalNumberingFromDDD ( const HcalDDDSimConstants hcons)

Definition at line 18 of file HcalNumberingFromDDD.cc.

18  : hcalConstants(hcons) {
19 #ifdef EDM_ML_DEBUG
20  edm::LogInfo("HCalGeom") << "Creating HcalNumberingFromDDD\n";
21 #endif
22 }

◆ ~HcalNumberingFromDDD()

HcalNumberingFromDDD::~HcalNumberingFromDDD ( )

Definition at line 24 of file HcalNumberingFromDDD.cc.

24  {
25 #ifdef EDM_ML_DEBUG
26  edm::LogInfo("HCalGeom") << "Deleting HcalNumberingFromDDD\n";
27 #endif
28 }

Member Function Documentation

◆ unitID() [1/4]

HcalNumberingFromDDD::HcalID HcalNumberingFromDDD::unitID ( double  eta,
double  phi,
int  depth = 1,
int  lay = -1 
) const

Definition at line 68 of file HcalNumberingFromDDD.cc.

68  {
69  std::pair<int, double> detEta = hcalConstants->getDetEta(eta, depth);
70  return unitID(detEta.first, detEta.second, fi, depth, lay);
71 }

References LEDCalibrationChannels::depth, PVValHelper::eta, HcalDDDSimConstants::getDetEta(), hcalConstants, and unitID().

◆ unitID() [2/4]

HcalNumberingFromDDD::HcalID HcalNumberingFromDDD::unitID ( int  det,
const math::XYZVectorD pos,
int  depth,
int  lay = -1 
) const

Definition at line 30 of file HcalNumberingFromDDD.cc.

33  {
34  double hx = point.x();
35  double hy = point.y();
36  double hz = point.z();
37  double hR = sqrt(hx * hx + hy * hy + hz * hz);
38  double htheta = (hR == 0. ? 0. : acos(std::max(std::min(hz / hR, 1.0), -1.0)));
39  double hsintheta = sin(htheta);
40  double hphi = (hR * hsintheta == 0. ? 0. : atan2(hy, hx));
41  double heta = (fabs(hsintheta) == 1. ? 0. : -log(fabs(tan(htheta / 2.))));
42 
43  int hsubdet = 0;
44  double etaR;
45 
46  //First eta index
47  if (det == 5) { // Forward HCal
48  hsubdet = static_cast<int>(HcalForward);
49  hR = sqrt(hx * hx + hy * hy);
50  etaR = (heta >= 0. ? hR : -hR);
51  } else { // Barrel or Endcap
52  etaR = heta;
53  if (det == 3) {
54  hsubdet = static_cast<int>(HcalBarrel);
55  etaR = hcalConstants->getEtaHO(heta, hx, hy, hz);
56  } else {
57  hsubdet = static_cast<int>(HcalEndcap);
58  }
59  }
60 
61 #ifdef EDM_ML_DEBUG
62  edm::LogVerbatim("HCalGeom") << "HcalNumberingFromDDD: point = " << point << " det " << det << ":" << hsubdet
63  << " eta/R " << etaR << " phi " << hphi << " depth " << depth << " layer " << lay;
64 #endif
65  return unitID(hsubdet, etaR, hphi, depth, lay);
66 }

References LEDCalibrationChannels::depth, HcalDDDSimConstants::getEtaHO(), HcalBarrel, hcalConstants, HcalEndcap, HcalForward, dqm-mbProfile::log, SiStripPI::max, min(), point, funct::sin(), mathSSE::sqrt(), and funct::tan().

Referenced by HcalDumpGeometry::dumpTouch(), SimG4HcalValidation::fill(), unitID(), and SimG4HGCalValidation::update().

◆ unitID() [3/4]

HcalNumberingFromDDD::HcalID HcalNumberingFromDDD::unitID ( int  det,
double  etaR,
double  phi,
int  depth,
int  lay = -1 
) const

Definition at line 73 of file HcalNumberingFromDDD.cc.

73  {
74  double hetaR = fabs(etaR);
75  int ieta = hcalConstants->getEta(det, lay, hetaR);
76  std::pair<double, double> ficons = hcalConstants->getPhiCons(det, ieta);
77 
78  int nphi = int((2._pi + 0.1 * ficons.second) / ficons.second);
79  int zside = etaR > 0 ? 1 : 0;
80  double hphi = phi + ficons.first;
81  if (hphi < 0)
82  hphi += (2._pi);
83  int iphi = int(hphi / ficons.second) + 1;
84  if (iphi > nphi)
85  iphi = 1;
86 
87 #ifdef EDM_ML_DEBUG
88  edm::LogVerbatim("HCalGeom") << "HcalNumberingFromDDD: etaR = " << etaR << " : " << zside << "/" << ieta << " phi "
89  << hphi << " : " << iphi << std::endl;
90 #endif
91  return unitID(det, zside, depth, ieta, iphi, lay);
92 }

References LEDCalibrationChannels::depth, HcalDDDSimConstants::getEta(), HcalDDDSimConstants::getPhiCons(), hcalConstants, LEDCalibrationChannels::ieta, createfilelist::int, LEDCalibrationChannels::iphi, nphi, phi, unitID(), and ecaldqm::zside().

◆ unitID() [4/4]

HcalNumberingFromDDD::HcalID HcalNumberingFromDDD::unitID ( int  det,
int  zside,
int  depth,
int  etaR,
int  phi,
int  lay = -1 
) const

Definition at line 94 of file HcalNumberingFromDDD.cc.

95  {
96  if (det == static_cast<int>(HcalBarrel) && lay > 17)
97  det = static_cast<int>(HcalOuter);
98 
99  int units = hcalConstants->unitPhi(det, etaR);
100  int iphi_skip = hcalConstants->phiNumber(phi, units);
101 
102  std::pair<int, int> etaDepth = hcalConstants->getEtaDepth(det, etaR, iphi_skip, zside, depth, lay);
103 
104 #ifdef EDM_ML_DEBUG
105  edm::LogVerbatim("HCalGeom") << "HcalNumberingFromDDD: phi units= " << units << " iphi_skip= " << iphi_skip;
106 #endif
107  HcalNumberingFromDDD::HcalID tmp(det, zside, etaDepth.second, etaDepth.first, phi, iphi_skip, lay);
108 
109 #ifdef EDM_ML_DEBUG
110  edm::LogVerbatim("HCalGeom") << "HcalNumberingFromDDD: det = " << det << " " << tmp.subdet << " zside = " << tmp.zside
111  << " depth = " << tmp.depth << " eta/R = " << tmp.etaR << " phi = " << tmp.phi
112  << " layer = " << tmp.lay;
113 #endif
114  return tmp;
115 }

References LEDCalibrationChannels::depth, HcalDDDSimConstants::getEtaDepth(), HcalBarrel, hcalConstants, HcalOuter, phi, HcalDDDSimConstants::phiNumber(), createJobs::tmp, HcalDDDSimConstants::unitPhi(), units(), and ecaldqm::zside().

Member Data Documentation

◆ hcalConstants

const HcalDDDSimConstants* HcalNumberingFromDDD::hcalConstants
private

Definition at line 33 of file HcalNumberingFromDDD.h.

Referenced by unitID().

HcalNumberingFromDDD::HcalID
Definition: HcalNumberingFromDDD.h:21
HcalDDDSimConstants::getEta
int getEta(const int &det, const int &lay, const double &hetaR) const
Definition: HcalDDDSimConstants.cc:225
min
T min(T a, T b)
Definition: MathUtil.h:58
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
HcalDDDSimConstants::getDetEta
std::pair< int, double > getDetEta(const double &eta, const int &depth) const
Definition: HcalDDDSimConstants.cc:201
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
HcalBarrel
Definition: HcalAssistant.h:33
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
HcalNumberingFromDDD::hcalConstants
const HcalDDDSimConstants * hcalConstants
Definition: HcalNumberingFromDDD.h:33
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
units
TString units(TString variable, Char_t axis)
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
nphi
const int nphi
Definition: CMTRawAnalyzer.h:424
HcalDDDSimConstants::getEtaHO
double getEtaHO(const double &etaR, const double &x, const double &y, const double &z) const
Definition: HcalDDDSimConstants.cc:295
PVValHelper::eta
Definition: PVValidationHelpers.h:69
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HcalOuter
Definition: HcalAssistant.h:35
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
HcalDDDSimConstants::unitPhi
int unitPhi(const int &det, const int &etaR) const
Definition: HcalDDDSimConstants.cc:729
HcalDDDSimConstants::getEtaDepth
std::pair< int, int > getEtaDepth(const int &det, int etaR, const int &phi, const int &zside, int depth, const int &lay) const
Definition: HcalDDDSimConstants.cc:252
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
createfilelist.int
int
Definition: createfilelist.py:10
HcalDDDSimConstants::phiNumber
int phiNumber(const int &phi, const int &unit) const
Definition: HcalDDDSimConstants.cc:684
HcalForward
Definition: HcalAssistant.h:36
DDAxes::phi
HcalEndcap
Definition: HcalAssistant.h:34
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
HcalDDDSimConstants::getPhiCons
std::pair< double, double > getPhiCons(const int &det, const int &ieta) const
Definition: HcalDDDSimConstants.cc:465
HcalNumberingFromDDD::unitID
HcalID unitID(int det, const math::XYZVectorD &pos, int depth, int lay=-1) const
Definition: HcalNumberingFromDDD.cc:30
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
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