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
No related branches found
No related tags found
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 ...@@ -12,4 +12,4 @@ atlas_add_library( GeoAdaptors
PUBLIC_HEADERS GeoAdaptors PUBLIC_HEADERS GeoAdaptors
INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
DEFINITIONS ${CLHEP_DEFINITIONS} 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 @@ ...@@ -19,10 +19,12 @@
class SiHit; class SiHit;
class PixelID; class PixelID;
class SCT_ID; class SCT_ID;
class HGTD_ID;
namespace InDetDD { namespace InDetDD {
class SCT_DetectorManager; class SCT_DetectorManager;
class PixelDetectorManager; class PixelDetectorManager;
} }
class HGTD_DetectorManager;
class GeoSiHit { class GeoSiHit {
...@@ -45,14 +47,18 @@ class GeoSiHit { ...@@ -45,14 +47,18 @@ class GeoSiHit {
static const InDetDD::PixelDetectorManager* initPixMgr(); static const InDetDD::PixelDetectorManager* initPixMgr();
static const InDetDD::PixelDetectorManager* initPlrMgr(); static const InDetDD::PixelDetectorManager* initPlrMgr();
static const InDetDD::SCT_DetectorManager* initSctMgr(); static const InDetDD::SCT_DetectorManager* initSctMgr();
static const HGTD_DetectorManager* initHgtdMgr();
static const PixelID* initPixID(); static const PixelID* initPixID();
static const SCT_ID* initSctID(); static const SCT_ID* initSctID();
static const HGTD_ID* initHgtdID();
const InDetDD::PixelDetectorManager* pixMgr() const; const InDetDD::PixelDetectorManager* pixMgr() const;
const InDetDD::PixelDetectorManager* plrMgr() const; const InDetDD::PixelDetectorManager* plrMgr() const;
const InDetDD::SCT_DetectorManager* sctMgr() const; const InDetDD::SCT_DetectorManager* sctMgr() const;
const HGTD_DetectorManager* hgtdMgr() const;
const PixelID* pixID() const; const PixelID* pixID() const;
const SCT_ID* sctID() const; const SCT_ID* sctID() const;
const HGTD_ID* hgtdID() const;
const SiHit *m_hit; const SiHit *m_hit;
}; };
......
...@@ -2,52 +2,58 @@ ...@@ -2,52 +2,58 @@
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#include "InDetSimEvent/SiHit.h" #include "GeoPrimitives/CLHEPtoEigenConverter.h"
#include "InDetReadoutGeometry/SiDetectorElement.h" #include "HGTD_Identifier/HGTD_ID.h"
#include "SCT_ReadoutGeometry/SCT_DetectorManager.h" #include "HGTD_ReadoutGeometry/HGTD_DetectorManager.h"
#include "PixelReadoutGeometry/PixelDetectorManager.h"
#include "InDetIdentifier/PixelID.h" #include "InDetIdentifier/PixelID.h"
#include "InDetIdentifier/SCT_ID.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) { inline GeoSiHit::GeoSiHit (const SiHit & h) {
m_hit = &h; m_hit = &h;
} }
inline HepGeom::Point3D<double> GeoSiHit::getGlobalPosition() const { inline HepGeom::Point3D<double> GeoSiHit::getGlobalPosition() const {
int Barrel = m_hit->getBarrelEndcap(); int Barrel = m_hit->getBarrelEndcap();
if (Barrel== 1) Barrel = -2; if (Barrel== 1) Barrel = -2;
Identifier id; Identifier id;
const InDetDD::SiDetectorElement *geoelement=NULL; const InDetDD::SolidStateDetectorElementBase *geoelement{};
if (m_hit->isPixel()) { if (m_hit->isPixel() || m_hit->isPLR()) {
id = pixID()->wafer_id(Barrel, id = pixID()->wafer_id(Barrel,
m_hit->getLayerDisk(), m_hit->getLayerDisk(),
m_hit->getPhiModule(), m_hit->getPhiModule(),
m_hit->getEtaModule()); m_hit->getEtaModule());
if (m_hit->isPLR()) { if (m_hit->isPLR()) {
geoelement = plrMgr()->getDetectorElement(id); geoelement = plrMgr()->getDetectorElement(id);
} else { } else {
geoelement = pixMgr()->getDetectorElement(id); geoelement = pixMgr()->getDetectorElement(id);
} }
} } else if (m_hit->isSCT()) {
else {
id = sctID()->wafer_id(Barrel, id = sctID()->wafer_id(Barrel,
m_hit->getLayerDisk(), m_hit->getLayerDisk(),
m_hit->getPhiModule(), m_hit->getPhiModule(),
m_hit->getEtaModule(), m_hit->getEtaModule(),
m_hit->getSide() ); 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()); const HepGeom::Point3D<double> globalStartPos = Amg::EigenTransformToCLHEP(geoelement->transformHit()) * HepGeom::Point3D<double>(m_hit->localStartPosition());
double x=globalStartPos.x(); double x=globalStartPos.x();
double y=globalStartPos.y(); double y=globalStartPos.y();
double z=globalStartPos.z(); double z=globalStartPos.z();
...@@ -56,4 +62,3 @@ inline HepGeom::Point3D<double> GeoSiHit::getGlobalPosition() const { ...@@ -56,4 +62,3 @@ inline HepGeom::Point3D<double> GeoSiHit::getGlobalPosition() const {
return HepGeom::Point3D<double>(0.0,0.0,0.0); return HepGeom::Point3D<double>(0.0,0.0,0.0);
} }
...@@ -15,7 +15,7 @@ const InDetDD::PixelDetectorManager* GeoSiHit::initPixMgr() ...@@ -15,7 +15,7 @@ const InDetDD::PixelDetectorManager* GeoSiHit::initPixMgr()
if (!detStore->contains<InDetDD::PixelDetectorManager>("Pixel") || detStore->retrieve(pix,"Pixel").isFailure()) if (!detStore->contains<InDetDD::PixelDetectorManager>("Pixel") || detStore->retrieve(pix,"Pixel").isFailure())
{ {
// if Pixel retrieval fails, try ITkPixel // 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(); std::abort();
} }
...@@ -49,6 +49,15 @@ const InDetDD::PixelDetectorManager* GeoSiHit::initPlrMgr() ...@@ -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() const PixelID* GeoSiHit::initPixID()
{ {
ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit"); ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoSiHit");
...@@ -71,6 +80,17 @@ const SCT_ID* GeoSiHit::initSctID() ...@@ -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* GeoSiHit::pixMgr() const
{ {
const InDetDD::PixelDetectorManager* const mgr = initPixMgr(); const InDetDD::PixelDetectorManager* const mgr = initPixMgr();
...@@ -92,16 +112,29 @@ const InDetDD::PixelDetectorManager* GeoSiHit::plrMgr() const ...@@ -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(); const PixelID* const id = initPixID();
return id; return id;
} }
const SCT_ID* GeoSiHit::sctID() const const SCT_ID* GeoSiHit::sctID() const
{ {
const SCT_ID* const id = initSctID(); const SCT_ID* const id = initSctID();
return id; return id;
} }
const HGTD_ID* GeoSiHit::hgtdID() const
{
const HGTD_ID* const id = initHgtdID();
return id;
}
...@@ -91,8 +91,8 @@ StatusCode SiHitAnalysis::initialize() ...@@ -91,8 +91,8 @@ StatusCode SiHitAnalysis::initialize()
} else if (detName == "HGTD") { } else if (detName == "HGTD") {
bin_down = -1000; bin_down = -1000;
bin_up = 1000; bin_up = 1000;
radius_up = 1000; radius_up = 700;
radius_down = 350; radius_down = 0;
z_max = 3600; z_max = 3600;
} else if (detName == "PLR") { } else if (detName == "PLR") {
bin_down = -125; 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