12#include "GeoModelKernel/GeoXF.h"
13#include "GeoModelKernel/GeoAlignableTransform.h"
66 delete barrelDescriptor;
69 delete endcapDescriptor;
101 ,
unsigned int moduleIndex
102 ,
unsigned int phiIndex
103 ,
unsigned int strawLayerIndex)
const
105 return m_elementContainer.getBarrelDetElement(positive,moduleIndex,phiIndex,strawLayerIndex);
109 ,
unsigned int moduleIndex
110 ,
unsigned int phiIndex
111 ,
unsigned int strawLayerIndex)
113 return m_elementContainer.getBarrelDetElement(positive,moduleIndex,phiIndex,strawLayerIndex);
117 ,
unsigned int wheelIndex
118 ,
unsigned int strawLayerIndex
119 ,
unsigned int phiIndex)
const
121 return m_elementContainer.getEndcapDetElement(positive,wheelIndex,strawLayerIndex,phiIndex);
125 ,
unsigned int wheelIndex
126 ,
unsigned int strawLayerIndex
127 ,
unsigned int phiIndex)
129 return m_elementContainer.getEndcapDetElement(positive,wheelIndex,strawLayerIndex,phiIndex);
151 if (hashId>=elements->
size())
return nullptr;
152 return (*elements)[hashId];
158 if (
id>=elements->
size())
return nullptr;
159 return (*elements)[id];
226 if(msgLvl(MSG::DEBUG))
227 msg(MSG::DEBUG) <<
"Registering alignmentCallback with key " << key <<
", at level " << level
232 ATH_MSG_ERROR(
"Cannot register callback with DetectorStore");
244 GeoAlignableTransform *transform,
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"
275 GeoAlignableTransform *transform,
276 const GeoVFullPhysVol *child,
277 const GeoVFullPhysVol *frameVol)
285 if(
msgLvl(MSG::VERBOSE)) {
286 msg(MSG::VERBOSE) <<
"TRT: Adding alignment at level " << level <<
" " <<
m_idHelper->show_to_string(
id);
287 if (child && !frameVol) {
288 msg(MSG::VERBOSE) <<
" using global frame";
289 }
else if (!child || child == frameVol ) {
290 msg(MSG::VERBOSE) <<
" using local frame";
292 msg(MSG::VERBOSE) <<
" using other frame";
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;
395 const GeoTrf::Transform3D & childXF = child->getDefAbsoluteTransform(alignStore);
396 extXF->
alignableTransform()->setDelta(childXF.inverse() * delta * childXF, alignStore);
410 const GeoTrf::Transform3D & xfChild = child->getDefAbsoluteTransform(alignStore);
411 const GeoTrf::Transform3D & xfFrame = frameVol->getDefAbsoluteTransform(alignStore);
412 extXF->
alignableTransform()->setDelta(xfChild.inverse() * xfFrame * delta * xfFrame.inverse() * xfChild, alignStore);
433 (*element_iter)->invalidate();
445 (*element_iter)->updateAllCaches();
460 msg(MSG::DEBUG) <<
"Processing TRT fine alignment." <<
endmsg;
463 StatusCode
sc = StatusCode::FAILURE;
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);
504 ATH_MSG_INFO(
"Read alignment from detector store with key " << key);
505 if (StatusCode::SUCCESS!=
m_detStore->retrieve(atrlistcol,key)) {
507 << key <<
" - no new global alignment");
508 return alignmentChange;
513 return alignmentChange;
518 for (
const auto & citr : *atrlistcol) {
520 const coral::AttributeList& atrlist=citr.second;
527 CLHEP::HepRotation newrotation;
529 HepGeom::Transform3D newtransform(newrotation, newtranslation);
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>()
536 <<
" ,Ty: " << atrlist[
"Ty"].data<
float>()
538 <<
" ,phi: " << atrlist[
"phi"].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;
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
#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,...
Class for storing/accessing trt endpoint corrections data.
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
MsgStream & msg() const
The standard message stream.
bool msgLvl(const MSG::Level lvl) const
Test the output level.
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
bool is_trt(Identifier id) const
This class is a collection of AttributeLists where each one is associated with a channel number.
an iterator over instances of a given type in StoreGateSvc.
DataModel_detail::const_iterator< DataVector > const_iterator
DataModel_detail::iterator< DataVector > iterator
size_type size() const noexcept
Returns the number of elements in the collection.
This is a "hash" representation of an Identifier.
StoreGateSvc * m_detStore
InDetDetectorManager(StoreGateSvc *detStore, const std::string &name)
void addChannel(const std::string &key, int level, FrameType frame)
Alignment access.
StatusCode align(IOVSVC_CALLBACK_ARGS)
Local Straw Positions (from the center of the module.)
Extended TRT_BaseElement to describe a TRT readout element, this is a planar layer with n ( order of ...
Virtual base class of TRT readout elements.
void setDxContainer(const TRTCond::StrawDxContainer *container)
Class to hold collection of TRT detector elements.
Class to hold different TRT detector elements structures.
virtual const TRT_ID * getIdHelper() const override
std::vector< PVLink > m_volume
const GeoXF::Function * m_barrelXF[3]
const TRT_BaseElement * getElement(Identifier id) const
Access Elements Generically---------------------------------------------—.
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.
void manageBarrelElement(TRT_BarrelElement *barrel)
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)
virtual void invalidateAll() override
Invalidate cache for all detector elements.
void setGasType(const ActiveGasType &)
TRT_Numerology * getNumerology()
Access Numerological information:---------------------------------------—.
void addTreeTop(const PVLink &)
const GeoXF::Function * endcapTransformField(size_t i) const
bool processSpecialAlignment(const std::string &key, InDetDD::AlignFolderType dummy) override
std::set< const TRT_BarrelDescriptor * > m_barrelDescriptors
void setBarrelDescriptor(const TRT_BarrelDescriptor *barrelDescriptor)
Set TRT_Barrel/EndcapDescriptor pointer to the internal sets to delete them in the destructor.
virtual bool identifierBelongs(const Identifier &id) const override
Check identifier is for this detector.
TRT_DetectorManager(StoreGateSvc *detStore)
virtual void updateAll() const override
Update all caches.
std::string m_digversname
bool setAlignableTransformAnyFrameDelta(ExtendedAlignableTransform *extXF, const Amg::Transform3D &delta, FrameType frame, GeoVAlignmentStore *alignStore) const
Set alignable transforms: Amg based.
virtual PVConstLink getTreeTop(unsigned int i) const override
TRT_DetElementCollection::const_iterator getDetectorElementBegin() const
const TRT_ID * m_idHelper
void setEndcapTransformField(size_t i, const GeoXF::Function *field)
const TRT_Conditions * conditions() const
Conditions interface (mostly for internal use):-------------------------—.
ActiveGasType gasType() const
std::vector< AlignableTransformMap > m_alignableTransforms
const TRT_DetElementContainer * getDetectorElementContainer() const
Access the element container -------------------------------------------—.
TRT_DetElementCollection::const_iterator getDetectorElementEnd() const
const GeoXF::Function * barrelTransformField(size_t i) const
void setEndcapDescriptor(const TRT_EndcapDescriptor *endcapDescriptor)
void manageEndcapElement(TRT_EndcapElement *endcap)
StatusCode alignmentCallback(IOVSVC_CALLBACK_ARGS)
Call back for alignment updates, DEPRECATED.
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_EndcapElement * getEndcapElement(unsigned int positive, unsigned int wheelIndex, unsigned int strawLayerIndex, unsigned int phiIndex) const
Access Endcap Elements:---------------—(Fast)--------------------------—.
virtual bool setAlignableTransformDelta(int level, const Identifier &id, const Amg::Transform3D &delta, FrameType frame, GeoVAlignmentStore *alignStore) const override
Set alignable transforms: Amg based.
void setIdHelper(const TRT_ID *idHelper, bool owns=true)
Get the ID helper: -----------------------------------------------------—.
void addKey(const std::string &key, int level, FrameType frame)
TRT_Numerology * m_numerology
virtual unsigned int getNumTreeTops() const override
Access Raw Geometry:----------------------------------------------------—.
std::set< const TRT_EndcapDescriptor * > m_endcapDescriptors
TRT_DetElementContainer m_elementContainer
const TRT_DetElementCollection * getDetectorElementCollection() const
Access to Whole Collection of Elements ---------------------------------—.
const GeoXF::Function * m_endcapXF[3]
class TRT_EndcapDescriptor
Extended class of a TRT_BaseElement to describe a readout elment in the endcap.
Helper class to organize the straw elements on TRT readout elements.
The Athena Transient Store API.
specialise to detector level
This is an Identifier helper class for the TRT subdetector.
Identifier module_id(int barrel_ec, int phi_module, int layer_or_wheel) const
For an individual module phi sector.
Amg::Transform3D CLHEPTransformToEigen(const HepGeom::Transform3D &CLHEPtransf)
Converts a CLHEP-based HepGeom::Transform3D into an Eigen Amg::Transform3D.
Eigen::Affine3d Transform3D
const int FIRST_HIGHER_LEVEL