From f45bd99e6e2c65a177bb2b5ef2bdc229de0d3d41 Mon Sep 17 00:00:00 2001 From: Vakhtang Tsulaia <Vakhtang.Tsulaia@cern.ch> Date: Fri, 15 Jun 2012 18:00:19 +0200 Subject: [PATCH] Migrate to CLHEP v21. OBO John Chapman (LArGeoH6Cryostats-00-00-11) --- .../LArGeoH6Cryostats/BPCConstruction.h | 47 +++ .../H6CryostatConstruction.h | 49 +++ .../LArGeoH6Cryostats/MWPCConstruction.h | 48 +++ .../LArGeoH6Cryostats/WallsConstruction.h | 46 +++ .../LArGeoH6Cryostats/cmt/requirements | 26 ++ .../LArGeoH6Cryostats/doc/MainPage.h | 19 + .../LArGeoH6Cryostats/src/BPCConstruction.cxx | 372 ++++++++++++++++++ .../src/H6CryostatConstruction.cxx | 201 ++++++++++ .../src/MWPCConstruction.cxx | 311 +++++++++++++++ .../src/WallsConstruction.cxx | 340 ++++++++++++++++ 10 files changed, 1459 insertions(+) create mode 100755 LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/LArGeoH6Cryostats/BPCConstruction.h create mode 100755 LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/LArGeoH6Cryostats/H6CryostatConstruction.h create mode 100755 LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/LArGeoH6Cryostats/MWPCConstruction.h create mode 100755 LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/LArGeoH6Cryostats/WallsConstruction.h create mode 100755 LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/cmt/requirements create mode 100644 LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/doc/MainPage.h create mode 100755 LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/src/BPCConstruction.cxx create mode 100755 LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/src/H6CryostatConstruction.cxx create mode 100755 LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/src/MWPCConstruction.cxx create mode 100755 LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/src/WallsConstruction.cxx diff --git a/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/LArGeoH6Cryostats/BPCConstruction.h b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/LArGeoH6Cryostats/BPCConstruction.h new file mode 100755 index 00000000000..c002e7d9f31 --- /dev/null +++ b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/LArGeoH6Cryostats/BPCConstruction.h @@ -0,0 +1,47 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// BPCConstruction +// Return an envelope that contains the LAr Beam Instrumentation. +// adopted from BPCConstruction +// Pavol S. May-2007 + +#ifndef __BPCConstruction_H__ +#define __BPCConstruction_H__ + +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoFullPhysVol.h" + +class IRDBAccessSvc; +class IGeoModelSvc; +class MsgStream; + +namespace LArGeo { + + class BPCConstruction + { + public: + + BPCConstruction(bool old = false); + + virtual ~BPCConstruction(); + + virtual GeoVPhysVol* GetEnvelope(); + + + + private: + + bool m_oldType; + + GeoPhysVol *m_BPCPhysical; + + IGeoModelSvc *m_geoModelSvc; + MsgStream *m_msg; + + }; + +} // namespace LArGeo + +#endif // __BPCConstruction_H__ diff --git a/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/LArGeoH6Cryostats/H6CryostatConstruction.h b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/LArGeoH6Cryostats/H6CryostatConstruction.h new file mode 100755 index 00000000000..eab4ffa7f6e --- /dev/null +++ b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/LArGeoH6Cryostats/H6CryostatConstruction.h @@ -0,0 +1,49 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// H6CryostatConstruction +// Return an envelope that contains the H6 LAr Cryostat. +// Should be common to H62002, H62003, H62004 +// Feb-2006 JP Archambault, Mohsen Khakzad + +#ifndef __H6CryostatConstruction_H__ +#define __H6CryostatConstruction_H__ + +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +#include "GeoModelKernel/GeoVFullPhysVol.h" + +class IRDBAccessSvc; +class IGeoModelSvc; + +namespace LArGeo { + + class H6CryostatConstruction + { + public: + + H6CryostatConstruction(); + virtual ~H6CryostatConstruction(); + + // Get the envelope containing this detector. + virtual GeoVFullPhysVol* GetEnvelope(); + GeoPhysVol* GetLArPhysical(); + + + private: + + //GeoFullPhysVol* createEnvelope(); + + GeoPhysVol *cryoEnvelopePhysical; + GeoFullPhysVol *cryoMotherPhysical; + GeoPhysVol *cryoLArPhys; + + IRDBAccessSvc *pAccessSvc; + IGeoModelSvc *geoModelSvc; + + }; + +} // namespace LArGeo + +#endif // __H6CryostatConstruction_H__ diff --git a/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/LArGeoH6Cryostats/MWPCConstruction.h b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/LArGeoH6Cryostats/MWPCConstruction.h new file mode 100755 index 00000000000..324b86fd131 --- /dev/null +++ b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/LArGeoH6Cryostats/MWPCConstruction.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// MWPCConstruction +// Return an envelope that contains the LAr Beam Instrumentation. +// Apr-2006 mgf + +#ifndef __MWPCConstruction_H__ +#define __MWPCConstruction_H__ + +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoFullPhysVol.h" + +class IRDBAccessSvc; +class IGeoModelSvc; +class MsgStream; + +namespace LArGeo { + + class MWPCConstruction + { + public: + + MWPCConstruction(double Step = 1.*CLHEP::mm); + + virtual ~MWPCConstruction(); + + virtual GeoVPhysVol* GetEnvelope(); + + MsgStream *msg; + + + private: + + double wireStep; + + GeoPhysVol *MWPCPhysical; + + + IRDBAccessSvc *pAccessSvc; + IGeoModelSvc *geoModelSvc; + + }; + +} // namespace LArGeo + +#endif // __MWPCConstruction_H__ diff --git a/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/LArGeoH6Cryostats/WallsConstruction.h b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/LArGeoH6Cryostats/WallsConstruction.h new file mode 100755 index 00000000000..250ec9adfe1 --- /dev/null +++ b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/LArGeoH6Cryostats/WallsConstruction.h @@ -0,0 +1,46 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// Construction of the walls in front of the H1 Cryostat +// +// March 2007 M.Fincke + +#ifndef __WallsConstruction_H__ +#define __WallsConstruction_H__ + +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +class IRDBAccessSvc; +class IGeoModelSvc; +class MsgStream; + +namespace LArGeo { + + class WallsConstruction + { + public: + + WallsConstruction(); + virtual ~WallsConstruction(); + + // Get the envelope containing this detector: + virtual GeoVPhysVol* GetEnvelope(); + + MsgStream *msg; + + + private: + + + GeoPhysVol *WallsPhysical; + + + IRDBAccessSvc *pAccessSvc; + IGeoModelSvc *geoModelSvc; + + }; + +} // namespace LArGeo + +#endif // __WallsConstruction_H__ diff --git a/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/cmt/requirements b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/cmt/requirements new file mode 100755 index 00000000000..a358882a5dd --- /dev/null +++ b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/cmt/requirements @@ -0,0 +1,26 @@ +package LArGeoH6Cryostats + +author Joe Boudreau <boudreau@pitt.edu> +author Mohsen Khakzad <mohsen@physics.carleton.ca> +author J.P. Archambault <jparcham@physics.carleton.ca> + +use AtlasPolicy AtlasPolicy-* +use GeoModelKernel GeoModelKernel-* DetectorDescription/GeoModel + +library LArGeoH6Cryostats *.cxx +apply_pattern installed_library + +# The following line would copy the contents of LArGeoAlgs/share to +# the user's run/ directory. Since there is no LArGeoAlgs/share +# directory (yet), let's save a bit of time and comment out this line. + +# apply_pattern declare_runtime + +#macro LArGeoH6Cryostats_cppflags "-g -O0" + +private +use GaudiInterface GaudiInterface-* External +use AtlasCLHEP AtlasCLHEP-* External +use StoreGate StoreGate-* Control +use RDBAccessSvc RDBAccessSvc-* Database/AthenaPOOL +use GeoModelInterfaces GeoModelInterfaces-* DetectorDescription/GeoModel \ No newline at end of file diff --git a/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/doc/MainPage.h b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/doc/MainPage.h new file mode 100644 index 00000000000..99603b9b198 --- /dev/null +++ b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/doc/MainPage.h @@ -0,0 +1,19 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/** + + +@mainpage + +This package GeoModel description of the H6 Test Beam setup cryostat. + +-------------------------------- + REQUIREMENTS +-------------------------------- + +@include requirements +@htmlinclude used_packages.html + +*/ diff --git a/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/src/BPCConstruction.cxx b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/src/BPCConstruction.cxx new file mode 100755 index 00000000000..b6570ce0da6 --- /dev/null +++ b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/src/BPCConstruction.cxx @@ -0,0 +1,372 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// This will construct a generic BPC for the H6 beamline that leads to the H1 cryostat. +// There are two kinds of BPCs - old and new one +#include "LArGeoH6Cryostats/BPCConstruction.h" + +#include "GeoModelKernel/GeoElement.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +#include "GeoModelKernel/GeoVFullPhysVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoVPhysVol.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoTubs.h" +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoSerialDenominator.h" +#include "GeoModelKernel/GeoSerialIdentifier.h" +#include "GeoModelKernel/GeoSerialTransformer.h" +#include "GeoModelKernel/GeoAlignableTransform.h" +#include "GeoModelKernel/GeoIdentifierTag.h" +#include "GeoModelKernel/GeoSerialDenominator.h" +#include "StoreGate/StoreGateSvc.h" +#include "StoreGate/DataHandle.h" +#include "GeoModelInterfaces/AbsMaterialManager.h" +#include "GeoModelInterfaces/StoredMaterialManager.h" +#include "GeoModelKernel/GeoShapeUnion.h" +#include "GeoModelKernel/GeoShapeShift.h" + +// For transforms: +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/GenericFunctions/Variable.hh" +// For units: +#include "CLHEP/Units/PhysicalConstants.h" + +// For the database: +#include "RDBAccessSvc/IRDBAccessSvc.h" +#include "RDBAccessSvc/IRDBRecord.h" +#include "RDBAccessSvc/IRDBRecordset.h" + +#include "GeoModelInterfaces/IGeoModelSvc.h" + +#include "StoreGate/StoreGateSvc.h" +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/Bootstrap.h" + +#include <string> +#include <cmath> +#include <iostream> + +LArGeo::BPCConstruction::BPCConstruction(bool old) + :m_BPCPhysical(0), + m_geoModelSvc(0), + m_msg(0) +{ + m_oldType = old; +} + + +LArGeo::BPCConstruction::~BPCConstruction() +{ +} + + + +GeoVPhysVol* LArGeo::BPCConstruction::GetEnvelope() +{ + + if (m_BPCPhysical) return m_BPCPhysical; + + // Message service: + ISvcLocator *svcLocator = Gaudi::svcLocator(); + IMessageSvc * m_msgSvc; + StatusCode status = svcLocator->service("MessageSvc", m_msgSvc); + + if(!status.isFailure()){ + m_msg = new MsgStream(m_msgSvc, "BPCConstruction"); + } else { + throw std::runtime_error("BPCConstruction: cannot initialze message service"); + } + + (*m_msg) << MSG::INFO << "BPCConstruction - creating an BPC oldType: " << m_oldType << " ! " << endreq; + + + + StoreGateSvc *detStore; + if (svcLocator->service("DetectorStore", detStore, false )==StatusCode::FAILURE) { + throw std::runtime_error("Error in BPCConstruction, cannot access DetectorStore"); + } + + + StatusCode sc; + + IGeoModelSvc *m_geoModelSvc; + sc = svcLocator->service ("GeoModelSvc",m_geoModelSvc); + if (sc != StatusCode::SUCCESS) { + throw std::runtime_error ("Cannot locate m_geoModelSvc!!"); + } + + + + // Get the materials from the material manager:-----------------------------------------------------// + // // + + DataHandle<StoredMaterialManager> materialManager; + if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) return NULL; + + std::string name; + double density; + GeoElement* W=materialManager->getElement("Wolfram"); + GeoMaterial* Tungsten = new GeoMaterial(name="Tungsten", density=19.3*CLHEP::g/CLHEP::cm3); + Tungsten->add(W,1.); + Tungsten->lock(); + + + GeoElement* Ar=materialManager->getElement("Argon"); + GeoElement* C=materialManager->getElement("Carbon"); + GeoElement* O=materialManager->getElement("Oxygen"); + GeoElement* H=materialManager->getElement("Hydrogen"); + GeoElement* Al=materialManager->getElement("Aluminium"); + GeoMaterial* CO2 = new GeoMaterial(name="CO2", density=1.84E-03*CLHEP::g/CLHEP::cm3); + CO2->add(C,0.273); + CO2->add(O,0.727); + CO2->lock(); + GeoMaterial* ArCO2_1 = new GeoMaterial(name="ArCO2_1", density=(0.8*1.782e-03 + 0.2*1.84E-03)*CLHEP::g/CLHEP::cm3); + ArCO2_1->add(Ar,0.8); + ArCO2_1->add(CO2,0.2); + ArCO2_1->lock(); + GeoMaterial* ArCO2_2 = new GeoMaterial(name="ArCO2_2", density=(0.9*1.782e-03 + 0.1*1.84E-03)*CLHEP::g/CLHEP::cm3); + ArCO2_2->add(Ar,0.9); + ArCO2_2->add(CO2,0.1); + ArCO2_2->lock(); + // AlMylar AlC5H4O2 ?????? + density = 1.39*CLHEP::g/CLHEP::cm3; + GeoMaterial* AlMylar=new GeoMaterial(name="AlMylar",density=1.39*CLHEP::g/CLHEP::cm3); + AlMylar->add(C,0.487980); + AlMylar->add(O,0.260014); + AlMylar->add(H,0.032761); + AlMylar->add(Al,0.219245); + AlMylar->lock(); + + GeoMaterial *Air = materialManager->getMaterial("std::Air"); + if (!Air) throw std::runtime_error("Error in BPCConstruction, std::Air is not found."); + + GeoMaterial *Aluminium = materialManager->getMaterial("std::Aluminium"); + if (!Aluminium) throw std::runtime_error("Error in BPCConstruction, std::Aluminium is not found."); + + GeoMaterial *Mylar = materialManager->getMaterial("std::Mylar"); + if (!Mylar) throw std::runtime_error("Error in BPCConstruction, std::Mylar is not found."); + + + //-------------------------------------------------------------------------------------------------// + + + + std::string AtlasVersion = m_geoModelSvc->atlasVersion(); + std::string LArVersion = m_geoModelSvc->LAr_VersionOverride(); + + std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion; + std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr"; + + + ////////////////////////////////////////////////////////////////// + // Define geometry + ////////////////////////////////////////////////////////////////// + double bpc_x = 15.0*CLHEP::cm; + double bpc_y = 15.0*CLHEP::cm; + double bpc_z = (8.684/2)*CLHEP::cm; + double bpc_send = (1.14/2)*CLHEP::cm; + double bpc_sen = (1.06)*CLHEP::cm; + double bpc_div = 5.06*CLHEP::mm; + //double bpc_space = 2.6*CLHEP::mm; + double bpc_ml = 0.0010*CLHEP::cm; + double bpc_alml = 0.0012*CLHEP::cm; + double bpc_frame = 12.1*CLHEP::mm; + double bpc_alframe = 8.*CLHEP::mm; + double bpc_step = 0.6*CLHEP::cm; + double bpc_cstep = 0.3*CLHEP::cm; + double bpc_wd = 0.0020*CLHEP::cm; + double bpc_cwd = 0.0100*CLHEP::cm; + + double bpc_old_x = 12.0*CLHEP::cm; + double bpc_old_y = 12.0*CLHEP::cm; + double bpc_old_z = (5.100/2)*CLHEP::cm; + double bpc_old_div = 7.6*CLHEP::mm; + double bpc_old_alml = 0.0020*CLHEP::cm; + double bpc_old_ml = 0.0050*CLHEP::cm; + double bpc_old_frame = 10.*CLHEP::mm; + double bpc_old_alframe = 2.*CLHEP::mm; + double bpc_old_alframe1 = 12.*CLHEP::mm; + double bpc_old_send = (1.7/2)*CLHEP::cm; + double bpc_old_sen = 0.5*CLHEP::cm; + double bpc_old_space = 1.*CLHEP::mm; + double bpc_old_step = 0.6*CLHEP::cm; + double bpc_old_cstep = 0.3*CLHEP::cm; + + + // Here we creat the envelope for the Moveable FrontBeam Instrumentation. This code is repeated + // createEnvelope() method below. There should be a way to avoid this repitition. + + + //------ Now create a BPC + + (*m_msg) << MSG::INFO <<" Create BPC " << endreq; + + std::string BPCName; + if(m_oldType) BPCName = "LAr::TB::BPCOLD"; else BPCName = "LAr::TB::BPC"; + + // This creates a square chamber: + GeoBox* shape_bpc; + if(m_oldType) shape_bpc = new GeoBox(bpc_old_x, bpc_old_y, bpc_old_z); + else shape_bpc = new GeoBox(bpc_x, bpc_y, bpc_z); + GeoLogVol* log_bpc; + if(m_oldType) log_bpc = new GeoLogVol(BPCName, shape_bpc, ArCO2_2); + else log_bpc = new GeoLogVol(BPCName, shape_bpc, ArCO2_1); + m_BPCPhysical = new GeoPhysVol(log_bpc); + + // AlMylar wall inside BPS + GeoBox* shape_bpc_almylar; + if(m_oldType) shape_bpc_almylar = new GeoBox(bpc_old_x, bpc_old_y, bpc_old_alml); + else shape_bpc_almylar = new GeoBox(bpc_x, bpc_y, bpc_alml); + GeoLogVol* log_bpc_almylar = new GeoLogVol(BPCName + "::bpcalmylar",shape_bpc_almylar, AlMylar); + GeoPhysVol* phys_bpc_almylar = new GeoPhysVol(log_bpc_almylar); + for(int i = 0; i < 2; i ++){ + double mylar_pos; + if(m_oldType) { + if(i == 0) mylar_pos = bpc_old_z - bpc_old_alml; + if(i == 1) mylar_pos = bpc_old_alml - bpc_old_z; + } else { + if(i == 0) mylar_pos = bpc_z - bpc_alml; + if(i == 1) mylar_pos = bpc_alml - bpc_z; + } + m_BPCPhysical->add( new GeoIdentifierTag( i ) ); + m_BPCPhysical->add( new GeoTransform( HepGeom::Translate3D(0., 0., mylar_pos) ) ); + m_BPCPhysical->add( phys_bpc_almylar ); + } + + // Mylar wall inside BPC + GeoBox* shape_bpc_mylar; + if(m_oldType) shape_bpc_mylar = new GeoBox(bpc_old_x, bpc_old_y, bpc_old_ml); + else shape_bpc_mylar = new GeoBox(bpc_x, bpc_y, bpc_ml); + GeoLogVol* log_bpc_mylar = new GeoLogVol(BPCName + "::bpc_mylar", shape_bpc_mylar, Mylar); + GeoPhysVol* phys_bpc_mylar = new GeoPhysVol(log_bpc_mylar); + for(int i = 0; i < 2; ++i){ + double mylar_pos; + if(m_oldType) { +// if(i == 0) mylar_pos = bpc_old_z - bpc_old_frame - bpc_old_alframe - bpc_old_ml/2.; +// if(i == 1) mylar_pos = - bpc_old_z + bpc_old_ml/2. + bpc_old_frame + bpc_old_alframe1; + if(i == 0) mylar_pos = bpc_old_z - bpc_old_frame - bpc_old_alframe - bpc_old_ml + bpc_old_space; + if(i == 1) mylar_pos = - bpc_old_z + bpc_old_ml + bpc_old_frame + bpc_old_alframe1 - bpc_old_space; + } else { + if(i == 0) mylar_pos = bpc_z - bpc_frame - bpc_alframe - bpc_alml; + if(i == 1) mylar_pos = bpc_alml - bpc_z + bpc_frame + bpc_alframe; + } + m_BPCPhysical->add( new GeoIdentifierTag( i ) ); + m_BPCPhysical->add( new GeoTransform( HepGeom::Translate3D(0., 0., mylar_pos) ) ); + m_BPCPhysical->add( phys_bpc_mylar ); + } + + + // X sensitive plane (old has only one sensitive plane, so we choose X) + GeoBox* shape_bpc_xplane; + if(m_oldType) shape_bpc_xplane = new GeoBox(bpc_old_x, bpc_old_y, bpc_old_send); + else shape_bpc_xplane = new GeoBox(bpc_x, bpc_y, bpc_send); + GeoLogVol* log_bpc_xplane; + if(m_oldType) log_bpc_xplane = new GeoLogVol(BPCName + "::bpco_plane", shape_bpc_xplane, ArCO2_2); + else log_bpc_xplane = new GeoLogVol(BPCName + "::bpc_xplane", shape_bpc_xplane, ArCO2_1); + GeoPhysVol* phys_bpc_xplane = new GeoPhysVol(log_bpc_xplane); + m_BPCPhysical->add( new GeoIdentifierTag( 0 ) ); + if(m_oldType) m_BPCPhysical->add( new GeoTransform( HepGeom::Translate3D(0., 0., bpc_old_sen) ) ); + else m_BPCPhysical->add( new GeoTransform( HepGeom::Translate3D(0., 0., -bpc_sen-bpc_send) ) ); + m_BPCPhysical->add(phys_bpc_xplane); + + // division of X plane + int Ndiv; + if(m_oldType) Ndiv = int(2.0*bpc_old_x/bpc_old_step); + else Ndiv = int(2.0*bpc_x/bpc_step); + GeoBox* shape_bpc_xdiv; + if(m_oldType) shape_bpc_xdiv = new GeoBox(bpc_old_step/2., bpc_old_y, bpc_old_div); + else shape_bpc_xdiv = new GeoBox(bpc_step/2., bpc_y, bpc_div); + GeoLogVol* log_bpc_xdiv; + if(m_oldType) log_bpc_xdiv = new GeoLogVol(BPCName + "::bpco_div", shape_bpc_xdiv, ArCO2_2); + else log_bpc_xdiv = new GeoLogVol(BPCName + "::bpc_xdiv", shape_bpc_xdiv, ArCO2_1); + GeoPhysVol* phys_bpc_xdiv = new GeoPhysVol(log_bpc_xdiv); + Genfun::Variable Index; + GeoXF::TRANSFUNCTION TXO = GeoXF::Pow(HepGeom::TranslateX3D(1.0), -bpc_old_x+(2*Index+1)*bpc_old_step/2.); + GeoXF::TRANSFUNCTION TX = GeoXF::Pow(HepGeom::TranslateX3D(1.0), -bpc_x+(2*Index+1)*bpc_step/2.); + phys_bpc_xplane->add( new GeoSerialIdentifier(0) ); + if(m_oldType) phys_bpc_xplane->add( new GeoSerialTransformer(phys_bpc_xdiv, &TXO, Ndiv ) ); + else phys_bpc_xplane->add( new GeoSerialTransformer(phys_bpc_xdiv, &TX, Ndiv ) ); + + // Y sensitive plane + GeoPhysVol* phys_bpc_yplane = 0; + GeoPhysVol* phys_bpc_ydiv = 0; + if(!m_oldType) { + GeoBox* shape_bpc_yplane = new GeoBox(bpc_x, bpc_y, bpc_send); + GeoLogVol* log_bpc_yplane = new GeoLogVol(BPCName + "::bpc_yplane",shape_bpc_yplane, ArCO2_1); + phys_bpc_yplane = new GeoPhysVol(log_bpc_yplane); + m_BPCPhysical->add( new GeoIdentifierTag( 0 ) ); + m_BPCPhysical->add( new GeoTransform( HepGeom::Translate3D(0., 0., bpc_sen+bpc_send) ) ); + m_BPCPhysical->add( phys_bpc_yplane ); + + // division of Y plane + GeoBox* shape_bpc_ydiv = new GeoBox(bpc_x, bpc_step/2.,bpc_div); + GeoLogVol* log_bpc_ydiv = new GeoLogVol(BPCName + "::bpc_ydiv", shape_bpc_ydiv, ArCO2_1); + phys_bpc_ydiv = new GeoPhysVol(log_bpc_ydiv); + GeoXF::TRANSFUNCTION TY = GeoXF::Pow(HepGeom::TranslateY3D(1.0), -bpc_y+(2*Index+1)*bpc_step/2); + phys_bpc_yplane->add( new GeoSerialIdentifier(0) ); + phys_bpc_yplane->add( new GeoSerialTransformer(phys_bpc_ydiv, &TY, Ndiv ) ); + } + + // wires in each division + GeoTubs* shape_bpc_wire; + if(m_oldType) shape_bpc_wire = new GeoTubs(0., bpc_wd, bpc_old_x, 0.*CLHEP::deg, 360.*CLHEP::deg); + else shape_bpc_wire = new GeoTubs(0., bpc_wd, bpc_x, 0.*CLHEP::deg, 360.*CLHEP::deg); + GeoLogVol* log_bpc_wire; + if(m_oldType) log_bpc_wire = new GeoLogVol(BPCName + "::bpco_wire", shape_bpc_wire, Tungsten); + else log_bpc_wire = new GeoLogVol(BPCName + "::bpc_wire", shape_bpc_wire, Tungsten); + GeoPhysVol* phys_bpc_wire = new GeoPhysVol(log_bpc_wire); + phys_bpc_xdiv->add( new GeoIdentifierTag( 1 ) ); + phys_bpc_xdiv->add( new GeoTransform( HepGeom::RotateX3D( 90.*CLHEP::deg ) ) ); + phys_bpc_xdiv->add(phys_bpc_wire); + if(!m_oldType) { + phys_bpc_ydiv->add( new GeoIdentifierTag( 1 ) ); + phys_bpc_ydiv->add( new GeoTransform( HepGeom::RotateY3D( 90.*CLHEP::deg ) ) ); + phys_bpc_ydiv->add(phys_bpc_wire); + } + +// cathode wires around each division + if(m_oldType) Ndiv = int(2.0*bpc_old_x/bpc_cstep); + else Ndiv = int(2.0*bpc_x/bpc_cstep); + GeoTubs* shape_bpc_cwire; + if(m_oldType) shape_bpc_cwire = new GeoTubs(0., bpc_cwd, bpc_old_x, 0.*CLHEP::deg, 360.*CLHEP::deg); + else shape_bpc_cwire = new GeoTubs( 0., bpc_cwd, bpc_x, 0.*CLHEP::deg, 360.*CLHEP::deg); + GeoLogVol* log_bpc_cwire; + if(m_oldType) log_bpc_cwire = new GeoLogVol(BPCName + "::bpco_cwire",shape_bpc_cwire, Tungsten); + else log_bpc_cwire = new GeoLogVol(BPCName + "::bpc_cwire",shape_bpc_cwire, Tungsten); + GeoPhysVol* phys_bpc_cwire = new GeoPhysVol(log_bpc_cwire); +// GeoXF::TRANSFUNCTION TXXMO = HepGeom::RotateX3D( 90.*CLHEP::deg ) * GeoXF::Pow(HepGeom::TranslateX3D(1.0), -bpc_old_x+(2*Index+1)*bpc_old_cstep/2.) * HepGeom::TranslateZ3D(-bpc_old_send-bpc_cwd+bpc_old_space); +// GeoXF::TRANSFUNCTION TXXPO = HepGeom::RotateX3D( 90.*CLHEP::deg ) * GeoXF::Pow(HepGeom::TranslateX3D(1.0), -bpc_old_x+(2*Index+1)*bpc_old_cstep/2.) * HepGeom::TranslateZ3D(bpc_old_send-bpc_old_space+bpc_cwd); + GeoXF::TRANSFUNCTION TXXMO = GeoXF::Pow(HepGeom::TranslateX3D(1.0), -bpc_old_x+(2*Index+1)*bpc_old_cstep/2.) * HepGeom::TranslateZ3D(-bpc_old_send-2.*bpc_cwd+bpc_old_space) * HepGeom::RotateX3D( 90.*CLHEP::deg ); + GeoXF::TRANSFUNCTION TXXPO = GeoXF::Pow(HepGeom::TranslateX3D(1.0), -bpc_old_x+(2*Index+1)*bpc_old_cstep/2.) * HepGeom::TranslateZ3D(bpc_old_send-bpc_old_space+2.*bpc_cwd) * HepGeom::RotateX3D( 90.*CLHEP::deg ); +// GeoXF::TRANSFUNCTION TXXM = HepGeom::RotateX3D( 90.*CLHEP::deg ) * GeoXF::Pow(HepGeom::TranslateX3D(1.0), -bpc_x+(2*Index+1)*bpc_cstep/2.) * HepGeom::TranslateZ3D(-bpc_div-bpc_cwd); +// GeoXF::TRANSFUNCTION TXXP = HepGeom::RotateX3D( 90.*CLHEP::deg ) * GeoXF::Pow(HepGeom::TranslateX3D(1.0), -bpc_x+(2*Index+1)*bpc_cstep/2.) * HepGeom::TranslateZ3D(bpc_div+bpc_cwd); + GeoXF::TRANSFUNCTION TXXM = GeoXF::Pow(HepGeom::TranslateX3D(1.0), -bpc_x+(2*Index+1)*bpc_cstep/2.) * HepGeom::TranslateZ3D(-bpc_div-bpc_cwd) * HepGeom::RotateX3D( 90.*CLHEP::deg ); + GeoXF::TRANSFUNCTION TXXP = GeoXF::Pow(HepGeom::TranslateX3D(1.0), -bpc_x+(2*Index+1)*bpc_cstep/2.) * HepGeom::TranslateZ3D(bpc_div+bpc_cwd) * HepGeom::RotateX3D( 90.*CLHEP::deg ); + phys_bpc_xplane->add( new GeoSerialIdentifier(0) ); + if(m_oldType) phys_bpc_xplane->add( new GeoSerialTransformer(phys_bpc_cwire, &TXXMO, Ndiv) ); + else phys_bpc_xplane->add( new GeoSerialTransformer(phys_bpc_cwire, &TXXM, Ndiv) ); + phys_bpc_xplane->add( new GeoSerialIdentifier(Ndiv) ); + if(m_oldType) phys_bpc_xplane->add( new GeoSerialTransformer(phys_bpc_cwire, &TXXPO, Ndiv) ); + else phys_bpc_xplane->add( new GeoSerialTransformer(phys_bpc_cwire, &TXXP, Ndiv) ); + if(!m_oldType) { +// GeoXF::TRANSFUNCTION TYYM = HepGeom::RotateY3D( 90.*CLHEP::deg ) * GeoXF::Pow(HepGeom::TranslateY3D(1.0), -bpc_y+(2*Index+1)*bpc_cstep/2.) * HepGeom::TranslateZ3D(-bpc_div-bpc_cwd); +// GeoXF::TRANSFUNCTION TYYP = HepGeom::RotateY3D( 90.*CLHEP::deg ) * GeoXF::Pow(HepGeom::TranslateY3D(1.0), -bpc_y+(2*Index+1)*bpc_cstep/2.) * HepGeom::TranslateZ3D(bpc_div+bpc_cwd); + GeoXF::TRANSFUNCTION TYYM = GeoXF::Pow(HepGeom::TranslateY3D(1.0), -bpc_y+(2*Index+1)*bpc_cstep/2.) * HepGeom::TranslateZ3D(-bpc_div-bpc_cwd) * HepGeom::RotateY3D( 90.*CLHEP::deg ); + GeoXF::TRANSFUNCTION TYYP = GeoXF::Pow(HepGeom::TranslateY3D(1.0), -bpc_y+(2*Index+1)*bpc_cstep/2.) * HepGeom::TranslateZ3D(bpc_div+bpc_cwd) * HepGeom::RotateY3D( 90.*CLHEP::deg ); + phys_bpc_yplane->add( new GeoSerialIdentifier(0) ); + phys_bpc_yplane->add( new GeoSerialTransformer(phys_bpc_cwire, &TYYM, Ndiv) ); + phys_bpc_yplane->add( new GeoSerialIdentifier(Ndiv) ); + phys_bpc_yplane->add( new GeoSerialTransformer(phys_bpc_cwire, &TYYP, Ndiv) ); + } + + return m_BPCPhysical; +} + + + diff --git a/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/src/H6CryostatConstruction.cxx b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/src/H6CryostatConstruction.cxx new file mode 100755 index 00000000000..77d780749b2 --- /dev/null +++ b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/src/H6CryostatConstruction.cxx @@ -0,0 +1,201 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// H6CryostatConstruction + +// Feb-2006 JPA; +// + +#include "LArGeoH6Cryostats/H6CryostatConstruction.h" + + +#include "GeoModelKernel/GeoElement.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoVPhysVol.h" +#include "GeoModelKernel/GeoVFullPhysVol.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoAlignableTransform.h" +#include "GeoModelKernel/GeoIdentifierTag.h" +#include "StoreGate/StoreGateSvc.h" +#include "StoreGate/DataHandle.h" +#include "GeoModelInterfaces/AbsMaterialManager.h" +#include "GeoModelInterfaces/StoredMaterialManager.h" +#include "GeoModelKernel/GeoShapeUnion.h" +#include "GeoModelKernel/GeoShapeShift.h" + +// For transforms: + +#include "CLHEP/Geometry/Transform3D.h" +// For units: +#include "CLHEP/Units/PhysicalConstants.h" + +// For the database: + +#include "RDBAccessSvc/IRDBAccessSvc.h" +#include "RDBAccessSvc/IRDBRecord.h" +#include "RDBAccessSvc/IRDBRecordset.h" + +#include "GeoModelInterfaces/IGeoModelSvc.h" + +#include "StoreGate/StoreGateSvc.h" +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/Bootstrap.h" + +#include <string> +#include <cmath> + +LArGeo::H6CryostatConstruction::H6CryostatConstruction(): +cryoEnvelopePhysical(0), +cryoMotherPhysical(NULL), +cryoLArPhys(0), +pAccessSvc(NULL), +geoModelSvc(NULL) +{} + +LArGeo::H6CryostatConstruction::~H6CryostatConstruction() {} + +GeoVFullPhysVol* LArGeo::H6CryostatConstruction::GetEnvelope() +{ + + if (cryoMotherPhysical) return cryoMotherPhysical; + + // Detector Store + ISvcLocator *svcLocator = Gaudi::svcLocator(); + StoreGateSvc *detStore; + if (svcLocator->service("DetectorStore", detStore, false )==StatusCode::FAILURE) { + throw std::runtime_error("Error in H6CryostatConstruction, cannot access DetectorStore"); + } + + // Material Manager + DataHandle<StoredMaterialManager> materialManager; + if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) return 0; + + GeoMaterial *Air = materialManager->getMaterial("std::Air"); + if (!Air) { + throw std::runtime_error("Error in H6CryostatConstruction, std::Air is not found."); + } + GeoMaterial *Iron = materialManager->getMaterial("std::Iron"); + if (!Iron) { + throw std::runtime_error("Error in H6CryostatConstruction, std::Iron is not found."); + } + GeoMaterial *LAr = materialManager->getMaterial("std::LiquidArgon"); + if (!LAr) { + throw std::runtime_error("Error in H6CryostatConstruction, std::LiquidArgon is not found."); + } + + // Database + StatusCode sc; + sc=svcLocator->service("RDBAccessSvc",pAccessSvc); + if (sc != StatusCode::SUCCESS) { + throw std::runtime_error ("Cannot locate RDBAccessSvc!!"); + } + + // GeoModelSvc + sc = svcLocator->service ("GeoModelSvc",geoModelSvc); + if (sc != StatusCode::SUCCESS) { + throw std::runtime_error ("Cannot locate GeoModelSvc!!"); + } + + std::string AtlasVersion = geoModelSvc->atlasVersion(); + std::string LArVersion = geoModelSvc->LAr_VersionOverride(); + + std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion; + std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr"; + + //-------- + // Cryostat + + // Here we should construct some sort of a cryostat: + // First attempt at creating the H6 cryostat: + // (values taken from HECCommonDetectorParamDef) + // + // A cylinder of half-height: zcryo = 2000.0 *CLHEP::mm + // outer radius of warm-wall: rwarm = 1295.5 *CLHEP::mm + // outer radius of vacuum: rvac = 1293.0 *CLHEP::mm + // outer radius of cold wall: rcold = 1258.0 *CLHEP::mm + // outer radius of LAr: rlar = 1255.0 *CLHEP::mm + + // needs to go into database: --- 4databa + double zcryo = 2000.0 *CLHEP::mm; + double rwarm = 1295.5 *CLHEP::mm; + double rvac = 1293.0 *CLHEP::mm; + double rcold = 1258.0 *CLHEP::mm; + double rlar = 1255.0 *CLHEP::mm; + + std::string cryoMotherName = "LAr::H6::Cryostat::MotherVolume"; + + // mother volume; cylinder of radius rwarm = outside of the cryostat warm wall + GeoTube* cryoMotherShape = new GeoTube(0.0 , rwarm+10.0, zcryo+10.0*CLHEP::mm); // mother is a little bigger than warm wall + + const GeoLogVol* cryoMotherLogical = new GeoLogVol(cryoMotherName, cryoMotherShape, Air); + cryoMotherPhysical = new GeoFullPhysVol(cryoMotherLogical); + + // Now we have a physical air-filled cylindrical mother, into which we can place all we want and need. + + // First insert the Cryostat walls and the LAr - all simple cylinders + // + // 4databa ??? + std::string baseName = "LArTB::H6::Cryostat::" ; + std::string cryoWallName = "LArTB::H6::Cryostat" ; + std::string cryoWarmWallName = baseName + "WarmWall" ; + std::string cryoVacuumGapName = baseName + "Vacuum" ; + std::string cryoColdWallName = baseName + "ColdWall" ; + std::string cryoLArName = baseName + "LAr" ; // <--- used to be called "Inside" + + + // Warm Wall + GeoTube* cryoWarmWallShape = new GeoTube(0. , rwarm, zcryo); + const GeoLogVol* cryoWarmWallLog = new GeoLogVol(cryoWarmWallName, cryoWarmWallShape, Iron); + //cryoMotherPhysical->add(new GeoNameTag(std::string("Cryostat"))); + GeoPhysVol* cryoWarmWallPhys = new GeoPhysVol(cryoWarmWallLog); + cryoMotherPhysical->add(cryoWarmWallPhys); + + // "Vacuum" gap (filled with air...) + GeoTube* cryoVacuumGapShape = new GeoTube(0. , rvac, zcryo-2.0*CLHEP::mm); // an arbitrary 2mm shorter to avoid confilct + const GeoLogVol* cryoVacuumGapLog = new GeoLogVol(cryoVacuumGapName, cryoVacuumGapShape, Air); + GeoPhysVol* cryoVacuumGapPhys = new GeoPhysVol(cryoVacuumGapLog); + cryoWarmWallPhys->add(cryoVacuumGapPhys); + + // Cold Wall + GeoTube* cryoColdWallShape = new GeoTube(0. , rcold, zcryo-4.0*CLHEP::mm); // an arbitrary 4mm shorter to avoid confilct + const GeoLogVol* cryoColdWallLog = new GeoLogVol(cryoColdWallName, cryoColdWallShape, Iron); + GeoPhysVol* cryoColdWallPhys = new GeoPhysVol(cryoColdWallLog); + cryoVacuumGapPhys->add(cryoColdWallPhys); + + + + // At the moment the CryostatMother is LAr, so the FCal should be in there, + // what would be better would be a mother of Air and LAr separately inside + // And the FCal the embedded in the LAr instead of the cryoMother! + + // Liquid Argon + GeoTube* cryoLArShape = new GeoTube(0. , rlar, zcryo-6.0*CLHEP::mm); // an arbitrary 2mm shorter to avoid confilct + const GeoLogVol* cryoLArLog = new GeoLogVol(cryoLArName, cryoLArShape, LAr); + cryoMotherPhysical->add(new GeoNameTag(std::string("Cryostat LAr Physical"))); + // cryoLArPhys is a class member so that we can place Detectors inside. + cryoLArPhys = new GeoPhysVol(cryoLArLog); + cryoColdWallPhys->add(cryoLArPhys); + + + // What remains needs to be inserted: + // - Rohacell (Needs an entry in LArCalorimeter/LArGeoModel/LArGeoAlgs/src/LArMaterialManager.cxx) + + return cryoMotherPhysical; + +} + +// Added so that FCal can be inserted in LArDetectorConstruction. +GeoPhysVol* LArGeo::H6CryostatConstruction::GetLArPhysical() +{ + return cryoLArPhys; +} + + + + diff --git a/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/src/MWPCConstruction.cxx b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/src/MWPCConstruction.cxx new file mode 100755 index 00000000000..46f06de0d94 --- /dev/null +++ b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/src/MWPCConstruction.cxx @@ -0,0 +1,311 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// This will construct a generic MWPC for the H6 beamline that leads to the H1 cryostat. +// There are two kinds of MWPCs - They differ in the size of the wire step (1mm or 2mm). +// The wire-step can be passed as an argument (A wire step of 1mm is default) +// 20. March 2007 Margret Fincke-Keeler + +#include "LArGeoH6Cryostats/MWPCConstruction.h" + +#include "GeoModelKernel/GeoElement.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +#include "GeoModelKernel/GeoVFullPhysVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoVPhysVol.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoTubs.h" +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoSerialDenominator.h" +#include "GeoModelKernel/GeoSerialIdentifier.h" +#include "GeoModelKernel/GeoSerialTransformer.h" +#include "GeoModelKernel/GeoAlignableTransform.h" +#include "GeoModelKernel/GeoIdentifierTag.h" +#include "GeoModelKernel/GeoSerialDenominator.h" +#include "StoreGate/StoreGateSvc.h" +#include "StoreGate/DataHandle.h" +#include "GeoModelInterfaces/AbsMaterialManager.h" +#include "GeoModelInterfaces/StoredMaterialManager.h" +#include "GeoModelKernel/GeoShapeUnion.h" +#include "GeoModelKernel/GeoShapeShift.h" + +// For transforms: +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/GenericFunctions/Variable.hh" +// For units: +#include "CLHEP/Units/PhysicalConstants.h" + +// For the database: +#include "RDBAccessSvc/IRDBAccessSvc.h" +#include "RDBAccessSvc/IRDBRecord.h" +#include "RDBAccessSvc/IRDBRecordset.h" + +#include "GeoModelInterfaces/IGeoModelSvc.h" + +#include "StoreGate/StoreGateSvc.h" +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/Bootstrap.h" + +#include <string> +#include <cmath> +#include <iostream> + +LArGeo::MWPCConstruction::MWPCConstruction(double Step) + :msg(0), + MWPCPhysical(0), + pAccessSvc(0), + geoModelSvc(0) +{ + wireStep = Step; +} + + +LArGeo::MWPCConstruction::~MWPCConstruction() +{ +} + + + +GeoVPhysVol* LArGeo::MWPCConstruction::GetEnvelope() +{ + + if (MWPCPhysical) return MWPCPhysical; + + // Message service: + ISvcLocator *svcLocator = Gaudi::svcLocator(); + IMessageSvc * msgSvc; + StatusCode status = svcLocator->service("MessageSvc", msgSvc); + + if(!status.isFailure()){ + msg = new MsgStream(msgSvc, "MWPCConstruction"); + } else { + throw std::runtime_error("MWPCConstruction: cannot initialze message service"); + } + + (*msg) << MSG::INFO << "MWPCConstruction - creating an MWPC with wire step " << wireStep << "mm ! " << endreq; + + + + StoreGateSvc *detStore; + if (svcLocator->service("DetectorStore", detStore, false )==StatusCode::FAILURE) { + throw std::runtime_error("Error in MWPCConstruction, cannot access DetectorStore"); + } + + + StatusCode sc; + + IGeoModelSvc *geoModelSvc; + sc = svcLocator->service ("GeoModelSvc",geoModelSvc); + if (sc != StatusCode::SUCCESS) { + throw std::runtime_error ("Cannot locate GeoModelSvc!!"); + } + + + + // Get the materials from the material manager:-----------------------------------------------------// + // // + + DataHandle<StoredMaterialManager> materialManager; + if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) return NULL; + + std::string name; + double density; + GeoElement* W=materialManager->getElement("Wolfram"); + GeoMaterial* Tungsten = new GeoMaterial(name="Tungsten", density=19.3*CLHEP::g/CLHEP::cm3); + Tungsten->add(W,1.); + Tungsten->lock(); + + + GeoElement* Ar=materialManager->getElement("Argon"); + GeoElement* C=materialManager->getElement("Carbon"); + GeoElement* H=materialManager->getElement("Hydrogen"); + GeoMaterial* Isobutane = new GeoMaterial(name="Isobutane", density=2.67*CLHEP::g/CLHEP::cm3); + Isobutane->add(C,0.8266); + Isobutane->add(H,0.1734); + Isobutane->lock(); + GeoMaterial* ArIso = new GeoMaterial(name="ArIso", density=0.0025*CLHEP::g/CLHEP::cm3); + ArIso->add(Ar,0.61); + ArIso->add(Isobutane,0.39); + ArIso->lock(); + + + +// // Test to see whether we can get the ArIso from the database +// GeoMaterial *ArIso2 = materialManager->getMaterial("LArTB::Argon70Isobutane30"); +// if (!ArIso2) (*msg) << MSG::INFO << "Found no Argon70Isobutane30 in database" << endreq; +// if (ArIso2) (*msg) << MSG::INFO << "Did find LArTB::Argon70Isobutane30 in database!" << endreq; + + GeoMaterial *Air = materialManager->getMaterial("std::Air"); + if (!Air) throw std::runtime_error("Error in MWPCConstruction, std::Air is not found."); + + GeoMaterial *Aluminium = materialManager->getMaterial("std::Aluminium"); + if (!Aluminium) throw std::runtime_error("Error in MWPCConstruction, std::Aluminium is not found."); + + GeoMaterial *Mylar = materialManager->getMaterial("std::Mylar"); + if (!Mylar) throw std::runtime_error("Error in MWPCConstruction, std::Mylar is not found."); + + + // // + //-------------------------------------------------------------------------------------------------// + + + + std::string AtlasVersion = geoModelSvc->atlasVersion(); + std::string LArVersion = geoModelSvc->LAr_VersionOverride(); + + std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion; + std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr"; + + + ////////////////////////////////////////////////////////////////// + // Define geometry + ////////////////////////////////////////////////////////////////// + + + // Here we creat the envelope for the Moveable FrontBeam Instrumentation. This code is repeated + // createEnvelope() method below. There should be a way to avoid this repitition. + + + //------ Now create a MWPC + + (*msg) << " Create MWPC5 " << endreq; + + std::string baseName = "LAr::TB"; + std::string MWPCName = baseName + "::MWPC"; + + // This creates a square wire-chamber: + const double MWPCDxy = 64.0*CLHEP::mm; + const double MWPCDz = 16.586*CLHEP::mm; + + + GeoBox* MWPCShape = new GeoBox(MWPCDxy, MWPCDxy, MWPCDz); // A generic WWPC + const GeoLogVol* MWPCLogical = new GeoLogVol( MWPCName, MWPCShape, ArIso ); + + MWPCPhysical = new GeoPhysVol(MWPCLogical); + + + //..... Add Mylar to MWPC: + const double MylarDz = 0.015*CLHEP::mm; + + GeoBox* MylarShape = new GeoBox(MWPCDxy, MWPCDxy, MylarDz); // Mylar fits across the MWPC in x,y + + for ( int side = 0; side<2 ; side++) + { + double MylarPos; + if (side==0) MylarPos = MylarDz-MWPCDz; + else MylarPos = MWPCDz-MylarDz; + std::string MylarName = MWPCName + "::Mylar"; + GeoLogVol* MylarLogical = new GeoLogVol( MylarName, MylarShape, Mylar ); + GeoPhysVol* MylarPhysical = new GeoPhysVol( MylarLogical ); + MWPCPhysical->add( new GeoIdentifierTag( side ) ); + MWPCPhysical->add( new GeoTransform( HepGeom::Translate3D( 0.*CLHEP::cm, 0.*CLHEP::cm, (MylarPos) ) ) ); + MWPCPhysical->add( MylarPhysical ); + } + // Done with the Mylar Foils + + + + //..... Add Al walls to MWPC5: + const double Aluz = 0.014*CLHEP::mm; + const double AluDz = Aluz; + const double Alu_f = 7.*CLHEP::mm; + const double Alu_s = 15.*CLHEP::mm; + + GeoBox* AluShape = new GeoBox(MWPCDxy, MWPCDxy, AluDz); // Al foil fits across the MWPC in x,y + for ( int pos = 0; pos<4 ; pos++) + { + double AluPos; + switch(pos) { + case 0: { AluPos = -Alu_s-AluDz; break; } + case 1: { AluPos = -Alu_f+AluDz; break; } + case 2: { AluPos = Alu_f-AluDz; break; } + case 3: { AluPos = Alu_s+AluDz; break; } + default: { throw std::runtime_error("MWPC5 - too many Al foils!"); break; } + } + + std::string AluName = MWPCName + "::AlFoil"; + GeoLogVol* AluLogical = new GeoLogVol( AluName, AluShape, Aluminium ); + GeoPhysVol* AluPhysical = new GeoPhysVol( AluLogical ); + MWPCPhysical->add( new GeoIdentifierTag( pos ) ); + MWPCPhysical->add( new GeoTransform( HepGeom::Translate3D( 0.*CLHEP::cm, 0.*CLHEP::cm, (AluPos) ) ) ); + MWPCPhysical->add( AluPhysical ); + } + + + + //..... Add a sensitive X and Y plane to MWPC5: + const double Senz = 4.0*CLHEP::mm; + const double SenDz = Senz; // z-Thickness of sensitive volume + const double SenPos = 11.*CLHEP::mm; // z-Position of sensitive volume + //const double Step = 2.*CLHEP::mm; // wire-step size for MWPC5 + + GeoBox* SenPlaneShape = new GeoBox(MWPCDxy, MWPCDxy, SenDz); // Sensitive Volume fits across the MWPC in x,y + + std::string XPlaneName = MWPCName + "::XPlane"; + std::string YPlaneName = MWPCName + "::YPlane"; + GeoLogVol* XPlaneLogical = new GeoLogVol( XPlaneName, SenPlaneShape, ArIso ); + GeoLogVol* YPlaneLogical = new GeoLogVol( YPlaneName, SenPlaneShape, ArIso ); + GeoPhysVol* XPlanePhysical = new GeoPhysVol( XPlaneLogical ); + GeoPhysVol* YPlanePhysical = new GeoPhysVol( YPlaneLogical ); + MWPCPhysical->add( new GeoIdentifierTag( 0 ) ); + MWPCPhysical->add( new GeoTransform( HepGeom::Translate3D( 0.*CLHEP::cm, 0.*CLHEP::cm, (-SenPos) ) ) ); + MWPCPhysical->add( XPlanePhysical ); + MWPCPhysical->add( new GeoIdentifierTag( 0 ) ); + MWPCPhysical->add( new GeoTransform( HepGeom::Translate3D( 0.*CLHEP::cm, 0.*CLHEP::cm, (SenPos) ) ) ); + MWPCPhysical->add( YPlanePhysical ); + + +//.... The X and Y planes have "divisions" +// These divisions will eventually be the sensitive volumes + + Genfun::Variable Index; + int NDiv= int ( 2*MWPCDxy / wireStep ) ; + GeoXF::TRANSFUNCTION TX = GeoXF::Pow(HepGeom::TranslateX3D(1.0), -MWPCDxy + wireStep/2. + wireStep*Index); + GeoXF::TRANSFUNCTION TY = GeoXF::Pow(HepGeom::TranslateY3D(1.0), -MWPCDxy + wireStep/2. + wireStep*Index); + GeoBox* XPlaneDiv = new GeoBox(wireStep/2., MWPCDxy , SenDz); + GeoBox* YPlaneDiv = new GeoBox(MWPCDxy , wireStep/2., SenDz); + std::string XDivName = MWPCName + "::XDiv"; + std::string YDivName = MWPCName + "::YDiv"; + GeoLogVol* XDivLogical = new GeoLogVol( XDivName, XPlaneDiv, ArIso ); + GeoLogVol* YDivLogical = new GeoLogVol( YDivName, YPlaneDiv, ArIso ); + GeoPhysVol* XDivPhysical = new GeoPhysVol( XDivLogical ); + GeoPhysVol* YDivPhysical = new GeoPhysVol( YDivLogical ); + + GeoSerialIdentifier *sIX = new GeoSerialIdentifier(0); + GeoSerialTransformer *sTSX = new GeoSerialTransformer(XDivPhysical, &TX, NDiv ); + GeoSerialIdentifier *sIY = new GeoSerialIdentifier(0); + GeoSerialTransformer *sTSY = new GeoSerialTransformer(YDivPhysical, &TY, NDiv ); + XPlanePhysical->add(sIX); + XPlanePhysical->add(sTSX); + YPlanePhysical->add(sIY); + YPlanePhysical->add(sTSY); + +//.... Put wires into the X/Y "divisions" + const double WireDiam = 0.006*CLHEP::mm; + const double WireLen = MWPCDxy; + GeoTubs* WireShape = new GeoTubs(0.*CLHEP::cm, WireDiam/2., WireLen , 0.*CLHEP::deg,360.*CLHEP::deg); + std::string WireName = MWPCName + "::Wire"; + GeoLogVol* WireLogical = new GeoLogVol(WireName, WireShape, Tungsten); + GeoPhysVol* WirePhysical = new GeoPhysVol( WireLogical ); + XDivPhysical->add(new GeoTransform(HepGeom::RotateX3D( 90.*CLHEP::deg ))); + XDivPhysical->add(WirePhysical); + YDivPhysical->add(new GeoTransform(HepGeom::RotateY3D( 90.*CLHEP::deg ))); + YDivPhysical->add(WirePhysical); + + +//----- Done with the MWPC + + + // End Moveable MWPC detectors + + + return MWPCPhysical; +} + + + diff --git a/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/src/WallsConstruction.cxx b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/src/WallsConstruction.cxx new file mode 100755 index 00000000000..5e152e44c53 --- /dev/null +++ b/LArCalorimeter/LArGeoModel/LArGeoH6Cryostats/src/WallsConstruction.cxx @@ -0,0 +1,340 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "LArGeoH6Cryostats/WallsConstruction.h" + +#include "GeoModelKernel/GeoElement.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +#include "GeoModelKernel/GeoVFullPhysVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoVPhysVol.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoTubs.h" +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoSerialDenominator.h" +#include "GeoModelKernel/GeoSerialIdentifier.h" +#include "GeoModelKernel/GeoSerialTransformer.h" +#include "GeoModelKernel/GeoAlignableTransform.h" +#include "GeoModelKernel/GeoIdentifierTag.h" +#include "GeoModelKernel/GeoSerialDenominator.h" +#include "StoreGate/StoreGateSvc.h" +#include "StoreGate/DataHandle.h" +#include "GeoModelInterfaces/AbsMaterialManager.h" +#include "GeoModelInterfaces/StoredMaterialManager.h" +#include "GeoModelKernel/GeoShapeUnion.h" +#include "GeoModelKernel/GeoShapeShift.h" + +// For transforms: +#include "CLHEP/Geometry/Transform3D.h" +#include "CLHEP/GenericFunctions/Variable.hh" +// For units: +#include "CLHEP/Units/PhysicalConstants.h" + +// For the database: +#include "RDBAccessSvc/IRDBAccessSvc.h" +#include "RDBAccessSvc/IRDBRecord.h" +#include "RDBAccessSvc/IRDBRecordset.h" + +#include "GeoModelInterfaces/IGeoModelSvc.h" + +#include "StoreGate/StoreGateSvc.h" +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/Bootstrap.h" + +#include <string> +#include <cmath> +#include <iostream> + +LArGeo::WallsConstruction::WallsConstruction() + :msg(0), + WallsPhysical(0), + pAccessSvc(0), + geoModelSvc(0) +{ +} + + +LArGeo::WallsConstruction::~WallsConstruction() +{ +} + + + +GeoVPhysVol* LArGeo::WallsConstruction::GetEnvelope() +{ + + if (WallsPhysical) return WallsPhysical; + + // Get access to the material manager: + + ISvcLocator *svcLocator = Gaudi::svcLocator(); + IMessageSvc * msgSvc; + StatusCode status = svcLocator->service("MessageSvc", msgSvc); + + if(!status.isFailure()){ + msg = new MsgStream(msgSvc, "WallsConstruction"); + } else { + throw std::runtime_error("WallsConstruction: cannot initialze message service"); + } + + (*msg) << MSG::INFO << "WallsConstruction - creating the walls in front of the cryostat " << endreq; + + + StoreGateSvc *detStore; + if (svcLocator->service("DetectorStore", detStore, false )==StatusCode::FAILURE) { + throw std::runtime_error("Error in WallsConstruction, cannot access DetectorStore"); + } + + + StatusCode sc; + + IGeoModelSvc *geoModelSvc; + sc = svcLocator->service ("GeoModelSvc",geoModelSvc); + if (sc != StatusCode::SUCCESS) { + throw std::runtime_error ("Cannot locate GeoModelSvc!!"); + } + + + + // Get the materials from the material manager:-----------------------------------------------------// + // // + + DataHandle<StoredMaterialManager> materialManager; + if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) return NULL; + + std::string name; + + + + + GeoMaterial *Air = materialManager->getMaterial("std::Air"); + if (!Air) throw std::runtime_error("Error in WallsConstruction, std::Air is not found."); + + GeoMaterial *Iron = materialManager->getMaterial("std::Iron"); + if (!Iron) throw std::runtime_error("Error in WallsConstruction, std::Iron is not found."); + + GeoMaterial *Lead = materialManager->getMaterial("std::Lead"); + if (!Lead) throw std::runtime_error("Error in WallsConstruction, std::Lead is not found."); + + GeoMaterial *Aluminium = materialManager->getMaterial("std::Aluminium"); + if (!Aluminium) throw std::runtime_error("Error in WallsConstruction, std::Aluminium is not found."); + + // Is this ok for the Scintillator? + // I don't really know for sure what kind of a scintillator we have. + // Lots of Scintillators are PMMA (Plexiglas), which has a composition of C5 H8 O2 and density 1.18 CLHEP::g/CLHEP::cm3 + // The Tile uses a composition of C H (density 1.032) + // The old Walls testbeam code uses a composition of C9 H10 (density 1.032) + // ... because it's easiest at the moment and not all that different from the fractional + // composition of the old tb code, take the Tile material (polysterene)... + GeoMaterial *Scint = materialManager->getMaterial("std::Polystyrene"); + if (!Scint) throw std::runtime_error("Error in WallsConstruction, std::Polystyrene is not found."); + + GeoMaterial *Mylar = materialManager->getMaterial("std::Mylar"); + if (!Mylar) throw std::runtime_error("Error in WallsConstruction, std::Mylar is not found."); + + + // // + //-------------------------------------------------------------------------------------------------// + + + + std::string AtlasVersion = geoModelSvc->atlasVersion(); + std::string LArVersion = geoModelSvc->LAr_VersionOverride(); + + std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion; + std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr"; + + + ////////////////////////////////////////////////////////////////// + // Define geometry + ////////////////////////////////////////////////////////////////// + + + // Here we creat the envelope for the Moveable Walls Instrumentation. This code is repeated + // createEnvelope() method below. There should be a way to avoid this repitition. + + //------ The Walls + + // All these numbers should really go into the database!... + // This hard-coding is only temporary! + + std::string baseName = "LAr::TBH6"; + std::string WallsName = baseName + "::Walls"; + + const double WallsX = 1500.*CLHEP::mm; + const double WallsY = 2000.*CLHEP::mm; + const double WallsZ = 560.5*CLHEP::mm; + + + GeoBox* WallsShape = new GeoBox( WallsX, WallsY, WallsZ ); + const GeoLogVol* WallsLogical = new GeoLogVol( WallsName, WallsShape, Air ); + + // This is the Mother Volume for all Walls in front of the cryostat: + WallsPhysical = new GeoPhysVol(WallsLogical); + + + // Into the mother, place all indiviual walls (Iron, Lead, Scntillator and additional iron plates) + // All these walls are never moved with respect to one another, so do them all here. + + //----- First the IronWall + + (*msg) << "Create Iron Wall " << endreq; + + const double IronX = 1499.*CLHEP::mm; + const double IronY = 1999.*CLHEP::mm; + const double IronZ = 200.0*CLHEP::mm; + const double IronHoleX = 51.5*CLHEP::mm; + const double IronHoleY = 1999.*CLHEP::mm; + const double IronHoleZ = 200.*CLHEP::mm; + const double IronPosZ = 270.*CLHEP::mm; + + // The wall itself: + GeoBox* IronWallShape = new GeoBox(IronX, IronY, IronZ); + std::string IronWallName = baseName + "::IronWall"; + GeoLogVol* IronWallLogical = new GeoLogVol( IronWallName, IronWallShape, Iron ); + GeoPhysVol* IronWallPhysical = new GeoPhysVol( IronWallLogical ); + + //Have to put a hole into the wall: + GeoBox* IronHoleShape = new GeoBox(IronHoleX, IronHoleY, IronHoleZ); + std::string IronHoleName = baseName + "::IronWall::Hole"; + GeoLogVol* IronHoleLogical = new GeoLogVol( IronHoleName, IronHoleShape, Air ); + GeoPhysVol* IronHolePhysical = new GeoPhysVol( IronHoleLogical ); + IronWallPhysical->add(IronHolePhysical); + + // Add the iron wall to the Wall mother: + WallsPhysical->add( new GeoTransform( HepGeom::Translate3D( 0.*CLHEP::mm, 0.*CLHEP::mm, (WallsZ-IronPosZ) ) ) ) ; + WallsPhysical->add( new GeoNameTag(IronWallName) ); + WallsPhysical->add( IronWallPhysical ); + + //----- Done with IronWall + + + + //----- Now the LeadWall + + (*msg) << "Create Lead Wall " << endreq; + + const double LeadX = 1499.*CLHEP::mm; + const double LeadY = 1999.*CLHEP::mm; + const double LeadZ = 6.*CLHEP::mm; + const double LeadHoleX = 23.5*CLHEP::mm; + const double LeadHoleY = 1999.*CLHEP::mm; + const double LeadHoleZ = 6.*CLHEP::mm; + const double LeadPosZ = 1045.*CLHEP::mm; + + // The wall itself: + GeoBox* LeadWallShape = new GeoBox(LeadX, LeadY, LeadZ); + std::string LeadWallName = baseName + "::LeadWall"; + GeoLogVol* LeadWallLogical = new GeoLogVol( LeadWallName, LeadWallShape, Lead ); + GeoPhysVol* LeadWallPhysical = new GeoPhysVol( LeadWallLogical ); + + //Have to put a hole into the wall: + GeoBox* LeadHoleShape = new GeoBox(LeadHoleX, LeadHoleY, LeadHoleZ); + std::string LeadHoleName = baseName + "::LeadWall::Hole"; + GeoLogVol* LeadHoleLogical = new GeoLogVol( LeadHoleName, LeadHoleShape, Air ); + GeoPhysVol* LeadHolePhysical = new GeoPhysVol( LeadHoleLogical ); + LeadWallPhysical->add(LeadHolePhysical); + + // Add the lead wall to the Wall mother: + WallsPhysical->add( new GeoTransform( HepGeom::Translate3D( 0.*CLHEP::mm, 0.*CLHEP::mm, (WallsZ-LeadPosZ) ) ) ) ; + WallsPhysical->add( new GeoNameTag(LeadWallName) ); + WallsPhysical->add( LeadWallPhysical ); + + //----- Done with LeadWall + + + //----- Now the ScintWall + + (*msg) << "Create Scint Wall " << endreq; + + const double ScintX = 1499.*CLHEP::mm; + const double ScintY = 1999.*CLHEP::mm; + const double ScintZ = 6.5*CLHEP::mm; + const double ScintHoleX = 92.5*CLHEP::mm; + const double ScintHoleY = 1999.*CLHEP::mm; + const double ScintHoleZ = 6.5*CLHEP::mm; + const double ScintPosZ = 625.*CLHEP::mm; + + // The wall itself: + GeoBox* ScintWallShape = new GeoBox(ScintX, ScintY, ScintZ); + std::string ScintWallName = baseName + "::ScintWall"; + GeoLogVol* ScintWallLogical = new GeoLogVol( ScintWallName, ScintWallShape, Scint ); + GeoPhysVol* ScintWallPhysical = new GeoPhysVol( ScintWallLogical ); + + //Have to put a hole into the wall: + GeoBox* ScintHoleShape = new GeoBox(ScintHoleX, ScintHoleY, ScintHoleZ); + std::string ScintHoleName = baseName + "::ScintWall::Hole"; + GeoLogVol* ScintHoleLogical = new GeoLogVol( ScintHoleName, ScintHoleShape, Air ); + GeoPhysVol* ScintHolePhysical = new GeoPhysVol( ScintHoleLogical ); + ScintWallPhysical->add(ScintHolePhysical); + + // Add the scintillator wall to the Wall mother: + WallsPhysical->add( new GeoTransform( HepGeom::Translate3D( 0.*CLHEP::mm, 0.*CLHEP::mm, (WallsZ-ScintPosZ) ) ) ) ; + WallsPhysical->add( new GeoNameTag(ScintWallName) ); + WallsPhysical->add( ScintWallPhysical ); + + //----- Done with ScintWall + + + + //----- Finally the iron plates + + //(*msg) << "Create Iron Plate " << endreq; + + const double IronPlateX = 50.*CLHEP::mm; + const double IronPlateY = 150.*CLHEP::mm; + const double IronPlateZ = 4.*CLHEP::mm; + const double IronPlatePosZ = 493.*CLHEP::mm; + const int nPlate = 0 ; + const int PlatePlace = 1 ; // There were two locations used for these plates - unclear which one when and exactly + // where they were....! For the moment, sort of copy the standalone code + // right now: +1 between Iron wall and Cryostat, + // -1 between Lead wall and table + // This should really be passed on via jobOptions! + + if (nPlate>0) { + // Print out a warning here, because extra matrial is in place only for a few special runs + (*msg) << MSG::WARNING << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! " << endreq; + (*msg) << MSG::WARNING << " EXTRA MATERIAL IN THE BEAM: " << nPlate << " plates " << endreq; + if (PlatePlace== 1) (*msg) << MSG::WARNING << " between cryostat and Iron Wall " << endreq; + //if (PlatePlace==-1) (*msg) << MSG::WARNING << " between Lead Wall and Table " << endreq; + (*msg) << MSG::WARNING << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! " << endreq; + + std::vector<double> v_PlateZ; + for (int iz=0; iz<(nPlate); iz++) v_PlateZ.push_back(IronPlatePosZ + double(iz)*(2*IronPlateZ+0.5)); + + // The plate itself: + GeoBox* IronPlateShape = new GeoBox(IronPlateX, IronPlateY, IronPlateZ); + std::string IronPlateName = baseName + "::IronPlate"; + GeoLogVol* IronPlateLogical = new GeoLogVol( IronPlateName, IronPlateShape, Iron ); + GeoPhysVol* IronPlatePhysical = new GeoPhysVol( IronPlateLogical ); + + + // Add the iron plate to the Plate mother: + for (int iz=0; iz<(nPlate); iz++) { + WallsPhysical->add( new GeoIdentifierTag(iz) ); + WallsPhysical->add( new GeoTransform( HepGeom::Translate3D( 0.*CLHEP::mm, 0.*CLHEP::mm, double(PlatePlace)*(v_PlateZ[iz]) ) ) ) ; + WallsPhysical->add( new GeoNameTag(IronPlateName) ); + WallsPhysical->add( IronPlatePhysical ); + } + } + //----- Done with Iron Plates + + + + + + + // Done with all walls in front of the cryostat. + + + return WallsPhysical; +} + + + -- GitLab