Mixin class to be inherited from objects that have a position. More...
#include <MPositionable.h>
Public Member Functions | |
utl::CoordinateSystemPtr | GetLocalCoordinateSystem () const |
Local system based on position and configured rotations. More... | |
utl::Point | GetPosition () const |
MPositionable (const Config &cp) | |
virtual | ~MPositionable () |
Protected Types | |
typedef std::string | CoordinateType |
Simple internal typedef to emulate the actual enumeration via a type handled in the configuration mechanism. More... | |
Protected Member Functions | |
Specific datum accesor components. | |
In the most commeon situation deriving clases won't override these methods (and so the actual retrieval will be forwarded to the expected method in the Config template argument. Nevertheless they are made virtual in order to allow posible customization by subclasses. This customization could be done in principle in the Get method, basing the decision on the tag, but that would be pretty ugly. | |
virtual double | GetComponent1 () const |
First component of the position vector. More... | |
virtual double | GetComponent2 () const |
Second component of the position vector. More... | |
virtual double | GetComponent3 () const |
Third component of the position vector. More... | |
virtual double | GetEulerPhi () const |
First Euler angle for rotation over (original) z. More... | |
virtual double | GetEulerTheta () const |
Second Euler angle for rotation over (intermediate) x. More... | |
virtual double | GetEulerPsi () const |
Third Euler angle for rotation over (intermediate) z. More... | |
virtual CoordinateType | GetCoordinateType () const |
Coordinate type. More... | |
Static Protected Attributes | |
static const std::string | kComponent1Tag = "positionComponent1" |
Tag for first vector component in config. More... | |
static const std::string | kComponent2Tag = "positionComponent2" |
Tag for second vector component in config. More... | |
static const std::string | kComponent3Tag = "positionComponent3" |
Tag for third vector component in config. More... | |
static const std::string | kCoordinateTypeTag = "coordinateType" |
static const std::string | kEulerPhiTag = "eulerPhi" |
Tag for first rotation's Euler angle in config. More... | |
static const std::string | kEulerPsiTag = "eulerPsi" |
Tag for third rotation's Euler angle in config. More... | |
static const std::string | kEulerThetaTag = "eulerTheta" |
Tag for second rotation's Euler angle in config. More... | |
Private Member Functions | |
virtual utl::CoordinateSystemPtr | GetReferenceCoordinateSystem () const =0 |
Private Attributes | |
const Config & | fConfig |
Hold a reference to the configuration proxy. More... | |
utl::ShadowPtr< double > | fComponent1 |
utl::ShadowPtr< double > | fComponent2 |
utl::ShadowPtr< double > | fComponent3 |
utl::ShadowPtr< double > | fEulerPhi |
utl::ShadowPtr< double > | fEulerTheta |
utl::ShadowPtr< double > | fEulerPsi |
utl::ShadowPtr< CoordinateType > | fCoordinateType |
utl::CoordinateSystemPtr | fLocalCoordinateSystem |
Mixin class to be inherited from objects that have a position.
The class provides the basic methods for one of those objects:
Delegates to deriving classes the definition of the coordinate system to which the position is referred (GetReferenceCoordinateSystem). The actual values are retrieved from the configuration imposed by the objects of the template argument. The position is specified by components and angles, the components can be on any of the defined types of coordinates.
The translational part is configured by three components, and the rotation by the so-called "Euler angles". The convention for Euler angles is taken from: Goldstein, Herbert et al; "Classical Mechanics", 3rd edition, Addison-Wesley. See 4.4-The Euler angles / pp 150-154. For quick reference the convention is given here:
These conventions for Euler angles are also the ones used in ROOT's TGeoRotation.
The template argument Config
is expected to be able to resolve a member call with the following signatures:
-double& GetData(utl::ShadowPtr<double>&, const std::string&) const; -CoordinateType& GetData(utl::ShadowPtr<CoordinateType>&, const std::string&) const;
with the semantics that that call will initialize the pointer or retrieve its current value (whatever is correct) for the given property (see constants with the tag names).
As reference see item 40 "Use multiple inheritance judiciouly" in "Effective C++" by Scott Meyers.
Definition at line 120 of file MPositionable.h.
|
protected |
Simple internal typedef to emulate the actual enumeration via a type handled in the configuration mechanism.
Definition at line 157 of file MPositionable.h.
|
inline |
Construct a MPositionable with the config provider. A reference to c
is kept const within this class, and to it the resolution of values (components, angles and type) are forwarded when appropiate. More preciselly the
Definition at line 126 of file MPositionable.h.
|
inlinevirtual |
Definition at line 128 of file MPositionable.h.
|
protectedvirtual |
First component of the position vector.
It could be x or r, according to the type determined by GetCoordinateType.
Definition at line 304 of file MPositionable.h.
|
protectedvirtual |
Second component of the position vector.
Definition at line 313 of file MPositionable.h.
|
protectedvirtual |
Third component of the position vector.
Definition at line 317 of file MPositionable.h.
|
protectedvirtual |
Coordinate type.
Definition at line 333 of file MPositionable.h.
|
protectedvirtual |
First Euler angle for rotation over (original) z.
Definition at line 321 of file MPositionable.h.
Referenced by mdet::Module::GetPhi0().
|
protectedvirtual |
Third Euler angle for rotation over (intermediate) z.
Definition at line 329 of file MPositionable.h.
|
protectedvirtual |
Second Euler angle for rotation over (intermediate) x.
Definition at line 325 of file MPositionable.h.
utl::CoordinateSystemPtr det::MPositionable< Config >::GetLocalCoordinateSystem | ( | ) | const |
Local system based on position and configured rotations.
Definition at line 342 of file MPositionable.h.
References utl::TransformerConstructor< Policy >::RotationX(), utl::TransformerConstructor< Policy >::RotationZ(), and utl::TransformerConstructor< Policy >::Translation().
Referenced by otoa::MD2ADST::AddParticle(), G4StationSimulatorOG::G4StationConstruction::AssembleUMD(), EdepSimulatorAG::PrimaryGenerator::GeneratePrimaries(), GroundPropagatorAG::PrimaryGenerator::GeneratePrimaries(), mdet::Fiber::GetReferenceCoordinateSystem(), mdet::Scintillator::GetReferenceCoordinateSystem(), mdet::Module::GetReferenceCoordinateSystem(), G4XTankSimulatorAG::G4XTankSimulator::Init(), otoa::MD2ADST::MakeSimCounter(), G4StationSimulatorOG::G4UMDScintStripAction::ProcessHits(), UnderGrdInjectorAG::UnderGrdInjector::Run(), GroundPropagatorAG::GroundPropagator::Run(), EdepSimulatorAG::EdepSimulator::Run(), MuonCounterViewerAG::MuonCounterViewer::Run(), and MdCounterSimulatorAG::MdCounterSimulator::SimulatePulses().
utl::Point det::MPositionable< Config >::GetPosition | ( | ) | const |
This object position, based the configured components and the reference coordinate system. The return type is by-copy as of the general recommendation due to Bugzilla's report #307. Also this topic was referred by in 'Point copy vs reference, GetPosition and report #307.', see auger-offline-devel archives for January 2009.
Definition at line 337 of file MPositionable.h.
Referenced by G4StationSimulatorOG::G4StationConstruction::AssembleUMD(), MdLDFFinderAG::Likelihood2::CalculateCandidateLikelihood(), MdLDFFinderAG::Likelihood3::CalculateCandidateLikelihood(), MdLDFFinderAG::Likelihood::CalculateCandidateLikelihood(), MdLDFFinderAG::MdLDFFinder::CalculateChi2(), MdLDFFinderAG::VMinMethodFunctor::CalculateSilentLikelihood(), MdMuonCounterAG::MdMuonCounter::ComputeSignalT50(), otoa::Detector2ADST::FillDetector(), MdLDFFinderAG::MdLDFFinder::FillModulesShowerPlaneDistances(), EdepSimulatorAG::PrimaryGenerator::GeneratePrimaries(), GroundPropagatorAG::PrimaryGenerator::GeneratePrimaries(), mdet::Module::GetDepth(), G4XTankSimulatorAG::G4XTankSimulator::Init(), UniversalityFitter::UniversalityFitter::InitBarilocheReconstruction(), otoa::MD2ADST::MakeModule(), MuonCounterViewerAG::MuonCounterViewer::Run(), MdLDFFinderAG::MdLDFFinder::SetLdfResiduals(), MdGeometryFitterAG::MdGeometryFitter::SetTimeData(), and MDetectorTest::testBasic().
|
privatepure virtual |
Coordinate system of reference wrt which the components are expressed. This pure virtual method acts as a hook by which deriving classes determine a reference coordinate system from which refer the coordinates.
Implemented in mdet::Module, mdet::Scintillator, mdet::Fiber, and mdet::Counter.
|
mutableprivate |
Cached data. Hold pointer to the data resolved by the respective calls to GetData. Note the usage of mutable, that goes along the caching meaning. Note that for the coordinate-system was is actually stored is computed from the calls to the here-defined GetXXX functions.
Definition at line 267 of file MPositionable.h.
|
mutableprivate |
Definition at line 268 of file MPositionable.h.
|
mutableprivate |
Definition at line 269 of file MPositionable.h.
|
private |
Hold a reference to the configuration proxy.
Definition at line 277 of file MPositionable.h.
|
mutableprivate |
Definition at line 273 of file MPositionable.h.
|
mutableprivate |
Definition at line 270 of file MPositionable.h.
|
mutableprivate |
Definition at line 272 of file MPositionable.h.
|
mutableprivate |
Definition at line 271 of file MPositionable.h.
|
mutableprivate |
Definition at line 274 of file MPositionable.h.
|
staticprotected |
Tag for first vector component in config.
Definition at line 145 of file MPositionable.h.
|
staticprotected |
Tag for second vector component in config.
Definition at line 147 of file MPositionable.h.
|
staticprotected |
Tag for third vector component in config.
Definition at line 149 of file MPositionable.h.
|
staticprotected |
Tag for coordinate type selection. This tag defines the meaning of the three components.
Definition at line 143 of file MPositionable.h.
|
staticprotected |
Tag for first rotation's Euler angle in config.
Definition at line 151 of file MPositionable.h.
|
staticprotected |
Tag for third rotation's Euler angle in config.
Definition at line 155 of file MPositionable.h.
|
staticprotected |
Tag for second rotation's Euler angle in config.
Definition at line 153 of file MPositionable.h.