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 24 of file HcalTB02HcalNumberingScheme.h.

Constructor & Destructor Documentation

HcalTB02HcalNumberingScheme::HcalTB02HcalNumberingScheme ( )

Definition at line 27 of file HcalTB02HcalNumberingScheme.cc.

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

Definition at line 32 of file HcalTB02HcalNumberingScheme.cc.

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

Member Function Documentation

int HcalTB02HcalNumberingScheme::getetaID ( int  sID) const

Definition at line 107 of file HcalTB02HcalNumberingScheme.cc.

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

Referenced by HcalTB02Analysis::update().

107  {
108 
109  sID = abs(sID);
110  int aux = sID - int(float(sID)/float(phiScale))*phiScale;
111  int etaID = int(float(aux)/float(etaScale));
112 
113  LogDebug("HcalTBSim") << "HcalTB02HcalNumberingScheme:: scintID " << sID
114  << " eta = " << etaID;
115  return etaID;
116 
117 }
#define LogDebug(id)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int HcalTB02HcalNumberingScheme::getetaScaleF ( ) const
inline

Definition at line 32 of file HcalTB02HcalNumberingScheme.h.

References etaScale.

int HcalTB02HcalNumberingScheme::getlayerID ( int  sID) const

Definition at line 79 of file HcalTB02HcalNumberingScheme.cc.

References funct::abs(), etaScale, and LogDebug.

Referenced by HcalTB02Analysis::update().

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

Definition at line 91 of file HcalTB02HcalNumberingScheme.cc.

References funct::abs(), LogDebug, and phiScale.

Referenced by HcalTB02Analysis::update().

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

Definition at line 31 of file HcalTB02HcalNumberingScheme.h.

References phiScale.

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

Implements HcalTB02NumberingScheme.

Definition at line 40 of file HcalTB02HcalNumberingScheme.cc.

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

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

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

int HcalTB02HcalNumberingScheme::phiScale
private

Definition at line 40 of file HcalTB02HcalNumberingScheme.h.

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