CMS 3D CMS Logo

HcalTB02HcalNumberingScheme Class Reference

Description: Numbering scheme for hadron calorimeter in 2002 test beam. More...

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

Inheritance diagram for HcalTB02HcalNumberingScheme:

HcalTB02NumberingScheme

List of all members.

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


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.

00026                                                          : 
00027   HcalTB02NumberingScheme(), phiScale(1000000), etaScale(10000) {
00028   edm::LogInfo("HcalTBSim") << "Creating HcalTB02HcalNumberingScheme";
00029 }

HcalTB02HcalNumberingScheme::~HcalTB02HcalNumberingScheme (  )  [virtual]

Definition at line 31 of file HcalTB02HcalNumberingScheme.cc.

00031                                                           {
00032   edm::LogInfo("HcalTBSim") << "Deleting HcalTB02HcalNumberingScheme";
00033 }


Member Function Documentation

int HcalTB02HcalNumberingScheme::getetaID ( int  sID  )  const

Definition at line 106 of file HcalTB02HcalNumberingScheme.cc.

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

Referenced by HcalTB02Analysis::update().

00106                                                        {
00107 
00108   sID = abs(sID);
00109   int aux = sID - int(float(sID)/float(phiScale))*phiScale;
00110   int etaID = int(float(aux)/float(etaScale));
00111 
00112   LogDebug("HcalTBSim") << "HcalTB02HcalNumberingScheme:: scintID " << sID
00113                         << " eta = " << etaID;
00114   return etaID;
00115 
00116 }    

int HcalTB02HcalNumberingScheme::getetaScaleF (  )  const [inline]

Definition at line 33 of file HcalTB02HcalNumberingScheme.h.

References etaScale.

00033 { return etaScale;}

int HcalTB02HcalNumberingScheme::getlayerID ( int  sID  )  const

Definition at line 78 of file HcalTB02HcalNumberingScheme.cc.

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

Referenced by HcalTB02Analysis::update().

00078                                                          {
00079 
00080   sID = abs(sID);
00081   int layerID = sID;
00082   if ( (layerID != 17) && (layerID != 18) )
00083     layerID = sID - int(float(sID)/float(etaScale))*etaScale;
00084 
00085   LogDebug("HcalTBSim") << "HcalTB02HcalNumberingScheme:: scintID " << sID 
00086                         << " layer = " << layerID;
00087   return layerID;
00088 }      

int HcalTB02HcalNumberingScheme::getphiID ( int  sID  )  const

Definition at line 90 of file HcalTB02HcalNumberingScheme.cc.

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

Referenced by HcalTB02Analysis::update().

00090                                                        {
00091 
00092   float IDsign = 1.;
00093   if (sID<0) IDsign = -1;
00094   sID = abs(sID);
00095   int phiID = int(float(sID)/float(phiScale));
00096   LogDebug("HcalTBSim") << "HcalTB02HcalNumberingScheme:: scintID " << sID 
00097                         << " phi = " << phiID;
00098   if (IDsign>0) {
00099     phiID += 4;
00100   } else {
00101     phiID = abs(phiID-3);
00102   }
00103   return phiID;
00104 }      

int HcalTB02HcalNumberingScheme::getphiScaleF (  )  const [inline]

Definition at line 32 of file HcalTB02HcalNumberingScheme.h.

References phiScale.

00032 { return phiScale;}

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

Implements HcalTB02NumberingScheme.

Definition at line 39 of file HcalTB02HcalNumberingScheme.cc.

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

00039                                                                     {
00040 
00041   int scintID = 0;
00042 
00043   G4StepPoint* preStepPoint = aStep->GetPreStepPoint(); 
00044   G4ThreeVector    hitPoint = preStepPoint->GetPosition();
00045   float hx = hitPoint.x();
00046   float hy = hitPoint.y();
00047   float hz = hitPoint.z();
00048   float hr = std::sqrt( pow(hx,2)+pow(hy,2) );
00049 
00050   // Check if hit happened in first HO layer or second.
00051 
00052   if ( (hr > 3.*m) && (hr < 3.830*m) ) return scintID=17;
00053   if (hr > 3.830*m)                    return scintID=18;
00054 
00055   // Compute the scintID in the HB.
00056 
00057   float hR = hitPoint.mag();//sqrt( pow(hx,2)+pow(hy,2)+pow(hz,2) );
00058   float htheta =  (hR == 0. ? 0. : acos(max(min(hz/hR,float(1.)),float(-1.))));
00059   float hsintheta = sin(htheta);
00060   float hphi = (hR*hsintheta == 0. ? 0. :acos( max(min(hx/(hR*hsintheta),float(1.)),float(-1.)) ) );
00061   float heta = ( fabs(hsintheta) == 1.? 0. : -log(fabs(tan(htheta/2.))) );
00062   int eta = int(heta/0.087);
00063   int phi = int(hphi/(5.*degree));
00064 
00065   G4VPhysicalVolume*  thePV = preStepPoint->GetPhysicalVolume();
00066   int ilayer = ((thePV->GetCopyNo())/10)%100;
00067   LogDebug("HcalTBSim") << "HcalTB02HcalNumberingScheme:: Layer " 
00068                         << thePV->GetName() << " found at phi = " << phi
00069                         << " eta = " << eta << " lay = " << thePV->GetCopyNo()
00070                         << " " << ilayer;
00071 
00072   scintID = phiScale*phi + etaScale*eta + ilayer;
00073   if (hy<0.) scintID = -scintID;
00074 
00075   return scintID;
00076 }


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().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:23:57 2009 for CMSSW by  doxygen 1.5.4