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  edm::LogVerbatim("HcalTBSim") << "Deleting HcalTB02HcalNumberingScheme";
32 }

Member Function Documentation

◆ getetaID()

int HcalTB02HcalNumberingScheme::getetaID ( int  sID) const

Definition at line 103 of file HcalTB02HcalNumberingScheme.cc.

103  {
104  sID = abs(sID);
105  int aux = sID - int(float(sID) / float(phiScale)) * phiScale;
106  int etaID = int(float(aux) / float(etaScale));
107 
108  edm::LogVerbatim("HcalTBSim") << "HcalTB02HcalNumberingScheme:: scintID " << sID << " eta = " << etaID;
109  return etaID;
110 }

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 78 of file HcalTB02HcalNumberingScheme.cc.

78  {
79  sID = abs(sID);
80  int layerID = sID;
81  if ((layerID != 17) && (layerID != 18))
82  layerID = sID - int(float(sID) / float(etaScale)) * etaScale;
83 
84  edm::LogVerbatim("HcalTBSim") << "HcalTB02HcalNumberingScheme:: scintID " << sID << " layer = " << layerID;
85  return layerID;
86 }

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

◆ getphiID()

int HcalTB02HcalNumberingScheme::getphiID ( int  sID) const

Definition at line 88 of file HcalTB02HcalNumberingScheme.cc.

88  {
89  float IDsign = 1.;
90  if (sID < 0)
91  IDsign = -1;
92  sID = abs(sID);
93  int phiID = int(float(sID) / float(phiScale));
94  edm::LogVerbatim("HcalTBSim") << "HcalTB02HcalNumberingScheme:: scintID " << sID << " phi = " << phiID;
95  if (IDsign > 0) {
96  phiID += 4;
97  } else {
98  phiID = abs(phiID - 3);
99  }
100  return phiID;
101 }

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 38 of file HcalTB02HcalNumberingScheme.cc.

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

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:69
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
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
edm::LogVerbatim
Definition: MessageLogger.h:297
DDAxes::phi
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:30
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22