|
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;
125 throw std::runtime_error(
"PixelDetectorManager: Error adding detector element.");
167 unsigned int barrelLayers = 0;
177 unsigned int endcapLayers = 0;
190 GeoVAlignmentStore* alignStore)
const
197 if (!idHash.
is_valid())
return false;
206 if (!element)
return false;
219 ATH_MSG_WARNING(
"Frames other than global or local are not supported.");
234 AlignableTransformMap::const_iterator iter;
248 const GeoVPhysVol * child)
253 const GeoVFullPhysVol * childFPV =
dynamic_cast<const GeoVFullPhysVol *
>(child);
255 ATH_MSG_ERROR(
"Child of alignable transform is not a full physical volume");
265 const GeoVFullPhysVol * child)
302 bool alignmentChange =
false;
304 std::string alignfolder;
308 ATH_MSG_INFO(
"Processing IBLDist alignment container with key (" <<
key <<
")"
309 <<
"and alignment folder pointing to " << alignfolder);
312 if (
numerology().numPhiModulesForLayer(0)<14) nstaves = 14;
315 std::vector<float> ibldist;
316 std::vector<float> iblbaseline;
317 ibldist.resize(nstaves);
318 iblbaseline.resize(nstaves);
325 ibldist[atrlist[
"stave"].data<
int>()] = atrlist[
"mag"].data<float>();
326 iblbaseline[atrlist[
"stave"].data<
int>()] = atrlist[
"base"].data<float>();
329 <<
" ,stave: " << atrlist[
"stave"].data<
int>()
330 <<
" ,mag: " << atrlist[
"mag"].data<
float>()
331 <<
" ,base: " << atrlist[
"base"].data<
float>());
336 <<
key <<
" - no IBL bowing alignment");
337 return alignmentChange;
353 ATH_MSG_ERROR(
"Cannot find AlignableTransformContainer for key "
354 <<
key <<
" - no misalignment");
356 throw std::runtime_error(
"Unable to apply Inner Detector alignments");
359 if (container->
empty()) {
361 <<
key <<
" is empty. Probably due to out of range IOV");
363 throw std::runtime_error(
"Unable to apply Inner Detector alignments.");
366 std::string IBLalignfolder = alignfolder;
367 IBLalignfolder.append(
"/PIXB1");
368 for (
const auto *
pat : *container)
370 if (!(
pat->tag()==IBLalignfolder &&
378 trans_iter != transformCollection->
end();
382 <<
getIdHelper()->show_to_string(trans_iter->identify()));
387 <<
getIdHelper()->show_to_string(trans_iter->identify()));
388 ATH_MSG_WARNING(
"No IBLDist corrections can be applied for invalid HashID's - exiting");
394 double z = center[2];
395 const double y0y0 = 366.5*366.5;
401 ATH_MSG_DEBUG(
"Total IBL-module Tx shift (baseline+bowing): " << basex+bowx);
402 if ( (basex+bowx)==0 )
continue;
423 trans_iter->identify(),
429 ATH_MSG_DEBUG(
"Cannot set AlignableTransform for identifier."
430 <<
getIdHelper()->show_to_string(trans_iter->identify())
431 <<
" at level 0 for IBLDist bowing deformation");
433 alignmentChange = (alignmentChange ||
status);
438 return alignmentChange;
443 GeoVAlignmentStore* alignStore)
const {
444 bool alignmentChange =
false;
446 ATH_MSG_INFO(
"Processing IBLDist alignment container with key " <<
key);
449 return alignmentChange;
453 if (
numerology().numPhiModulesForLayer(0) < 14)
458 std::vector<float> ibldist;
459 std::vector<float> iblbaseline;
460 ibldist.resize(nstaves);
461 iblbaseline.resize(nstaves);
465 citr !=
obj->end(); ++citr) {
468 ibldist[atrlist[
"stave"].data<
int>()] = atrlist[
"mag"].data<float>();
469 iblbaseline[atrlist[
"stave"].data<
int>()] = atrlist[
"base"].data<float>();
472 <<
", stave: " << atrlist[
"stave"].data<
int>()
473 <<
", mag: " << atrlist[
"mag"].data<
float>()
474 <<
", base: " << atrlist[
"base"].data<
float>());
490 if(!detElem->isInnermostPixelLayer()) {
503 "invalid HashID's - exiting ");
511 double z = center[2];
512 const double y0y0 = 366.5 * 366.5;
514 double bowx = ibldist[stave] * (
z *
z - y0y0) / y0y0;
515 double basex = iblbaseline[stave];
518 ATH_MSG_DEBUG(
"Total IBL-module Tx shift (baseline+bowing): " << basex + bowx);
520 if ((basex + bowx) == 0) {
525 Amg::RotationMatrix3D::Identity();
531 if (currentDelta ==
nullptr) {
532 ATH_MSG_ERROR(
"Have IBL Dist for element which does not have an alignment delta."
533 <<
" This indicates inconsistent alignment data");
558 alignmentChange |=
status;
561 return alignmentChange;
568 bool alignmentChange =
false;
570 ATH_MSG_INFO(
"Processing new global alignment containers with key " <<
key
571 <<
" in the " << frame <<
" frame at level " <<
level);
580 <<
key <<
" - no new global alignment");
581 return alignmentChange;
586 return alignmentChange;
594 if (atrlist[
"det"].data<int>()!=1)
continue;
597 atrlist[
"layer"].data<int>(),
598 atrlist[
"ring"].data<int>(),
599 atrlist[
"sector"].data<int>());
605 ATH_MSG_WARNING(
"No global alignment corrections can be applied for invalid HashID's - exiting");
611 Amg::Translation3D newtranslation(atrlist[
"Tx"].data<float>(),atrlist[
"Ty"].data<float>(),atrlist[
"Tz"].data<float>());
612 Amg::Transform3D newtrans = newtranslation * Amg::RotationMatrix3D::Identity();
618 <<
" ,det: " << atrlist[
"det"].data<
int>()
619 <<
" ,bec: " << atrlist[
"bec"].data<
int>()
620 <<
" ,layer: " << atrlist[
"layer"].data<
int>()
621 <<
" ,ring: " << atrlist[
"ring"].data<
int>()
622 <<
" ,sector: " << atrlist[
"sector"].data<
int>()
623 <<
" ,Tx: " << atrlist[
"Tx"].data<
float>()
624 <<
" ,Ty: " << atrlist[
"Ty"].data<
float>()
625 <<
" ,Tz: " << atrlist[
"Tz"].data<
float>()
626 <<
" ,Rx: " << atrlist[
"Rx"].data<
float>()
627 <<
" ,Ry: " << atrlist[
"Ry"].data<
float>()
628 <<
" ,Rz: " << atrlist[
"Rz"].data<
float>());
638 ATH_MSG_DEBUG(
"Cannot set AlignableTransform for identifier."
640 <<
" at level " <<
level <<
" for new global DB");
643 alignmentChange = (alignmentChange ||
status);
646 return alignmentChange;
654 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
JetConstituentVector::iterator iterator
bool is_pixel(Identifier id) const
unsigned int getBarrelLayers() const
Layers built.
const_iterator end() const
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.
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)
void setCache()
Set/calculate cache values (inline)
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)
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.
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.
std::vector< PVConstLink > m_volume
virtual const PixelID * getIdHelper() const override
size_type wafer_hash_max(void) const
constexpr unsigned int numLayers()
Eigen::Matrix< double, 3, 1 > Vector3D
virtual unsigned int getNumTreeTops() const override
Access to raw geometry:
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
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
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.
virtual void addDetectorElement(SiDetectorElement *element) override
Add elememts.
bool processSpecialAlignment(const std::string &, InDetDD::AlignFolderType) const override
Process new IBLDist DB folder.
virtual SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements : via Identifier