LDMX Software
Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | Friends | List of all members
tracking::geo::GeometryContext Class Reference

The context for a specific geometry. More...

#include <GeometryContext.h>

Public Member Functions

 GeometryContext ()
 TODO it should be private == KEEPING IT PUBLIC FOR TESTING PURPOSE.
 
void loadTransformations (const tgSurfMap &surf_map)
 
void addAlignCorrection (unsigned int sensorId, const Acts::Vector3 deltaT, const Acts::Vector3 deltaR, const bool active=true)
 Fill an internal map holding the alignment transformations sensorId : id of the alignable element in the alignment_map deltaT : translation correction deltaR : rotation correction active : true="rotate, then translate", false = viceversa.
 
const Acts::GeometryContext & get () const
 get an Acts::GeometryContext wrapping the pointer to the instance of this GeometryContext
 
- Public Member Functions inherited from framework::ConditionsObject
 ConditionsObject (const std::string &name)
 Class constructor.
 
virtual ~ConditionsObject ()
 Destructor.
 
std::string getName () const
 Get the name of this object.
 

Public Attributes

std::unordered_map< unsigned int, Acts::Transform3 > alignment_map
 

Static Public Attributes

static const std::string NAME = "TrackingGeometryContext"
 Conditions object name.
 

Private Attributes

Acts::GeometryContext acts_gc_
 Wrap this instance in an Acts::GeometryContext any object for passing it down to the various acts tools.
 

Friends

class GeometryContextProvider
 the provider is a friend and so it can make one
 

Detailed Description

The context for a specific geometry.

The context is both the object used as a condition and the provider of that condition. We could separate the two if a new context needs to be constructed when the conditions are updated but for now keeping them together reduces the amount of code needed.

Definition at line 26 of file GeometryContext.h.

Constructor & Destructor Documentation

◆ GeometryContext()

tracking::geo::GeometryContext::GeometryContext ( )

TODO it should be private == KEEPING IT PUBLIC FOR TESTING PURPOSE.

This constructor is where parameters would be passed into the Geometry context from the provider. Right now, there aren't any parameters to pass and so it is just default constructed. We still have it be private so that only the provider can make a new one.

Definition at line 13 of file GeometryContext.cxx.

14 acts_gc_ = this;
15}
Base class for all conditions objects, very simple.
static const std::string NAME
Conditions object name.
Acts::GeometryContext acts_gc_
Wrap this instance in an Acts::GeometryContext any object for passing it down to the various acts too...

References acts_gc_.

Member Function Documentation

◆ addAlignCorrection()

void tracking::geo::GeometryContext::addAlignCorrection ( unsigned int  sensorId,
const Acts::Vector3  deltaT,
const Acts::Vector3  deltaR,
const bool  active = true 
)

Fill an internal map holding the alignment transformations sensorId : id of the alignable element in the alignment_map deltaT : translation correction deltaR : rotation correction active : true="rotate, then translate", false = viceversa.

Note::If active is used for original transformation, passive should be used for the inverse. For small corrections, active/passive order is not important (small transformations commute at first order) For rw=10mrad tu=100um using this property causes a global Y shift wrt inverting active/passive order correctly (tested on one tagger axial sensor)

Definition at line 43 of file GeometryContext.cxx.

46 {
47 Acts::Translation3 deltaTranslation{deltaT};
48 Acts::RotationMatrix3 rot = deltaRot(deltaR);
49 Acts::Transform3 correction(deltaTranslation * rot);
50
51 // Add the correction to the alignment map
52
53 if (alignment_map.count(sensorId) < 1) {
54 throw std::logic_error("GeometryContext:: could not addAlignCorrection");
55 }
56
57 if (active) {
58 // qaligned = dR*R(t0 + dt0).
59 // ==> rotate, then translate.
60 alignment_map[sensorId].rotate(correction.rotation());
61 alignment_map[sensorId].translate(correction.translation());
62 } else {
63 alignment_map[sensorId].translate(correction.translation());
64 alignment_map[sensorId].rotate(correction.rotation());
65 }
66}

◆ get()

const Acts::GeometryContext & tracking::geo::GeometryContext::get ( ) const

get an Acts::GeometryContext wrapping the pointer to the instance of this GeometryContext

Note
For future developers, the conditions object should handle the validity of the geometry context. In other words, if someone has a valid handle to a GeometryContext object, they should be able to call this function without worry.

Definition at line 17 of file GeometryContext.cxx.

17{ return acts_gc_; }

References acts_gc_.

◆ loadTransformations()

void tracking::geo::GeometryContext::loadTransformations ( const tgSurfMap &  surf_map)

Definition at line 19 of file GeometryContext.cxx.

19 {
20 // Always clear the map before reloading the transformations.
21 alignment_map.clear();
22
23 for (auto entry : surf_map) {
24 alignment_map[entry.first] =
25 static_cast<const DetectorElement*>(
26 (entry.second)->associatedDetectorElement())
27 ->uncorrectedTransform();
28 }
29}

Friends And Related Symbol Documentation

◆ GeometryContextProvider

friend class GeometryContextProvider
friend

the provider is a friend and so it can make one

Definition at line 81 of file GeometryContext.h.

Member Data Documentation

◆ acts_gc_

Acts::GeometryContext tracking::geo::GeometryContext::acts_gc_
private

Wrap this instance in an Acts::GeometryContext any object for passing it down to the various acts tools.

Definition at line 87 of file GeometryContext.h.

Referenced by GeometryContext(), and get().

◆ alignment_map

std::unordered_map<unsigned int, Acts::Transform3> tracking::geo::GeometryContext::alignment_map

Definition at line 64 of file GeometryContext.h.

◆ NAME

const std::string tracking::geo::GeometryContext::NAME = "TrackingGeometryContext"
static

Conditions object name.

Definition at line 67 of file GeometryContext.h.

Referenced by tracking::geo::TrackersTrackingGeometryProvider::getCondition().


The documentation for this class was generated from the following files: