Skip to content
Commits on Source (27)
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
/**
......@@ -25,19 +25,19 @@ namespace LArGeo {
class LArDetectorFactory : public GeoVDetectorFactory {
public:
// Constructor:
LArDetectorFactory(int testbeam, bool fullGeo);
// Destructor:
virtual ~LArDetectorFactory();
// Creation of geometry:
virtual void create(GeoPhysVol* world);
// Access to the results:
virtual const LArDetectorManager* getDetectorManager() const;
// Set parameters:
......@@ -46,14 +46,14 @@ namespace LArGeo {
void setFCALVisLimit(int maxCell) {m_fcalVisLimit = maxCell;}
void setBuildBarrel(bool flag) {m_buildBarrel = flag;}
void setBuildEndcap(bool flag) {m_buildEndcap = flag;}
void setActivateFT(bool flag) { m_activateFT = flag; }
private:
private:
// Illegal operations:
const LArDetectorFactory & operator=(const LArDetectorFactory &right);
LArDetectorFactory(const LArDetectorFactory &right);
// The manager:
LArDetectorManager* m_detectorManager;
bool m_barrelSagging;
......@@ -66,9 +66,10 @@ namespace LArGeo {
int m_testbeam;
bool m_fullGeo; // true->FULL, false->RECO
bool m_activateFT;
};
} // namespace LArGeo
#endif
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
/**
......@@ -44,7 +44,7 @@ public:
// Callback function itself
virtual StatusCode align(IOVSVC_CALLBACK_ARGS);
private:
bool m_barrelSaggingOn;
......@@ -62,6 +62,7 @@ public:
StoreGateSvc* m_detStore;
std::string m_geometryConfig; // FULL, SIMU, RECO
bool m_activateFT;
};
#endif
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "LArGeoAlgsNV/LArDetectorFactory.h"
......@@ -11,13 +11,13 @@
#include "LArGeoTBBarrel/TBBarrelCryostatConstruction.h"
#include "LArGeoEndcap/EndcapCryostatConstruction.h"
#include "GeoModelKernel/GeoPhysVol.h"
#include "GeoModelKernel/GeoPhysVol.h"
#include "GeoModelKernel/GeoTransform.h"
#include "GeoModelKernel/GeoAlignableTransform.h"
#include "GeoModelKernel/GeoNameTag.h"
#include "GeoModelKernel/GeoShapeUnion.h"
#include "CLHEP/Geometry/Transform3D.h"
#include "CLHEP/Geometry/Transform3D.h"
#include "LArGeoCode/LArMaterialManager.h"
#include "GeoModelInterfaces/StoredMaterialManager.h"
......@@ -61,7 +61,8 @@ LArGeo::LArDetectorFactory::LArDetectorFactory(int testbeam,bool fullGeo)
m_buildBarrel(true),
m_buildEndcap(true),
m_testbeam(testbeam),
m_fullGeo(fullGeo)
m_fullGeo(fullGeo),
m_activateFT(false)
{}
......@@ -92,51 +93,51 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
{
// 26-Sep-2003 WGS: Get our LAr detector parameters via the NOVA
// converters.
VDetectorParameters* parameters =
VDetectorParameters* parameters =
(VDetectorParameters *) new LArGeo::RAL();
VDetectorParameters::SetInstance(parameters);
// Get access to the material manager:
ISvcLocator *svcLocator = Gaudi::svcLocator();
IMessageSvc * msgSvc;
if (svcLocator->service("MessageSvc", msgSvc, true )==StatusCode::FAILURE) {
throw std::runtime_error("Error in LAr::DetectorFactor, cannot access MessageSvc");
}
MsgStream log(msgSvc, "LAr::DetectorFactory");
MsgStream log(msgSvc, "LAr::DetectorFactory");
StoreGateSvc *detStore;
if (svcLocator->service("DetectorStore", detStore, false )==StatusCode::FAILURE) {
throw std::runtime_error("Error in LArDetectorFactory, cannot access DetectorStore");
}
DataHandle<StoredMaterialManager> materialManager;
if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) {
throw std::runtime_error("Error in LArDetectorFactory, cannot access Material Manager");
}
IGeoModelSvc *geoModel;
IRDBAccessSvc* rdbAccess;
if(svcLocator->service ("GeoModelSvc",geoModel) == StatusCode::FAILURE)
throw std::runtime_error("Error in LArDetectorFactoryNV, cannot access GeoModelSvc");
if(svcLocator->service ("RDBAccessSvc",rdbAccess) == StatusCode::FAILURE)
throw std::runtime_error("Error in BarrelCryostatConstruction, cannot access RDBAccessSvc");
DecodeVersionKey larVersionKey(geoModel, "LAr");
log << MSG::DEBUG << "Getting primary numbers for " << larVersionKey.node() << ", " << larVersionKey.tag() << endreq;
IRDBRecordset_ptr larPosition = rdbAccess->getRecordsetPtr("LArPosition",larVersionKey.tag(),larVersionKey.node());
if(larPosition->size()==0)
if(larPosition->size()==0)
{
larPosition = rdbAccess->getRecordsetPtr("LArPosition", "LArPosition-00");
if (larPosition->size()==0)
if (larPosition->size()==0)
throw std::runtime_error("Error, no lar position table in database!");
}
......@@ -147,26 +148,26 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
// Patch the materials list by adding special materials. These
// cannot be added for the moment to the standard list because they
// are blended materials and to do the blending requires access to
// LAr Geometry.
// LAr Geometry.
//
LArMaterialManager lArMaterialManager(detStore);
lArMaterialManager.buildMaterials();
if (m_testbeam==0) {
BarrelCryostatConstruction barrelCryostatConstruction(m_fullGeo);
BarrelCryostatConstruction barrelCryostatConstruction(m_fullGeo, m_activateFT);
barrelCryostatConstruction.setBarrelSagging(m_barrelSagging);
barrelCryostatConstruction.setBarrelCellVisLimit(m_barrelVisLimit);
EndcapCryostatConstruction endcapCryostatConstruction(m_fullGeo);
EndcapCryostatConstruction endcapCryostatConstruction(m_fullGeo, m_activateFT);
endcapCryostatConstruction.setFCALVisLimit(m_fcalVisLimit);
//const GeoMaterial* matAir = materialManager->getMaterial("std::Air");
if(m_buildBarrel)
barrelEnvelope = barrelCryostatConstruction.GetEnvelope();
if(m_buildEndcap)
{
endcapEnvelopePos = endcapCryostatConstruction.createEnvelope(true);
......@@ -176,7 +177,7 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
// Offset of endcaps from nominal position.
a_container->add(new GeoNameTag("LAr"));
if(m_buildBarrel && m_buildEndcap)
{
// Typical scenario for each of the Tree Tops:
......@@ -185,7 +186,7 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
// 3. Store Alignable XF in SG
// --- Barrel
const IRDBRecord *barrelRec = GeoDBUtils::getTransformRecord(larPosition,"LARCRYO_B");
const IRDBRecord *barrelRec = GeoDBUtils::getTransformRecord(larPosition,"LARCRYO_B");
if(!barrelRec) throw std::runtime_error("Error, no lar position record in the database");
HepGeom::Transform3D xfBarrel = GeoDBUtils::getTransform(barrelRec);
GeoAlignableTransform* barrelAlXf = new GeoAlignableTransform(xfBarrel);
......@@ -247,7 +248,7 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
else if(!m_buildEndcap)
{
// -- Build the Barrel only
const IRDBRecord *barrelRec = GeoDBUtils::getTransformRecord(larPosition,"LARCRYO_B");
const IRDBRecord *barrelRec = GeoDBUtils::getTransformRecord(larPosition,"LARCRYO_B");
if(!barrelRec) throw std::runtime_error("Error, no lar position record in the database");
HepGeom::Transform3D xfBarrel = GeoDBUtils::getTransform(barrelRec);
GeoAlignableTransform* barrelAlXf = new GeoAlignableTransform(xfBarrel);
......@@ -308,7 +309,7 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
a_container->add(xfEndcapNeg);
a_container->add( new GeoTransform(HepGeom::RotateY3D(180.0*CLHEP::deg)));
a_container->add(endcapEnvelopeNeg);
}
}
else
......@@ -316,12 +317,12 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
TBBarrelCryostatConstruction tbbarrelCryostatConstruction;
tbbarrelCryostatConstruction.setBarrelSagging(m_barrelSagging);
tbbarrelCryostatConstruction.setBarrelCellVisLimit(m_barrelVisLimit);
barrelEnvelope = tbbarrelCryostatConstruction.GetEnvelope();
a_container->add(new GeoNameTag("LAr"));
a_container->add(barrelEnvelope);
}
}
......@@ -334,8 +335,8 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
if (svcLocator->service("MessageSvc", msgSvc, true )==StatusCode::FAILURE) {
throw std::runtime_error("Error in LAr::DetectorFactor, cannot access MessageSvc");
}
MsgStream log(msgSvc, "LAr::DetectorFactory");
MsgStream log(msgSvc, "LAr::DetectorFactory");
try
{
fcalDetectorManager = new FCALDetectorManager();
......@@ -366,27 +367,27 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
for (unsigned int r=0;r<2;r++) {
unsigned int nPhi = r==0? 2:1;
for (unsigned int endcap=0;endcap<2;endcap++) {
StoredPhysVol *vol;
StoredPhysVol *vol;
std::string nameTag= endcap==0 ? (s<2 ? "HEC1_NEG":"HEC2_NEG") : (s<2 ? "HEC1_POS":"HEC2_POS");
if(detStore->contains<StoredPhysVol>(nameTag)){
if (StatusCode::SUCCESS==detStore->retrieve(vol, nameTag)) {
if (StatusCode::SUCCESS==detStore->retrieve(vol, nameTag)) {
unsigned int width = 32;
double startPhi = endcap==0? M_PI : 0;
double endPhi = endcap==0? -M_PI : 2*M_PI ;
CellBinning phiBinning(startPhi, endPhi, width*nPhi);
HECDetDescr *d = new HECDetDescr(hecDetectorManager,s,r,phiBinning);
HECDetDescr *d = new HECDetDescr(hecDetectorManager,s,r,phiBinning);
HECDetectorRegion::DetectorSide side = (HECDetectorRegion::DetectorSide) endcap;
HECDetectorRegion *region = new HECDetectorRegion(vol->getPhysVol(),d,side,projectivityDisplacement);
hecDetectorManager->addDetectorRegion(region);
}
}
}
else
log << MSG::DEBUG << " No Stored PV for " << nameTag
<< " in Detector Store" << endreq;
<< " in Detector Store" << endreq;
}
}
}
......@@ -394,39 +395,39 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
catch (std::exception & ex) {
log << MSG::WARNING << "Unable to build HEC detector manager. " << ex.what() << endreq;
}
try
{
emecDetectorManager = new EMECDetectorManager();
// Here is a table of min and max eta for different sampling layers, radial part (i/o) and region.
for (int e=0;e<2;e++) {
double startPhi = e==0? M_PI-2*M_PI/768/2 : -2*M_PI/768/2;
double endPhi = e==0? -M_PI-2*M_PI/768/2 : 2*M_PI-2*M_PI/768/2 ;
StoredPhysVol *sPhys;
if(detStore->contains<StoredPhysVol>(e==0 ? "EMEC_OUTER_WHEEL_NEG" : "EMEC_OUTER_WHEEL_POS")){
if (detStore->retrieve(sPhys,e==0 ? "EMEC_OUTER_WHEEL_NEG" : "EMEC_OUTER_WHEEL_POS")==StatusCode::SUCCESS)
if (detStore->retrieve(sPhys,e==0 ? "EMEC_OUTER_WHEEL_NEG" : "EMEC_OUTER_WHEEL_POS")==StatusCode::SUCCESS)
{
GeoFullPhysVol *emecEnvelope=(GeoFullPhysVol *) sPhys->getPhysVol();
{
CellBinning phiBinning(startPhi,endPhi,64);
EMECDetDescr *detDescr = new EMECDetDescr(emecDetectorManager,1,0,0,phiBinning);
EMECDetectorRegion *region = new EMECDetectorRegion(emecEnvelope,detDescr,EMECDetectorRegion::DetectorSide(e),projectivityDisplacement);
emecDetectorManager->addDetectorRegion(region);
}
// Outer Wheel Sampling 1 Region 1:
{
CellBinning phiBinning(startPhi,endPhi,64);
......@@ -490,10 +491,10 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
<< " in Detector Store" << endreq;
if(detStore->contains<StoredPhysVol>(e==0 ? "EMEC_INNER_WHEEL_NEG" : "EMEC_INNER_WHEEL_POS")){
if (detStore->retrieve(sPhys,e==0 ? "EMEC_INNER_WHEEL_NEG" : "EMEC_INNER_WHEEL_POS")==StatusCode::SUCCESS)
if (detStore->retrieve(sPhys,e==0 ? "EMEC_INNER_WHEEL_NEG" : "EMEC_INNER_WHEEL_POS")==StatusCode::SUCCESS)
{
GeoFullPhysVol *emecEnvelope=(GeoFullPhysVol *) sPhys->getPhysVol();
// Inner Wheel Sampling 1 Region 0:
{
CellBinning phiBinning(startPhi,endPhi,64);
......@@ -502,43 +503,43 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
emecDetectorManager->addDetectorRegion(region);
}
// Inner Wheel Sampling 2 Region 0:
{
CellBinning phiBinning(startPhi,endPhi,64);
EMECDetDescr *detDescr = new EMECDetDescr(emecDetectorManager,2,0,1,phiBinning);
EMECDetectorRegion *region = new EMECDetectorRegion(emecEnvelope,detDescr,EMECDetectorRegion::DetectorSide(e),projectivityDisplacement);
emecDetectorManager->addDetectorRegion(region);
}
}
}
else
log << MSG::DEBUG << " No Stored PV for " << (e==0 ? "EMEC_INNER_WHEEL_NEG" : "EMEC_INNER_WHEEL_POS")
<< " in Detector Store" << endreq;
StoredPhysVol *sPresamplerEnvelope;
StoredPhysVol *sPresamplerEnvelope;
if(detStore->contains<StoredPhysVol>(e==0 ? "PRESAMPLER_EC_NEG":"PRESAMPLER_EC_POS" )){
if (StatusCode::SUCCESS==detStore->retrieve(sPresamplerEnvelope, e==0 ? "PRESAMPLER_EC_NEG":"PRESAMPLER_EC_POS" )) {
if (StatusCode::SUCCESS==detStore->retrieve(sPresamplerEnvelope, e==0 ? "PRESAMPLER_EC_NEG":"PRESAMPLER_EC_POS" )) {
GeoFullPhysVol * PresamplerEnvelope=sPresamplerEnvelope->getPhysVol();
CellBinning presamplerPhiBinning(startPhi,endPhi,64);
EMECDetDescr *presamplerDetDescr = new EMECDetDescr(emecDetectorManager,0,0,0,presamplerPhiBinning);
EMECDetectorRegion *presamplerRegion = new EMECDetectorRegion(PresamplerEnvelope,presamplerDetDescr,EMECDetectorRegion::DetectorSide(e),projectivityDisplacement);
emecDetectorManager->addDetectorRegion(presamplerRegion);
}
}
}
else
else
log << MSG::DEBUG << " No Stored PV for " << (e==0 ? "PRESAMPLER_EC_NEG":"PRESAMPLER_EC_POS")
<< " in Detector Store" << endreq;
}
}
catch (std::exception & ex) {
log << MSG::WARNING << "Unable to build EMEC detector manager. " << ex.what() << endreq;
}
try
{
{
embDetectorManager = new EMBDetectorManager();
int firstEndcap=m_testbeam==0 ? 0:1, endEndcap=2;
for (int e= firstEndcap ;e<endEndcap;e++) {
......@@ -551,14 +552,14 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
endPhi =22.5*M_PI/180;
NDIV=16;
}
// Sampling layer 3 region 0:
if (1)
{
StoredPhysVol *sPhys;
if(detStore->contains<StoredPhysVol>(e==0 ? "EMB_NEG" : "EMB_POS"))
{
if (detStore->retrieve(sPhys,e==0 ? "EMB_NEG" : "EMB_POS")==StatusCode::SUCCESS)
if (detStore->retrieve(sPhys,e==0 ? "EMB_NEG" : "EMB_POS")==StatusCode::SUCCESS)
{
CellBinning phiBinning(startPhi,endPhi,256/NDIV);
EMBDetDescr *detDescr = new EMBDetDescr(embDetectorManager,3,0,phiBinning);
......@@ -573,11 +574,11 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
// Sampling layer 2 region 0:
if (1)
{
StoredPhysVol *sPhys;
if(detStore->contains<StoredPhysVol>(e==0 ? "EMB_NEG" : "EMB_POS"))
{
if (detStore->retrieve(sPhys,e==0 ? "EMB_NEG" : "EMB_POS")==StatusCode::SUCCESS)
if (detStore->retrieve(sPhys,e==0 ? "EMB_NEG" : "EMB_POS")==StatusCode::SUCCESS)
{
CellBinning phiBinning(startPhi,endPhi,256/NDIV);
EMBDetDescr *detDescr = new EMBDetDescr(embDetectorManager,2,0,phiBinning);
......@@ -595,7 +596,7 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
StoredPhysVol *sPhys;
if(detStore->contains<StoredPhysVol>(e==0 ? "EMB_NEG" : "EMB_POS"))
{
if (detStore->retrieve(sPhys,e==0 ? "EMB_NEG" : "EMB_POS")==StatusCode::SUCCESS)
if (detStore->retrieve(sPhys,e==0 ? "EMB_NEG" : "EMB_POS")==StatusCode::SUCCESS)
{
CellBinning phiBinning(startPhi,endPhi,256/NDIV);
EMBDetDescr *detDescr = new EMBDetDescr(embDetectorManager,2,1,phiBinning);
......@@ -613,7 +614,7 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
StoredPhysVol *sPhys;
if(detStore->contains<StoredPhysVol>(e==0 ? "EMB_NEG" : "EMB_POS"))
{
if (detStore->retrieve(sPhys,e==0 ? "EMB_NEG" : "EMB_POS")==StatusCode::SUCCESS)
if (detStore->retrieve(sPhys,e==0 ? "EMB_NEG" : "EMB_POS")==StatusCode::SUCCESS)
{
CellBinning phiBinning(startPhi,endPhi,64/NDIV);
EMBDetDescr *detDescr = new EMBDetDescr(embDetectorManager,1,0,phiBinning);
......@@ -631,7 +632,7 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
StoredPhysVol *sPhys;
if(detStore->contains<StoredPhysVol>(e==0 ? "EMB_NEG" : "EMB_POS"))
{
if (detStore->retrieve(sPhys,e==0 ? "EMB_NEG" : "EMB_POS")==StatusCode::SUCCESS)
if (detStore->retrieve(sPhys,e==0 ? "EMB_NEG" : "EMB_POS")==StatusCode::SUCCESS)
{
CellBinning phiBinning(startPhi,endPhi,256/NDIV);
EMBDetDescr *detDescr = new EMBDetDescr(embDetectorManager,1,1,phiBinning);
......@@ -649,7 +650,7 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
StoredPhysVol *sPhys;
if(detStore->contains<StoredPhysVol>(e==0 ? "EMB_NEG" : "EMB_POS"))
{
if (detStore->retrieve(sPhys,e==0 ? "EMB_NEG" : "EMB_POS")==StatusCode::SUCCESS)
if (detStore->retrieve(sPhys,e==0 ? "EMB_NEG" : "EMB_POS")==StatusCode::SUCCESS)
{
CellBinning phiBinning(startPhi,endPhi,64/NDIV);
EMBDetDescr *detDescr = new EMBDetDescr(embDetectorManager,0,0,phiBinning);
......@@ -672,30 +673,30 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
if (barrelEnvelope) m_detectorManager->addTreeTop(barrelEnvelope);
if (endcapEnvelopePos) m_detectorManager->addTreeTop(endcapEnvelopePos);
if (endcapEnvelopeNeg) m_detectorManager->addTreeTop(endcapEnvelopeNeg);
StatusCode sc;
if (embDetectorManager)
if (embDetectorManager)
{
sc = detStore->record(embDetectorManager, embDetectorManager->getName());
if(sc.isFailure())
log << MSG::ERROR << "Unable to record embDetectorManager" << endreq;
}
if (emecDetectorManager)
if (emecDetectorManager)
{
sc = detStore->record(emecDetectorManager, emecDetectorManager->getName());
if(sc.isFailure())
log << MSG::ERROR << "Unable to record emecDetectorManager" << endreq;
}
if (hecDetectorManager)
if (hecDetectorManager)
{
sc = detStore->record(hecDetectorManager, hecDetectorManager->getName());
if(sc.isFailure())
log << MSG::ERROR << "Unable to record hecDetectorManager" << endreq;
}
if (fcalDetectorManager)
if (fcalDetectorManager)
{
sc = detStore->record(fcalDetectorManager, fcalDetectorManager->getName());
if(sc.isFailure())
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "LArReadoutGeometry/FCAL_ChannelMap.h"
#include "LArGeoAlgsNV/LArDetectorToolNV.h"
#include "LArGeoAlgsNV/LArDetectorFactory.h"
#include "LArGeoAlgsNV/LArDetectorFactory.h"
#include "LArGeoCode/VDetectorParameters.h"
#include "GeoModelUtilities/GeoModelExperiment.h"
#include "GaudiKernel/IService.h"
......@@ -41,10 +41,10 @@
#define LAR_ALIGN "/LAR/Align"
LArDetectorToolNV::LArDetectorToolNV(const std::string& type,
const std::string& name,
LArDetectorToolNV::LArDetectorToolNV(const std::string& type,
const std::string& name,
const IInterface* parent)
: GeoModelTool(type,name,parent),
: GeoModelTool(type,name,parent),
m_barrelSaggingOn(false),
m_barrelVisLimit(-1),
m_fcalVisLimit(-1),
......@@ -52,7 +52,7 @@ LArDetectorToolNV::LArDetectorToolNV(const std::string& type,
m_buildEndcap(true),
m_applyAlignments(false),
m_detStore(0),
m_geometryConfig("FULL")
m_geometryConfig("FULL"), m_activateFT(false)
{
declareProperty("SaggingBarrelAccordeon",m_barrelSaggingOn);
declareProperty("BarrelCellVisLimit", m_barrelVisLimit);
......@@ -62,6 +62,7 @@ LArDetectorToolNV::LArDetectorToolNV(const std::string& type,
declareProperty("BuildEndcap", m_buildEndcap);
declareProperty("ApplyAlignments", m_applyAlignments);
declareProperty("GeometryConfig", m_geometryConfig);
declareProperty("ActivateFeedThrougs", m_activateFT);
m_manager = 0;
}
......@@ -73,7 +74,7 @@ LArDetectorToolNV::~LArDetectorToolNV()
}
StatusCode LArDetectorToolNV::create(StoreGateSvc* detStore)
{
{
IMessageSvc* msgSvc;
if(StatusCode::FAILURE==service ("MessageSvc",msgSvc))
{
......@@ -94,14 +95,14 @@ StatusCode LArDetectorToolNV::create(StoreGateSvc* detStore)
LArHVManager *hvManager= new LArHVManager(embHV,emecHVI, emecHVO, hecHV, fcalHV,embPSHV, emecPSHV);
MsgStream log(msgSvc, name());
MsgStream log(msgSvc, name());
m_detStore = detStore;
if (StatusCode::SUCCESS != detStore->record(hvManager,"LArHVManager")) {
log << MSG::ERROR << "Unable to record LArHVManager in detector store " << endreq;
return StatusCode::FAILURE;
}
// Get the detector configuration.
IGeoModelSvc *geoModel;
......@@ -110,10 +111,10 @@ StatusCode LArDetectorToolNV::create(StoreGateSvc* detStore)
log << MSG::ERROR << "Unable to get GeoModel service" << endreq;
return StatusCode::FAILURE;
}
std::string AtlasVersion = geoModel->atlasVersion();
std::string LArVersion = geoModel->LAr_VersionOverride();
IRDBAccessSvc *accessSvc;
if(StatusCode::FAILURE==service("RDBAccessSvc",accessSvc))
{
......@@ -124,27 +125,27 @@ StatusCode LArDetectorToolNV::create(StoreGateSvc* detStore)
std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion;
std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr";
log << MSG::INFO << "Keys for LAr are " << detectorKey << " " << detectorNode << endreq;
log << MSG::INFO << "Building LAr version " << geoModel->LAr_Version()
log << MSG::INFO << "Building LAr version " << geoModel->LAr_Version()
<< " while ATLAS version is " << AtlasVersion << endreq;
if(LArVersion=="CUSTOM")
if(LArVersion=="CUSTOM")
{
log << MSG::WARNING << "LArDetectorToolNV: Detector Information coming from a custom configuration!!"
log << MSG::WARNING << "LArDetectorToolNV: Detector Information coming from a custom configuration!!"
<< endreq;
}
else
}
else
{
IRDBRecordset_ptr switchSet = accessSvc->getRecordsetPtr("LArSwitches", detectorKey, detectorNode);
if ((*switchSet).size()==0) return StatusCode::FAILURE;
const IRDBRecord *switches = (*switchSet)[0];
m_barrelSaggingOn = switches->getInt("SAGGING");
try
{
if (!switches->isFieldNull("BARREL_ON"))
m_buildBarrel = switches->getInt("BARREL_ON");
if (!switches->isFieldNull("ENDCAP_ON"))
m_buildEndcap = switches->getInt("ENDCAP_ON");
}
......@@ -159,13 +160,13 @@ StatusCode LArDetectorToolNV::create(StoreGateSvc* detStore)
log << MSG::INFO << " Barrel = " << (m_buildBarrel ? "ON" : "OFF") << endreq;
log << MSG::INFO << " Endcap = " << (m_buildEndcap ? "ON" : "OFF") << endreq;
// Locate the top level experiment node
DataHandle<GeoModelExperiment> theExpt;
if (StatusCode::SUCCESS != detStore->retrieve( theExpt, "ATLAS" ))
{
log << MSG::ERROR << "Could not find GeoModelExperiment ATLAS" << endreq;
return (StatusCode::FAILURE);
}
// Locate the top level experiment node
DataHandle<GeoModelExperiment> theExpt;
if (StatusCode::SUCCESS != detStore->retrieve( theExpt, "ATLAS" ))
{
log << MSG::ERROR << "Could not find GeoModelExperiment ATLAS" << endreq;
return (StatusCode::FAILURE);
}
// determine the geometry layout - Atlas/Testbeam
std::string geometryLayout = "Atlas";
......@@ -195,20 +196,20 @@ StatusCode LArDetectorToolNV::create(StoreGateSvc* detStore)
theLArFactory.setFCALVisLimit (m_fcalVisLimit);
theLArFactory.setBuildBarrel(m_buildBarrel);
theLArFactory.setBuildEndcap(m_buildEndcap);
theLArFactory.setActivateFT(m_activateFT);
if (0 == m_detector)
if (0 == m_detector)
{
GeoPhysVol *world=&*theExpt->getPhysVol();
theLArFactory.create(world);
m_manager = theLArFactory.getDetectorManager();
if (StatusCode::SUCCESS != detStore->record(theLArFactory.getDetectorManager(),
theLArFactory.getDetectorManager()->getName()))
{
log << MSG::ERROR << "Could not record" << endreq;
return (StatusCode::FAILURE);
}
theLArFactory.getDetectorManager()->getName()))
{
log << MSG::ERROR << "Could not record" << endreq;
return (StatusCode::FAILURE);
}
theExpt->addManager(theLArFactory.getDetectorManager());
......@@ -278,7 +279,7 @@ StatusCode LArDetectorToolNV::registerCallback(StoreGateSvc* detStore)
{
// Return FAILURE if no callbacks have been registered
MsgStream log(msgSvc(), name());
if(!m_applyAlignments)
{
log << MSG::DEBUG << "LAr alignments switched OFF" << endreq;
......@@ -289,7 +290,7 @@ StatusCode LArDetectorToolNV::registerCallback(StoreGateSvc* detStore)
const DataHandle<DetCondKeyTrans> dckt;
log << MSG::DEBUG << "Registering callback on DetCondKeyTrans with folder " << folderName << endreq;
StatusCode sc = detStore->regFcn(&IGeoModelTool::align, dynamic_cast<IGeoModelTool *>(this), dckt, folderName);
StatusCode sc = detStore->regFcn(&IGeoModelTool::align, dynamic_cast<IGeoModelTool *>(this), dckt, folderName);
if(sc.isSuccess())
log << MSG::DEBUG << " Successfully registered " << endreq;
else
......@@ -300,7 +301,7 @@ StatusCode LArDetectorToolNV::registerCallback(StoreGateSvc* detStore)
StatusCode LArDetectorToolNV::align(IOVSVC_CALLBACK_ARGS)
{
MsgStream log(msgSvc(), name());
MsgStream log(msgSvc(), name());
if(!m_applyAlignments)
{
......@@ -339,7 +340,7 @@ StatusCode LArDetectorToolNV::align(IOVSVC_CALLBACK_ARGS)
// <--- !!! To Do
if(0 == m_manager)
if(0 == m_manager)
{
log << MSG::WARNING << " LArDetDescrManager not created yet, cannot align !" << endreq;
return StatusCode::FAILURE;
......@@ -349,14 +350,14 @@ StatusCode LArDetectorToolNV::align(IOVSVC_CALLBACK_ARGS)
if(m_detStore->contains<DetCondKeyTrans>(LAR_ALIGN))
{
StatusCode sc = m_detStore->retrieve(align, LAR_ALIGN);
if(sc.isFailure())
{
log << MSG::WARNING << " Could not retrieve LAr DetCondKeyTrans " << endreq;
return sc;
}
if(0 == align)
if(0 == align)
{
log << MSG::WARNING <<" LAr DetCondKeyTrans ptr is 0" << endreq;
return StatusCode::FAILURE;
......@@ -393,7 +394,7 @@ StatusCode LArDetectorToolNV::align(IOVSVC_CALLBACK_ARGS)
GeoAlignableTransform *hec1GatNeg = hec1AlxPos ? hec1AlxNeg->getAlignX(): NULL;
GeoAlignableTransform *hec2GatPos = hec2AlxPos ? hec2AlxPos->getAlignX(): NULL;
GeoAlignableTransform *hec2GatNeg = hec2AlxPos ? hec2AlxNeg->getAlignX(): NULL;
// loop over align names
// if the transform presented alter its delta
// if the transform is not presented clear its delta
......@@ -471,7 +472,7 @@ StatusCode LArDetectorToolNV::align(IOVSVC_CALLBACK_ARGS)
else
log << MSG::DEBUG << " No LAr DetCondKeyTrans in SG, skipping align() " << endreq;
// debug printout of global positions:
for(unsigned int i=0; i<alignNames.size(); i++)
{
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
/**
......@@ -19,25 +19,25 @@ class StoreGateSvc;
namespace LArGeo {
/** @class LArGeo::BarrelCryostatConstruction
/** @class LArGeo::BarrelCryostatConstruction
@brief Builds GeoModel description of the LAr Electromagnetic Barrel.
Descriptions of the presampler and dad material in the crack region are
implemented in separate classes
*/
class BarrelCryostatConstruction
class BarrelCryostatConstruction
{
public:
BarrelCryostatConstruction(bool fullGeo);
BarrelCryostatConstruction(bool fullGeo, bool activateFT = false);
virtual ~BarrelCryostatConstruction();
// Get the envelope containing this detector.
virtual GeoFullPhysVol* GetEnvelope();
void setBarrelSagging(bool flag) {m_barrelSagging = flag;}
void setBarrelCellVisLimit(int maxCell) {m_barrelVisLimit = maxCell;}
private:
bool m_barrelSagging;
......@@ -45,6 +45,7 @@ namespace LArGeo {
GeoFullPhysVol *m_cryoMotherPhysical;
bool m_fullGeo; // true->FULL, false->RECO
bool m_activateFT;
};
} // namespace LArGeo
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
/**
......@@ -26,7 +26,7 @@ namespace LArGeo {
public:
// Constructor;
BarrelDMConstruction();
BarrelDMConstruction(bool activateFT = false);
// Destructor:
virtual ~BarrelDMConstruction();
......@@ -34,7 +34,7 @@ namespace LArGeo {
// Add passive materials to the barrel envelope
void create(GeoFullPhysVol* envelope);
private:
private:
// It is illegal to copy a BarrelDMConstruction:
BarrelDMConstruction (const BarrelDMConstruction &);
......@@ -42,9 +42,10 @@ namespace LArGeo {
// It is illegal to assign a BarrelDMConstruction:
BarrelDMConstruction & operator= (const BarrelDMConstruction &);
};
bool m_activateFT;
};
} // namespace LArGeo
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "LArGeoCode/LArMaterialManager.h"
......@@ -504,5 +504,138 @@ void LArMaterialManager::buildMaterials()
msg << MSG::INFO<< "EMEC G10FeInner radiation length " << G10FeInner->getRadLength() << endreq;
#endif
// Materials for Barrel and Endcap Signal Feedthroughs
{
GeoMaterial* myIron = m_storedManager->getMaterial("std::Iron");
GeoMaterial* myCopper = m_storedManager->getMaterial("std::Copper");
GeoMaterial* myKapton = m_storedManager->getMaterial("std::Kapton");
GeoMaterial* myAlu = m_storedManager->getMaterial("std::Aluminium");
GeoMaterial* myLAr = m_storedManager->getMaterial("std::LiquidArgon");
GeoElement* O = m_storedManager->getElement("Oxygen");
GeoElement* Na = m_storedManager->getElement("Potassium");
GeoElement* Si = m_storedManager->getElement("Silicon");
GeoElement* Ca = m_storedManager->getElement("Calcium");
GeoMaterial* myGlass = new GeoMaterial("PinCarrierGlas",2.40*CLHEP::g/CLHEP::cm3);
myGlass->add(O ,0.459800);
myGlass->add(Na,0.096441);
myGlass->add(Si,0.336553);
myGlass->add(Ca,0.107205);
myGlass->lock();
m_storedManager->addMaterial("LAr",myGlass);
// Average material for Warm Flange
/* contains
* bolt ring 1.88 kg Al
* seal ring 5.84 kg Fe
* heater 1.00 kg Al
* plate 8.67 kg - 2*(0.478+0.540) kg = 6.634 kg Fe
* pin carr. 2.036 kg mixture Fe+ glass (36g) + Cu (170g)
*
* hardcoded volume = 37*170^2*pi = 3766141 mm^3
*/
const double wflange_total = 1.88 + 5.84 + 1.0 + 6.634 + 2.036;
GeoMaterial* warm_flange = new GeoMaterial("FT::WarmFlange",
wflange_total*CLHEP::kg / (3766141.*CLHEP::mm3)
);
warm_flange->add(myAlu, 2.88 / wflange_total);
warm_flange->add(myIron, (5.84 + 6.634 + 1.83) / wflange_total);
warm_flange->add(myCopper, 0.17 / wflange_total);
warm_flange->add(myGlass, 0.036 / wflange_total);
warm_flange->lock();
m_storedManager->addMaterial("LAr", warm_flange);
// Average material for Cold Flange
/* contains
* plate 11.21 kg - 2*(0.478+0.540) kg = 9.174 kg Fe
* pin carr. 2.036 kg mixture Fe+ glass (36g) + Cu (170g)
*
* hardcoded volume = 35*141.5^2*pi = 2201561 mm^3
*/
{
const double m = 11.21;
const double mGlass = 0.036;
const double mCopper = 0.170;
const double mFe = m - mGlass - mCopper;
GeoMaterial* cold_flange = new GeoMaterial("FT::ColdFlange",
m*CLHEP::kg / (2201561.*CLHEP::mm3)
);
cold_flange->add(myIron, mFe / m);
cold_flange->add(myCopper, mCopper / m);
cold_flange->add(myGlass, mGlass / m);
cold_flange->lock();
m_storedManager->addMaterial("LAr", cold_flange);
}
/* bellow is iron + vacuum
as geometry described in DMConstruction,
bellow also includes cuff ring and some part of seal ring
0.511 kg bellow
0.840 kg cuff ring
0 seal ring (sum whole ring to warm flange)
hardcoded volume is 225*pi*(229^2 - (229 - 15)^2)/4 = 1253790 mm^3
*/
GeoMaterial* bellow_mat = new GeoMaterial("FT::Bellow",
1.351*CLHEP::kg / (1253790.*CLHEP::mm3)
);
bellow_mat->add(myIron, 1.);
bellow_mat->lock();
m_storedManager->addMaterial("LAr", bellow_mat);
/* vacuum cables are kapton+copper placed in vacuum,
insulation is ignored yet (btw different for barrel and EC)
3.928 kg Cu (0.5657)
3.015 kg Polymide (0.4343)
------------------
6.943 kg total
hardcoded volume is 225*pi*(229 - 15)^2/4 = 8092821 mm^3
*/
GeoMaterial* vacuum_cables_mat = new GeoMaterial("FT::VacuumCables",
6.943*CLHEP::kg / (8092821.*CLHEP::mm3)
);
vacuum_cables_mat->add(myCopper, 0.5657);
vacuum_cables_mat->add(myKapton, 0.4343);
vacuum_cables_mat->lock();
m_storedManager->addMaterial("LAr", vacuum_cables_mat);
/* cables
* 0.215 cm^3 per 1m copper
* 0.735 cm^3 per 1m kapton
* 2.90 g per 1m = 100*pi*(0.11/2)^2 = 0.95 cm^3
*/
const double vCopper = 0.215;
const double vKapton = 0.735;
const double mCopper = vCopper*8.96;
const double mKapton = vKapton*1.3;
const double m = mCopper + mKapton;
GeoMaterial* cable_mat = new GeoMaterial("FT::Cable",
m*CLHEP::g / ((vCopper + vKapton)*CLHEP::cm3)
);
cable_mat->add(myCopper, mCopper / m);
cable_mat->add(myKapton, mKapton / m);
cable_mat->lock();
m_storedManager->addMaterial("LAr", cable_mat);
/* pigtail cables are cables + LAr
*
*/
const double v = M_PI*(13.3/2)*(13.3/2);
const double vc = M_PI*(.11/2)*(.11/2)*1920;
const double va = v - vc;
const double mc = vc * 2.9/0.95;
const double ma = va * 1.392;
GeoMaterial* pigtail_mat = new GeoMaterial("FT::Pigtail",
(mc + ma)*CLHEP::g / (v*CLHEP::cm3)
);
msg << MSG::DEBUG << pigtail_mat->getName() << " "
<< pigtail_mat->getDensity() / (CLHEP::g/CLHEP::cm3)
<< endmsg;
pigtail_mat->add(cable_mat, mc / (mc + ma));
pigtail_mat->add(myLAr, ma / (mc + ma));
pigtail_mat->lock();
m_storedManager->addMaterial("LAr", pigtail_mat);
}
}
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
/**
......@@ -31,18 +31,18 @@ namespace LArGeo {
/** @class LArGeo::EndcapCryostatConstruction
@brief Description of the LAr End Cap cryostat, including MBTS description
*/
class EndcapCryostatConstruction
class EndcapCryostatConstruction
{
public:
EndcapCryostatConstruction(bool fullGeo);
EndcapCryostatConstruction(bool fullGeo, bool activateFT = false);
virtual ~EndcapCryostatConstruction();
// Get the envelope containing one endcap (pos/neg)
GeoFullPhysVol* createEnvelope(bool bPos);
virtual GeoVPhysVol* GetEnvelope() {return 0;};
// Set a vis limit for the FCAL
void setFCALVisLimit(int limit) {m_fcalVisLimit=limit;}
......@@ -59,8 +59,9 @@ namespace LArGeo {
EMECConstruction m_emec;
HEC2WheelConstruction m_hec2;
FCALConstruction* m_fcal;
bool m_fullGeo; // true->FULL, false->RECO
bool m_activateFT;
friend class ::LArDetectorToolNV;
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "EndcapDMConstruction.h"
......@@ -18,6 +18,7 @@
#include "GeoModelKernel/GeoSerialTransformer.h"
#include "GeoModelKernel/GeoTube.h"
#include "GeoModelKernel/GeoBox.h"
#include "GeoModelKernel/GeoPcon.h"
#include "GeoModelKernel/GeoTrd.h"
#include "GeoModelKernel/GeoShape.h"
#include "GeoModelKernel/GeoShapeUnion.h"
......@@ -39,12 +40,13 @@
// ***********************************************************************
//
// Construction of passive materials in the LAr EC cryostate.
// Initial implementation consists of the lectronics crates
// Initial implementation consists of the lectronics crates
// copied over from the Barrel DM description.
//
// ***********************************************************************
LArGeo::EndcapDMConstruction::EndcapDMConstruction()
LArGeo::EndcapDMConstruction::EndcapDMConstruction(bool ft) :
m_activateFT(ft)
{
}
......@@ -57,13 +59,13 @@ void LArGeo::EndcapDMConstruction::create(GeoFullPhysVol* envelope)
{
ISvcLocator* svcLocator = Gaudi::svcLocator();
IMessageSvc* msgSvc(0);
if(svcLocator->service("MessageSvc", msgSvc, true)==StatusCode::FAILURE)
if(svcLocator->service("MessageSvc", msgSvc, true)==StatusCode::FAILURE)
throw std::runtime_error("Error in EndcapDMConstruction, cannot access MessageSvc");
MsgStream log(msgSvc, "EndcapDMConstruction");
log << MSG::INFO << "Start building EC electronics geometry" << endreq;
StoreGateSvc* detStore(0);
if(svcLocator->service("DetectorStore", detStore, false)==StatusCode::FAILURE)
if(svcLocator->service("DetectorStore", detStore, false)==StatusCode::FAILURE)
throw std::runtime_error("Error in EndcapDMConstruction, cannot access DetectorStore");
IGeoModelSvc* geoModel(0);
......@@ -76,7 +78,7 @@ void LArGeo::EndcapDMConstruction::create(GeoFullPhysVol* envelope)
DecodeVersionKey keyLAr(geoModel, "LAr");
DataHandle<StoredMaterialManager> materialManager;
if(StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS")))
if(StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS")))
throw std::runtime_error("Error in EndcapDMConstruction, stored MaterialManager is not found");
IRDBRecordset_ptr LArEndcapCrate = rdbAccess->getRecordsetPtr("LArEndcapCrate",keyLAr.tag(),keyLAr.node());
......@@ -157,29 +159,45 @@ void LArGeo::EndcapDMConstruction::create(GeoFullPhysVol* envelope)
double BoardEytr = (*BarrelDMBoxes)[recordIndex]->getDouble("YTR");
double BoardEztr = (*BarrelDMBoxes)[recordIndex]->getDouble("ZTR");
// For endcap cryostat overwrite some values
// For endcap cryostat overwrite some values
std::map<std::string, unsigned int>::const_iterator it = ecCrateMap.find("Crate1");
if(it!=ecCrateMap.end()) {
recordIndex = ecCrateMap["Crate1"];
double ztrEC = (*LArEndcapCrate)[recordIndex]->getDouble("ZTR");
double xtrEC = (*LArEndcapCrate)[recordIndex]->getDouble("XTR");
/* FEC position sould be corrected in the DB, but we have no time */
if(m_activateFT && ztrEC == -249.05){
ztrEC += 6.;
log << MSG::DEBUG << "FEC position corrected to " << ztrEC
<< " to fit mother volume" << endmsg;
}
crate1ztr = ztrEC;
pedestztr = ztrEC;
BoardEztr = ztrEC;
crate1xtr = xtrEC;
}
it = ecCrateMap.find("Pedest");
if(it!=ecCrateMap.end()) {
recordIndex = ecCrateMap["Pedest"];
pedestxtr = (*LArEndcapCrate)[recordIndex]->getDouble("XTR");
BoardEztr = ztrEC;
if(m_activateFT){
// keep crate at same height as in Barrel - there is no difference
} else {
// keep the old behavoir
double xtrEC = (*LArEndcapCrate)[recordIndex]->getDouble("XTR");
crate1xtr = xtrEC;
}
}
it = ecCrateMap.find("BoardE");
if(it!=ecCrateMap.end()) {
recordIndex = ecCrateMap["BoardE"];
BoardExtr = (*LArEndcapCrate)[recordIndex]->getDouble("XTR");
if(m_activateFT){
// do not move Pedest and BoardE in r - they are also like in the barrel
} else {
// keep the old behavior
it = ecCrateMap.find("Pedest");
if(it!=ecCrateMap.end()) {
recordIndex = ecCrateMap["Pedest"];
pedestxtr = (*LArEndcapCrate)[recordIndex]->getDouble("XTR");
}
it = ecCrateMap.find("BoardE");
if(it!=ecCrateMap.end()) {
recordIndex = ecCrateMap["BoardE"];
BoardExtr = (*LArEndcapCrate)[recordIndex]->getDouble("XTR");
}
}
double epsilon(6.); // Squeeze boxes in EC, as there is not enough room
const double epsilon = m_activateFT? 0.: 6.;
// ----- build pedestal -----
GeoBox *Pedestal = new GeoBox(pedesthlen, pedesthwdt, pedesthhgt-epsilon);
......@@ -235,16 +253,215 @@ void LArGeo::EndcapDMConstruction::create(GeoFullPhysVol* envelope)
envelope->add(boardenvelope);
}
// Build services
IRDBRecordset_ptr EndcapDMTubes = rdbAccess->getRecordsetPtr("LArEndcapDMTubes",keyLAr.tag(),keyLAr.node());
if(EndcapDMTubes->size()) {
GeoMaterial* matECServices = materialManager->getMaterial("LAr::LArECServices");
for(unsigned i(0); i<EndcapDMTubes->size(); ++i) {
GeoTube* endcapTube = new GeoTube((*EndcapDMTubes)[i]->getDouble("RMIN"),(*EndcapDMTubes)[i]->getDouble("RMAX"),(*EndcapDMTubes)[i]->getDouble("DZ"));
GeoLogVol* endcapTubeLv = new GeoLogVol((*EndcapDMTubes)[i]->getString("TUBENAME"),endcapTube,matECServices);
GeoPhysVol* endcapTubePv = new GeoPhysVol(endcapTubeLv);
envelope->add(new GeoTransform(HepGeom::TranslateZ3D((*EndcapDMTubes)[i]->getDouble("ZPOS"))));
envelope->add(endcapTubePv);
if(m_activateFT){
std::string name = "LAr::Endcap::SignalFT::";
log << MSG::INFO << "creating " << name << " volumes" << endmsg;
const GeoMaterial* iron = materialManager->getMaterial("std::Iron");
const double wflange_height = 37.*CLHEP::mm;
const double wflange_R = 0.5*360.*CLHEP::mm;
const GeoMaterial* wflange_mat = materialManager->getMaterial("LAr::FT::WarmFlange");
GeoShape* wflange = new GeoTube(0., wflange_R, wflange_height/2);
GeoLogVol* wflangeLV = new GeoLogVol(name + "WarmFlange", wflange, wflange_mat);
GeoPhysVol* wflangePV = new GeoPhysVol(wflangeLV);
const double bellow_height = 225.*CLHEP::mm;
const double bellow_Router = 0.5*299.*CLHEP::mm; // this also to be cut in warm wall
const double bellow_wall = 15.*CLHEP::mm;
const GeoMaterial* bellow_mat = materialManager->getMaterial("LAr::FT::Bellow");
const double bellow_Rinner = bellow_Router - bellow_wall;
GeoShape* bellow = new GeoTube(bellow_Rinner, bellow_Router, bellow_height/2);
GeoLogVol* bellowLV = new GeoLogVol(name + "Bellow", bellow, bellow_mat);
GeoPhysVol* bellowPV = new GeoPhysVol(bellowLV);
const GeoMaterial* vcables_mat = materialManager->getMaterial("LAr::FT::VacuumCables");
GeoShape* vcables = new GeoTube(0., bellow_Rinner, bellow_height/2);
GeoLogVol* vcablesLV = new GeoLogVol(name + "VacuumCables", vcables, vcables_mat);
GeoPhysVol* vcablesPV = new GeoPhysVol(vcablesLV);
const double cflange_height = 35.*CLHEP::mm;
const double cflange_Router = 0.5*283.*CLHEP::mm;
const GeoMaterial* cflange_mat = materialManager->getMaterial("LAr::FT::ColdFlange");
GeoShape* cflange = new GeoTube(0., cflange_Router, cflange_height/2);
GeoLogVol* cflangeLV = new GeoLogVol(name + "ColdFlange", cflange, cflange_mat);
GeoPhysVol* cflangePV = new GeoPhysVol(cflangeLV);
const double coldbox1_Router = cflange_Router;
const double coldbox1_wall = 0.134*2.54*CLHEP::cm;
const double coldbox1_height = 90.*CLHEP::mm;
const double coldbox2_height = 16.*CLHEP::mm;
const double hole_r = 0.5*133.*CLHEP::mm;
const double hole_shift = -31.*CLHEP::mm;
const double coldbox3_Router = 0.5*140.*CLHEP::mm; // this also to be cut in cold wall
const double coldbox3_height = 220.*CLHEP::mm;
const GeoMaterial* coldbox_mat = iron;
GeoShape* coldbox1 = new GeoTube(coldbox1_Router - coldbox1_wall, coldbox1_Router, coldbox1_height/2); // wide part
GeoShape* coldbox11 = new GeoTube(0., coldbox1_Router, coldbox1_height/2); // wide part for FTenvelope
GeoLogVol* coldbox1LV = new GeoLogVol(name + "ColdBox1", coldbox1, coldbox_mat);
GeoPhysVol* coldbox1PV = new GeoPhysVol(coldbox1LV);
GeoShape* coldbox21 = new GeoTube(0., coldbox1_Router, coldbox2_height/2); // plate
GeoShape* coldbox22 = new GeoTube(0., hole_r, coldbox2_height); // hole in the plate
const GeoShape& coldbox2 = coldbox21->subtract((*coldbox22) << HepGeom::TranslateY3D(hole_shift));
GeoLogVol* coldbox2LV = new GeoLogVol(name + "ColdBox2", &coldbox2, coldbox_mat);
GeoPhysVol* coldbox2PV = new GeoPhysVol(coldbox2LV);
GeoShape* coldbox3 = new GeoTube(hole_r, coldbox3_Router, coldbox3_height/2); // narrow part
GeoShape* coldbox31 = new GeoTube(0., coldbox3_Router, coldbox3_height/2); // narrow part for FTenvelope
GeoLogVol* coldbox3LV = new GeoLogVol(name + "ColdBox3", coldbox3, coldbox_mat);
GeoPhysVol* coldbox3PV = new GeoPhysVol(coldbox3LV);
HepGeom::TranslateZ3D bellow_pos(-wflange_height/2 - bellow_height/2);
HepGeom::TranslateZ3D cflange_pos(-wflange_height/2 - bellow_height - cflange_height/2);
HepGeom::TranslateZ3D coldbox1_pos(-wflange_height/2 - bellow_height - cflange_height - coldbox1_height/2);
HepGeom::TranslateZ3D coldbox2_pos(-wflange_height/2 - bellow_height - cflange_height - coldbox1_height - coldbox2_height/2);
HepGeom::Translate3D coldbox2hole_pos(
0., hole_shift,
-wflange_height/2 - bellow_height - cflange_height - coldbox1_height - coldbox2_height/2
);
HepGeom::Translate3D coldbox3_pos(
0., hole_shift,
-wflange_height/2 - bellow_height - cflange_height - coldbox1_height - coldbox2_height - coldbox3_height/2
);
const GeoShape& FTenvelope = wflange->add(
(*bellow) << bellow_pos
).add(
(*cflange) << cflange_pos
).add(
(*coldbox11) << coldbox1_pos
).add(
(*coldbox21) << coldbox2_pos
).add(
(*coldbox31) << coldbox3_pos
);
GeoLogVol* FTLV = new GeoLogVol(name + "Envelope",
&FTenvelope,
materialManager->getMaterial("std::Air")
);
GeoPhysVol* FTPV = new GeoPhysVol(FTLV);
FTPV->add(wflangePV);
GeoTransform *bellow_trf = new GeoTransform(bellow_pos);
FTPV->add(bellow_trf);
FTPV->add(bellowPV);
FTPV->add(bellow_trf);
FTPV->add(vcablesPV);
GeoTransform *cflange_trf = new GeoTransform(cflange_pos);
FTPV->add(cflange_trf);
FTPV->add(cflangePV);
GeoTransform *coldbox1_trf = new GeoTransform(coldbox1_pos);
FTPV->add(coldbox1_trf);
FTPV->add(coldbox1PV);
GeoTransform *coldbox2_trf = new GeoTransform(coldbox2_pos);
FTPV->add(coldbox2_trf);
FTPV->add(coldbox2PV);
GeoTransform *coldbox3_trf = new GeoTransform(coldbox3_pos);
FTPV->add(coldbox3_trf);
FTPV->add(coldbox3PV);
const GeoMaterial* lar_mat = materialManager->getMaterial("std::LiquidArgon");
GeoShape* lar1 = new GeoTube(0., coldbox1_Router - coldbox1_wall, coldbox1_height/2);
GeoShape* lar2 = new GeoTube(0., hole_r, coldbox1_height);
const GeoShape& lar = lar1->subtract((*lar2) << HepGeom::TranslateY3D(hole_shift));
GeoLogVol* larLV = new GeoLogVol(name + "LAr", &lar, lar_mat);
GeoPhysVol* larPV = new GeoPhysVol(larLV);
FTPV->add(coldbox1_trf);
FTPV->add(larPV);
const GeoMaterial *pigtail_mat = materialManager->getMaterial("LAr::FT::Pigtail");
const double pth = (coldbox1_height + coldbox2_height + coldbox3_height) / 2;
GeoTransform *pigtail_trf = new GeoTransform(
HepGeom::Translate3D(0, hole_shift,
-wflange_height/2 - bellow_height - cflange_height - pth
));
GeoShape* pigtail = new GeoTube(0., hole_r, pth);
GeoLogVol* pigtailLV = new GeoLogVol(name + "Pigtails", pigtail, pigtail_mat);
GeoPhysVol* pigtailPV = new GeoPhysVol(pigtailLV);
FTPV->add(pigtail_trf);
FTPV->add(pigtailPV);
// total lenght should be 28.5 cm
const double ocable_len = 10.*CLHEP::cm;
const double ocable_R = (1.1/2)*sqrt(1920*2.85)*CLHEP::mm;
const GeoMaterial* ocable_mat = materialManager->getMaterial("LAr::FT::Cable");
GeoShape* ocable = new GeoTube(0., ocable_R, ocable_len / 2);
GeoLogVol* ocableLV = new GeoLogVol("LAr::Endcap::FTCables", ocable, ocable_mat);
GeoPhysVol* ocablePV = new GeoPhysVol(ocableLV);
const double chimney_height = 277.*CLHEP::mm;
const double chimney_wall = 5.*CLHEP::mm;
const double chimney_Router = 0.5*351.*CLHEP::mm;
const GeoMaterial* chimney_mat = iron;
GeoShape* chimney1 = new GeoTube(chimney_Router - chimney_wall, chimney_Router, chimney_height/2);
const double ch_lowring_h = 30.*CLHEP::mm;
const double ch_lowring_r = 20.*CLHEP::mm;
GeoShape* chimney2 = new GeoTube(chimney_Router, chimney_Router + ch_lowring_r, ch_lowring_h/2);
const double ch_upring_r = 5.*CLHEP::mm;
const double ch_upring_h = 20.*CLHEP::mm;
GeoShape* chimney3 = new GeoTube(bellow_Router, chimney_Router + ch_upring_r, ch_upring_h/2);
const GeoShape& chimney = chimney1->add(
(*chimney2) << HepGeom::TranslateZ3D(-chimney_height/2 + ch_lowring_h/2)
).add(
(*chimney3) << HepGeom::TranslateZ3D(chimney_height/2 - ch_upring_h/2)
);
GeoLogVol* chimneyLV = new GeoLogVol("LAr::Endcap::FTChimney", &chimney, chimney_mat);
GeoPhysVol* chimneyPV = new GeoPhysVol(chimneyLV);
// todo: take cryostat parameters from DB
const double cryo_Router = 2475.*CLHEP::mm; // cryo warm wall outer radius
const double z_pos = -(472 - 412 + 247)*CLHEP::mm;
const double r0 = cryo_Router + chimney_height + wflange_height/2;
const double r1 = cryo_Router + chimney_height/2;
const double r2 = cryo_Router + chimney_height + wflange_height + ocable_len/2;
auto put1 = [&envelope, z_pos](GeoPhysVol *object, double r, double phi)
{
envelope->add(new GeoTransform(
HepGeom::Translate3D(r*cos(phi), r*sin(phi), z_pos) *
HepGeom::RotateX3D(90.*CLHEP::deg) *
HepGeom::RotateY3D(phi + 90.*CLHEP::deg)
));
envelope->add(object);
};
auto put = [&put1, &FTPV, &chimneyPV, &ocablePV, r0, r1, r2](double phi)
{
put1(FTPV, r0, phi);
put1(chimneyPV, r1, phi);
put1(ocablePV, r2, phi);
};
const double dphi = 5.*CLHEP::deg;
for(unsigned int i{0}; i < LArEndcapCratePhiPos->size(); ++ i){
const int num = (*LArEndcapCratePhiPos)[i]->getInt("CRATENUM");
const double phi = (*LArEndcapCratePhiPos)[i]->getDouble("PHIPOS")*CLHEP::deg;
if(num == 10){ // the topmost crate has one FT, positioned assymetrically
put(phi + dphi);
} else {
put(phi - dphi);
put(phi + dphi);
}
}
} else { // No FTs, old LArServices variant
/*
S.M. Feb 2020: these services are located between FEC and TileFingers.
In this area is mostly air and a few cables. It was
probably intended to go below the FEC
*/
IRDBRecordset_ptr EndcapDMTubes = rdbAccess->getRecordsetPtr("LArEndcapDMTubes",keyLAr.tag(),keyLAr.node());
if(EndcapDMTubes->size()) {
const GeoMaterial* matECServices = materialManager->getMaterial("LAr::LArECServices");
for(unsigned i(0); i<EndcapDMTubes->size(); ++i) {
GeoTube* endcapTube = new GeoTube((*EndcapDMTubes)[i]->getDouble("RMIN"),(*EndcapDMTubes)[i]->getDouble("RMAX"),(*EndcapDMTubes)[i]->getDouble("DZ"));
GeoLogVol* endcapTubeLv = new GeoLogVol((*EndcapDMTubes)[i]->getString("TUBENAME"),endcapTube,matECServices);
GeoPhysVol* endcapTubePv = new GeoPhysVol(endcapTubeLv);
envelope->add(new GeoTransform(HepGeom::TranslateZ3D((*EndcapDMTubes)[i]->getDouble("ZPOS"))));
envelope->add(endcapTubePv);
}
}
}
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef __EndcapDMConstruction_H__
......@@ -12,7 +12,7 @@ namespace LArGeo {
class EndcapDMConstruction
{
public:
EndcapDMConstruction();
EndcapDMConstruction(bool);
~EndcapDMConstruction();
void create(GeoFullPhysVol* envelope);
......@@ -20,6 +20,8 @@ namespace LArGeo {
private:
EndcapDMConstruction(const EndcapDMConstruction&);
EndcapDMConstruction& operator=(const EndcapDMConstruction&);
bool m_activateFT;
};
}
......
21.0.111.1
\ No newline at end of file
21.0.112.1
\ No newline at end of file
......@@ -218,7 +218,6 @@
+ LArCalorimeter/LArG4/LArG4RunControl
+ LArCalorimeter/LArG4/LArG4SD
+ LArCalorimeter/LArG4/LArG4ShowerLib
+ LArCalorimeter/LArG4/LArG4ShowerLibData
+ LArCalorimeter/LArG4/LArG4ShowerLibSvc
+ LArCalorimeter/LArGeoModel/LArGeoAlgsNV
+ LArCalorimeter/LArGeoModel/LArGeoBarrel
......
21.0.112
\ No newline at end of file
21.0.113
\ No newline at end of file
......@@ -17,7 +17,7 @@ StatusCode TruthElectronHistograms::initializePlots() {
histoMap["deltaPhiRescaled2"] = new TH1D(Form("%s_%s",m_name.c_str(),"deltaPhiRescaled2"), ";deltaPhi2; Events", 20, -0.04, 0.04);
histoMap["d0Oversigmad0"] = new TH1D(Form("%s_%s",m_name.c_str(),"d0Oversigmad0"), "; d0Oversigmad0; Events", 20, -10, 10);
histoMap["qOverp_resolution"] = new TH1D(Form("%s_%s",m_name.c_str(),"qOverp_resolution"), ";(q/P reco - q/P truth)/ q/p truth; Events", 20, -2, 2);
histoMap["qOverp_resolution"] = new TH1D(Form("%s_%s",m_name.c_str(),"qOverp_resolution"), ";(q/P reco - q/P truth)/ q/p truth; Events", 60, -1, 1.5);
ATH_CHECK(m_rootHistSvc->regHist(m_folder+"deltaPhi2", histoMap["deltaPhi2"]));
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from AthenaCommon import CfgMgr
from AthenaCommon.SystemOfUnits import *
......@@ -89,11 +89,18 @@ def getIDETEnvelope(name="IDET", **kwargs):
return CfgMgr.CylindricalEnvelope(name, **kwargs)
def getCALOEnvelope(name="CALO", **kwargs):
from LArGeoAlgsNV.LArGeoAlgsNVConf import LArDetectorToolNV
calolim = 6735.
try:
if LArDetectorToolNV.ActivateFeedThrougs:
calolim = 6747.
except AttributeError:
pass
kwargs.setdefault("DetectorName", "CALO")
nSurfaces = 18
innerRadii = [41.,41.,41.,41.,41.,41.,120.,120.,1148.,1148.,120.,120.,41.,41.,41.,41.,41.,41.] #FIXME Units?
outerRadii = [415.,415,3795.,3795.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,3795.,3795.,415.,415.] #FIXME Units?
zSurfaces = [-6781.,-6735.,-6735.,-6530.,-6530.,-4587.,-4587.,-3475.,-3475.,3475.,3475.,4587.,4587.,6530.,6530.,6735.,6735.,6781.] #FIXME Units?
zSurfaces = [-6781.,-calolim,-calolim,-6530.,-6530.,-4587.,-4587.,-3475.,-3475.,3475.,3475.,4587.,4587.,6530.,6530.,calolim,calolim,6781.] #FIXME Units?
from AthenaCommon.DetFlags import DetFlags
if hasattr(DetFlags.simulate, 'HGTD_on') and DetFlags.simulate.HGTD_on():
nSurfaces = 22
......@@ -132,11 +139,18 @@ def getForwardRegionEnvelope(name='ForwardRegion', **kwargs):
return CfgMgr.GeoDetectorTool(name, **kwargs) ##FIXME Should this really be a GeoDetectorTool???
def getMUONEnvelope(name="MUONQ02", **kwargs): #FIXME rename to MUON when safe
from LArGeoAlgsNV.LArGeoAlgsNVConf import LArDetectorToolNV
calolim = 6736.
try:
if LArDetectorToolNV.ActivateFeedThrougs:
calolim = 6748.
except AttributeError:
pass
kwargs.setdefault("DetectorName", "MUONQ02") #FIXME rename to MUON when safe
kwargs.setdefault("NSurfaces", 34)
kwargs.setdefault("InnerRadii", [1050.,1050.,1050.,1050.,436.7,436.7,279.,279.,70.,70.,420.,420.,3800.,3800.,4255.,4255.,4255.,4255.,4255.,4255.,3800.,3800.,420.,420.,70.,70.,279.,279.,436.7,436.7,1050.,1050.,1050.,1050.]) #FIXME Units?
kwargs.setdefault("OuterRadii", [1500.,1500.,2750.,2750.,12650.,12650.,13400.,13400.,14200.,14200.,14200.,14200.,14200.,14200.,14200.,14200.,13000.,13000.,14200.,14200.,14200.,14200.,14200.,14200.,14200.,14200.,13400.,13400.,12650.,12650.,2750.,2750.,1500.,1500.]) #FIXME Units?
kwargs.setdefault("ZSurfaces", [-26046.,-23001.,-23001.,-22030.,-22030.,-18650.,-18650.,-12900.,-12900.,-6783.,-6783.,-6736.,-6736.,-6550.,-6550.,-4000.,-4000.,4000.,4000.,6550.,6550.,6736.,6736.,6783.,6783.,12900.,12900.,18650.,18650.,22030.,22030.,23001.,23001.,26046.]) #FIXME Units?
kwargs.setdefault("ZSurfaces", [-26046.,-23001.,-23001.,-22030.,-22030.,-18650.,-18650.,-12900.,-12900.,-6783.,-6783.,-calolim,-calolim,-6550.,-6550.,-4000.,-4000.,4000.,4000.,6550.,6550.,calolim,calolim,6783.,6783.,12900.,12900.,18650.,18650.,22030.,22030.,23001.,23001.,26046.]) #FIXME Units?
SubDetectorList=[]
from AthenaCommon.DetFlags import DetFlags
if DetFlags.geometry.Muon_on():
......
......@@ -29,6 +29,7 @@ find_package( XercesC )
# Component(s) in the package:
atlas_add_library( G4DebuggingHelperLib
src/G4DebuggingHelper.cxx
PUBLIC_HEADERS G4DebuggingTools
INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
LINK_LIBRARIES ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} )
......