#include <SimG4CMS/HcalTestBeam/interface/HcalTB02HcalNumberingScheme.h>
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 () |
Private Attributes | |
int | etaScale |
int | phiScale |
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.
HcalTB02HcalNumberingScheme::HcalTB02HcalNumberingScheme | ( | ) |
Definition at line 26 of file HcalTB02HcalNumberingScheme.cc.
: HcalTB02NumberingScheme(), phiScale(1000000), etaScale(10000) { edm::LogInfo("HcalTBSim") << "Creating HcalTB02HcalNumberingScheme"; }
HcalTB02HcalNumberingScheme::~HcalTB02HcalNumberingScheme | ( | ) | [virtual] |
Definition at line 31 of file HcalTB02HcalNumberingScheme.cc.
{ edm::LogInfo("HcalTBSim") << "Deleting HcalTB02HcalNumberingScheme"; }
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().
int HcalTB02HcalNumberingScheme::getetaScaleF | ( | ) | const [inline] |
Definition at line 33 of file HcalTB02HcalNumberingScheme.h.
References etaScale.
{ return etaScale;}
int HcalTB02HcalNumberingScheme::getlayerID | ( | int | sID | ) | const |
Definition at line 78 of file HcalTB02HcalNumberingScheme.cc.
References abs, etaScale, and LogDebug.
Referenced by HcalTB02Analysis::update().
int HcalTB02HcalNumberingScheme::getphiID | ( | int | sID | ) | const |
Definition at line 90 of file HcalTB02HcalNumberingScheme.cc.
References abs, LogDebug, and phiScale.
Referenced by HcalTB02Analysis::update().
int HcalTB02HcalNumberingScheme::getphiScaleF | ( | ) | const [inline] |
Definition at line 32 of file HcalTB02HcalNumberingScheme.h.
References phiScale.
{ return 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().
{ int scintID = 0; G4StepPoint* preStepPoint = aStep->GetPreStepPoint(); G4ThreeVector hitPoint = preStepPoint->GetPosition(); float hx = hitPoint.x(); float hy = hitPoint.y(); float hz = hitPoint.z(); float hr = std::sqrt( pow(hx,2)+pow(hy,2) ); // Check if hit happened in first HO layer or second. if ( (hr > 3.*m) && (hr < 3.830*m) ) return scintID=17; if (hr > 3.830*m) return scintID=18; // Compute the scintID in the HB. float hR = hitPoint.mag();//sqrt( pow(hx,2)+pow(hy,2)+pow(hz,2) ); float htheta = (hR == 0. ? 0. : acos(max(min(hz/hR,float(1.)),float(-1.)))); float hsintheta = sin(htheta); float hphi = (hR*hsintheta == 0. ? 0. :acos( max(min(hx/(hR*hsintheta),float(1.)),float(-1.)) ) ); float heta = ( fabs(hsintheta) == 1.? 0. : -log(fabs(tan(htheta/2.))) ); int eta = int(heta/0.087); int phi = int(hphi/(5.*degree)); G4VPhysicalVolume* thePV = preStepPoint->GetPhysicalVolume(); int ilayer = ((thePV->GetCopyNo())/10)%100; LogDebug("HcalTBSim") << "HcalTB02HcalNumberingScheme:: Layer " << thePV->GetName() << " found at phi = " << phi << " eta = " << eta << " lay = " << thePV->GetCopyNo() << " " << ilayer; scintID = phiScale*phi + etaScale*eta + ilayer; if (hy<0.) scintID = -scintID; return scintID; }
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().