Commit 1b9dbdbf authored by David Richard Shope's avatar David Richard Shope Committed by Edward Moyse
Browse files

Configuration of HGTD Simulation

parent 24bfc9cb
......@@ -25,13 +25,13 @@ def EnvelopeDefSvcCfg(ConfigFlags, name="AtlasGeometry_EnvelopeDefSvc", **kwargs
# setup fallback BeamPipeEnvelope
BeamPipe = Volume()
BeamPipe.addRZ( 34.3, 3475.0 )
if ConfigFlags.Detector.GeometryHGTD:
BeamPipe.addRZ( 47.0, 3475.0 )
BeamPipe.addRZ( 47.0, 3535.0 )
BeamPipe.addRZ( 120.0, 3535.0 )
BeamPipe.addRZ( 34.3, 3420.0 )
BeamPipe.addRZ( 34.3, 3545.0 )
BeamPipe.addRZ( 120.0, 3545.0 )
else:
BeamPipe.addRZ( 34.3, 3475.0 )
BeamPipe.addRZ( 120.0, 3475.0 )
BeamPipe.addRZ( 120.0, 4185.0 )
BeamPipe.addRZ( 41.0, 4185.0 )
......@@ -52,21 +52,25 @@ def EnvelopeDefSvcCfg(ConfigFlags, name="AtlasGeometry_EnvelopeDefSvc", **kwargs
# setup fallback IDEnvelope
InDet = Volume()
InDet.addRZ( 1148., 3475. )
InDet.addRZ( 34.3, 3475. )
# InDet should include HGTD when it's turned on
if ConfigFlags.Detector.GeometryHGTD:
InDet.addRZ( 1148., 3545. )
InDet.addRZ( 34.3, 3545. )
else:
InDet.addRZ( 1148., 3475. )
InDet.addRZ( 34.3, 3475. )
kwargs.setdefault("FallbackInDetR" , InDet.getRs() )
kwargs.setdefault("FallbackInDetZ" , InDet.getZs() )
# setup fallback CaloEnvelope
Calo = Volume()
Calo.addRZ( 1148.0, 3475.0 )
if ConfigFlags.Detector.GeometryHGTD:
Calo.addRZ( 47.0, 3475.0 )
Calo.addRZ( 47.0, 3535.0 )
Calo.addRZ( 120.0, 3535.0 )
Calo.addRZ( 1148.0, 3545.0 )
Calo.addRZ( 120.0, 3545.0 )
else:
Calo.addRZ( 1148.0, 3475.0 )
Calo.addRZ( 120.0, 3475.0 )
Calo.addRZ( 120.0, 4185.0 )
Calo.addRZ( 41.0, 4185.0 )
......
......@@ -194,7 +194,7 @@ void HGTD_DetectorFactory::readDbParameters() {
innerRCoverBulkMaterial->add(m_materialMgr->getMaterial("std::Aerogel"), 0.5);
innerRCoverBulkMaterial->add(m_materialMgr->getMaterial("muo::Honeycomb"), 0.5);
m_materialMgr->addMaterial("hgtd", innerRCoverBulkMaterial);
m_cylVolPars["HGTD::InnerRCover2"] = {"HGTD::InnerRCover2", 111., 119., 105./2, -10., "hgtd::AerogelAndHoneycomb"};
m_cylVolPars["HGTD::InnerRCover2"] = {"HGTD::InnerRCover2", 111., 119., 105./2, -10., "AerogelAndHoneycomb"};
m_cylVolPars["HGTD::InnerRCover3"] = {"HGTD::InnerRCover3", 119., 120., 105./2, -10., "sct::CFRP"};
m_cylVolPars["HGTD::OuterRCover"] = {"HGTD::OuterRCover", 980., 1000., 82./2, -6.5, "pix::Peek"};
m_cylVolPars["HGTD::PeripheralCoolingLines"] = {"HGTD::PeripheralCoolingLines", 920., 980., 3./2, 31., "std::SSteel"};
......@@ -206,7 +206,7 @@ void HGTD_DetectorFactory::readDbParameters() {
coolantMaterial->add(m_materialMgr->getMaterial("pix::CO2_Liquid"), 0.5);
coolantMaterial->add(m_materialMgr->getMaterial("trt::CO2"), 0.5);
m_materialMgr->addMaterial("hgtd", coolantMaterial);
m_cylVolPars["HGTD::CoolingTubeFluid"] = {"HGTD::CoolingTubeFluid", 0, 0, 1.5, 0, "hgtd::CO2CoolantMix"}; // TODO: to add to db
m_cylVolPars["HGTD::CoolingTubeFluid"] = {"HGTD::CoolingTubeFluid", 0, 0, 1.5, 0, "CO2CoolantMix"}; // TODO: to add to db
// These parameters are not in the db (yet) and don't fit into the cylinder or box structures used above
// TODO: put these (and others needed for three-ring layout) into a separate table in the db when migrating to master
......@@ -537,9 +537,6 @@ GeoVPhysVol* HGTD_DetectorFactory::build( const GeoLogVol* logicalEnvelope, bool
// These are items that are shared by all detector elements
std::unique_ptr<SiCommonItems> commonItems{std::make_unique<SiCommonItems>(m_athComps->getIdHelper())};
// Add SiCommonItems to HGTD_DetectorManager to hold and delete it.
m_detectorManager->setCommonItems(std::move(commonItems));
for (int layer = 0; layer < 4; layer++) {
if (m_outputIdfr) cout << "Layer #" << layer << std::endl;
// select from front vs back side of a disk
......@@ -674,6 +671,9 @@ GeoVPhysVol* HGTD_DetectorFactory::build( const GeoLogVol* logicalEnvelope, bool
ATH_MSG_DEBUG( "Done placing modules for layer " << layer );
}
// Add SiCommonItems to HGTD_DetectorManager to hold and delete it.
m_detectorManager->setCommonItems(std::move(commonItems));
ATH_MSG_INFO( "**************************************************" );
ATH_MSG_INFO( " Done building HGTD with " << totMod <<" modules " );
ATH_MSG_INFO( "**************************************************" );
......
......@@ -149,7 +149,7 @@ HGTD_IDDetDescrCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj)
}
// Pass a pointer to the container to the Persistency service by reference.
pObj = StoreGateSvc::asStorable(m_hgtdId.get());
pObj = StoreGateSvc::asStorable(m_hgtdId.release());
return StatusCode::SUCCESS;
......
......@@ -102,9 +102,10 @@ public:
// link to the particle generating the hit
const HepMcParticleLink& particleLink() const;
// Pixel or SCT
// Pixel, SCT, or HGTD
bool isPixel() const;
bool isSCT() const;
bool isHGTD() const;
// Barrel or Endcap
int getBarrelEndcap() const;
......
......@@ -29,9 +29,10 @@ class SiHitIdHelper : HitIdHelper {
static const SiHitIdHelper* GetHelper();
//
// Info retrieval:
// Pixel or SCT
// Pixel, SCT, or HGTD
bool isPixel(const int& hid) const;
bool isSCT(const int& hid) const;
bool isHGTD(const int& hid) const;
// Barrel or Endcap
int getBarrelEndcap(const int& hid) const;
......
......@@ -50,7 +50,7 @@ SiHit::SiHit(const HepGeom::Point3D<double> &localStartPosition,
const double energyLoss,
const double meanTime,
const int trackNumber,
const int Pixel_SCT, const int BrlECap, const int LayerDisk,
const int Part, const int BrlECap, const int LayerDisk,
const int etaM, const int phiM, const int side) :
// m_localStartPosition(localStartPosition),
// m_localEndPosition(localEndPosition),
......@@ -66,7 +66,7 @@ SiHit::SiHit(const HepGeom::Point3D<double> &localStartPosition,
m_ID(0)
{
// Compress the location info into the integer:
m_ID = SiHitIdHelper::GetHelper()->buildHitId(Pixel_SCT,BrlECap,LayerDisk,etaM,phiM,side);
m_ID = SiHitIdHelper::GetHelper()->buildHitId(Part,BrlECap,LayerDisk,etaM,phiM,side);
}
// Constructor
......@@ -97,7 +97,7 @@ SiHit::SiHit(const HepGeom::Point3D<double> &localStartPosition,
const double energyLoss,
const double meanTime,
const HepMcParticleLink &track,
const int Pixel_SCT, const int BrlECap, const int LayerDisk,
const int Part, const int BrlECap, const int LayerDisk,
const int etaM, const int phiM, const int side) :
// m_localStartPosition(localStartPosition),
// m_localEndPosition(localEndPosition),
......@@ -113,7 +113,7 @@ SiHit::SiHit(const HepGeom::Point3D<double> &localStartPosition,
m_ID(0)
{
// Compress the location info into the integer:
m_ID = SiHitIdHelper::GetHelper()->buildHitId(Pixel_SCT,BrlECap,LayerDisk,etaM,phiM,side);
m_ID = SiHitIdHelper::GetHelper()->buildHitId(Part,BrlECap,LayerDisk,etaM,phiM,side);
}
void SiHit::ScaleLength(double sfactor) {
......@@ -135,6 +135,10 @@ bool SiHit::isSCT() const {
return SiHitIdHelper::GetHelper()->isSCT(m_ID);
}
bool SiHit::isHGTD() const {
return SiHitIdHelper::GetHelper()->isHGTD(m_ID);
}
HepGeom::Point3D<double> SiHit::localStartPosition() const
{
// return m_localEndPosition;
......@@ -171,9 +175,12 @@ int SiHit::getSide() const {
void SiHit::print() const {
if (isPixel() == true) {
std::cout << "*** Pixel Hit " << std::endl;
} else {
} else if (isSCT() == true) {
std::cout << "*** SCT Hit " << std::endl;
}
else {
std::cout << "*** HGTD Hit " << std::endl;
}
std::cout << " Barrel/ EndCap Number " << getBarrelEndcap() << std::endl;
std::cout << " Layer/Disk Number " << getLayerDisk() << std::endl;
std::cout << " Eta Number " << getEtaModule() << std::endl;
......
......@@ -34,8 +34,8 @@ void SiHitIdHelper::Initialize() {
//Run4 includes ITk and HGTD
bool isRun4 = (pix !=0 && pix->dictionaryVersion() == "ITkHGTD");
InitializeField("PixelSCT",0,1);
if (isRun4) InitializeField("Part",0,2);
else InitializeField("Part",0,1);
if (isDBM) InitializeField("BarrelEndcap",-4,4);
else InitializeField("BarrelEndcap",-2,2);
InitializeField("LayerDisk",0,20);
......@@ -47,19 +47,26 @@ void SiHitIdHelper::Initialize() {
}
// Info retrieval:
// Pixel or SCT
// Pixel, SCT, or HGTD
bool SiHitIdHelper::isPixel(const int& hid) const
{
int ps = this->GetFieldValue("PixelSCT", hid);
if (ps ==0 ) return true;
int psh = this->GetFieldValue("Part", hid);
if (psh ==0 ) return true;
else return false;
}
bool SiHitIdHelper::isSCT(const int& hid) const
{
int ps = this->GetFieldValue("PixelSCT", hid);
if (ps ==0 ) return false;
else return true;
int psh = this->GetFieldValue("Part", hid);
if (psh ==1 ) return true;
else return false;
}
bool SiHitIdHelper::isHGTD(const int& hid) const
{
int psh = this->GetFieldValue("Part", hid);
if (psh ==2 ) return true;
else return false;
}
// Barrel or Endcap
......@@ -95,11 +102,11 @@ int SiHitIdHelper::getSide(const int& hid) const
//
// Info packing:
int SiHitIdHelper::buildHitId(const int Pixel_SCT, const int BrlECap, const int LayerDisk,
int SiHitIdHelper::buildHitId(const int Part, const int BrlECap, const int LayerDisk,
const int etaM, const int phiM, const int side) const
{
int theID(0);
this->SetFieldValue("PixelSCT", Pixel_SCT, theID);
this->SetFieldValue("Part", Part, theID);
this->SetFieldValue("BarrelEndcap", BrlECap, theID);
this->SetFieldValue("LayerDisk", LayerDisk, theID);
this->SetFieldValue("EtaModule", etaM, theID);
......
......@@ -169,6 +169,11 @@
+ Generators/HepMCWeightSvc
+ Generators/McEventSelector
+ Generators/TruthUtils
+ HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel
+ HighGranularityTimingDetector/HGTD_DetDescr/HGTD_Identifier
+ HighGranularityTimingDetector/HGTD_DetDescr/HGTD_ReadoutGeometry
+ HighGranularityTimingDetector/HGTD_DetDescrCnv/HGTD_IdCnv
+ HighGranularityTimingDetector/HGTD_G4/HGTD_G4_SD
+ InnerDetector/InDetConditions/BeamSpotConditions
+ InnerDetector/InDetConditions/BeamSpotConditionsData
+ InnerDetector/InDetConditions/InDetCondFolders
......
......@@ -105,9 +105,8 @@ def HGTDSensitiveDetectorListCfg(ConfigFlags):
tools = []
if ConfigFlags.Detector.EnableHGTD:
# TODO: disabled pending infrastructure updates
# from HGTD_G4.HGTD_G4_SDToolConfig import HgtdSensorSDCfg
# tools += [ result.popToolsAndMerge(HgtdSensorSDCfg(ConfigFlags)) ]
from HGTD_G4_SD.HGTD_G4_SDToolConfig import HgtdSensorSDCfg
tools += [ result.popToolsAndMerge(HgtdSensorSDCfg(ConfigFlags)) ]
pass
result.setPrivateTools(tools)
......
......@@ -19,6 +19,7 @@ GeoDetectorTool=CompFactory.GeoDetectorTool
from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg
from AtlasGeoModel.InDetGMConfig import InDetGeometryCfg, InDetServiceMaterialCfg
from AtlasGeoModel.ITkGMConfig import ITkGeometryCfg
from HGTD_GeoModel.HGTD_GeoModelConfig import HGTD_GeometryCfg
from LArGeoAlgsNV.LArGMConfig import LArGMCfg
from TileGeoModel.TileGMConfig import TileGMCfg
from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
......@@ -95,6 +96,17 @@ def ITkStripGeoDetectorToolCfg(ConfigFlags, name='ITkStrip', **kwargs):
return result
def HGTDGeoDetectorToolCfg(ConfigFlags, name='HGTD', **kwargs):
#set up geometry
result=HGTD_GeometryCfg(ConfigFlags)
kwargs.setdefault("DetectorName", "HGTD")
#add the GeometryNotifierSvc
result.addService(G4GeometryNotifierSvcCfg(ConfigFlags))
kwargs.setdefault("GeometryNotifierSvc", result.getService("G4GeometryNotifierSvc"))
result.setPrivateTools(GeoDetectorTool(name, **kwargs))
return result
def TRTGeoDetectorToolCfg(ConfigFlags, name='TRT', **kwargs):
#set up geometry
result=InDetGeometryCfg(ConfigFlags)
......@@ -224,7 +236,11 @@ def ITKEnvelopeCfg(ConfigFlags, name="ITK", **kwargs):
kwargs.setdefault("DetectorName", "ITK")
kwargs.setdefault("InnerRadius", 32.15*mm)
kwargs.setdefault("OuterRadius", 1.148*m)
kwargs.setdefault("dZ", 347.5*cm)
if ConfigFlags.Detector.GeometryHGTD:
# ITk should include the HGTD (3420 mm < |z| < 3545 mm) when turned on
kwargs.setdefault("dZ", 354.5*cm)
else:
kwargs.setdefault("dZ", 347.5*cm)
SubDetectorList=[]
if ConfigFlags.Detector.GeometryITkPixel:
......@@ -281,7 +297,11 @@ def CALOEnvelopeCfg(ConfigFlags, name="CALO", **kwargs):
kwargs.setdefault("NSurfaces", 18)
kwargs.setdefault("InnerRadii", [41.,41.,41.,41.,41.,41.,120.,120.,1148.,1148.,120.,120.,41.,41.,41.,41.,41.,41.]) #FIXME Units?
kwargs.setdefault("OuterRadii", [415.,415.,3795.,3795.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,3795.,3795.,415.,415.]) #FIXME Units?
kwargs.setdefault("ZSurfaces", [-6781.,-calolim,-calolim,-6530.,-6530.,-4587.,-4587.,-3475.,-3475.,3475.,3475.,4587.,4587.,6530.,6530.,calolim,calolim,6781.]) #FIXME Units?
if ConfigFlags.Detector.GeometryHGTD:
# Make room for HGTD (3420 mm < |z| < 3545 mm) when turned on
kwargs.setdefault("ZSurfaces", [-6781.,-calolim,-calolim,-6530.,-6530.,-4587.,-4587.,-3545.,-3545.,3545.,3545.,4587.,4587.,6530.,6530.,calolim,calolim,6781.]) #FIXME Units?
else:
kwargs.setdefault("ZSurfaces", [-6781.,-calolim,-calolim,-6530.,-6530.,-4587.,-4587.,-3475.,-3475.,3475.,3475.,4587.,4587.,6530.,6530.,calolim,calolim,6781.]) #FIXME Units?
SubDetectorList=[]
if ConfigFlags.Detector.GeometryLAr:
toolLArMgr = result.popToolsAndMerge(LArMgrGeoDetectorToolCfg(ConfigFlags))
......@@ -376,6 +396,9 @@ def generateSubDetectorList(ConfigFlags):
if ConfigFlags.Detector.GeometryITk:
toolITK = result.popToolsAndMerge(ITKEnvelopeCfg(ConfigFlags))
SubDetectorList += [ toolITK ]
if ConfigFlags.Detector.GeometryHGTD:
toolHGTD = result.popToolsAndMerge(HGTDGeoDetectorToolCfg(ConfigFlags))
SubDetectorList += [ toolHGTD ]
if ConfigFlags.Detector.GeometryCalo:
toolCALO = result.popToolsAndMerge(CALOEnvelopeCfg(ConfigFlags))
SubDetectorList += [ toolCALO ]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment