Commit 980ae251 authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'master-calodd-emb' into 'master'

Prepared Calo Descriptors and Elements to work with yet-to-be-implemented CaloAlignCondAlg

See merge request !46395
parents a5f50dd2 fe0072f7
......@@ -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
......
/*
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
......@@ -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()
{
}