Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

NonProjCalLayer Class Reference

#include <NonProjCalLayer.hh>

Collaboration diagram for NonProjCalLayer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 NonProjCalLayer (const NonProjCalGeomParams &par, const int ilay)
 ~NonProjCalLayer ()
int Index () const
int NumCellsAlongPhi () const
int NumCellsAlongZ () const
NPCellID getClosestCell (const G4ThreeVector &pos) const
bool activeCellContains (const NPCellID &id, const G4ThreeVector &pos) const
double getCellCenterCylR (const NPCellID &id) const
double getCellCenterPhi (const NPCellID &id) const
double getCellCenterZ (const NPCellID &id) const
G4ThreeVector getCellCenter (const NPCellID &id) const
double getCellCenterX (const NPCellID &id) const
double getCellCenterY (const NPCellID &id) const
double getCellCenterTheta (const NPCellID &id) const
double getCellCenterSphR (const NPCellID &id) const
double getInnerRadiusOfActive () const
double getCenterRadiusOfActive () const
int getNcellsAlongZ () const
int getNcellsAlongPhi () const
double getCellSizeAlongZ () const
double getDeltaPhi () const
double getCellSizeAlongPhi () const

Private Attributes

const NonProjCalGeomParams_par
unsigned int layerIndex
double rc
double deltaR
int nphi
double phic
double deltaPhi
int nz
double zc
double deltaZ

Constructor & Destructor Documentation

NonProjCalLayer::NonProjCalLayer const NonProjCalGeomParams par,
const int  ilay
 

Definition at line 4 of file NonProjCalLayer.cc.

References _par, deltaPhi, deltaR, deltaZ, layerIndex, nphi, nz, phic, NonProjCalGeomParams::PreAbsThickness(), rc, and zc.

00004                                                                                 {
00005 
00006   // layer number
00007   layerIndex = ilay;
00008   _par = &par;
00009 
00010   // layer thickness
00011   double preabs_thick = par.PreAbsThickness();
00012   double postabs_thick = par.PostAbsThickness();  
00013   double sens_thick = par.SensorThickness();
00014   double layer_thick = preabs_thick + sens_thick + postabs_thick;
00015   // inner radius of sensitive layer
00016   double ri= par.GlobalRmin() + layerIndex*layer_thick + preabs_thick;
00017 //      System.out.println("abst="+abs_thick+", senst="+sens_thick
00018 //                         +", layt="+layer_thick);
00019 
00020   // cyl coord r for cell center
00021   rc = ri + sens_thick/2;
00022   // radial distance between adjacent layers
00023   deltaR = layer_thick;
00024 //      System.out.println("rc="+rc+", deltaR="+deltaR);
00025 
00026   // number of cells along phi in current layer
00027   nphi = (int)floor( 2.*M_PI*ri / par.CellDimPhi() );
00028   // phi angle corresponding to a single cell in current layer
00029   deltaPhi = 2.*M_PI / nphi;
00030   // azymuth for center of cell indexed iphi=0 in current layer
00031   phic = deltaPhi / 2;
00032 //      System.out.println("nphi="+nphi+", deltaPhi="+deltaPhi
00033 //                         +", phic="+phic);
00034 //      double philen = ri * deltaPhi;
00035 //      System.out.println("philen="+philen);
00036 
00037   // number of cells along z in current layer
00038   double zmax = par.GlobalZmax();
00039   nz = (int)floor( 2.*zmax / par.CellDimZ() );
00040   // distance along z between neighbor cell centers
00041   deltaZ = 2.*zmax / nz;
00042   // z-coord of cell indexed iz=0 in current layer
00043   zc = -double(nz-1)*deltaZ/2.;  // works for any nz!
00044 //   G4cout <<"zmax="<< zmax <<", nz="<< nz <<", dZ="<< deltaZ
00045 //       <<", zc="<< zc << G4endl;
00046 }

NonProjCalLayer::~NonProjCalLayer  )  [inline]
 

Definition at line 24 of file NonProjCalLayer.hh.

00024 {}


Member Function Documentation

bool NonProjCalLayer::activeCellContains const NPCellID id,
const G4ThreeVector &  pos
const
 

Definition at line 61 of file NonProjCalLayer.cc.

References _par, deltaPhi, deltaZ, NPCellID::iphi, NPCellID::ir, NPCellID::iz, layerIndex, phic, rc, NonProjCalGeomParams::SensorThickness(), and zc.

00063 {
00064   assert( id.ir == layerIndex ); // otherwise is a nonsense...
00065   // Check it is within sensor thickness
00066   double r = sqrt( pos.x()*pos.x() + pos.y()*pos.y() );
00067   if( fabs(r-rc) > _par->SensorThickness()/2 ) return false;
00068 
00069   // point is in layer, check cell indices
00070   unsigned int iz = (int)floor((pos.z()-zc)/deltaZ + 0.5);
00071   if( iz != id.iz ) return false;
00072 
00073   double phi = atan( pos.y() / pos.x() );
00074   unsigned int iphi = (int)floor((phi-phic)/deltaPhi + 0.5);
00075   if( iphi != id.iphi ) return false;
00076 
00077   // well... ok
00078   return true;
00079 }

G4ThreeVector NonProjCalLayer::getCellCenter const NPCellID id  )  const [inline]
 

Definition at line 46 of file NonProjCalLayer.hh.

References getCellCenterX(), getCellCenterY(), and getCellCenterZ().

00046                                                         {
00047     return G4ThreeVector(getCellCenterX(id),
00048                          getCellCenterY(id),
00049                          getCellCenterZ(id));
00050   }

double NonProjCalLayer::getCellCenterCylR const NPCellID id  )  const [inline]
 

Definition at line 37 of file NonProjCalLayer.hh.

References rc.

00037                                                      {
00038     return rc;
00039   }

double NonProjCalLayer::getCellCenterPhi const NPCellID id  )  const [inline]
 

Definition at line 40 of file NonProjCalLayer.hh.

References deltaPhi, NPCellID::iphi, and phic.

Referenced by getCellCenterX(), and getCellCenterY().

00040                                                     {
00041     return phic + id.iphi * deltaPhi;
00042   }

double NonProjCalLayer::getCellCenterSphR const NPCellID id  )  const [inline]
 

Definition at line 61 of file NonProjCalLayer.hh.

References getCellCenterZ(), rc, and zc.

00061                                                      {
00062     double zc = getCellCenterZ(id);
00063     return std::sqrt( rc*rc + zc*zc );
00064 //      return Math.sqrt( rc*rc + Math.pow(getCellCenterZ(id),2) );
00065   }

double NonProjCalLayer::getCellCenterTheta const NPCellID id  )  const [inline]
 

Definition at line 58 of file NonProjCalLayer.hh.

References getCellCenterZ(), and rc.

00058                                                       {
00059     return M_PI/2 - std::atan( getCellCenterZ(id)/rc );
00060   }

double NonProjCalLayer::getCellCenterX const NPCellID id  )  const [inline]
 

Definition at line 52 of file NonProjCalLayer.hh.

References getCellCenterPhi(), and rc.

Referenced by getCellCenter().

00052                                                   {
00053     return rc * std::cos( getCellCenterPhi(id) );
00054   }

double NonProjCalLayer::getCellCenterY const NPCellID id  )  const [inline]
 

Definition at line 55 of file NonProjCalLayer.hh.

References getCellCenterPhi(), and rc.

Referenced by getCellCenter().

00055                                                   {
00056     return rc * std::sin( getCellCenterPhi(id) );
00057   }

double NonProjCalLayer::getCellCenterZ const NPCellID id  )  const [inline]
 

Definition at line 43 of file NonProjCalLayer.hh.

References deltaZ, NPCellID::iz, and zc.

Referenced by getCellCenter(), getCellCenterSphR(), and getCellCenterTheta().

00043                                                   {
00044     return zc + id.iz * deltaZ;
00045   }

double NonProjCalLayer::getCellSizeAlongPhi  )  const [inline]
 

Definition at line 85 of file NonProjCalLayer.hh.

References deltaPhi, and getInnerRadiusOfActive().

00085                                      {
00086     // Note that this is measured along inner face, not along center
00087     return deltaPhi * getInnerRadiusOfActive();
00088   }

double NonProjCalLayer::getCellSizeAlongZ  )  const [inline]
 

Definition at line 79 of file NonProjCalLayer.hh.

References deltaZ.

00079                                    {
00080     return deltaZ;
00081   }

double NonProjCalLayer::getCenterRadiusOfActive  )  const [inline]
 

Definition at line 70 of file NonProjCalLayer.hh.

References rc.

00070                                          {
00071     return rc;
00072   }

NPCellID NonProjCalLayer::getClosestCell const G4ThreeVector &  pos  )  const
 

Definition at line 50 of file NonProjCalLayer.cc.

References deltaPhi, deltaZ, layerIndex, phic, and zc.

00051 {
00052   // calculate cell indices
00053   double phi = pos.phi();
00054   if(phi<0) phi += 2*M_PI;
00055   int iphi = (int)floor( (phi-phic)/deltaPhi + 0.5 );
00056   int iz   = (int)floor( (pos.z()-zc)/deltaZ + 0.5 );
00057   return NPCellID(layerIndex, iphi, iz);
00058 }

double NonProjCalLayer::getDeltaPhi  )  const [inline]
 

Definition at line 82 of file NonProjCalLayer.hh.

References deltaPhi.

00082                              {
00083     return deltaPhi;
00084   }

double NonProjCalLayer::getInnerRadiusOfActive  )  const [inline]
 

Definition at line 67 of file NonProjCalLayer.hh.

References _par, rc, and NonProjCalGeomParams::SensorThickness().

Referenced by getCellSizeAlongPhi().

00067                                         {
00068     return rc - _par->SensorThickness()/2;
00069   }

int NonProjCalLayer::getNcellsAlongPhi  )  const [inline]
 

Definition at line 76 of file NonProjCalLayer.hh.

References nphi.

00076                                 {
00077     return nphi;
00078   }

int NonProjCalLayer::getNcellsAlongZ  )  const [inline]
 

Definition at line 73 of file NonProjCalLayer.hh.

References nz.

00073                               {
00074     return nz;
00075   }

int NonProjCalLayer::Index  )  const [inline]
 

Definition at line 27 of file NonProjCalLayer.hh.

References layerIndex.

00027 { return layerIndex; }

int NonProjCalLayer::NumCellsAlongPhi  )  const [inline]
 

Definition at line 28 of file NonProjCalLayer.hh.

References nphi.

00028 { return nphi; }

int NonProjCalLayer::NumCellsAlongZ  )  const [inline]
 

Definition at line 29 of file NonProjCalLayer.hh.

References nz.

00029 { return nz; }


Member Data Documentation

const NonProjCalGeomParams* NonProjCalLayer::_par [private]
 

Definition at line 93 of file NonProjCalLayer.hh.

Referenced by activeCellContains(), getInnerRadiusOfActive(), and NonProjCalLayer().

double NonProjCalLayer::deltaPhi [private]
 

Definition at line 106 of file NonProjCalLayer.hh.

Referenced by activeCellContains(), getCellCenterPhi(), getCellSizeAlongPhi(), getClosestCell(), getDeltaPhi(), and NonProjCalLayer().

double NonProjCalLayer::deltaR [private]
 

Definition at line 99 of file NonProjCalLayer.hh.

Referenced by NonProjCalLayer().

double NonProjCalLayer::deltaZ [private]
 

Definition at line 113 of file NonProjCalLayer.hh.

Referenced by activeCellContains(), getCellCenterZ(), getCellSizeAlongZ(), getClosestCell(), and NonProjCalLayer().

unsigned int NonProjCalLayer::layerIndex [private]
 

Definition at line 95 of file NonProjCalLayer.hh.

Referenced by activeCellContains(), getClosestCell(), Index(), and NonProjCalLayer().

int NonProjCalLayer::nphi [private]
 

Definition at line 102 of file NonProjCalLayer.hh.

Referenced by getNcellsAlongPhi(), NonProjCalLayer(), and NumCellsAlongPhi().

int NonProjCalLayer::nz [private]
 

Definition at line 109 of file NonProjCalLayer.hh.

Referenced by getNcellsAlongZ(), NonProjCalLayer(), and NumCellsAlongZ().

double NonProjCalLayer::phic [private]
 

Definition at line 104 of file NonProjCalLayer.hh.

Referenced by activeCellContains(), getCellCenterPhi(), getClosestCell(), and NonProjCalLayer().

double NonProjCalLayer::rc [private]
 

Definition at line 97 of file NonProjCalLayer.hh.

Referenced by activeCellContains(), getCellCenterCylR(), getCellCenterSphR(), getCellCenterTheta(), getCellCenterX(), getCellCenterY(), getCenterRadiusOfActive(), getInnerRadiusOfActive(), and NonProjCalLayer().

double NonProjCalLayer::zc [private]
 

Definition at line 111 of file NonProjCalLayer.hh.

Referenced by activeCellContains(), getCellCenterSphR(), getCellCenterZ(), getClosestCell(), and NonProjCalLayer().


The documentation for this class was generated from the following files:
Generated on Thu Oct 7 18:45:10 2004 for LCDG4 by doxygen 1.3.4