Skip to content
Snippets Groups Projects
Verified Commit 74f3b1e7 authored by Tadej Novak's avatar Tadej Novak
Browse files

Update GeoSiHit for HGTD

parent 7794571e
5 merge requests!69091Fix correlated smearing bug in JER in JetUncertainties in 22.0,!58791DataQualityConfigurations: Modify L1Calo config for web display,!51674Fixing hotSpotInHIST for Run3 HIST,!50012RecExConfig: Adjust log message levels from GetRunNumber and GetLBNumber,!47464Update GeoSiHit for HGTD
......@@ -12,4 +12,4 @@ atlas_add_library( GeoAdaptors
PUBLIC_HEADERS GeoAdaptors
INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
DEFINITIONS ${CLHEP_DEFINITIONS}
LINK_LIBRARIES ${CLHEP_LIBRARIES} CaloIdentifier CaloSimEvent GeoPrimitives Identifier InDetIdentifier InDetReadoutGeometry PixelReadoutGeometryLib SCT_ReadoutGeometry TRT_ReadoutGeometry InDetSimEvent LArSimEvent MuonReadoutGeometry MuonPrepRawData MuonSimEvent CaloDetDescrLib StoreGateLib MuonIdHelpersLib )
LINK_LIBRARIES ${CLHEP_LIBRARIES} CaloIdentifier CaloSimEvent GeoPrimitives HGTD_Identifier HGTD_ReadoutGeometry Identifier InDetIdentifier InDetReadoutGeometry PixelReadoutGeometryLib SCT_ReadoutGeometry TRT_ReadoutGeometry InDetSimEvent LArSimEvent MuonReadoutGeometry MuonPrepRawData MuonSimEvent CaloDetDescrLib StoreGateLib MuonIdHelpersLib )
......@@ -19,10 +19,12 @@
class SiHit;
class PixelID;
class SCT_ID;
class HGTD_ID;
namespace InDetDD {
class SCT_DetectorManager;
class PixelDetectorManager;
}
class HGTD_DetectorManager;
class GeoSiHit {
......@@ -45,14 +47,18 @@ class GeoSiHit {
static const InDetDD::PixelDetectorManager* initPixMgr();
static const InDetDD::PixelDetectorManager* initPlrMgr();
static const InDetDD::SCT_DetectorManager* initSctMgr();
static const HGTD_DetectorManager* initHgtdMgr();
static const PixelID* initPixID();
static const SCT_ID* initSctID();
static const HGTD_ID* initHgtdID();
const InDetDD::PixelDetectorManager* pixMgr() const;
const InDetDD::PixelDetectorManager* plrMgr() const;
const InDetDD::SCT_DetectorManager* sctMgr() const;
const HGTD_DetectorManager* hgtdMgr() const;
const PixelID* pixID() const;
const SCT_ID* sctID() const;
const HGTD_ID* hgtdID() const;
const SiHit *m_hit;
};
......
......@@ -2,52 +2,58 @@
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "InDetSimEvent/SiHit.h"
#include "InDetReadoutGeometry/SiDetectorElement.h"
#include "SCT_ReadoutGeometry/SCT_DetectorManager.h"
#include "PixelReadoutGeometry/PixelDetectorManager.h"
#include "GeoPrimitives/CLHEPtoEigenConverter.h"
#include "HGTD_Identifier/HGTD_ID.h"
#include "HGTD_ReadoutGeometry/HGTD_DetectorManager.h"
#include "InDetIdentifier/PixelID.h"
#include "InDetIdentifier/SCT_ID.h"
#include "GeoPrimitives/CLHEPtoEigenConverter.h"
#include "InDetReadoutGeometry/SiDetectorElement.h"
#include "InDetSimEvent/SiHit.h"
#include "PixelReadoutGeometry/PixelDetectorManager.h"
#include "SCT_ReadoutGeometry/SCT_DetectorManager.h"
inline GeoSiHit::GeoSiHit (const SiHit & h) {
m_hit = &h;
}
inline HepGeom::Point3D<double> GeoSiHit::getGlobalPosition() const {
int Barrel = m_hit->getBarrelEndcap();
if (Barrel== 1) Barrel = -2;
Identifier id;
const InDetDD::SiDetectorElement *geoelement=NULL;
if (m_hit->isPixel()) {
const InDetDD::SolidStateDetectorElementBase *geoelement{};
if (m_hit->isPixel() || m_hit->isPLR()) {
id = pixID()->wafer_id(Barrel,
m_hit->getLayerDisk(),
m_hit->getPhiModule(),
m_hit->getLayerDisk(),
m_hit->getPhiModule(),
m_hit->getEtaModule());
if (m_hit->isPLR()) {
geoelement = plrMgr()->getDetectorElement(id);
geoelement = plrMgr()->getDetectorElement(id);
} else {
geoelement = pixMgr()->getDetectorElement(id);
}
}
else {
} else if (m_hit->isSCT()) {
id = sctID()->wafer_id(Barrel,
m_hit->getLayerDisk(),
m_hit->getPhiModule(),
m_hit->getEtaModule(),
m_hit->getLayerDisk(),
m_hit->getPhiModule(),
m_hit->getEtaModule(),
m_hit->getSide() );
geoelement = sctMgr()->getDetectorElement(id);
geoelement = sctMgr()->getDetectorElement(id);
} else if (m_hit->isHGTD()) {
id = hgtdID()->wafer_id(Barrel,
m_hit->getLayerDisk(),
m_hit->getPhiModule(),
m_hit->getEtaModule());
geoelement = hgtdMgr()->getDetectorElement(id);
}
if (geoelement) {
if (geoelement) {
const HepGeom::Point3D<double> globalStartPos = Amg::EigenTransformToCLHEP(geoelement->transformHit()) * HepGeom::Point3D<double>(m_hit->localStartPosition());
double x=globalStartPos.x();
double y=globalStartPos.y();
double z=globalStartPos.z();
......@@ -56,4 +62,3 @@ inline HepGeom::Point3D<double> GeoSiHit::getGlobalPosition() const {
return HepGeom::Point3D<double>(0.0,0.0,0.0);
}
......@@ -15,7 +15,7 @@ const InDetDD::PixelDetectorManager* GeoSiHit::initPixMgr()
if (!detStore->contains<InDetDD::PixelDetectorManager>("Pixel") || detStore->retrieve(pix,"Pixel").isFailure())
{
// if Pixel retrieval fails, try ITkPixel
if (!detStore->contains<InDetDD::PixelDetectorManager>("ITkPixel") || detStore->retrieve(pix,"ITkPixel").isFailure())
if (!detStore->contains<InDetDD::PixelDetectorManager>("ITkPixel") || detStore->retrieve(pix,"ITkPixel").isFailure())
{
std::abort();
}
......@@ -49,6 +49,15 @@ const InDetDD::PixelDetectorManager* GeoSiHit::initPlrMgr()
}
const HGTD_DetectorManager* GeoSiHit::initHgtdMgr()
{
ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit");
const HGTD_DetectorManager* hgtd = nullptr;
detStore->retrieve(hgtd,"HGTD").isFailure();
return hgtd;
}
const PixelID* GeoSiHit::initPixID()
{
ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit");
......@@ -71,6 +80,17 @@ const SCT_ID* GeoSiHit::initSctID()
}
const HGTD_ID* GeoSiHit::initHgtdID()
{
ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit");
const HGTD_ID* hgtd = nullptr;
if(detStore->retrieve(hgtd,"HGTD_ID").isFailure()) {
std::abort();
}
return hgtd;
}
const InDetDD::PixelDetectorManager* GeoSiHit::pixMgr() const
{
const InDetDD::PixelDetectorManager* const mgr = initPixMgr();
......@@ -92,16 +112,29 @@ const InDetDD::PixelDetectorManager* GeoSiHit::plrMgr() const
}
const PixelID* GeoSiHit::pixID() const
const HGTD_DetectorManager* GeoSiHit::hgtdMgr() const
{
const HGTD_DetectorManager* const mgr = initHgtdMgr();
return mgr;
}
const PixelID* GeoSiHit::pixID() const
{
const PixelID* const id = initPixID();
return id;
}
const SCT_ID* GeoSiHit::sctID() const
const SCT_ID* GeoSiHit::sctID() const
{
const SCT_ID* const id = initSctID();
return id;
}
const HGTD_ID* GeoSiHit::hgtdID() const
{
const HGTD_ID* const id = initHgtdID();
return id;
}
......@@ -91,8 +91,8 @@ StatusCode SiHitAnalysis::initialize()
} else if (detName == "HGTD") {
bin_down = -1000;
bin_up = 1000;
radius_up = 1000;
radius_down = 350;
radius_up = 700;
radius_down = 0;
z_max = 3600;
} else if (detName == "PLR") {
bin_down = -125;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment