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

geo::CellGeo Class Reference

Encapsulate the cell geometry. More...

#include <CellGeo.h>

List of all members.

Public Member Functions

 CellGeo (std::vector< const TGeoNode * > &n, int depth)
 Construct a cell geometry.

void GetCenter (double *xyz, double localz=0.0) const
double DistToReadOut (double localz) const
double HalfW () const
double HalfL () const
double HalfD () const
void LocalToWorld (const double *local, double *world) const
void LocalToWorldVect (const double *local, double *world) const
void WorldToLocal (const double *local, double *world) const
void WorldToLocalVect (const double *local, double *world) const
const TGeoNode * Node () const
const CellUniqueIdId () const

Private Attributes

CellUniqueId fId
 Node ID number.

const TGeoNode * fCellNode
 Pointer to the cell node.

TGeoHMatrix * fGeoMatrix
 Transformation matrix to world frame.


Detailed Description

Encapsulate the cell geometry.

A note on the cell geometry: Cells are constructed such that, in their local frame, their profile occupies the x-y plane with their long dimension running along the z-axis. The dimension transverse to the beam runs along the local x and is called the width. The dimension parallel to the beam runs along the local y and is called the depth. The length of the cell runs along the local z-axis with z increasing as one moves toward the readout end of the cell.

Definition at line 23 of file CellGeo.h.


Constructor & Destructor Documentation

CellGeo::CellGeo std::vector< const TGeoNode * > &  n,
int  depth
 

Construct a cell geometry.

Definition at line 11 of file CellGeo.cxx.

References fCellNode, fGeoMatrix, fId, and geo::NodesToUniqueId().

00012 {
00013   fCellNode = n[depth];
00014   
00015   // Build the matrix that takes us to the top world frame
00016   fGeoMatrix = new TGeoHMatrix(*n[0]->GetMatrix());
00017   for (int i=1; i<=depth; ++i) {
00018     fGeoMatrix->Multiply(n[i]->GetMatrix());
00019   }
00020 
00021   // Construct the unique id for this cell
00022   fId = NodesToUniqueId(n, depth);
00023 }


Member Function Documentation

double CellGeo::DistToReadOut double  localz  )  const
 

Return the distance from a point in the cell to the read out side of the cell

Parameters:
localz : Z position in cm in local cell frame
Returns:
Distance in cm

Definition at line 84 of file CellGeo.cxx.

References HalfL().

00085 {
00086   this->HalfL()-localz;
00087 }

void CellGeo::GetCenter double *  xyz,
double  localz = 0.0
const
 

Return the center position of a cell.

Parameters:
xyz : 3-D array. The returned location.
localy : Distance along the length of the cell (cm). Default is center of cell

Definition at line 71 of file CellGeo.cxx.

References LocalToWorld().

Referenced by evd::Display3D::DrawRawData(), plane_sort(), rpr::TrackReco::Reco(), rpr::FindTrackSeg::Reco(), geo::Geometry::SetDetectorSize(), sort_hori(), sort_vert(), and testCellPos().

00072 {
00073   static double xyzLocal[3] = {0,0,0};
00074   xyzLocal[2] = localz;
00075   this->LocalToWorld(xyzLocal, xyz);
00076 }

double CellGeo::HalfD  )  const
 

Definition at line 105 of file CellGeo.cxx.

References fCellNode.

Referenced by evd::Display3D::DrawRawData().

00106 {
00107   return ((TGeoBBox*)fCellNode->GetVolume()->GetShape())->GetDY();
00108 }

double CellGeo::HalfL  )  const
 

Definition at line 98 of file CellGeo.cxx.

References fCellNode.

Referenced by DistToReadOut().

00099 {
00100   return ((TGeoBBox*)fCellNode->GetVolume()->GetShape())->GetDZ();
00101 }

double CellGeo::HalfW  )  const
 

Definition at line 91 of file CellGeo.cxx.

References fCellNode.

Referenced by subshower::RecoSubShower::BestHough(), subshower::RecoSubShower::CalculateEnergyVertexAngle(), evd::Display3D::DrawRawData(), subshower::RecoSubShower::HoughTransCluster(), and subshower::RecoSubShower::TransCluster().

00092 {
00093   return ((TGeoBBox*)fCellNode->GetVolume()->GetShape())->GetDX();
00094 }

const CellUniqueId& geo::CellGeo::Id  )  const [inline]
 

Definition at line 39 of file CellGeo.h.

References geo::CellUniqueId, and fId.

Referenced by geo::Geometry::BuildMaps(), and testUniqueId().

00039 { return fId; }

void CellGeo::LocalToWorld const double *  local,
double *  world
const
 

Transform a position from local frame to world frame

Parameters:
local : 3D array. Position in the local frame Input.
world : 3D array. Position in the world frame. Returned.

Definition at line 30 of file CellGeo.cxx.

References fGeoMatrix.

Referenced by GetCenter().

00031 {
00032   fGeoMatrix->LocalToMaster(local,world);
00033 }

void CellGeo::LocalToWorldVect const double *  local,
double *  world
const
 

Transform a 3-vector from local frame to world frame

Parameters:
local : 3D array. Position in the local frame Input.
world : 3D array. Position in the world frame. Returned.

Definition at line 40 of file CellGeo.cxx.

References fGeoMatrix.

00041 {
00042   fGeoMatrix->LocalToMasterVect(local,world);
00043 }

const TGeoNode* geo::CellGeo::Node  )  const [inline]
 

Definition at line 38 of file CellGeo.h.

References fCellNode.

00038 { return fCellNode; }

void CellGeo::WorldToLocal const double *  local,
double *  world
const
 

Transform a position from world frame to local frame

Parameters:
world : 3D array. Position in the world frame. Input.
local : 3D array. Position in the local frame Returned.

Definition at line 50 of file CellGeo.cxx.

References fGeoMatrix.

Referenced by novamc::MCApplication::Stepping().

00051 {
00052   fGeoMatrix->MasterToLocal(local,world);
00053 }

void CellGeo::WorldToLocalVect const double *  local,
double *  world
const
 

Transform a 3-vector from world frame to local frame

Parameters:
world : 3D array. Position in the world frame. Input.
local : 3D array. Position in the local frame Returned.

Definition at line 60 of file CellGeo.cxx.

References fGeoMatrix.

00061 {
00062   fGeoMatrix->MasterToLocalVect(local,world);
00063 }


Member Data Documentation

const TGeoNode* geo::CellGeo::fCellNode [private]
 

Pointer to the cell node.

Definition at line 43 of file CellGeo.h.

Referenced by CellGeo(), HalfD(), HalfL(), HalfW(), and Node().

TGeoHMatrix* geo::CellGeo::fGeoMatrix [private]
 

Transformation matrix to world frame.

Definition at line 44 of file CellGeo.h.

Referenced by CellGeo(), LocalToWorld(), LocalToWorldVect(), WorldToLocal(), and WorldToLocalVect().

CellUniqueId geo::CellGeo::fId [private]
 

Node ID number.

Definition at line 42 of file CellGeo.h.

Referenced by CellGeo(), and Id().


The documentation for this class was generated from the following files:
Generated on Thu Sep 4 02:05:34 2008 for NOvA Offline by doxygen 1.3.5