CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
virtual int getUnitID (const G4Step *aStep) const
 
 HcalTB02HcalNumberingScheme ()
 
virtual ~HcalTB02HcalNumberingScheme ()
 
- 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 25 of file HcalTB02HcalNumberingScheme.h.

Constructor & Destructor Documentation

HcalTB02HcalNumberingScheme::HcalTB02HcalNumberingScheme ( )

Definition at line 26 of file HcalTB02HcalNumberingScheme.cc.

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

Definition at line 31 of file HcalTB02HcalNumberingScheme.cc.

31  {
32  edm::LogInfo("HcalTBSim") << "Deleting HcalTB02HcalNumberingScheme";
33 }

Member Function Documentation

int HcalTB02HcalNumberingScheme::getetaID ( int  sID) const

Definition at line 106 of file HcalTB02HcalNumberingScheme.cc.

References abs, printConversionInfo::aux, etaScale, LogDebug, and phiScale.

Referenced by HcalTB02Analysis::update().

106  {
107 
108  sID = abs(sID);
109  int aux = sID - int(float(sID)/float(phiScale))*phiScale;
110  int etaID = int(float(aux)/float(etaScale));
111 
112  LogDebug("HcalTBSim") << "HcalTB02HcalNumberingScheme:: scintID " << sID
113  << " eta = " << etaID;
114  return etaID;
115 
116 }
#define LogDebug(id)
#define abs(x)
Definition: mlp_lapack.h:159
int HcalTB02HcalNumberingScheme::getetaScaleF ( ) const
inline

Definition at line 33 of file HcalTB02HcalNumberingScheme.h.

References etaScale.

int HcalTB02HcalNumberingScheme::getlayerID ( int  sID) const

Definition at line 78 of file HcalTB02HcalNumberingScheme.cc.

References abs, etaScale, and LogDebug.

Referenced by HcalTB02Analysis::update().

78  {
79 
80  sID = abs(sID);
81  int layerID = sID;
82  if ( (layerID != 17) && (layerID != 18) )
83  layerID = sID - int(float(sID)/float(etaScale))*etaScale;
84 
85  LogDebug("HcalTBSim") << "HcalTB02HcalNumberingScheme:: scintID " << sID
86  << " layer = " << layerID;
87  return layerID;
88 }
#define LogDebug(id)
#define abs(x)
Definition: mlp_lapack.h:159
int HcalTB02HcalNumberingScheme::getphiID ( int  sID) const

Definition at line 90 of file HcalTB02HcalNumberingScheme.cc.

References abs, LogDebug, and phiScale.

Referenced by HcalTB02Analysis::update().

90  {
91 
92  float IDsign = 1.;
93  if (sID<0) IDsign = -1;
94  sID = abs(sID);
95  int phiID = int(float(sID)/float(phiScale));
96  LogDebug("HcalTBSim") << "HcalTB02HcalNumberingScheme:: scintID " << sID
97  << " phi = " << phiID;
98  if (IDsign>0) {
99  phiID += 4;
100  } else {
101  phiID = abs(phiID-3);
102  }
103  return phiID;
104 }
#define LogDebug(id)
#define abs(x)
Definition: mlp_lapack.h:159
int HcalTB02HcalNumberingScheme::getphiScaleF ( ) const
inline

Definition at line 32 of file HcalTB02HcalNumberingScheme.h.

References phiScale.

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

Implements HcalTB02NumberingScheme.

Definition at line 39 of file HcalTB02HcalNumberingScheme.cc.

References eta(), etaScale, funct::log(), LogDebug, m, max(), min, phi, phiScale, funct::pow(), funct::sin(), mathSSE::sqrt(), and funct::tan().

39  {
40 
41  int scintID = 0;
42 
43  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
44  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) ) return scintID=17;
53  if (hr > 3.830*m) 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(max(min(hz/hR,float(1.)),float(-1.))));
59  float hsintheta = sin(htheta);
60  float hphi = (hR*hsintheta == 0. ? 0. :acos( max(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  LogDebug("HcalTBSim") << "HcalTB02HcalNumberingScheme:: Layer "
68  << thePV->GetName() << " found at phi = " << phi
69  << " eta = " << eta << " lay = " << thePV->GetCopyNo()
70  << " " << ilayer;
71 
72  scintID = phiScale*phi + etaScale*eta + ilayer;
73  if (hy<0.) scintID = -scintID;
74 
75  return scintID;
76 }
#define LogDebug(id)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
#define min(a, b)
Definition: mlp_lapack.h:161
T eta() const
const T & max(const T &a, const T &b)
T sqrt(T t)
Definition: SSEVec.h:28
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Log< T >::type log(const T &t)
Definition: Log.h:22
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
Definition: DDAxes.h:10

Member Data Documentation

int HcalTB02HcalNumberingScheme::etaScale
private

Definition at line 42 of file HcalTB02HcalNumberingScheme.h.

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

int HcalTB02HcalNumberingScheme::phiScale
private

Definition at line 41 of file HcalTB02HcalNumberingScheme.h.

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