 |
ATLAS Offline Software
|
Go to the documentation of this file.
12 #include "GeoModelKernel/GeoXF.h"
13 #include "GeoModelKernel/GeoAlignableTransform.h"
30 m_ownsIdHelper(false),
33 m_digversname(
"ERROR:DIGVERSNOTSET!")
66 delete barrelDescriptor;
69 delete endcapDescriptor;
101 ,
unsigned int moduleIndex
103 ,
unsigned int strawLayerIndex)
const
109 ,
unsigned int moduleIndex
111 ,
unsigned int strawLayerIndex)
117 ,
unsigned int wheelIndex
118 ,
unsigned int strawLayerIndex
125 ,
unsigned int wheelIndex
126 ,
unsigned int strawLayerIndex
151 if (hashId>=elements->
size())
return nullptr;
152 return (*elements)[hashId];
158 if (
id>=elements->
size())
return nullptr;
159 return (*elements)[
id];
232 ATH_MSG_ERROR(
"Cannot register callback with DetectorStore");
245 const GeoVPhysVol * child,
246 const GeoVPhysVol * frameVol)
251 const GeoVFullPhysVol * childFPV =
nullptr;
253 childFPV =
dynamic_cast<const GeoVFullPhysVol *
>(child);
255 const GeoVFullPhysVol * frameFPV =
nullptr;
257 frameFPV =
dynamic_cast<const GeoVFullPhysVol *
>(frameVol);
259 if (child && !childFPV) {
261 <<
"Child of alignable transform is not a full physical volume"
263 }
else if (frameVol && !frameFPV) {
265 <<
"Frame for alignable transform is not a full physical volume"
276 const GeoVFullPhysVol *child,
277 const GeoVFullPhysVol *frameVol)
287 if (child && !frameVol) {
289 }
else if (!child || child == frameVol ) {
308 GeoVAlignmentStore* alignStore)
const
319 AlignableTransformMap::const_iterator
iter;
331 GeoVAlignmentStore* alignStore)
const
373 if (!extXF)
return false;
376 const GeoVFullPhysVol * child = extXF->
child();
377 const GeoVFullPhysVol * frameVol = extXF->
frame();
382 if (child && !frameVol) {
385 }
else if (!child || child == frameVol){
393 msg(MSG::ERROR) <<
"global frame specified, but child == 0" <<
endmsg;
396 extXF->
alignableTransform()->setDelta(childXF.inverse() * delta * childXF, alignStore);
412 extXF->
alignableTransform()->setDelta(xfChild.inverse() * xfFrame * delta * xfFrame.inverse() * xfChild, alignStore);
433 (*element_iter)->invalidate();
445 (*element_iter)->updateAllCaches();
468 if (
sc.isFailure()) {
470 msg(
MSG::INFO) <<
"Cannot find StrawDxContainer for key "
471 <<
key <<
" - no fine alignment " <<
endmsg;
472 throw std::runtime_error(
"Unable to apply TRT fine alignment. This is normal for simulation");
481 GeoVAlignmentStore* )
const {
496 bool alignmentChange =
false;
498 ATH_MSG_INFO(
"Processing new global alignment containers with key " <<
key <<
" in the " << frame <<
" frame at level " <<
level);
507 <<
key <<
" - no new global alignment");
508 return alignmentChange;
513 return alignmentChange;
518 for (
const auto & citr : *atrlistcol) {
522 atrlist[
"layer"].data<int>(),
523 atrlist[
"sector"].data<int>());
526 CLHEP::Hep3Vector newtranslation(atrlist[
"Tx"].data<float>(),atrlist[
"Ty"].data<float>(),atrlist[
"Tz"].data<float>());
527 CLHEP::HepRotation newrotation;
528 newrotation.set(atrlist[
"phi"].data<float>(),atrlist[
"theta"].data<float>(),atrlist[
"psi"].data<float>());
531 msg(
MSG::DEBUG) <<
"New global DB -- channel: " << citr.first
532 <<
" ,bec: " << atrlist[
"bec"].data<
int>()
533 <<
" ,layer: " << atrlist[
"layer"].data<int>()
534 <<
" ,sector: " << atrlist[
"sector"].data<
int>()
535 <<
" ,Tx: " << atrlist[
"Tx"].data<float>()
536 <<
" ,Ty: " << atrlist[
"Ty"].data<
float>()
537 <<
" ,Tz: " << atrlist[
"Tz"].data<float>()
538 <<
" ,phi: " << atrlist[
"phi"].data<
float>()
539 <<
" ,theta: " << atrlist[
"theta"].data<float>()
540 <<
" ,psi: " << atrlist[
"psi"].data<
float>() <<
endmsg;
551 msg(
MSG::DEBUG) <<
"Cannot set AlignableTransform for identifier."
553 <<
" at level " <<
level <<
" for new global DB " <<
endmsg;
557 alignmentChange = (alignmentChange ||
status);
560 return alignmentChange;
virtual void invalidateAll() override
Invalidate cache for all detector elements.
void manageBarrelElement(TRT_BarrelElement *barrel)
const TRT_Conditions * conditions() const
Conditions interface (mostly for internal use):-------------------------—.
Identifier layer_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
For an individual straw layer.
bool contains(const TKEY &key) const
Look up a keyed object in TDS (compare also tryRetrieve) returns false if object not available in TDS...
Const iterator class for DataVector/DataList.
void addAlignableTransform(int level, const Identifier &id, GeoAlignableTransform *transform, const GeoVFullPhysVol *child=0, const GeoVFullPhysVol *frameVol=0)
Add alignable transforms: GeoModel/CLHEP based.
const TRT_DetElementCollection * getDetectorElementCollection() const
Access to Whole Collection of Elements ---------------------------------—.
void setEndcapDescriptor(const TRT_EndcapDescriptor *endcapDescriptor)
void manageEndcapElement(TRT_EndcapElement *endcap, const TRT_ID *idHelper)
const TRT_ID * m_idHelper
Class to hold different TRT detector elements structures.
const TRT_BarrelElement * getBarrelElement(unsigned int positive, unsigned int moduleIndex, unsigned int phiIndex, unsigned int strawLayerIndex) const
Access Barrel Elements:---------------—(Fast)-------------------------—.
void setBarrelTransformField(size_t i, const GeoXF::Function *field)
const GeoXF::Function * m_barrelXF[3]
virtual bool setAlignableTransformDelta(int level, const Identifier &id, const Amg::Transform3D &delta, FrameType frame, GeoVAlignmentStore *alignStore) const override
Set alignable transforms: Amg based.
std::set< const TRT_EndcapDescriptor * > m_endcapDescriptors
#define IOVSVC_CALLBACK_ARGS_P(I, K)
short hand for IOVSvc call back argument list, to be used when access to formal arguments is needed,...
bool is_trt(Identifier id) const
const GeoXF::Function * barrelTransformField(size_t i) const
This class is a collection of AttributeLists where each one is associated with a channel number....
TRT_DetectorManager(StoreGateSvc *detStore)
virtual const TRT_ID * getIdHelper() const override
void manageBarrelElement(TRT_BarrelElement *barrel, const TRT_ID *idHelper)
class TRT_EndcapDescriptor
void addTreeTop(const PVLink &)
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
void manageEndcapElement(TRT_EndcapElement *endcap)
void setNumerology(const TRT_Numerology *mynum)
The Athena Transient Store API.
virtual PVConstLink getTreeTop(unsigned int i) const override
TRT_Numerology * getNumerology()
Access Numerological information:---------------------------------------—.
const GeoXF::Function * m_endcapXF[3]
void setDxContainer(const TRTCond::StrawDxContainer *container)
bool msgLvl(const MSG::Level lvl) const
Test the output level.
const GeoXF::Function * endcapTransformField(size_t i) const
(Non-const) Iterator class for DataVector/DataList.
virtual unsigned int getNumTreeTops() const override
Access Raw Geometry:----------------------------------------------------—.
::StatusCode StatusCode
StatusCode definition for legacy code.
Eigen::Affine3d Transform3D
StatusCode align(IOVSVC_CALLBACK_ARGS)
std::vector< AlignableTransformMap > m_alignableTransforms
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
const int FIRST_HIGHER_LEVEL
std::vector< PVLink > m_volume
TRT_Numerology * m_numerology
bool setAlignableTransformAnyFrameDelta(ExtendedAlignableTransform *extXF, const Amg::Transform3D &delta, FrameType frame, GeoVAlignmentStore *alignStore) const
Set alignable transforms: Amg based.
StoreGateSvc * m_detStore
MsgStream & msg() const
The standard message stream.
TRT_DetElementContainer m_elementContainer
StatusCode alignmentCallback(IOVSVC_CALLBACK_ARGS)
Call back for alignment updates, DEPRECATED.
TRT_DetElementCollection::const_iterator getDetectorElementBegin() const
TRT_DetElementCollection::const_iterator getDetectorElementEnd() const
const TRT_EndcapElement * getEndcapElement(unsigned int positive, unsigned int wheelIndex, unsigned int strawLayerIndex, unsigned int phiIndex) const
Access Endcap Elements:---------------—(Fast)--------------------------—.
void TRT_DetectorManager::addKey ATLAS_NOT_THREAD_SAFE(const std::string &key, int level)
virtual bool identifierBelongs(const Identifier &id) const override
Check identifier is for this detector.
const TRT_BarrelElement * getBarrelDetElement(unsigned int positive, unsigned int moduleIndex, unsigned int phiIndex, unsigned int strawLayerIndex) const
bool processSpecialAlignment(const std::string &key, InDetDD::AlignFolderType dummy) override
void setGasType(const ActiveGasType &)
const TRT_BaseElement * getElement(Identifier id) const
Access Elements Generically---------------------------------------------—.
an iterator over instances of a given type in StoreGateSvc. It d-casts and caches locally the pointed...
std::set< const TRT_BarrelDescriptor * > m_barrelDescriptors
void setIdHelper(const TRT_ID *idHelper, bool owns=true)
Get the ID helper: -----------------------------------------------------—.
const TRT_DetElementContainer * getDetectorElementContainer() const
Access the element container -------------------------------------------—.
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
void addKey(const std::string &key, int level, FrameType frame)
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
#define ATH_MSG_WARNING(x)
Amg::Transform3D CLHEPTransformToEigen(const HepGeom::Transform3D &CLHEPtransf)
Converts a CLHEP-based HepGeom::Transform3D into an Eigen Amg::Transform3D.
ActiveGasType gasType() const
void setEndcapTransformField(size_t i, const GeoXF::Function *field)
virtual void updateAll() const override
Update all caches.
const TRT_DetElementCollection * getElements() const
Class to hold collection of TRT detector elements.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
void addChannel(const std::string &key, int level, FrameType frame)
Alignment access.
const TRT_EndcapElement * getEndcapDetElement(unsigned int positive, unsigned int wheelIndex, unsigned int strawLayerIndex, unsigned int phiIndex) const
size_type size() const noexcept
Returns the number of elements in the collection.
Class for storing/accessing trt endpoint corrections data.
virtual bool processGlobalAlignment(const std::string &, int level, FrameType frame, const CondAttrListCollection *obj, GeoVAlignmentStore *alignStore) const override
Process new global DB folders for L1 and L2.
IdentifierHash straw_layer_hash(Identifier straw_layer_id) const
straw_layer hash from id - optimized
void setBarrelDescriptor(const TRT_BarrelDescriptor *barrelDescriptor)
Set TRT_Barrel/EndcapDescriptor pointer to the internal sets to delete them in the destructor.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
Identifier module_id(int barrel_ec, int phi_module, int layer_or_wheel) const
For an individual module phi sector.