 |
ATLAS Offline Software
|
Go to the documentation of this file.
10 #include "Identifier/Identifier.h"
15 #include "GeoModelKernel/GeoVAlignmentStore.h"
26 const std::string&
name,
27 const std::string& pixelIDName)
35 if (pixelIDName ==
"PLR_ID") {
36 const PLR_ID* plr_idHelper;
132 throw std::runtime_error(
"PixelDetectorManager: Error adding detector element.");
174 unsigned int barrelLayers = 0;
184 unsigned int endcapLayers = 0;
197 GeoVAlignmentStore* alignStore)
const
204 if (!idHash.
is_valid())
return false;
213 if (!element)
return false;
231 ATH_MSG_WARNING(
"Frames other than global or local are not supported.");
246 AlignableTransformMap::const_iterator
iter;
260 const GeoVPhysVol * child)
265 const GeoVFullPhysVol * childFPV =
dynamic_cast<const GeoVFullPhysVol *
>(child);
267 ATH_MSG_ERROR(
"Child of alignable transform is not a full physical volume");
277 const GeoVFullPhysVol * child)
314 bool alignmentChange =
false;
316 std::string alignfolder;
320 ATH_MSG_INFO(
"Processing IBLDist alignment container with key (" <<
key <<
")"
321 <<
"and alignment folder pointing to " << alignfolder);
324 if (
numerology().numPhiModulesForLayer(0)<14) nstaves = 14;
327 std::vector<float> ibldist;
328 std::vector<float> iblbaseline;
329 ibldist.resize(nstaves);
330 iblbaseline.resize(nstaves);
337 ibldist[atrlist[
"stave"].data<
int>()] = atrlist[
"mag"].data<float>();
338 iblbaseline[atrlist[
"stave"].data<
int>()] = atrlist[
"base"].data<float>();
341 <<
" ,stave: " << atrlist[
"stave"].data<
int>()
342 <<
" ,mag: " << atrlist[
"mag"].data<
float>()
343 <<
" ,base: " << atrlist[
"base"].data<
float>());
348 <<
key <<
" - no IBL bowing alignment");
349 return alignmentChange;
365 ATH_MSG_ERROR(
"Cannot find AlignableTransformContainer for key "
366 <<
key <<
" - no misalignment");
368 throw std::runtime_error(
"Unable to apply Inner Detector alignments");
371 if (container->
empty()) {
373 <<
key <<
" is empty. Probably due to out of range IOV");
375 throw std::runtime_error(
"Unable to apply Inner Detector alignments.");
378 std::string IBLalignfolder = alignfolder;
379 IBLalignfolder.append(
"/PIXB1");
380 for (
const auto *
pat : *container)
382 if (!(
pat->tag()==IBLalignfolder &&
390 trans_iter != transformCollection->
end();
394 <<
getIdHelper()->show_to_string(trans_iter->identify()));
399 <<
getIdHelper()->show_to_string(trans_iter->identify()));
400 ATH_MSG_WARNING(
"No IBLDist corrections can be applied for invalid HashID's - exiting");
406 double z = center[2];
407 const double y0y0 = 366.5*366.5;
413 ATH_MSG_DEBUG(
"Total IBL-module Tx shift (baseline+bowing): " << basex+bowx);
414 if ( (basex+bowx)==0 )
continue;
435 trans_iter->identify(),
441 ATH_MSG_DEBUG(
"Cannot set AlignableTransform for identifier."
442 <<
getIdHelper()->show_to_string(trans_iter->identify())
443 <<
" at level 0 for IBLDist bowing deformation");
445 alignmentChange = (alignmentChange ||
status);
450 return alignmentChange;
455 GeoVAlignmentStore* alignStore)
const {
456 bool alignmentChange =
false;
458 ATH_MSG_INFO(
"Processing IBLDist alignment container with key " <<
key);
461 return alignmentChange;
465 if (
numerology().numPhiModulesForLayer(0) < 14)
470 std::vector<float> ibldist;
471 std::vector<float> iblbaseline;
472 ibldist.resize(nstaves);
473 iblbaseline.resize(nstaves);
477 citr !=
obj->end(); ++citr) {
480 ibldist[atrlist[
"stave"].data<
int>()] = atrlist[
"mag"].data<float>();
481 iblbaseline[atrlist[
"stave"].data<
int>()] = atrlist[
"base"].data<float>();
484 <<
", stave: " << atrlist[
"stave"].data<
int>()
485 <<
", mag: " << atrlist[
"mag"].data<
float>()
486 <<
", base: " << atrlist[
"base"].data<
float>());
502 if(!detElem->isInnermostPixelLayer()) {
515 "invalid HashID's - exiting ");
523 double z = center[2];
524 const double y0y0 = 366.5 * 366.5;
526 double bowx = ibldist[stave] * (
z *
z - y0y0) / y0y0;
527 double basex = iblbaseline[stave];
530 ATH_MSG_DEBUG(
"Total IBL-module Tx shift (baseline+bowing): " << basex + bowx);
532 if ((basex + bowx) == 0) {
537 Amg::RotationMatrix3D::Identity();
543 if (currentDelta ==
nullptr) {
544 ATH_MSG_ERROR(
"Have IBL Dist for element which does not have an alignment delta."
545 <<
" This indicates inconsistent alignment data");
570 alignmentChange |=
status;
573 return alignmentChange;
580 bool alignmentChange =
false;
582 ATH_MSG_INFO(
"Processing new global alignment containers with key " <<
key
583 <<
" in the " << frame <<
" frame at level " <<
level);
592 <<
key <<
" - no new global alignment");
593 return alignmentChange;
598 return alignmentChange;
606 if (atrlist[
"det"].data<int>()!=1)
continue;
609 atrlist[
"layer"].data<int>(),
610 atrlist[
"ring"].data<int>(),
611 atrlist[
"sector"].data<int>());
617 ATH_MSG_WARNING(
"No global alignment corrections can be applied for invalid HashID's - exiting");
623 Amg::Translation3D newtranslation(atrlist[
"Tx"].data<float>(),atrlist[
"Ty"].data<float>(),atrlist[
"Tz"].data<float>());
624 Amg::Transform3D newtrans = newtranslation * Amg::RotationMatrix3D::Identity();
630 <<
" ,det: " << atrlist[
"det"].data<
int>()
631 <<
" ,bec: " << atrlist[
"bec"].data<
int>()
632 <<
" ,layer: " << atrlist[
"layer"].data<
int>()
633 <<
" ,ring: " << atrlist[
"ring"].data<
int>()
634 <<
" ,sector: " << atrlist[
"sector"].data<
int>()
635 <<
" ,Tx: " << atrlist[
"Tx"].data<
float>()
636 <<
" ,Ty: " << atrlist[
"Ty"].data<
float>()
637 <<
" ,Tz: " << atrlist[
"Tz"].data<
float>()
638 <<
" ,Rx: " << atrlist[
"Rx"].data<
float>()
639 <<
" ,Ry: " << atrlist[
"Ry"].data<
float>()
640 <<
" ,Rz: " << atrlist[
"Rz"].data<
float>());
650 ATH_MSG_DEBUG(
"Cannot set AlignableTransform for identifier."
652 <<
" at level " <<
level <<
" for new global DB");
655 alignmentChange = (alignmentChange ||
status);
658 return alignmentChange;
666 ATH_MSG_LVL_NOCHK(
level,
" - translation: " << tr.translation().x() <<
" " <<tr.translation().y() <<
" " <<tr.translation().z());
void printTransform(MSG::Level level, const Amg::Transform3D &tr) const
bool is_pixel(Identifier id) const
unsigned int getBarrelLayers() const
Layers built.
const_iterator end() const
Const iterator class for DataVector/DataList.
SiDetectorElementCollection m_elementCollection
const SiNumerology & numerology() const
Access Numerology.
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
void setPrevInEta(const SiDetectorElement *element)
const PixelID * m_idHelper
A CondMultChanCollection is a template class which can hold a collection of T* objects which are inte...
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.
bool useLayer(int layer) const
Check if layer exists.
bool processSpecialAlignment(const std::string &, InDetDD::AlignFolderType) override
Process new IBLDist DB folder.
This is a Identifier helper class for the PLR subdetector. This class inherits from PixelID.
std::atomic_bool m_suppressWarnings
void setPrevInPhi(const SiDetectorElement *element)
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
GeoIntrusivePtr< T > GeoNodePtr
void setNextInEta(const SiDetectorElement *element)
int get_prev_in_phi(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in phi (return == 0 for neighbor found)
#define ATH_MSG_VERBOSE(x)
This class is a collection of AttributeLists where each one is associated with a channel number....
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
static bool setAlignableTransformGlobalDelta(ExtendedAlignableTransform *extXF, const Amg::Transform3D &delta, GeoVAlignmentStore *alignStore=nullptr)
Helper method to set delta transform from a global delta - Amg interface.
bool m_isLogical
This variable switches the how the local alignment corrections are applied If true they will be calcu...
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
#define ATH_MSG_LVL_NOCHK(lvl, x)
virtual const SiDetectorElementCollection * getDetectorElementCollection() const override
access to whole collection via Iterators
const Amg::Transform3D defTransform() const
The Athena Transient Store API.
unsigned int getEndcapLayers() const
Layers built.
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
bool msgLvl(const MSG::Level lvl) const
Test the output level.
int get_next_in_phi(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in phi (return == 0 for neighbor found)
(Non-const) Iterator class for DataVector/DataList.
virtual bool identifierBelongs(const Identifier &id) const override
Check identifier is for this detector.
virtual void initNeighbours() override
Initialize the neighbours.
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual void updateCache() const
Recalculate cached values.
const SiDetectorDesign * getDesign(int i) const
Eigen::Affine3d Transform3D
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
const int FIRST_HIGHER_LEVEL
PixelDetectorManager(StoreGateSvc *detStore)
Constructor.
std::string repr(PyObject *o)
returns the string representation of a python object equivalent of calling repr(o) in python
bool useDisk(int disk) const
Check if disk exists.
virtual SiDetectorElementCollection::const_iterator getDetectorElementBegin() const override
void addTreeTop(const PVConstLink &vol)
Add a Tree top:
int get_next_in_eta(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in eta (return == 0 for neighbor found)
StoreGateSvc * m_detStore
virtual void addAlignableTransform(int level, const Identifier &id, GeoAlignableTransform *xf, const GeoVFullPhysVol *child)
Add alignable transforms.
bool is_valid() const
Check if id is in a valid state.
size_type wafer_hash_max() const
void resize(size_type sz)
Resizes the collection to the specified number of elements.
std::vector< PVConstLink > m_volume
virtual const PixelID * getIdHelper() const override
constexpr unsigned int numLayers()
Eigen::Matrix< double, 3, 1 > Vector3D
virtual unsigned int getNumTreeTops() const override
Access to raw geometry:
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
void setNextInPhi(const SiDetectorElement *element)
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)
ChanAttrListMap::const_iterator const_iterator
Amg::Transform3D CLHEPTransformToEigen(const HepGeom::Transform3D &CLHEPtransf)
Converts a CLHEP-based HepGeom::Transform3D into an Eigen Amg::Transform3D.
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...
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.
virtual PVConstLink getTreeTop(unsigned int i) const override
Eigen::Translation< double, 3 > Translation3D
HepGeom::Transform3D EigenTransformToCLHEP(const Amg::Transform3D &eigenTransf)
Converts an Eigen-based Amg::Transform3D into a CLHEP-based HepGeom::Transform3D.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
int numPhiModulesForLayer(int layer) const
Number of sectors in phi for a layer.
std::vector< std::unique_ptr< ExtendedAlignableTransform > > m_alignableTransforms
virtual SiDetectorElementCollection::const_iterator getDetectorElementEnd() const override
Eigen::AngleAxisd AngleAxis3D
virtual const SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements : via Identifier
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
int phi_module(const Identifier &id) const
size_type size() const noexcept
Returns the number of elements in the collection.
int get_prev_in_eta(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in eta (return == 0 for neighbor found)
std::vector< AlignableTransformMap > m_higherAlignableTransforms
bool empty() const noexcept
Returns true if the collection is empty.
virtual const Amg::Transform3D & transform() const override final
Return local to global transform.
virtual const PixelModuleDesign * getPixelDesign(int i) const
Access to module design, Casts to PixelModuleDesign.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
virtual void addDetectorElement(SiDetectorElement *element) override
Add elememts.