Skip to content
Snippets Groups Projects
Commit dcc3b6cf authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'dataHandle.LArGeoH6Cryostats-20181127' into 'master'

LArGeoH6Cryostats: Avoid use of non-bound DataHandle.

See merge request atlas/athena!16261

Former-commit-id: 698b866e
parents 3023e7db 7c4c8cfe
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
// This will construct a generic BPC for the H6 beamline that leads to the H1 cryostat.
......@@ -25,7 +25,6 @@
#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"
......@@ -102,22 +101,22 @@ GeoVPhysVol* LArGeo::BPCConstruction::GetEnvelope()
// Get the materials from the material manager:-----------------------------------------------------//
// //
DataHandle<StoredMaterialManager> materialManager;
const StoredMaterialManager* materialManager = nullptr;
if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) return NULL;
std::string name;
double density;
GeoElement* W=materialManager->getElement("Wolfram");
const 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");
const GeoElement* Ar=materialManager->getElement("Argon");
const GeoElement* C=materialManager->getElement("Carbon");
const GeoElement* O=materialManager->getElement("Oxygen");
const GeoElement* H=materialManager->getElement("Hydrogen");
const 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);
......@@ -139,13 +138,13 @@ GeoVPhysVol* LArGeo::BPCConstruction::GetEnvelope()
AlMylar->add(Al,0.219245);
AlMylar->lock();
GeoMaterial *Air = materialManager->getMaterial("std::Air");
const 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");
const 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");
const GeoMaterial *Mylar = materialManager->getMaterial("std::Mylar");
if (!Mylar) throw std::runtime_error("Error in BPCConstruction, std::Mylar is not found.");
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
// H6CryostatConstruction
......@@ -23,7 +23,6 @@
#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"
......@@ -70,18 +69,18 @@ GeoVFullPhysVol* LArGeo::H6CryostatConstruction::GetEnvelope()
}
// Material Manager
DataHandle<StoredMaterialManager> materialManager;
const StoredMaterialManager* materialManager = nullptr;
if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) return 0;
GeoMaterial *Air = materialManager->getMaterial("std::Air");
const 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");
const 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");
const GeoMaterial *LAr = materialManager->getMaterial("std::LiquidArgon");
if (!LAr) {
throw std::runtime_error("Error in H6CryostatConstruction, std::LiquidArgon is not found.");
}
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
// This will construct a generic MWPC for the H6 beamline that leads to the H1 cryostat.
......@@ -28,7 +28,6 @@
#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"
......@@ -105,20 +104,20 @@ GeoVPhysVol* LArGeo::MWPCConstruction::GetEnvelope()
// Get the materials from the material manager:-----------------------------------------------------//
// //
DataHandle<StoredMaterialManager> materialManager;
const StoredMaterialManager* materialManager = nullptr;
if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) return NULL;
std::string name;
double density;
GeoElement* W=materialManager->getElement("Wolfram");
const 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");
const GeoElement* Ar=materialManager->getElement("Argon");
const GeoElement* C=materialManager->getElement("Carbon");
const 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);
......@@ -131,17 +130,17 @@ GeoVPhysVol* LArGeo::MWPCConstruction::GetEnvelope()
// // Test to see whether we can get the ArIso from the database
// GeoMaterial *ArIso2 = materialManager->getMaterial("LArTB::Argon70Isobutane30");
// const GeoMaterial *ArIso2 = materialManager->getMaterial("LArTB::Argon70Isobutane30");
// if (!ArIso2) (*m_msg) << MSG::INFO << "Found no Argon70Isobutane30 in database" << endmsg;
// if (ArIso2) (*m_msg) << MSG::INFO << "Did find LArTB::Argon70Isobutane30 in database!" << endmsg;
GeoMaterial *Air = materialManager->getMaterial("std::Air");
const 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");
const 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");
const GeoMaterial *Mylar = materialManager->getMaterial("std::Mylar");
if (!Mylar) throw std::runtime_error("Error in MWPCConstruction, std::Mylar is not found.");
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
#include "LArGeoH6Cryostats/WallsConstruction.h"
......@@ -23,7 +23,6 @@
#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"
......@@ -99,7 +98,7 @@ GeoVPhysVol* LArGeo::WallsConstruction::GetEnvelope()
// Get the materials from the material manager:-----------------------------------------------------//
// //
DataHandle<StoredMaterialManager> materialManager;
const StoredMaterialManager* materialManager = nullptr;
if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) return NULL;
std::string name;
......@@ -107,16 +106,16 @@ GeoVPhysVol* LArGeo::WallsConstruction::GetEnvelope()
GeoMaterial *Air = materialManager->getMaterial("std::Air");
const 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");
const 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");
const 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");
const 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?
......@@ -126,10 +125,10 @@ GeoVPhysVol* LArGeo::WallsConstruction::GetEnvelope()
// 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");
const 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");
const GeoMaterial *Mylar = materialManager->getMaterial("std::Mylar");
if (!Mylar) throw std::runtime_error("Error in WallsConstruction, std::Mylar is not found.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment