/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Private Attributes
PmtGeomInfo Class Reference

Implementation of IPmtGeomInfo. More...

#include <PmtGeomInfo.h>

Inheritance diagram for PmtGeomInfo:
Inheritance graph
[legend]
Collaboration diagram for PmtGeomInfo:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PmtGeomInfo (unsigned int pmtid, IDetectorElement *me, IDetectorElement *parent)
virtual ~PmtGeomInfo ()
virtual unsigned int pmtid () const
 Return the fully qualified packed ID.
virtual const CLHEP::Hep3Vector & globalPosition () const
 Return the position in world coordinates.
virtual const CLHEP::Hep3Vector & localPosition () const
 Return the position in the natural coordinate system for doing reconstruction (AD local or Pool local coordinates)
virtual const CLHEP::Hep3Vector & globalDirection () const
 Return the direction normal to the PMT face in the global coordinate system.
virtual const CLHEP::Hep3Vector & localDirection () const
 Return the direction normal to the PMT face in the natural coordinate system for doing reconstruction (AD local or Pool local coordinates)
virtual const IDetectorElement & detectorElement () const
 Return coresponding DetectorElement.
virtual const IDetectorElement & parentDetector () const
 Return DE for detector volume containing PMT.

Private Attributes

unsigned int m_id
IDetectorElement * m_me
IDetectorElement * m_parent
CLHEP::Hep3Vector * m_gp
CLHEP::Hep3Vector * m_lp
CLHEP::Hep3Vector * m_gd
CLHEP::Hep3Vector * m_ld

Detailed Description

Implementation of IPmtGeomInfo.

Give access to information about a particular touchable PMT.

bv@bnl.gov Mon Apr 21 13:32:32 2008

Definition at line 18 of file PmtGeomInfo.h.


Constructor & Destructor Documentation

PmtGeomInfo::PmtGeomInfo ( unsigned int  pmtid,
IDetectorElement *  me,
IDetectorElement *  parent 
)

Definition at line 13 of file PmtGeomInfo.cc.

    : m_id(pmtid)
    , m_me(me)
    , m_parent(parent)
    , m_gp(0), m_lp(0), m_gd(0), m_ld(0)
{
}
PmtGeomInfo::~PmtGeomInfo ( ) [virtual]

Definition at line 23 of file PmtGeomInfo.cc.

{
    if (m_gp) delete m_gp; m_gp = 0;
    if (m_lp) delete m_lp; m_lp = 0;
    if (m_gd) delete m_gd; m_gd = 0;
    if (m_ld) delete m_ld; m_ld = 0;
}

Member Function Documentation

unsigned int PmtGeomInfo::pmtid ( ) const [virtual]

Return the fully qualified packed ID.

Implements IPmtGeomInfo.

Definition at line 31 of file PmtGeomInfo.cc.

{
    return m_id;
}
const Hep3Vector & PmtGeomInfo::globalPosition ( ) const [virtual]

Return the position in world coordinates.

Implements IPmtGeomInfo.

Definition at line 36 of file PmtGeomInfo.cc.

{
    if (m_gp) return *m_gp;

    Gaudi::XYZPoint zero(0,0,0);
    Gaudi::XYZPoint gp = m_me->geometry()->toGlobal(zero);

    m_gp = new Hep3Vector(gp.x(),gp.y(),gp.z());
    return *m_gp;
}
const Hep3Vector & PmtGeomInfo::localPosition ( ) const [virtual]

Return the position in the natural coordinate system for doing reconstruction (AD local or Pool local coordinates)

Implements IPmtGeomInfo.

Definition at line 47 of file PmtGeomInfo.cc.

{
    if (m_lp) return *m_lp;

    Gaudi::XYZPoint zero(0,0,0);
    Gaudi::XYZPoint gp = m_me->geometry()->toGlobal(zero);
    Gaudi::XYZPoint lp = m_parent->geometry()->toLocal(gp);
    m_lp = new Hep3Vector(lp.x(),lp.y(),lp.z());
    return *m_lp;
}
const Hep3Vector & PmtGeomInfo::globalDirection ( ) const [virtual]

Return the direction normal to the PMT face in the global coordinate system.

Implements IPmtGeomInfo.

Definition at line 58 of file PmtGeomInfo.cc.

{
    if (m_gd) return *m_gd;

    Gaudi::XYZVector norm(0,0,1);
    Gaudi::XYZVector gd = m_me->geometry()->toGlobal(norm);
    m_gd = new Hep3Vector(gd.x(),gd.y(),gd.z());
    return *m_gd;
}
const Hep3Vector & PmtGeomInfo::localDirection ( ) const [virtual]

Return the direction normal to the PMT face in the natural coordinate system for doing reconstruction (AD local or Pool local coordinates)

Implements IPmtGeomInfo.

Definition at line 68 of file PmtGeomInfo.cc.

{
    if (m_ld) return *m_ld;

    Gaudi::XYZVector norm(0,0,1);
    Gaudi::XYZVector gd = m_me->geometry()->toGlobal(norm);
    Gaudi::XYZVector ld = m_parent->geometry()->toLocal(gd);
    m_ld = new Hep3Vector(ld.x(),ld.y(),ld.z());
    return *m_ld;
}
const IDetectorElement & PmtGeomInfo::detectorElement ( ) const [virtual]

Return coresponding DetectorElement.

Implements IPmtGeomInfo.

Definition at line 79 of file PmtGeomInfo.cc.

{
    return *m_me;
}
const IDetectorElement & PmtGeomInfo::parentDetector ( ) const [virtual]

Return DE for detector volume containing PMT.

Implements IPmtGeomInfo.

Definition at line 84 of file PmtGeomInfo.cc.

{
    return *m_parent;
}

Member Data Documentation

unsigned int PmtGeomInfo::m_id [private]

Definition at line 52 of file PmtGeomInfo.h.

IDetectorElement* PmtGeomInfo::m_me [private]

Definition at line 53 of file PmtGeomInfo.h.

IDetectorElement* PmtGeomInfo::m_parent [private]

Definition at line 54 of file PmtGeomInfo.h.

CLHEP::Hep3Vector* PmtGeomInfo::m_gp [mutable, private]

Definition at line 56 of file PmtGeomInfo.h.

CLHEP::Hep3Vector * PmtGeomInfo::m_lp [mutable, private]

Definition at line 56 of file PmtGeomInfo.h.

CLHEP::Hep3Vector * PmtGeomInfo::m_gd [mutable, private]

Definition at line 56 of file PmtGeomInfo.h.

CLHEP::Hep3Vector * PmtGeomInfo::m_ld [mutable, private]

Definition at line 56 of file PmtGeomInfo.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:56:27 for DetHelpers by doxygen 1.7.4