CMS 3D CMS Logo

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

#include <SimG4CMS/HcalTestBeam/interface/HcalTB02HcalNumberingScheme.h>

Inheritance diagram for HcalTB02HcalNumberingScheme:
HcalTB02NumberingScheme

Public Member Functions

int getetaID (int sID) const
 
int getetaScaleF () const
 
int getlayerID (int sID) const
 
int getphiID (int sID) const
 
int getphiScaleF () const
 
int getUnitID (const G4Step *aStep) const override
 
 HcalTB02HcalNumberingScheme ()
 
 ~HcalTB02HcalNumberingScheme () override
 
- Public Member Functions inherited from HcalTB02NumberingScheme
 HcalTB02NumberingScheme ()
 
virtual ~HcalTB02NumberingScheme ()
 

Private Attributes

int etaScale
 
int phiScale
 

Detailed Description

Description: Numbering scheme for hadron calorimeter in 2002 test beam

Usage: Sets up unique identifier for HB towers in 2002 test beam

Definition at line 24 of file HcalTB02HcalNumberingScheme.h.

Constructor & Destructor Documentation

◆ HcalTB02HcalNumberingScheme()

HcalTB02HcalNumberingScheme::HcalTB02HcalNumberingScheme ( )

Definition at line 25 of file HcalTB02HcalNumberingScheme.cc.

26  : HcalTB02NumberingScheme(), phiScale(1000000), etaScale(10000) {
27  edm::LogVerbatim("HcalTBSim") << "Creating HcalTB02HcalNumberingScheme";
28 }

◆ ~HcalTB02HcalNumberingScheme()

HcalTB02HcalNumberingScheme::~HcalTB02HcalNumberingScheme ( )
override

Definition at line 30 of file HcalTB02HcalNumberingScheme.cc.

30  {
31 #ifdef EDM_ML_DEBUG
32  edm::LogVerbatim("HcalTBSim") << "Deleting HcalTB02HcalNumberingScheme";
33 #endif
34 }

Member Function Documentation

◆ getetaID()

int HcalTB02HcalNumberingScheme::getetaID ( int  sID) const

Definition at line 110 of file HcalTB02HcalNumberingScheme.cc.

110  {
111  sID = abs(sID);
112  int aux = sID - int(float(sID) / float(phiScale)) * phiScale;
113  int etaID = int(float(aux) / float(etaScale));
114 
115 #ifdef EDM_ML_DEBUG
116  edm::LogVerbatim("HcalTBSim") << "HcalTB02HcalNumberingScheme:: scintID " << sID << " eta = " << etaID;
117 #endif
118  return etaID;
119 }

References funct::abs(), printConversionInfo::aux, etaScale, createfilelist::int, and phiScale.

◆ getetaScaleF()

int HcalTB02HcalNumberingScheme::getetaScaleF ( ) const
inline

Definition at line 31 of file HcalTB02HcalNumberingScheme.h.

31 { return etaScale; }

References etaScale.

◆ getlayerID()

int HcalTB02HcalNumberingScheme::getlayerID ( int  sID) const

Definition at line 81 of file HcalTB02HcalNumberingScheme.cc.

81  {
82  sID = abs(sID);
83  int layerID = sID;
84  if ((layerID != 17) && (layerID != 18))
85  layerID = sID - int(float(sID) / float(etaScale)) * etaScale;
86 
87 #ifdef EDM_ML_DEBUG
88  edm::LogVerbatim("HcalTBSim") << "HcalTB02HcalNumberingScheme:: scintID " << sID << " layer = " << layerID;
89 #endif
90  return layerID;
91 }

References funct::abs(), etaScale, and createfilelist::int.

◆ getphiID()

int HcalTB02HcalNumberingScheme::getphiID ( int  sID) const

Definition at line 93 of file HcalTB02HcalNumberingScheme.cc.

93  {
94  float IDsign = 1.;
95  if (sID < 0)
96  IDsign = -1;
97  sID = abs(sID);
98  int phiID = int(float(sID) / float(phiScale));
99 #ifdef EDM_ML_DEBUG
100  edm::LogVerbatim("HcalTBSim") << "HcalTB02HcalNumberingScheme:: scintID " << sID << " phi = " << phiID;
101 #endif
102  if (IDsign > 0) {
103  phiID += 4;
104  } else {
105  phiID = abs(phiID - 3);
106  }
107  return phiID;
108 }

References funct::abs(), createfilelist::int, and phiScale.

◆ getphiScaleF()

int HcalTB02HcalNumberingScheme::getphiScaleF ( ) const
inline

Definition at line 30 of file HcalTB02HcalNumberingScheme.h.

30 { return phiScale; }

References phiScale.

◆ getUnitID()

int HcalTB02HcalNumberingScheme::getUnitID ( const G4Step *  aStep) const
overridevirtual

Implements HcalTB02NumberingScheme.

Definition at line 40 of file HcalTB02HcalNumberingScheme.cc.

40  {
41  int scintID = 0;
42 
43  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
44  const G4ThreeVector& hitPoint = preStepPoint->GetPosition();
45  float hx = hitPoint.x();
46  float hy = hitPoint.y();
47  float hz = hitPoint.z();
48  float hr = std::sqrt(pow(hx, 2) + pow(hy, 2));
49 
50  // Check if hit happened in first HO layer or second.
51 
52  if ((hr > 3. * m) && (hr < 3.830 * m))
53  return scintID = 17;
54  if (hr > 3.830 * m)
55  return scintID = 18;
56 
57  // Compute the scintID in the HB.
58 
59  float hR = hitPoint.mag(); //sqrt( pow(hx,2)+pow(hy,2)+pow(hz,2) );
60  float htheta = (hR == 0. ? 0. : acos(std::max(std::min(hz / hR, float(1.)), float(-1.))));
61  float hsintheta = sin(htheta);
62  float hphi = (hR * hsintheta == 0. ? 0. : acos(std::max(std::min(hx / (hR * hsintheta), float(1.)), float(-1.))));
63  float heta = (fabs(hsintheta) == 1. ? 0. : -log(fabs(tan(htheta / 2.))));
64  int eta = int(heta / 0.087);
65  int phi = int(hphi / (5. * degree));
66 
67  G4VPhysicalVolume* thePV = preStepPoint->GetPhysicalVolume();
68  int ilayer = ((thePV->GetCopyNo()) / 10) % 100;
69 #ifdef EDM_ML_DEBUG
70  edm::LogVerbatim("HcalTBSim") << "HcalTB02HcalNumberingScheme:: Layer " << thePV->GetName()
71  << " found at phi = " << phi << " eta = " << eta << " lay = " << thePV->GetCopyNo()
72  << " " << ilayer;
73 #endif
74  scintID = phiScale * phi + etaScale * eta + ilayer;
75  if (hy < 0.)
76  scintID = -scintID;
77 
78  return scintID;
79 }

References PVValHelper::eta, etaScale, createfilelist::int, dqm-mbProfile::log, visualization-live-secondInstance_cfg::m, SiStripPI::max, min(), phi, phiScale, funct::pow(), funct::sin(), mathSSE::sqrt(), and funct::tan().

Member Data Documentation

◆ etaScale

int HcalTB02HcalNumberingScheme::etaScale
private

Definition at line 39 of file HcalTB02HcalNumberingScheme.h.

Referenced by getetaID(), getetaScaleF(), getlayerID(), and getUnitID().

◆ phiScale

int HcalTB02HcalNumberingScheme::phiScale
private

Definition at line 38 of file HcalTB02HcalNumberingScheme.h.

Referenced by getetaID(), getphiID(), getphiScaleF(), and getUnitID().

min
T min(T a, T b)
Definition: MathUtil.h:58
HcalTB02HcalNumberingScheme::phiScale
int phiScale
Definition: HcalTB02HcalNumberingScheme.h:38
HcalTB02HcalNumberingScheme::etaScale
int etaScale
Definition: HcalTB02HcalNumberingScheme.h:39
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
PVValHelper::eta
Definition: PVValidationHelpers.h:70
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:78
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HcalTB02NumberingScheme::HcalTB02NumberingScheme
HcalTB02NumberingScheme()
Definition: HcalTB02NumberingScheme.h:26
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
printConversionInfo.aux
aux
Definition: printConversionInfo.py:19
createfilelist.int
int
Definition: createfilelist.py:10
DDAxes::phi
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22