diff --git a/Calorimeter/CaloDetDescr/CMakeLists.txt b/Calorimeter/CaloDetDescr/CMakeLists.txt index 74154f2e14908e07025911e283ef46e7c7b43b92..f56bb8416c0124a51d25ea94d14a370ab509cf60 100644 --- a/Calorimeter/CaloDetDescr/CMakeLists.txt +++ b/Calorimeter/CaloDetDescr/CMakeLists.txt @@ -14,7 +14,7 @@ atlas_add_library( CaloDetDescrLib LINK_LIBRARIES ${Boost_LIBRARIES} GaudiKernel AthenaKernel AthContainers AthenaBaseComps CxxUtils GeoModelInterfaces Identifier CaloIdentifier CaloGeoHelpers GeoPrimitives LArReadoutGeometry - PRIVATE_LINK_LIBRARIES CaloConditions StoreGateLib ) + PRIVATE_LINK_LIBRARIES CaloConditions StoreGateLib GeoModelUtilities) atlas_add_component( CaloDetDescr src/components/*.cxx diff --git a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDescriptors.h b/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDescriptors.h index 1c741db198171b65234cc2def125c7c424a49bbe..79e7a4886faf953fed94208e809dd3ff0cd5e31b 100755 --- a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDescriptors.h +++ b/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDescriptors.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /** @@ -7,13 +7,13 @@ * * @brief LAr subsystem specific descriptors * - * @author Vakho Tsulaia (tsulaia@mail.cern.ch) + * @author Vakho Tsulaia * * $Id: CaloDescriptors.h,v 1.3 2009-04-22 19:54:16 ssnyder Exp $ */ -#ifndef CALODESCRIPTORS_H -#define CALODESCRIPTORS_H +#ifndef CALODETDESCR_CALODESCRIPTORS_H +#define CALODETDESCR_CALODESCRIPTORS_H #include "CaloDetDescr/CaloDetDescriptor.h" @@ -22,6 +22,8 @@ class EMECDetectorRegion; class HECDetectorRegion; class FCALModule; +class GeoAlignmentStore; + /** * @class EMBDescriptor * @@ -31,47 +33,34 @@ class FCALModule; class EMBDescriptor : public CaloDetDescriptor { public: - /** @brief Constructor - @param id [IN] region identifier (for base class constructor) - @param helper [IN] ID helper (for base class constructor) - @param calo_helper [IN] ID helper (for base class constructor) - @param embRegion [IN] EMB Region Descriptor from LArReadoutGeometry - */ - EMBDescriptor(const Identifier& id, - const AtlasDetectorID* helper, - const CaloCell_ID* calo_helper, - const EMBDetectorRegion* embRegion); - /** @brief Destructor + /** + * @brief Constructor + * @param id [IN] region identifier (for base class constructor) + * @param helper [IN] ID helper (for base class constructor) + * @param calo_helper [IN] ID helper (for base class constructor) + * @param embRegion [IN] EMB Region Descriptor from LArReadoutGeometry */ - ~EMBDescriptor(); + EMBDescriptor(const Identifier& id + , const AtlasDetectorID* helper + , const CaloCell_ID* calo_helper + , const EMBDetectorRegion* embRegion + , const GeoAlignmentStore* alignStore = nullptr); - /** @brief get pointer to the EMB Region object (from LArReadoutGeometry) + /** + * @brief Destructor */ - inline const EMBDetectorRegion* getEMBDetectorRegion() const - {return m_region;} + virtual ~EMBDescriptor(); private: - /** @brief pointer to the EMB Region object (from LArReadoutGeometry) - */ - const EMBDetectorRegion* m_region; - - /** @brief default constructor hidden + /** + * @brief default constructor hidden */ EMBDescriptor() = delete; - /** @brief copy constructor hidden + /** + * @brief copy constructor hidden */ EMBDescriptor & operator=(const EMBDescriptor &right) = delete; - - /** @brief initialize base description - */ - void init_description(); - - - /** @brief Fill all missing fields of CaloDetDescriptor which - have not been filled by init_description() - */ - void init_interpretation(); }; /** @@ -82,48 +71,34 @@ class EMBDescriptor : public CaloDetDescriptor class EMECDescriptor : public CaloDetDescriptor { public: - /** @brief Constructor - @param id [IN] region identifier (for base class constructor) - @param helper [IN] ID helper (for base class constructor) - @param calo_helper [IN] ID helper (for base class constructor) - @param emecRegion [IN] EMEC Region Descriptor from LArReadoutGeometry - */ - EMECDescriptor(const Identifier& id, - const AtlasDetectorID* helper, - const CaloCell_ID* calo_helper, - const EMECDetectorRegion* emecRegion); - - /** @brief Destructor + /** + * @brief Constructor + * @param id [IN] region identifier (for base class constructor) + * @param helper [IN] ID helper (for base class constructor) + * @param calo_helper [IN] ID helper (for base class constructor) + * @param emecRegion [IN] EMEC Region Descriptor from LArReadoutGeometry */ - ~EMECDescriptor(); + EMECDescriptor(const Identifier& id + , const AtlasDetectorID* helper + , const CaloCell_ID* calo_helper + , const EMECDetectorRegion* emecRegion + , const GeoAlignmentStore* alignStore = nullptr); - /** @brief get pointer to the EMEC Region object (from LArReadoutGeometry) + /** + * @brief Destructor */ - inline const EMECDetectorRegion* getEMECDetectorRegion() const - {return m_region;} + virtual ~EMECDescriptor(); private: - /** @brief pointer to the EMEC Region object (from LArReadoutGeometry) - */ - const EMECDetectorRegion* m_region; - - /** @brief default constructor hidden + /** + * @brief default constructor hidden */ EMECDescriptor() = delete; - /** @brief copy constructor hidden + /** + * @brief copy constructor hidden */ EMECDescriptor & operator=(const EMECDescriptor &right) = delete; - - /** @brief initialize base description - */ - void init_description(); - - /** @brief Fill all missing fields of CaloDetDescriptor which - have not been filled by init_description() - */ - void init_interpretation(); - }; /** @@ -134,50 +109,33 @@ class EMECDescriptor : public CaloDetDescriptor class HECDescriptor : public CaloDetDescriptor { public: - /** @brief Constructor - @param id [IN] region identifier (for base class constructor) - @param helper [IN] ID helper (for base class constructor) - @param calo_helper [IN] ID helper (for base class constructor) - @param hecRegion [IN] HEC Region Descriptor from LArReadoutGeometry - */ - HECDescriptor(const Identifier& id, - const AtlasDetectorID* helper, - const CaloCell_ID* calo_helper, - const HECDetectorRegion* hecRegion); - - /** @brief Destructor - */ - ~HECDescriptor(); - - /** @brief get pointer to the HEC Region object (from LArReadoutGeometry) - */ - inline const HECDetectorRegion* getHECDetectorRegion() const - {return m_region;} - + /** + * @brief Constructor + * @param id [IN] region identifier (for base class constructor) + * @param helper [IN] ID helper (for base class constructor) + * @param calo_helper [IN] ID helper (for base class constructor) + * @param hecRegion [IN] HEC Region Descriptor from LArReadoutGeometry + */ + HECDescriptor(const Identifier& id + , const AtlasDetectorID* helper + , const CaloCell_ID* calo_helper + , const HECDetectorRegion* hecRegion + , const GeoAlignmentStore* alignStore = nullptr); + /** + * @brief Destructor + */ + virtual ~HECDescriptor(); private: - /** @brief pointer to the HEC Region object (from LArReadoutGeometry) - */ - const HECDetectorRegion* m_region; - - /** @brief default constructor hidden + /** + * @brief default constructor hidden */ HECDescriptor() = delete; - /** @brief copy constructor hidden + /** + * @brief copy constructor hidden */ HECDescriptor & operator=(const HECDescriptor &right) = delete; - - - /** @brief initialize base description - */ - void init_description(); - - /** @brief Fill all missing fields of CaloDetDescriptor which - have not been filled by init_description() - */ - void init_interpretation(); - }; /** @@ -188,48 +146,34 @@ class HECDescriptor : public CaloDetDescriptor class FCALDescriptor : public CaloDetDescriptor { public: - /** @brief Constructor - @param id [IN] region identifier (for base class constructor) - @param helper [IN] ID helper (for base class constructor) - @param calo_helper [IN] ID helper (for base class constructor) - @param fcalModule [IN] FCAL Module Descriptor from LArReadoutGeometry - */ - FCALDescriptor(const Identifier& id, - const AtlasDetectorID* helper, - const CaloCell_ID* calo_helper, - const FCALModule* fcalModule); - - /** @brief Destructor + /** + * @brief Constructor + * @param id [IN] region identifier (for base class constructor) + * @param helper [IN] ID helper (for base class constructor) + * @param calo_helper [IN] ID helper (for base class constructor) + * @param fcalModule [IN] FCAL Module Descriptor from LArReadoutGeometry */ - ~FCALDescriptor(); + FCALDescriptor(const Identifier& id + , const AtlasDetectorID* helper + , const CaloCell_ID* calo_helper + , const FCALModule* fcalModule + , const GeoAlignmentStore* alignStore = nullptr); - /** @brief get pointer to the FCAL Module object (from LArReadoutGeometry) + /** + * @brief Destructor */ - inline const FCALModule* getFCALModule() const - {return m_module;} + virtual ~FCALDescriptor(); private: - /** @brief pointer to the FCAL Module object (from LArReadoutGeometry) - */ - const FCALModule* m_module; - - /** @brief default constructor hidden + /** + * @brief default constructor hidden */ FCALDescriptor() = delete; - /** @brief copy constructor hidden + /** + * @brief copy constructor hidden */ FCALDescriptor & operator=(const FCALDescriptor &right) = delete; - - /** @brief initialize base description - */ - void init_description(); - - /** @brief Fill all missing fields of CaloDetDescriptor which - have not been filled by init_description() - */ - void init_interpretation(); - }; #endif diff --git a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetectorElements.h b/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetectorElements.h index f7eef7dfa274b06a3064db5caf644ec0123e20e3..5b249fa6467e1b900acc98242bd16fa72513daf2 100755 --- a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetectorElements.h +++ b/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetectorElements.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /** @@ -10,8 +10,8 @@ * $Id: CaloDetectorElements.h,v 1.13 2009-04-22 19:54:16 ssnyder Exp $ */ -#ifndef CALODETECTORELEMENTS_H -#define CALODETECTORELEMENTS_H +#ifndef CALODETDESCR_CALODETECTORELEMENTS_H +#define CALODETDESCR_CALODETECTORELEMENTS_H #include "CaloDetDescr/CaloDetDescrElement.h" @@ -28,6 +28,7 @@ #include "Identifier/Identifier.h" class CaloDetDescriptor; +class GeoAlignmentStore; /** * @struct CaloElementPositionShift @@ -50,66 +51,69 @@ typedef struct class EMBDetectorElement : public CaloDetDescrElement { public: - /** @brief Constructor, takes all necessary parameters for the base class constructor - plus some specific parameters for this class - @param subcaloHash [IN] for the base class - @param onl1 [IN] for the base class - @param onl2 [IN] for the base class - @param descriptor [IN] for the base class - @param embCell [IN] EMB Cell description from LArReadoutGeometry - @param embRegion [IN] EMB Region description from LArReadoutGeometry - */ - EMBDetectorElement(const IdentifierHash subcaloHash, - const IdentifierHash onl1, - const IdentifierHash onl2, - const CaloDetDescriptor* descriptor, - EMBCellConstLink& embCell, - const EMBDetectorRegion* embRegion, - bool isTestBeam); + /** + * @brief Constructor, takes all necessary parameters for the base class constructor + * plus some specific parameters for this class + * @param subcaloHash [IN] for the base class + * @param onl1 [IN] for the base class + * @param onl2 [IN] for the base class + * @param descriptor [IN] for the base class + * @param embCell [IN] EMB Cell description from LArReadoutGeometry + * @param embRegion [IN] EMB Region description from LArReadoutGeometry + */ + EMBDetectorElement(const IdentifierHash subcaloHash + , const IdentifierHash onl1 + , const IdentifierHash onl2 + , const CaloDetDescriptor* descriptor + , EMBCellConstLink& embCell + , const EMBDetectorRegion* embRegion + , bool isTestBeam + , const GeoAlignmentStore* geoAlignStore = nullptr + , const CaloElementPositionShift* posShift = nullptr); - /** @brief EMB Cell description from LArReadoutGeometry - */ - inline EMBCellConstLink getEMBCell() const {return m_cell;} - /** @brief EMB Region description from LArReadoutGeometry + /** + * @brief EMB Cell description from LArReadoutGeometry */ - inline const EMBDetectorRegion* getEMBDetectorRegion() const - {return m_region;} + inline EMBCellConstLink getEMBCell() const {return m_cell;} - /** @brief the method called by CaloAlignTool, updates alignment information - @param embCell [IN] misaligned EMB Cell description from LArReadoutGeometry - @param embRegion [IN] misaligned EMB Region description from LArReadoutGeometry + /** + * @brief the method called by CaloAlignTool, updates alignment information + * @param embCell [IN] misaligned EMB Cell description from LArReadoutGeometry + * @param embRegion [IN] misaligned EMB Region description from LArReadoutGeometry */ - void updateAlignment(EMBCellConstLink& embCell, - const EMBDetectorRegion* embRegion, - const CaloElementPositionShift* posShift = nullptr); + void updateAlignment(EMBCellConstLink& embCell + , const EMBDetectorRegion* embRegion + , const CaloElementPositionShift* posShift = nullptr); - /** @brief get layer + /** + * @brief get layer */ - int getLayer() const; + virtual int getLayer() const override; private: - /** @brief EMB Cell description from LArReadoutGeometry + /** + * @brief EMB Cell description from LArReadoutGeometry */ EMBCellConstLink m_cell; - /** @brief EMB Region description from LArReadoutGeometry + /** + * @brief EMB Region description from LArReadoutGeometry */ const EMBDetectorRegion* m_region; - /** @brief default constructor hidden + /** + * @brief default constructor hidden */ EMBDetectorElement() = delete; - /** @brief copy constructor hidden + /** + * @brief copy constructor hidden */ EMBDetectorElement & operator=(const EMBDetectorElement &right) = delete; - /** @brief initialize base description - */ - void init_description(const CaloElementPositionShift* posShift = nullptr); - - /** @brief Fill all missing fields of CaloDetDescrElement which - have not been filled by init_description() + /** + * @brief initialize base description */ - void init_interpretation(); + void init_description(const GeoAlignmentStore* geoAlignStore + , const CaloElementPositionShift* posShift); }; /** @@ -120,65 +124,74 @@ class EMBDetectorElement : public CaloDetDescrElement class EMECDetectorElement : public CaloDetDescrElement { public: - /** @brief Constructor, takes all necessary parameters for the base class constructor - plus some specific parameters for this class - @param subcaloHash [IN] for the base class - @param onl1 [IN] for the base class - @param onl2 [IN] for the base class - @param descriptor [IN] for the base class - @param emecCell [IN] EMEC Cell description from LArReadoutGeometry - @param emecRegion [IN] EMEC Region description from LArReadoutGeometry - */ - EMECDetectorElement(const IdentifierHash subcaloHash, - const IdentifierHash onl1, - const IdentifierHash onl2, - const CaloDetDescriptor* descriptor, - EMECCellConstLink& emecCell, - const EMECDetectorRegion* emecRegion, - bool isTestBeam); + /** + * @brief Constructor, takes all necessary parameters for the base class constructor + * plus some specific parameters for this class + * @param subcaloHash [IN] for the base class + * @param onl1 [IN] for the base class + * @param onl2 [IN] for the base class + * @param descriptor [IN] for the base class + * @param emecCell [IN] EMEC Cell description from LArReadoutGeometry + * @param emecRegion [IN] EMEC Region description from LArReadoutGeometry + */ + EMECDetectorElement(const IdentifierHash subcaloHash + , const IdentifierHash onl1 + , const IdentifierHash onl2 + , const CaloDetDescriptor* descriptor + , EMECCellConstLink& emecCell + , const EMECDetectorRegion* emecRegion + , bool isTestBeam + , const GeoAlignmentStore* geoAlignStore = nullptr + , const CaloElementPositionShift* posShift = nullptr); - /** @brief EMEC Cell description from LArReadoutGeometry - */ - inline EMECCellConstLink getEMECCell() const {return m_cell;} - /** @brief EMEC Region description from LArReadoutGeometry + /** + * @brief EMEC Cell description from LArReadoutGeometry */ - inline const EMECDetectorRegion* getEMECDetectorRegion() const - {return m_region;} + inline EMECCellConstLink getEMECCell() const {return m_cell;} - /** @brief the method called by CaloAlignTool, updates alignment information - @param emecCell [IN] misaligned EMEC Cell description from LArReadoutGeometry - @param emecRegion [IN] misaligned EMEC Region description from LArReadoutGeometry + /** + * @brief the method called by CaloAlignTool, updates alignment information + * @param emecCell [IN] misaligned EMEC Cell description from LArReadoutGeometry + * @param emecRegion [IN] misaligned EMEC Region description from LArReadoutGeometry */ - void updateAlignment(EMECCellConstLink& emecCell, - const EMECDetectorRegion* emecRegion, - const CaloElementPositionShift* posShift = nullptr); + void updateAlignment(EMECCellConstLink& emecCell + , const EMECDetectorRegion* emecRegion + , const CaloElementPositionShift* posShift = nullptr); - /** @brief get layer + /** + * @brief get layer */ - int getLayer() const; + virtual int getLayer() const override; private: - /** @brief EMEC Cell description from LArReadoutGeometry + /** + * @brief EMEC Cell description from LArReadoutGeometry */ EMECCellConstLink m_cell; - /** @brief EMEC Region description from LArReadoutGeometry + /** + * @brief EMEC Region description from LArReadoutGeometry */ const EMECDetectorRegion* m_region; - /** @brief default constructor hidden + /** + * @brief default constructor hidden */ EMECDetectorElement() = delete; - /** @brief copy constructor hidden + /** + * @brief copy constructor hidden */ EMECDetectorElement & operator=(const EMECDetectorElement &right) = delete; - /** @brief initialize base description + /** + * @brief initialize base description */ - void init_description(bool isTestBeam, - const CaloElementPositionShift* posShift = nullptr); + void init_description(bool isTestBeam + , const GeoAlignmentStore* geoAlignStore + , const CaloElementPositionShift* posShift); - /** @brief Fill all missing fields of CaloDetDescrElement which - have not been filled by init_description() + /** + * @brief Fill all missing fields of CaloDetDescrElement which + * have not been filled by init_description() */ void init_interpretation(); @@ -193,65 +206,74 @@ class EMECDetectorElement : public CaloDetDescrElement class HECDetectorElement : public CaloDetDescrElement { public: - /** @brief Constructor, takes all necessary parameters for the base class constructor - plus some specific parameters for this class - @param subcaloHash [IN] for the base class - @param onl1 [IN] for the base class - @param onl2 [IN] for the base class - @param descriptor [IN] for the base class - @param hecCell [IN] HEC Cell description from LArReadoutGeometry - @param hecRegion [IN] HEC Region description from LArReadoutGeometry - */ - HECDetectorElement(const IdentifierHash subcaloHash, - const IdentifierHash onl1, - const IdentifierHash onl2, - const CaloDetDescriptor* descriptor, - HECCellConstLink& hecCell, - const HECDetectorRegion* hecRegion, - bool isTestBeam); + /** + * @brief Constructor, takes all necessary parameters for the base class constructor + * plus some specific parameters for this class + * @param subcaloHash [IN] for the base class + * @param onl1 [IN] for the base class + * @param onl2 [IN] for the base class + * @param descriptor [IN] for the base class + * @param hecCell [IN] HEC Cell description from LArReadoutGeometry + * @param hecRegion [IN] HEC Region description from LArReadoutGeometry + */ + HECDetectorElement(const IdentifierHash subcaloHash + , const IdentifierHash onl1 + , const IdentifierHash onl2 + , const CaloDetDescriptor* descriptor + , HECCellConstLink& hecCell + , const HECDetectorRegion* hecRegion + , bool isTestBeam + , const GeoAlignmentStore* geoAlignStore = nullptr + , const CaloElementPositionShift* posShift = nullptr); - /** @brief HEC Cell description from LArReadoutGeometry - */ - inline HECCellConstLink getHECCell() const {return m_cell;} - /** @brief HEC Region description from LArReadoutGeometry + /** + * @brief HEC Cell description from LArReadoutGeometry */ - inline const HECDetectorRegion* getHECDetectorRegion() const - {return m_region;} + inline HECCellConstLink getHECCell() const {return m_cell;} - /** @brief the method called by CaloAlignTool, updates alignment information - @param hecCell [IN] misaligned HEC Cell description from LArReadoutGeometry - @param hecRegion [IN] misaligned HEC Region description from LArReadoutGeometry + /** + * @brief the method called by CaloAlignTool, updates alignment information + * @param hecCell [IN] misaligned HEC Cell description from LArReadoutGeometry + * @param hecRegion [IN] misaligned HEC Region description from LArReadoutGeometry */ - void updateAlignment(HECCellConstLink& hecCell, - const HECDetectorRegion* hecRegion, - const CaloElementPositionShift* posShift = nullptr); + void updateAlignment(HECCellConstLink& hecCell + , const HECDetectorRegion* hecRegion + , const CaloElementPositionShift* posShift = nullptr); - /** @brief get layer + /** + * @brief get layer */ - int getLayer() const; + virtual int getLayer() const override; private: - /** @brief HEC Cell description from LArReadoutGeometry + /** + * @brief HEC Cell description from LArReadoutGeometry */ HECCellConstLink m_cell; - /** @brief HEC Region description from LArReadoutGeometry + /** + * @brief HEC Region description from LArReadoutGeometry */ const HECDetectorRegion* m_region; - /** @brief default constructor hidden + /** + * @brief default constructor hidden */ HECDetectorElement() = delete; - /** @brief copy constructor hidden + /** + * @brief copy constructor hidden */ HECDetectorElement & operator=(const HECDetectorElement &right) = delete; - /** @brief initialize base description + /** + * @brief initialize base description */ - void init_description(bool isTestBeam, - const CaloElementPositionShift* posShift = nullptr); + void init_description(bool isTestBeam + , const GeoAlignmentStore* geoAlignStore + , const CaloElementPositionShift* posShift); - /** @brief Fill all missing fields of CaloDetDescrElement which - have not been filled by init_description() + /** + * @brief Fill all missing fields of CaloDetDescrElement which + * have not been filled by init_description() */ void init_interpretation(); @@ -265,66 +287,70 @@ class HECDetectorElement : public CaloDetDescrElement class FCALDetectorElement : public CaloDetDescrElement { public: - /** @brief Constructor, takes all necessary parameters for the base class constructor - plus some specific parameters for this class - @param subcaloHash [IN] for the base class - @param onl1 [IN] for the base class - @param onl2 [IN] for the base class - @param descriptor [IN] for the base class - @param fcalTile [IN] FCAL Tile description from LArReadoutGeometry - @param fcalModule [IN] FCAL Module description from LArReadoutGeometry - */ - FCALDetectorElement(const IdentifierHash subcaloHash, - const IdentifierHash onl1, - const IdentifierHash onl2, - const CaloDetDescriptor* descriptor, - const FCALTile* fcalTile, - const FCALModule* fcalModule, - bool isTestBeam); + /** + * @brief Constructor, takes all necessary parameters for the base class constructor + * plus some specific parameters for this class + * @param subcaloHash [IN] for the base class + * @param onl1 [IN] for the base class + * @param onl2 [IN] for the base class + * @param descriptor [IN] for the base class + * @param fcalTile [IN] FCAL Tile description from LArReadoutGeometry + * @param fcalModule [IN] FCAL Module description from LArReadoutGeometry + */ + FCALDetectorElement(const IdentifierHash subcaloHash + , const IdentifierHash onl1 + , const IdentifierHash onl2 + , const CaloDetDescriptor* descriptor + , const FCALTile* fcalTile + , const FCALModule* fcalModule + , bool isTestBeam + , const GeoAlignmentStore* geoAlignStore = nullptr + , const CaloElementPositionShift* posShift = nullptr); - /** @brief FCAL Tile description from LArReadoutGeometry - */ - inline const FCALTile* getFCALTile() const {return m_tile;} - /** @brief FCAL Module description from LArReadoutGeometry + /** + * @brief FCAL Tile description from LArReadoutGeometry */ - inline const FCALModule* getFCALModule() const {return m_module;} + inline const FCALTile* getFCALTile() const {return m_tile;} - /** @brief the method called by CaloAlignTool, updates alignment information - @param fcalTile [IN] misaligned FCAL Tile description from LArReadoutGeometry - @param fcalModule [IN] misaligned FCAL Module description from LArReadoutGeometry + /** + * @brief the method called by CaloAlignTool, updates alignment information + * @param fcalTile [IN] misaligned FCAL Tile description from LArReadoutGeometry + * @param fcalModule [IN] misaligned FCAL Module description from LArReadoutGeometry */ - void updateAlignment(const FCALTile* fcalTile, - const FCALModule* fcalModule, - const CaloElementPositionShift* posShift = nullptr); + void updateAlignment(const FCALTile* fcalTile + , const FCALModule* fcalModule + , const CaloElementPositionShift* posShift = nullptr); - /** @brief get layer + /** + * @brief get layer */ - int getLayer() const; + virtual int getLayer() const override; private: - /** @brief FCAL Tile description from LArReadoutGeometry + /** + * @brief FCAL Tile description from LArReadoutGeometry */ const FCALTile* m_tile; - /** @brief FCAL Module description from LArReadoutGeometry + /** + * @brief FCAL Module description from LArReadoutGeometry */ const FCALModule* m_module; - /** @brief default constructor hidden + /** + * @brief default constructor hidden */ FCALDetectorElement() = delete; - /** @brief copy constructor hidden + /** + * @brief copy constructor hidden */ FCALDetectorElement & operator=(const FCALDetectorElement &right) = delete; - /** @brief initialize base description - */ - void init_description(bool isTestBeam, - const CaloElementPositionShift* posShift = nullptr); - - /** @brief Fill all missing fields of CaloDetDescrElement which - have not been filled by init_description() + /** + * @brief initialize base description */ - void init_interpretation(); + void init_description(bool isTestBeam + , const GeoAlignmentStore* geoAlignStore + , const CaloElementPositionShift* posShift); }; @@ -336,41 +362,50 @@ class FCALDetectorElement : public CaloDetDescrElement class TileDetectorElement : public CaloDetDescrElement { public: - /** @brief Constructor, takes all necessary parameters for the base class constructor + /** + * @brief Constructor, takes all necessary parameters for the base class constructor */ - TileDetectorElement(const IdentifierHash subcaloHash, - const IdentifierHash onl1, - const IdentifierHash onl2, - const CaloDetDescriptor* descriptor); + TileDetectorElement(const IdentifierHash subcaloHash + , const IdentifierHash onl1 + , const IdentifierHash onl2 + , const CaloDetDescriptor* descriptor); - /** @brief set raw cylindric coordinates + /** + * @brief set raw cylindric coordinates */ - void set_cylindric_raw(double eta_raw, - double phi_raw, - double r_raw); + void set_cylindric_raw(double eta_raw + , double phi_raw + , double r_raw); - /** @brief set cylindric coordinates + /** + * @brief set cylindric coordinates */ - void set_cylindric(double eta, - double phi, - double r); + void set_cylindric(double eta + , double phi + , double r); - /** @brief set cylindric size deta + /** + * @brief set cylindric size deta */ inline void set_deta(double deta) {m_deta = static_cast<float> (deta);} - /** @brief set cylindric size dphi + /** + * @brief set cylindric size dphi */ inline void set_dphi(double dphi) {m_dphi = static_cast<float> (dphi);} - /** @brief set cartezian size dz + /** + * @brief set cartezian size dz */ inline void set_dz(double dz) {m_dz = static_cast<float> (dz);} - /** @brief set cylindric size dr + /** + * @brief set cylindric size dr */ inline void set_dr(double dr) {m_dr = static_cast<float> (dr);} - /** @brief set z + /** + * @brief set z */ inline void set_z(double z) {m_z = static_cast<float> (z);} - /** @brief set r + /** + * @brief set r */ inline void set_r(double r) { m_r = static_cast<float> (r); @@ -387,7 +422,8 @@ class TileDetectorElement : public CaloDetDescrElement class MbtsDetectorElement : public CaloDetDescrElement { public: - /** @brief Constructor, initializes base class constructor parameters with default values + /** + * @brief Constructor, initializes base class constructor parameters with default values */ MbtsDetectorElement(); diff --git a/Calorimeter/CaloDetDescr/src/CaloDescriptors.cxx b/Calorimeter/CaloDetDescr/src/CaloDescriptors.cxx index e70ddf73cd13367358dc71065f047c129b39ce9a..e7e972b96968aa2e62431eae296ad48383a1daa3 100755 --- a/Calorimeter/CaloDetDescr/src/CaloDescriptors.cxx +++ b/Calorimeter/CaloDetDescr/src/CaloDescriptors.cxx @@ -12,281 +12,104 @@ #include "LArReadoutGeometry/HECDetectorRegion.h" #include "LArReadoutGeometry/FCALTile.h" #include "LArReadoutGeometry/FCALModule.h" +#include "GeoModelUtilities/GeoAlignmentStore.h" #include "GaudiKernel/SystemOfUnits.h" - -// To Define Globally: -// -// m_lar_* -// - // -- EMBDescriptor -- -EMBDescriptor::EMBDescriptor(const Identifier& id, - const AtlasDetectorID* helper, - const CaloCell_ID* calo_helper, - const EMBDetectorRegion* embRegion): - CaloDetDescriptor(id,helper,calo_helper), - m_region(embRegion) -{ - init_description(); - init_interpretation(); -} - -EMBDescriptor::~EMBDescriptor() +EMBDescriptor::EMBDescriptor(const Identifier& id + , const AtlasDetectorID* helper + , const CaloCell_ID* calo_helper + , const EMBDetectorRegion* embRegion + , const GeoAlignmentStore* alignStore) + : CaloDetDescriptor(id,helper,calo_helper) { -} - -void EMBDescriptor::init_description() -{ - // -- m_calo_phi_min/m_calo_phi_max - // -- m_calo_z_min/m_calo_z_max - // -- m_calo_r_min/m_calo_r_max - /* - m_calo_phi_min = 10000.; - m_calo_phi_max = -10000.; - m_calo_z_min = 10000.; - m_calo_z_max = -10000.; - - double eta_min = 10000.; - double eta_max = -10000.; - - for (unsigned int iPhi=m_region->beginPhiIndex();iPhi<m_region->endPhiIndex();iPhi++) - for (unsigned int iEta=m_region->beginEtaIndex();iEta<m_region->endEtaIndex();iEta++) - { - EMBCellConstLink cellPtr = m_region->getEMBCell(iEta,iPhi); - - if(cellPtr) - { - if(cellPtr->getPhiLocalLower() < m_calo_phi_min) - m_calo_phi_min = cellPtr->getPhiLocalLower(); - if(cellPtr->getPhiLocalUpper() > m_calo_phi_max) - m_calo_phi_max = cellPtr->getPhiLocalUpper(); - - if(eta_min > cellPtr->getEtaMin()) - eta_min = cellPtr->getEtaMin(); - if(eta_max < cellPtr->getEtaMax()) - eta_max = cellPtr->getEtaMax(); - - if(m_calo_z_min > cellPtr->getZMinLocal(EMBCell::FRONT)) - m_calo_z_min = cellPtr->getZMinLocal(EMBCell::FRONT); - if(m_calo_z_min > cellPtr->getZMinLocal(EMBCell::BACK)) - m_calo_z_min = cellPtr->getZMinLocal(EMBCell::BACK); - if(m_calo_z_max < cellPtr->getZMaxLocal(EMBCell::FRONT)) - m_calo_z_max = cellPtr->getZMaxLocal(EMBCell::FRONT); - if(m_calo_z_max < cellPtr->getZMaxLocal(EMBCell::BACK)) - m_calo_z_max = cellPtr->getZMaxLocal(EMBCell::BACK); - } - } - - m_calo_r_min = m_calo_z_min/sinh(eta_max); - m_calo_r_max = m_calo_z_min/sinh(eta_min); - */ - - // -- m_transform - const Amg::Transform3D &xfDef = m_region->getDefAbsoluteTransform(); - const Amg::Transform3D &xfAbs = m_region->getAbsoluteTransform(); + const Amg::Transform3D &xfDef = embRegion->getDefAbsoluteTransform(alignStore); + const Amg::Transform3D &xfAbs = embRegion->getAbsoluteTransform(alignStore); m_transform = xfAbs*xfDef.inverse(); } -void EMBDescriptor::init_interpretation() +EMBDescriptor::~EMBDescriptor() { } - // -- EMECDescriptor -- -EMECDescriptor::EMECDescriptor(const Identifier& id, - const AtlasDetectorID* helper, - const CaloCell_ID* calo_helper, - const EMECDetectorRegion* emecRegion): - CaloDetDescriptor(id,helper,calo_helper), - m_region(emecRegion) -{ - init_description(); - init_interpretation(); -} - -EMECDescriptor::~EMECDescriptor() +EMECDescriptor::EMECDescriptor(const Identifier& id + , const AtlasDetectorID* helper + , const CaloCell_ID* calo_helper + , const EMECDetectorRegion* emecRegion + , const GeoAlignmentStore* alignStore) + : CaloDetDescriptor(id,helper,calo_helper) { -} - -void EMECDescriptor::init_description() -{ - // -- m_calo_phi_min/m_calo_phi_max - // -- m_calo_z_min/m_calo_z_max - // -- m_calo_r_min/m_calo_r_max - /* - m_calo_phi_min = 10000.; - m_calo_phi_max = -10000.; - m_calo_z_min = 10000.; - m_calo_z_max = -10000.; - - double eta_min = 10000.; - double eta_max = -10000.; - - for (unsigned int iPhi=m_region->beginPhiIndex();iPhi<m_region->endPhiIndex();iPhi++) - for (unsigned int iEta=m_region->beginEtaIndex();iEta<m_region->endEtaIndex();iEta++) - { - EMECCellConstLink cellPtr = m_region->getEMECCell(iEta,iPhi); - - if(cellPtr) - { - if(cellPtr->getPhiLocalLower()<m_calo_phi_min) - m_calo_phi_min = cellPtr->getPhiLocalLower(); - if(cellPtr->getPhiLocalUpper()>m_calo_phi_max) - m_calo_phi_max = cellPtr->getPhiLocalUpper(); - - if(eta_min > cellPtr->getEtaMin()) - eta_min = cellPtr->getEtaMin(); - if(eta_max < cellPtr->getEtaMax()) - eta_max = cellPtr->getEtaMax(); - - if(m_calo_z_min > cellPtr->getZLocal(EMECCell::FRONT)) - m_calo_z_min = cellPtr->getZLocal(EMECCell::FRONT); - if(m_calo_z_min > cellPtr->getZLocal(EMECCell::BACK)) - m_calo_z_min = cellPtr->getZLocal(EMECCell::BACK); - if(m_calo_z_max < cellPtr->getZLocal(EMECCell::FRONT)) - m_calo_z_max = cellPtr->getZLocal(EMECCell::FRONT); - if(m_calo_z_max < cellPtr->getZLocal(EMECCell::BACK)) - m_calo_z_max = cellPtr->getZLocal(EMECCell::BACK); - } - } - - m_calo_r_min = m_calo_z_min/sinh(eta_max); - m_calo_r_max = m_calo_z_min/sinh(eta_min); - */ // -- m_transform - const Amg::Transform3D &xfDef = m_region->getDefAbsoluteTransform(); + const Amg::Transform3D &xfDef = emecRegion->getDefAbsoluteTransform(alignStore); // we need to apply the famous ZShift. Amg::Transform3D xfNominal; - if(m_region->getEndcapIndex()==0) - xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,m_region->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Negative EMEC - else - xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,-m_region->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Positive EMEC - - const Amg::Transform3D &xfAbs = m_region->getAbsoluteTransform(); + if(emecRegion->getEndcapIndex()==0) { + xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,emecRegion->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Negative EMEC + } + else { + xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,-emecRegion->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Positive EMEC + } + const Amg::Transform3D &xfAbs = emecRegion->getAbsoluteTransform(alignStore); m_transform = xfAbs*xfNominal.inverse(); } -void EMECDescriptor::init_interpretation() +EMECDescriptor::~EMECDescriptor() { } // -- HECDescriptor -- -HECDescriptor::HECDescriptor(const Identifier& id, - const AtlasDetectorID* helper, - const CaloCell_ID* calo_helper, - const HECDetectorRegion* hecRegion): - CaloDetDescriptor(id,helper,calo_helper), - m_region(hecRegion) -{ - init_description(); - init_interpretation(); -} - -HECDescriptor::~HECDescriptor() +HECDescriptor::HECDescriptor(const Identifier& id + , const AtlasDetectorID* helper + , const CaloCell_ID* calo_helper + , const HECDetectorRegion* hecRegion + , const GeoAlignmentStore* alignStore) + : CaloDetDescriptor(id,helper,calo_helper) { -} - -void HECDescriptor::init_description() -{ - // -- m_calo_phi_min/m_calo_phi_max - // -- m_calo_z_min/m_calo_z_max - // -- m_calo_r_min/m_calo_r_max - /* - m_calo_phi_min = 10000.; - m_calo_phi_max = -10000.; - m_calo_z_min = 10000.; - m_calo_z_max = -10000.; - - double eta_min = 10000.; - double eta_max = -10000.; - - for (unsigned int iPhi=m_region->beginPhiIndex();iPhi<m_region->endPhiIndex();iPhi++) - for (unsigned int iEta=m_region->beginEtaIndex();iEta<m_region->endEtaIndex();iEta++) - { - HECCellConstLink cellPtr = m_region->getHECCell(iEta,iPhi); - - if(cellPtr) - { - if(cellPtr->getPhiLocalLower()<m_calo_phi_min) - m_calo_phi_min = cellPtr->getPhiLocalLower(); - if(cellPtr->getPhiLocalUpper()>m_calo_phi_max) - m_calo_phi_max = cellPtr->getPhiLocalUpper(); - - if(eta_min > cellPtr->getEtaMinNominal()) - eta_min = cellPtr->getEtaMinNominal(); - if(eta_max < cellPtr->getEtaMaxNominal()) - eta_max = cellPtr->getEtaMaxNominal(); - - if(m_calo_z_min > cellPtr->getZLocal(HECCell::FRONT)) - m_calo_z_min = cellPtr->getZLocal(HECCell::FRONT); - if(m_calo_z_min > cellPtr->getZLocal(HECCell::BACK)) - m_calo_z_min = cellPtr->getZLocal(HECCell::BACK); - if(m_calo_z_max < cellPtr->getZLocal(HECCell::FRONT)) - m_calo_z_max = cellPtr->getZLocal(HECCell::FRONT); - if(m_calo_z_max < cellPtr->getZLocal(HECCell::BACK)) - m_calo_z_max = cellPtr->getZLocal(HECCell::BACK); - } - } - - m_calo_r_min = m_calo_z_min/sinh(eta_max); - m_calo_r_max = m_calo_z_min/sinh(eta_min); - - */ - // -- m_transform - const Amg::Transform3D &xfDef = m_region->getDefAbsoluteTransform(); + const Amg::Transform3D &xfDef = hecRegion->getDefAbsoluteTransform(alignStore); // we need to apply the famous ZShift Amg::Transform3D xfNominal; - if(m_region->getEndcapIndex()==0) - xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,m_region->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Negative HEC - else - xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,-m_region->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Positive HEC - - const Amg::Transform3D &xfAbs = m_region->getAbsoluteTransform(); + if(hecRegion->getEndcapIndex()==0) { + xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,hecRegion->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Negative HEC + } + else { + xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,-hecRegion->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Positive HEC + } + const Amg::Transform3D &xfAbs = hecRegion->getAbsoluteTransform(alignStore); m_transform = xfAbs*xfNominal.inverse(); } -void HECDescriptor::init_interpretation() +HECDescriptor::~HECDescriptor() { } // -- FCALDescriptor -- -FCALDescriptor::FCALDescriptor(const Identifier& id, - const AtlasDetectorID* helper, - const CaloCell_ID* calo_helper, - const FCALModule* fcalModule): - CaloDetDescriptor(id,helper,calo_helper), - m_module(fcalModule) -{ - init_description(); - init_interpretation(); -} - -FCALDescriptor::~FCALDescriptor() -{ -} - -void FCALDescriptor::init_description() +FCALDescriptor::FCALDescriptor(const Identifier& id + , const AtlasDetectorID* helper + , const CaloCell_ID* calo_helper + , const FCALModule* fcalModule + , const GeoAlignmentStore* alignStore) + : CaloDetDescriptor(id,helper,calo_helper) { // -- m_transform - const Amg::Transform3D &xfDef = m_module->getDefAbsoluteTransform(); + const Amg::Transform3D &xfDef = fcalModule->getDefAbsoluteTransform(alignStore); // we need to apply the famous ZShift. Amg::Transform3D xfNominal; - if(m_module->getEndcapIndex()==FCALModule::POS) - xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,m_module->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Negative FCAL - else - xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,-m_module->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Positive FCAL - - const Amg::Transform3D &xfAbs = m_module->getAbsoluteTransform(); + if(fcalModule->getEndcapIndex()==FCALModule::POS) { + xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,fcalModule->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Negative FCAL + } + else { + xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,-fcalModule->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Positive FCAL + } + const Amg::Transform3D &xfAbs = fcalModule->getAbsoluteTransform(alignStore); m_transform = xfAbs*xfNominal.inverse(); } -void FCALDescriptor::init_interpretation() +FCALDescriptor::~FCALDescriptor() { } - diff --git a/Calorimeter/CaloDetDescr/src/CaloDetectorElements.cxx b/Calorimeter/CaloDetDescr/src/CaloDetectorElements.cxx index 0d3a50d7614240a0a17e92c40f6269dc43a6a81b..c935aa1a20feb6afe5c4adabafd075257fe48e01 100755 --- a/Calorimeter/CaloDetDescr/src/CaloDetectorElements.cxx +++ b/Calorimeter/CaloDetDescr/src/CaloDetectorElements.cxx @@ -10,6 +10,8 @@ #include "CaloGeoHelpers/CaloPhiRange.h" +#include "GeoModelUtilities/GeoAlignmentStore.h" + #include "GaudiKernel/SystemOfUnits.h" namespace { @@ -53,26 +55,25 @@ void fcal_deta_dphi (const CaloDetDescrElement& elt, // -- EMBDetectorElement -- - -EMBDetectorElement::EMBDetectorElement(const IdentifierHash subcaloHash, - const IdentifierHash onl1, - const IdentifierHash onl2, - const CaloDetDescriptor* descriptor, - EMBCellConstLink& embCell, - const EMBDetectorRegion* embRegion, - bool isTestBeam): - CaloDetDescrElement(subcaloHash,onl1,onl2,descriptor), - m_cell(embCell), - m_region(embRegion) +EMBDetectorElement::EMBDetectorElement(const IdentifierHash subcaloHash + , const IdentifierHash onl1 + , const IdentifierHash onl2 + , const CaloDetDescriptor* descriptor + , EMBCellConstLink& embCell + , const EMBDetectorRegion* embRegion + , bool isTestBeam + , const GeoAlignmentStore* geoAlignStore + , const CaloElementPositionShift* posShift) + : CaloDetDescrElement(subcaloHash,onl1,onl2,descriptor) + , m_cell(embCell) + , m_region(embRegion) { - init_description(); - init_interpretation(); - - if(isTestBeam) - propagateRaw(); + init_description(geoAlignStore,posShift); + if(isTestBeam) propagateRaw(); } -void EMBDetectorElement::init_description(const CaloElementPositionShift* posShift) +void EMBDetectorElement::init_description(const GeoAlignmentStore* geoAlignStore + , const CaloElementPositionShift* posShift) { m_eta_raw = static_cast<float> ((m_cell->getEtaMin() + m_cell->getEtaMax())/2.); if(m_cell->getEndcapIndex()==0) @@ -81,8 +82,8 @@ void EMBDetectorElement::init_description(const CaloElementPositionShift* posShi const double phi_loc = (m_cell->getPhiLocalLower() + m_cell->getPhiLocalUpper())/2.; double x_loc, y_loc, z_loc, r_loc; - const Amg::Transform3D &xfDef = m_region->getDefAbsoluteTransform(); - const Amg::Transform3D &xfAbs = m_region->getAbsoluteTransform(); + const Amg::Transform3D &xfDef = m_region->getDefAbsoluteTransform(geoAlignStore); + const Amg::Transform3D &xfAbs = m_region->getAbsoluteTransform(geoAlignStore); z_loc = (m_cell->getZMaxLocal(EMBCell::CENTER) + m_cell->getZMinLocal(EMBCell::CENTER))/2.; r_loc = m_cell->getRLocal(EMBCell::CENTER); @@ -91,9 +92,9 @@ void EMBDetectorElement::init_description(const CaloElementPositionShift* posShi y_loc = r_loc*sin(phi_loc); Amg::Vector3D globalDefCoords = xfDef*Amg::Vector3D(x_loc,y_loc,z_loc); - Amg::Vector3D globalAbsCoords = (posShift!=nullptr ? - xfAbs*Amg::Vector3D(x_loc+posShift->dx,y_loc+posShift->dy,z_loc+posShift->dz) : - xfAbs*Amg::Vector3D(x_loc,y_loc,z_loc)); + Amg::Vector3D globalAbsCoords = posShift + ? xfAbs*Amg::Vector3D(x_loc+posShift->dx,y_loc+posShift->dy,z_loc+posShift->dz) + : xfAbs*Amg::Vector3D(x_loc,y_loc,z_loc); m_x_raw = static_cast<float> (globalDefCoords.x()); m_y_raw = static_cast<float> (globalDefCoords.y()); @@ -142,20 +143,15 @@ void EMBDetectorElement::init_description(const CaloElementPositionShift* posShi } -void EMBDetectorElement::init_interpretation() -{ - // TO DO - // Divide previous method into description and interpretation -} - -void EMBDetectorElement::updateAlignment(EMBCellConstLink& embCell, - const EMBDetectorRegion* embRegion, - const CaloElementPositionShift* posShift) +void EMBDetectorElement::updateAlignment(EMBCellConstLink& embCell + , const EMBDetectorRegion* embRegion + , const CaloElementPositionShift* posShift) { m_cell = embCell; m_region = embRegion; - init_description(posShift); - init_interpretation(); + // updateAlignment() is called only from CaloAlignTool::align() callback + // This is why we explicitly use nullptr as first argument to init_description() + init_description(nullptr,posShift); } int EMBDetectorElement::getLayer() const @@ -165,25 +161,27 @@ int EMBDetectorElement::getLayer() const // -- EMECDetectorElement -- -EMECDetectorElement::EMECDetectorElement(const IdentifierHash subcaloHash, - const IdentifierHash onl1, - const IdentifierHash onl2, - const CaloDetDescriptor* descriptor, - EMECCellConstLink& emecCell, - const EMECDetectorRegion* emecRegion, - bool isTestBeam): - CaloDetDescrElement(subcaloHash,onl1,onl2,descriptor), - m_cell(emecCell), - m_region(emecRegion) +EMECDetectorElement::EMECDetectorElement(const IdentifierHash subcaloHash + , const IdentifierHash onl1 + , const IdentifierHash onl2 + , const CaloDetDescriptor* descriptor + , EMECCellConstLink& emecCell + , const EMECDetectorRegion* emecRegion + , bool isTestBeam + , const GeoAlignmentStore* geoAlignStore + , const CaloElementPositionShift* posShift) + : CaloDetDescrElement(subcaloHash,onl1,onl2,descriptor) + , m_cell(emecCell) + , m_region(emecRegion) { - init_description(isTestBeam); + init_description(isTestBeam,geoAlignStore,posShift); init_interpretation(); - - if(isTestBeam) - propagateRaw(); + if(isTestBeam) propagateRaw(); } -void EMECDetectorElement::init_description(bool isTestBeam, const CaloElementPositionShift* posShift) +void EMECDetectorElement::init_description(bool isTestBeam + , const GeoAlignmentStore* geoAlignStore + , const CaloElementPositionShift* posShift) { m_eta_raw = static_cast<float> ((m_cell->getEtaMin() + m_cell->getEtaMax())/2.); if(m_cell->getEndcapIndex()==0) @@ -192,7 +190,7 @@ void EMECDetectorElement::init_description(bool isTestBeam, const CaloElementPos m_phi_raw = static_cast<float> ((m_cell->getPhiLocalLower() + m_cell->getPhiLocalUpper())/2.); double x_loc, y_loc, z_loc, r_loc; - const Amg::Transform3D &xfDef = m_region->getDefAbsoluteTransform(); + const Amg::Transform3D &xfDef = m_region->getDefAbsoluteTransform(geoAlignStore); // we need to apply the famous ZShift. Amg::Transform3D xfNominal; @@ -205,7 +203,7 @@ void EMECDetectorElement::init_description(bool isTestBeam, const CaloElementPos xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,3689.5*Gaudi::Units::mm)); } - const Amg::Transform3D &xfAbs = m_region->getAbsoluteTransform(); + const Amg::Transform3D &xfAbs = m_region->getAbsoluteTransform(geoAlignStore); z_loc = m_cell->getZLocal(EMECCell::CENTER); r_loc = (m_cell->getRMinLocal(EMECCell::CENTER) + m_cell->getRMaxLocal(EMECCell::CENTER))/2.; @@ -281,13 +279,15 @@ void EMECDetectorElement::init_interpretation() } } -void EMECDetectorElement::updateAlignment(EMECCellConstLink& emecCell, - const EMECDetectorRegion* emecRegion, - const CaloElementPositionShift* posShift) +void EMECDetectorElement::updateAlignment(EMECCellConstLink& emecCell + , const EMECDetectorRegion* emecRegion + , const CaloElementPositionShift* posShift) { m_cell = emecCell; m_region = emecRegion; - init_description(false,posShift); + // updateAlignment() is called only from CaloAlignTool::align() callback + // This is why we explicitly use nullptr as first argument to init_description() + init_description(false,nullptr,posShift); init_interpretation(); } @@ -297,25 +297,29 @@ int EMECDetectorElement::getLayer() const } // -- HECDetectorElement -- -HECDetectorElement::HECDetectorElement(const IdentifierHash subcaloHash, - const IdentifierHash onl1, - const IdentifierHash onl2, - const CaloDetDescriptor* descriptor, - HECCellConstLink& hecCell, - const HECDetectorRegion* hecRegion, - bool isTestBeam): - CaloDetDescrElement(subcaloHash,onl1,onl2,descriptor), - m_cell(hecCell), - m_region(hecRegion) +HECDetectorElement::HECDetectorElement(const IdentifierHash subcaloHash + , const IdentifierHash onl1 + , const IdentifierHash onl2 + , const CaloDetDescriptor* descriptor + , HECCellConstLink& hecCell + , const HECDetectorRegion* hecRegion + , bool isTestBeam + , const GeoAlignmentStore* geoAlignStore + , const CaloElementPositionShift* posShift) + : CaloDetDescrElement(subcaloHash,onl1,onl2,descriptor) + , m_cell(hecCell) + , m_region(hecRegion) { - init_description(isTestBeam); + init_description(isTestBeam,geoAlignStore,posShift); init_interpretation(); if(isTestBeam) propagateRaw(); } -void HECDetectorElement::init_description(bool isTestBeam, const CaloElementPositionShift* posShift) +void HECDetectorElement::init_description(bool isTestBeam + , const GeoAlignmentStore* geoAlignStore + , const CaloElementPositionShift* posShift) { // take PHI_RAW from LAr Readout geometry and use it xor calculations of x_loc and y_loc m_phi_raw = static_cast<float> ((m_cell->getPhiLocalLower() + m_cell->getPhiLocalUpper())/2.); @@ -329,7 +333,7 @@ void HECDetectorElement::init_description(bool isTestBeam, const CaloElementPosi z_loc = m_cell->getZLocal(HECCell::CENTER); - const Amg::Transform3D &xfDef = m_region->getDefAbsoluteTransform(); + const Amg::Transform3D &xfDef = m_region->getDefAbsoluteTransform(geoAlignStore); // we need to apply the famous ZShift. Amg::Transform3D xfNominal; @@ -342,7 +346,7 @@ void HECDetectorElement::init_description(bool isTestBeam, const CaloElementPosi xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0., 4277.*Gaudi::Units::mm)); } - const Amg::Transform3D &xfAbs = m_region->getAbsoluteTransform(); + const Amg::Transform3D &xfAbs = m_region->getAbsoluteTransform(geoAlignStore); x_loc = r_loc*cos(m_phi_raw); y_loc = r_loc*sin(m_phi_raw); @@ -420,13 +424,13 @@ void HECDetectorElement::init_interpretation() m_phi_raw = static_cast<float> (m_phi_raw + (2*M_PI)); } -void HECDetectorElement::updateAlignment(HECCellConstLink& hecCell, - const HECDetectorRegion* hecRegion, - const CaloElementPositionShift* posShift) +void HECDetectorElement::updateAlignment(HECCellConstLink& hecCell + , const HECDetectorRegion* hecRegion + , const CaloElementPositionShift* posShift) { m_cell = hecCell; m_region = hecRegion; - init_description(false,posShift); + init_description(false,nullptr,posShift); init_interpretation(); } @@ -437,32 +441,33 @@ int HECDetectorElement::getLayer() const // -- FCALDetectorElement -- -FCALDetectorElement::FCALDetectorElement(const IdentifierHash subcaloHash, - const IdentifierHash onl1, - const IdentifierHash onl2, - const CaloDetDescriptor* descriptor, - const FCALTile* fcalTile, - const FCALModule* fcalModule, - bool isTestBeam): - CaloDetDescrElement(subcaloHash,onl1,onl2,descriptor), - m_tile(fcalTile), - m_module(fcalModule) +FCALDetectorElement::FCALDetectorElement(const IdentifierHash subcaloHash + , const IdentifierHash onl1 + , const IdentifierHash onl2 + , const CaloDetDescriptor* descriptor + , const FCALTile* fcalTile + , const FCALModule* fcalModule + , bool isTestBeam + , const GeoAlignmentStore* geoAlignStore + , const CaloElementPositionShift* posShift) + : CaloDetDescrElement(subcaloHash,onl1,onl2,descriptor) + , m_tile(fcalTile) + , m_module(fcalModule) { - init_description(isTestBeam); - init_interpretation(); - - if(isTestBeam) - propagateRaw(); + init_description(isTestBeam,geoAlignStore,posShift); + if(isTestBeam) propagateRaw(); } -void FCALDetectorElement::init_description(bool isTestBeam, const CaloElementPositionShift* posShift) +void FCALDetectorElement::init_description(bool isTestBeam + , const GeoAlignmentStore* geoAlignStore + , const CaloElementPositionShift* posShift) { double x_loc = m_tile->getX(); double y_loc = m_tile->getY(); // double z_loc = -m_module->getFullDepthZ(*m_tile)/2.; double z_loc = 0.; - const Amg::Transform3D &xfDef = m_module->getDefAbsoluteTransform(); + const Amg::Transform3D &xfDef = m_module->getDefAbsoluteTransform(geoAlignStore); // we need to apply the famous ZShift. Amg::Transform3D xfNominal; if(m_module->getEndcapIndex()==FCALModule::POS) @@ -481,7 +486,7 @@ void FCALDetectorElement::init_description(bool isTestBeam, const CaloElementPos } } - const Amg::Transform3D &xfAbs = m_module->getAbsoluteTransform(); + const Amg::Transform3D &xfAbs = m_module->getAbsoluteTransform(geoAlignStore); Amg::Vector3D globalDefCoords = xfNominal*Amg::Vector3D(x_loc,y_loc,z_loc); Amg::Vector3D globalAbsCoords = (posShift!=nullptr ? @@ -555,20 +560,13 @@ void FCALDetectorElement::init_description(bool isTestBeam, const CaloElementPos } -void FCALDetectorElement::init_interpretation() -{ - // TO DO - // Divide previous method into description and interpretation -} - void FCALDetectorElement::updateAlignment(const FCALTile* fcalTile, const FCALModule* fcalModule, const CaloElementPositionShift* posShift) { m_tile = fcalTile; m_module = fcalModule; - init_description(false,posShift); - init_interpretation(); + init_description(false,nullptr,posShift); } int FCALDetectorElement::getLayer() const diff --git a/Calorimeter/CaloDetDescrUtils/src/CaloDetDescrBuilder.cxx b/Calorimeter/CaloDetDescrUtils/src/CaloDetDescrBuilder.cxx index ea36850618ae59f5fec4b06237d6645cb1632173..521076a4a80d446d3456682282f3fa36ca1a0dc8 100644 --- a/Calorimeter/CaloDetDescrUtils/src/CaloDetDescrBuilder.cxx +++ b/Calorimeter/CaloDetDescrUtils/src/CaloDetDescrBuilder.cxx @@ -43,7 +43,7 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator , IMessageSvc* msgSvc - , const GeoAlignmentStore* /*geoAlignStore*/ + , const GeoAlignmentStore* geoAlignStore , const CaloRec::CaloCellPositionShift* /*cellPosShift*/) { MsgStream log(msgSvc, "buildCaloDetDescr"); @@ -138,7 +138,11 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator , embRegion->getSamplingIndex() , embRegion->getRegionIndex()); - EMBDescriptor* embDescr = new EMBDescriptor(regId,(AtlasDetectorID *)cell_id,cell_id,embRegion); + EMBDescriptor* embDescr = new EMBDescriptor(regId + , (AtlasDetectorID *)cell_id + , cell_id + , embRegion + , geoAlignStore); caloMgr->add(embDescr); double phi_min = 0.; @@ -176,7 +180,8 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator , embDescr , cellPtr , embRegion - , isTestBeam); + , isTestBeam + , geoAlignStore); if(iPhi==embRegion->beginPhiIndex()) { phi_min = embElement->phi() - 0.5*embElement->dphi(); } @@ -296,7 +301,11 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator , emecRegion->getSamplingIndex() , emecRegion->getRegionIndex()); - EMECDescriptor* emecDescr = new EMECDescriptor(regId,(AtlasDetectorID *)cell_id,cell_id,emecRegion); + EMECDescriptor* emecDescr = new EMECDescriptor(regId + , (AtlasDetectorID *)cell_id + , cell_id + , emecRegion + , geoAlignStore); caloMgr->add(emecDescr); double phi_min = 0.; @@ -332,7 +341,8 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator , emecDescr , cellPtr , emecRegion - , isTestBeam); + , isTestBeam + , geoAlignStore); if(iPhi==emecRegion->beginPhiIndex()) { phi_min = emecElement->phi() - 0.5*emecElement->dphi(); } @@ -424,7 +434,11 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator , hecregion->getSamplingIndex() , hecregion->getRegionIndex()); - HECDescriptor* hecDescr = new HECDescriptor(regId,(AtlasDetectorID *)cell_id,cell_id,hecregion); + HECDescriptor* hecDescr = new HECDescriptor(regId + , (AtlasDetectorID *)cell_id + , cell_id + , hecregion + , geoAlignStore); caloMgr->add(hecDescr); double phi_min = 0.; @@ -462,7 +476,8 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator , hecDescr , cellPtr , hecregion - , isTestBeam); + , isTestBeam + , geoAlignStore); if(iPhi==hecregion->beginPhiIndex()) { phi_min = hecElement->phi() - 0.5*hecElement->dphi(); } @@ -557,9 +572,10 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator Identifier regId = fcal_id->module_id(pos_neg,(int)fcalmodule->getModuleIndex()); FCALDescriptor* fcalDescr = new FCALDescriptor(regId - ,(AtlasDetectorID *)cell_id - ,cell_id - ,fcalmodule); + , (AtlasDetectorID *)cell_id + , cell_id + , fcalmodule + , geoAlignStore); caloMgr->add(fcalDescr); double eta_min = 10000.; @@ -591,7 +607,8 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator , fcalDescr , &(*fcaltileIt) , fcalmodule - , isTestBeam); + , isTestBeam + , geoAlignStore); // calculate cell volume double tubeSpacing = cellVol.getFcalTubeSpacing((int)fcalmodule->getModuleIndex()); unsigned int numTubes = fcaltileIt->getNumTubes();