10#include "Identifier/Identifier.h"
29 const std::string& name,
30 const bool doEndcapEtaNeighbour )
40 StatusCode
sc = detStore->retrieve(
m_idHelper,
"SCT_ID");
121 throw std::runtime_error(
"SCT_DetectorManager: Error adding detector element.");
178 const bool phi_plus_one)
const
199 int target_phi = phi_module;
200 if (eta_module==9) target_phi = (phi_plus_one)? 2*phi_module+1 : 2*phi_module;
205 Identifier other_id = other_element->identify();
208 int other_bec =
m_idHelper->barrel_ec(other_id);
209 if(other_bec != bec)
continue;
211 int other_layer_disk =
m_idHelper->layer_disk(other_id);
212 if(other_layer_disk != layer_disk)
continue;
214 int other_phi_module =
m_idHelper->phi_module(other_id);
215 if(other_phi_module != target_phi)
continue;
218 int other_eta_module =
m_idHelper->eta_module(other_id);
219 if( (other_eta_module-eta_module) != 1 )
continue;
223 if(other_side==side)
continue;
226 idHashNeighbour = other_element->identifyHash();
227 ATH_MSG_VERBOSE(__FUNCTION__<<
"found strip endcap neighbour for id="<<
id<<
" neigh="<<other_id
228 <<
" eta:"<<eta_module<<
" "<<other_eta_module);
245 GeoVAlignmentStore* alignStore)
const
252 if (!idHash.
is_valid())
return false;
261 if (!element)
return false;
276 ATH_MSG_WARNING(
"Frames other than global or local are not supported.");
280 }
else if (level == 1) {
284 if (!idHash.
is_valid())
return false;
286 int idModuleHash = idHash / 2;
298 if (!element)
return false;
312 ATH_MSG_WARNING(
"Frames other than global or local are not supported.");
319 ATH_MSG_WARNING(
"Non global shift at higher levels is not supported.");
327 AlignableTransformMap::const_iterator iter;
339 GeoAlignableTransform *transform,
340 const GeoVPhysVol * child)
344 const GeoVFullPhysVol * childFPV =
dynamic_cast<const GeoVFullPhysVol *
>(child);
346 ATH_MSG_ERROR(
"Child of alignable transform is not a full physical volume");
355 GeoAlignableTransform *transform,
356 const GeoVFullPhysVol * child)
365 }
else if (level == 1) {
398 ATH_MSG_INFO(
"Processing new global alignment containers with key " << key <<
" in the " << frame <<
" frame at level ");
401 if(atrlistcol==
nullptr and
m_detStore->retrieve(atrlistcol,key)!=StatusCode::SUCCESS) {
403 << key <<
" - no new global alignment ");
407 bool alignmentChange =
false;
412 const coral::AttributeList& atrlist=citr->second;
414 if (atrlist[
"det"].
data<int>()!=2)
continue;
425 Amg::Transform3D newtrans = newtranslation * Amg::RotationMatrix3D::Identity();
431 <<
" ,det: " << atrlist[
"det"].data<
int>()
432 <<
" ,bec: " << atrlist[
"bec"].data<
int>()
433 <<
" ,layer: " << atrlist[
"layer"].data<
int>()
434 <<
" ,ring: " << atrlist[
"ring"].data<
int>()
435 <<
" ,sector: " << atrlist[
"sector"].data<
int>()
436 <<
" ,Tx: " << atrlist[
"Tx"].data<
float>()
437 <<
" ,Ty: " << atrlist[
"Ty"].data<
float>()
438 <<
" ,Tz: " << atrlist[
"Tz"].data<
float>()
439 <<
" ,Rx: " << atrlist[
"Rx"].data<
float>()
440 <<
" ,Ry: " << atrlist[
"Ry"].data<
float>()
441 <<
" ,Rz: " << atrlist[
"Rz"].data<
float>());
451 ATH_MSG_DEBUG(
"Cannot set AlignableTransform for identifier."
453 <<
" at level " << level <<
" for new global DB ");
456 alignmentChange = (alignmentChange || status);
458 return alignmentChange;
468 GeoVAlignmentStore* )
const {
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
char data[hepevt_bytes_allocation_ATLAS]
This is an Identifier helper class for the SCT subdetector.
bool is_sct(Identifier id) const
This class is a collection of AttributeLists where each one is associated with a channel number.
const_iterator end() const
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
ChanAttrListMap::const_iterator const_iterator
DataModel_detail::const_iterator< DataVector > const_iterator
DataModel_detail::iterator< DataVector > iterator
This is a "hash" representation of an Identifier.
bool is_valid() const
Check if id is in a valid state.
StoreGateSvc * m_detStore
std::vector< std::unique_ptr< ExtendedAlignableTransform > > m_moduleAlignableTransforms
virtual void addDetectorElement(SiDetectorElement *element) override
Add elememts during construction.
virtual SiDetectorElementCollection::const_iterator getDetectorElementBegin() const override
virtual void initNeighbours() override
Initialize the neighbours. This can only be done when all elements are built.
SiDetectorElementCollection m_elementCollection
virtual const SCT_ID * getIdHelper() const override
virtual SiDetectorElementCollection::const_iterator getDetectorElementEnd() const override
SCT_DetectorManager(StoreGateSvc *detStore)
Constructor.
virtual unsigned int getNumTreeTops() const override
virtual const SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements via Identifier
std::vector< PVConstLink > m_volume
bool m_isLogical
This variable switches the how the local alignment corrections are applied If true they will be calcu...
virtual void addAlignableTransform(int level, const Identifier &id, GeoAlignableTransform *xf, const GeoVFullPhysVol *child)
Add alignable transforms. No access to these, they will be changed by manager:
virtual bool setAlignableTransformDelta(int level, const Identifier &id, const Amg::Transform3D &delta, FrameType frame, GeoVAlignmentStore *alignStore) const override
implements the main alignment update for delta transforms in different frames, it translates into the...
const SCT_ModuleSideDesign * getSCT_Design(int i) const
Access to module design, casts to SCT_ModuleSideDesign.
void addTreeTop(const PVConstLink &vol)
Add tree top.
void addMotherDesign(std::unique_ptr< const SCT_ModuleSideDesign > &&)
std::vector< AlignableTransformMap > m_higherAlignableTransforms
virtual PVConstLink getTreeTop(unsigned int i) const override
const SCT_ID * m_idHelper
virtual bool identifierBelongs(const Identifier &id) const override
Check identifier is for this detector.
bool processSpecialAlignment(const std::string &key, InDetDD::AlignFolderType alignfolder) override
Comply with InDetDetectorManager interface (not implemented for SCT)
int getStripEndcapEtaNeighbour(const SiDetectorElement *element, IdentifierHash &idHashNeighbour, const bool phi_plus_one=false) const
std::vector< std::unique_ptr< const SCT_ModuleSideDesign > > m_motherDesigns
virtual const SiDetectorElementCollection * getDetectorElementCollection() const override
access to whole collectiom
std::vector< std::unique_ptr< ExtendedAlignableTransform > > m_alignableTransforms
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.
bool m_doEndcapEtaNeighbour
Base class for the SCT module side design, extended by the Forward and Barrel module design.
Class to hold the SiDetectorElement objects to be put in the detector store.
Class to hold geometrical description of a silicon detector element.
void setPrevInEta(const SiDetectorElement *element)
bool isStereo() const
Check if it is the stereo side (useful for SCT)
void setPrevInPhi(const SiDetectorElement *element)
void setNextInEta(const SiDetectorElement *element)
Amg::Transform3D defModuleTransform() const
Default module to global frame transform, ie with no misalignment.
void setOtherSide(const SiDetectorElement *element)
For SCT only.
void setNextInPhi(const SiDetectorElement *element)
const Amg::Transform3D & moduleTransform() const
Module to global frame transform.
SiDetectorManager(StoreGateSvc *detStore, const std::string &name)
const SiDetectorDesign * getDesign(int i) const
static bool setAlignableTransformGlobalDelta(ExtendedAlignableTransform *extXF, const Amg::Transform3D &delta, GeoVAlignmentStore *alignStore=nullptr)
Helper method to set delta transform from a global delta - Amg interface.
static bool setAlignableTransformLocalDelta(ExtendedAlignableTransform *extXF, const Amg::Transform3D &localToGlobalXF, const Amg::Transform3D &delta, GeoVAlignmentStore *alignStore=nullptr)
Helper method to set delta transform from a local delta - Amg interface.
const Amg::Transform3D defTransform() const
virtual const Amg::Transform3D & transform() const override final
Return local to global transform.
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
virtual Identifier identify() const override final
identifier of this detector element (inline)
virtual void updateCache() const
Recalculate cached values.
This is an Identifier helper class for the SCT subdetector.
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
The Athena Transient Store API.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Eigen::AngleAxisd AngleAxis3D
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Eigen::Translation< double, 3 > Translation3D
const int FIRST_HIGHER_LEVEL