ATLAS Offline Software
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
InDetMaterialManager Class Reference

InDetMaterialManager. More...

#include <InDetMaterialManager.h>

Inheritance diagram for InDetMaterialManager:
Collaboration diagram for InDetMaterialManager:

Classes

class  MaterialByWeight
 
class  MaterialComponent
 
class  MaterialDef
 Class to hold information need to create a material. More...
 

Public Member Functions

 InDetMaterialManager (const std::string &managerName, StoreGateSvc *detStore)
 
 InDetMaterialManager (const std::string &managerName, StoreGateSvc *detStore, const IRDBRecordset_ptr &weightTable, const std::string &space="", bool extraFunctionality=false)
 
 InDetMaterialManager (const std::string &managerName, StoreGateSvc *detStore, const IRDBRecordset_ptr &weightTable, const IRDBRecordset_ptr &compositionTable, const std::string &space="")
 
 InDetMaterialManager (const std::string &managerName, InDetDD::AthenaComps *)
 
 ~InDetMaterialManager ()
 
void addWeightTable (const IRDBRecordset_ptr &weightTable, const std::string &space="")
 
void addWeightMaterial (const std::string &materialName, const std::string &materialBase, double weight, int linearWeightFlag)
 
void addCompositionTable (const IRDBRecordset_ptr &compositionTable, const std::string &space="")
 
void addScalingTable (const IRDBRecordset_ptr &scalingTable)
 
bool hasMaterial (const std::string &materialName) const
 
const GeoMaterial * getMaterial (const std::string &materialName)
 Get material. First looks for locally defined material and if not found looks in GeoModel material manager. More...
 
const GeoElement * getElement (const std::string &elementName)
 Get element from GeoModel material manager. More...
 
const GeoMaterial * getMaterial (const std::string &origMaterialName, double density, const std::string &newName="")
 Create and get material with a specified density based on an existing material. More...
 
const GeoMaterial * getMaterialScaled (const std::string &origMaterialName, double scaleFactor, const std::string &newName="")
 
const GeoMaterial * getMaterialForVolume (const std::string &materialName, double volume, const std::string &newName="")
 Create and get material with a density calculated to give weight in predefined weight table. More...
 
const GeoMaterial * getMaterialForVolumeLength (const std::string &materialName, double volume, double length, const std::string &newName="")
 
const GeoMaterial * getMaterialForVolumeLength (const std::string &name, const std::vector< std::string > &materialComponents, const std::vector< double > &factors, double volume, double length)
 
const GeoMaterial * getMaterialForVolumeLength (const std::string &name, const std::string &materialComponent, double factor, double volume, double length)
 
const GeoMaterial * getCompositeMaterialForVolume (const std::string &newMatName, const double volumeTot, const double volume1, const std::string &matName1, const double volume2, const std::string &matName2)
 
const GeoMaterial * getMaterial (const std::string &name, const std::vector< std::string > &materialComponents, const std::vector< double > &fractWeights, double density)
 
void addMaterial (GeoMaterial *material)
 Add material. More...
 
bool msgLvl (const MSG::Level lvl) const
 Test the output level. More...
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Private Types

using MaterialStore = std::map< std::string, GeoIntrusivePtr< const GeoMaterial > >
 
typedef std::map< std::string, MaterialByWeightMaterialWeightMap
 
typedef std::map< std::string, MaterialComponentMaterialCompositionMap
 
typedef std::map< std::string, double > ExtraScaleFactorMap
 

Private Member Functions

StoredMaterialManagerretrieveManager (const StoreGateSvc *detStore)
 
const GeoMaterial * getAdditionalMaterial (const std::string &materialName) const
 
bool compareDensity (double d1, double d2) const
 
void addWeightTableOld (const IRDBRecordset_ptr &weightTable, const std::string &space)
 
const GeoMaterial * getMaterialInternal (const std::string &materialName)
 
const GeoMaterial * getMaterialInternal (const std::string &origMaterialName, double density, const std::string &newName="")
 
const GeoMaterial * getMaterialScaledInternal (const std::string &origMaterialName, double scaleFactor, const std::string &newName="")
 
const GeoMaterial * getMaterialInternal (const std::string &name, const std::vector< std::string > &materialComponents, const std::vector< double > &fractWeights, double density)
 
const GeoMaterial * extraScaledMaterial (const std::string &materialName, const std::string &newName, const GeoMaterial *origMaterial)
 
const GeoMaterial * extraScaledMaterial (const std::string &materialName, const GeoMaterial *origMaterial)
 
const IGeometryDBSvcdb ()
 
void addTextFileMaterials ()
 
void createMaterial (const MaterialDef &material)
 
double getExtraScaleFactor (const std::string &materialName)
 
void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

StoredMaterialManagerm_materialManager
 
std::string m_managerName
 
MaterialStore m_store
 
MaterialWeightMap m_weightMap
 
MaterialCompositionMap m_matCompositionMap
 
ExtraScaleFactorMap m_scalingMap
 
bool m_extraFunctionality
 
const InDetDD::AthenaCompsm_athenaComps
 
std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

Detailed Description

InDetMaterialManager.

This provides an interface to the GeoModel Material Manager as well as allowing additional materials to be defined or standard ones redefined. It also allows creating new materials based on existing ones but with a different density. It is also possible to specify a weight table and this is used to create materials with a density such that the the total weight is correct.

Definition at line 33 of file InDetMaterialManager.h.

Member Typedef Documentation

◆ ExtraScaleFactorMap

typedef std::map<std::string, double > InDetMaterialManager::ExtraScaleFactorMap
private

Definition at line 224 of file InDetMaterialManager.h.

◆ MaterialCompositionMap

typedef std::map<std::string, MaterialComponent > InDetMaterialManager::MaterialCompositionMap
private

Definition at line 221 of file InDetMaterialManager.h.

◆ MaterialStore

using InDetMaterialManager::MaterialStore = std::map<std::string, GeoIntrusivePtr<const GeoMaterial> >
private

Definition at line 215 of file InDetMaterialManager.h.

◆ MaterialWeightMap

typedef std::map<std::string, MaterialByWeight > InDetMaterialManager::MaterialWeightMap
private

Definition at line 218 of file InDetMaterialManager.h.

Constructor & Destructor Documentation

◆ InDetMaterialManager() [1/4]

InDetMaterialManager::InDetMaterialManager ( const std::string &  managerName,
StoreGateSvc detStore 
)

Definition at line 24 of file InDetMaterialManager.cxx.

26  : AthMessaging(managerName),
27  m_managerName(managerName),
28  m_extraFunctionality(false),
29  m_athenaComps(nullptr) {
31 }

◆ InDetMaterialManager() [2/4]

InDetMaterialManager::InDetMaterialManager ( const std::string &  managerName,
StoreGateSvc detStore,
const IRDBRecordset_ptr weightTable,
const std::string &  space = "",
bool  extraFunctionality = false 
)

Definition at line 34 of file InDetMaterialManager.cxx.

39  : AthMessaging(managerName),
40  m_managerName(managerName),
41  m_extraFunctionality(extraFunctionality),
42  m_athenaComps(nullptr) {
44 
45  if (weightTable) addWeightTable(weightTable, space);
46 
47  // For testing we add a few materials.
48  //m_weightMap["sct::CoolingBlock"] = MaterialByWeight(2.418*CLHEP::gram);
49  //m_weightMap["sct::CoolingBlock"] = MaterialByWeight(2*CLHEP::gram);
50  //m_weightMap["sct::BrlHybrid"] = MaterialByWeight("sct::Hybrid", 8*CLHEP::gram);
51  //m_weightMap["sct::FwdHybrid"] = MaterialByWeight("std::Carbon", 7.662*CLHEP::gram);
52 }

◆ InDetMaterialManager() [3/4]

InDetMaterialManager::InDetMaterialManager ( const std::string &  managerName,
StoreGateSvc detStore,
const IRDBRecordset_ptr weightTable,
const IRDBRecordset_ptr compositionTable,
const std::string &  space = "" 
)

Definition at line 54 of file InDetMaterialManager.cxx.

58  : AthMessaging(managerName),
59  m_managerName(managerName),
61  m_athenaComps(nullptr) {
63 
64  if (weightTable) addWeightTable(weightTable, space);
65  if (compositionTable) addCompositionTable(compositionTable, space);
66 }

◆ InDetMaterialManager() [4/4]

InDetMaterialManager::InDetMaterialManager ( const std::string &  managerName,
InDetDD::AthenaComps athenaComps 
)

Definition at line 68 of file InDetMaterialManager.cxx.

70  : AthMessaging(managerName),
71  m_managerName(managerName),
73  m_athenaComps(athenaComps) {
74  m_materialManager = retrieveManager(athenaComps->detStore());
76 }

◆ ~InDetMaterialManager()

InDetMaterialManager::~InDetMaterialManager ( )
default

Member Function Documentation

◆ addCompositionTable()

void InDetMaterialManager::addCompositionTable ( const IRDBRecordset_ptr compositionTable,
const std::string &  space = "" 
)

Definition at line 406 of file InDetMaterialManager.cxx.

406  {
407  ATH_MSG_DEBUG("Reading in composition table: " << compositionTable->nodeName());
408 
409  if (!db()) {
410  ATH_MSG_ERROR("GeometryDBSvc not available. Unable to read in composition table.");
411  }
412  for (unsigned int i = 0; i < db()->getTableSize(compositionTable); i++) {
413  std::string materialName = db()->getString(compositionTable, "MATERIAL", i);
414  if (!space.empty()) {
415  materialName = space + "::" + materialName;
416  }
417 
418  std::string componentName = db()->getString(compositionTable, "COMPONENT", i);
419  int count = db()->getInt(compositionTable, "COUNT", i);
420  double factor = db()->getDouble(compositionTable, "FACTOR", i);
421  double actualLength = db()->getDouble(compositionTable, "ACTUALLENGTH", i);
422 
423  m_matCompositionMap.insert(std::pair<std::string, MaterialComponent>(materialName,
424  MaterialComponent(componentName,
425  count * factor,
426  actualLength)));
427  }
428 }

◆ addMaterial()

void InDetMaterialManager::addMaterial ( GeoMaterial *  material)

Add material.

Definition at line 299 of file InDetMaterialManager.cxx.

299  {
300  GeoIntrusivePtr<const GeoMaterial> matPtr{material};
301  std::string name(material->getName());
302  if (m_store.find(name) != m_store.end()) {
303  ATH_MSG_WARNING("Ignoring attempt to redefine an existing material: " << name);
304  // Delete the material if it is not already ref counted.
305  //std::cout << m_store[name] << std::endl;
306  } else {
307  material->lock();
308  m_store[name] = matPtr;
309 
310  ATH_MSG_DEBUG("Created new material: " << name << ", " << material->getDensity() /
311  (Gaudi::Units::g / Gaudi::Units::cm3) << " g/cm3");
312  }
313 }

◆ addScalingTable()

void InDetMaterialManager::addScalingTable ( const IRDBRecordset_ptr scalingTable)

Definition at line 431 of file InDetMaterialManager.cxx.

431  {
432  if (!scalingTable) return;
433 
434  if (db()->getTableSize(scalingTable) == 0) return;
435 
436  ATH_MSG_DEBUG("Reading in extra material scaling table: " << scalingTable->nodeName());
437  if (!db()) {
438  ATH_MSG_ERROR("GeometryDBSvc not available. Unable to read in scaling table.");
439  }
440  for (unsigned int i = 0; i < db()->getTableSize(scalingTable); i++) {
441  std::string materialName = db()->getString(scalingTable, "MATERIAL", i);
442  double scalingFactor = db()->getDouble(scalingTable, "FACTOR", i);
443 
444  if (msgLvl(MSG::DEBUG)) {
445  if (scalingFactor >= 0 || scalingFactor == 1) {
446  msg(MSG::DEBUG) << "Material " << materialName << " will be scaled by: " << scalingFactor << endmsg;
447  } else {
448  // -ve or scalefactor = 1 means will not be scaled.
449  msg(MSG::DEBUG) << "Material " << materialName << " will be NOT be scaled." << endmsg;
450  }
451  }
452  if (m_scalingMap.find(materialName) != m_scalingMap.end()) {
453  ATH_MSG_WARNING("Overriding material: " << materialName << " which already exists in scaling table");
454  }
455  m_scalingMap[materialName] = scalingFactor;
456  }
457 }

◆ addTextFileMaterials()

void InDetMaterialManager::addTextFileMaterials ( )
private

Definition at line 764 of file InDetMaterialManager.cxx.

764  {
765  const std::string materialTable = "ExtraMaterials";
766  const std::string componentsTable = "ExtraMatComponents";
767 
768  // Look for tables ExtraMaterials and ExtraMatComponents.
769  // These are text file only tables where extra materials are desired or
770  // one wants to override some database ones.
771  if (!db() || !db()->testField("", "TableSize:" + materialTable) || !db()->getTableSize(materialTable)
772  || !db()->testField("", "TableSize:" + componentsTable) || !db()->getTableSize(componentsTable)) return;
773 
774 
775  ATH_MSG_INFO("Extra materials being read in from text file.");
776 
777  using MatMap = std::map<std::string, MaterialDef>;
778  MatMap materials;
779 
780  // read in material table
781  for (unsigned int iMat = 0; iMat < db()->getTableSize(materialTable); iMat++) {
782  std::string materialName = db()->getString(materialTable, "NAME", iMat);
783  double density = db()->getDouble(materialTable, "DENSITY", iMat) * Gaudi::Units::g / Gaudi::Units::cm3;
784  materials[materialName] = MaterialDef(materialName, density);
785  }
786 
787  // read in material component table
788  for (unsigned int iComp = 0; iComp < db()->getTableSize(componentsTable); iComp++) {
789  std::string materialName = db()->getString(componentsTable, "NAME", iComp);
790  std::string compName = db()->getString(componentsTable, "COMPNAME", iComp);
791  double fracWeight = db()->getDouble(componentsTable, "FRACTION", iComp);
792  MatMap::iterator iter = materials.find(materialName);
793  if (iter != materials.end()) {
794  iter->second.addComponent(compName, fracWeight);
795  } else {
796  ATH_MSG_ERROR("Attemp to add material component, " << compName << ", to non-existing material: "
797  << materialName);
798  }
799  }
800 
801  //Now create the materials
802  int matCount = 0;
803  int matCountLast = -1;
804  bool someUndefined = true;
805  // While there are still undefined materials keep creating materials.
806  // Check also that the matCount had change to avoid endless loop due to cyclicly
807  // defined materials.
808  while (someUndefined && matCount != matCountLast) {
809  matCountLast = matCount;
810  someUndefined = false;
811  for (MatMap::iterator iter = materials.begin(); iter != materials.end(); ++iter) {
812  MaterialDef& tmpMat = iter->second;
813  if (!tmpMat.isCreated()) {
814  // Check if any components are materials in this table and if they are defined.
815  // If not flag that there are undefined materials and go to next material
816  bool compsDefined = true;
817  for (unsigned int iComp = 0; iComp < tmpMat.numComponents(); ++iComp) {
818  const std::string& compName = tmpMat.compName(iComp);
819  MatMap::iterator iter2 = materials.find(compName);
820  if (iter2 != materials.end()) {
821  if (!iter2->second.isCreated()) {
822  compsDefined = false;
823  break;
824  }
825  }
826  }
827  if (compsDefined) {
828  createMaterial(tmpMat);
829  tmpMat.setCreated();
830  matCount++;
831  } else {
832  someUndefined = true;
833  }
834  }
835  }
836  }
837 
838 
839  if (someUndefined) {
840  ATH_MSG_ERROR("Not all materials could be defined due to cyclic definitions");
841  }
842 }

◆ addWeightMaterial()

void InDetMaterialManager::addWeightMaterial ( const std::string &  materialName,
const std::string &  materialBase,
double  weight,
int  linearWeightFlag 
)

Definition at line 361 of file InDetMaterialManager.cxx.

362  {
363  // Weight in gr
365 
366  if (m_weightMap.find(materialName) != m_weightMap.end()) {
367  ATH_MSG_WARNING("Material: " << materialName << " already exists in weight table");
368  } else {
369  ATH_MSG_DEBUG("Adding " << materialName
370  << " weight " << weight
371  << " linearWeightFlag " << linearWeightFlag
372  << " to weight table");
373  m_weightMap[materialName] = MaterialByWeight(materialBase, weight, linearWeightFlag);
374  }
375 }

◆ addWeightTable()

void InDetMaterialManager::addWeightTable ( const IRDBRecordset_ptr weightTable,
const std::string &  space = "" 
)

Definition at line 321 of file InDetMaterialManager.cxx.

321  {
322  ATH_MSG_DEBUG("Reading in weight table: " << weightTable->nodeName());
323  // If not using geometryDBSvc revert to old version
324  if (!db()) {
325  ATH_MSG_DEBUG("GeometryDBSvc not available. Using old version.");
326  addWeightTableOld(weightTable, space);
327  return;
328  }
329  for (unsigned int i = 0; i < db()->getTableSize(weightTable); i++) {
330  std::string materialName = db()->getString(weightTable, "MATERIAL", i);
331  if (!space.empty()) {
332  materialName = space + "::" + materialName;
333  }
334  std::string materialBase;
335  if (db()->testField(weightTable, "BASEMATERIAL", i)) {
336  materialBase = db()->getString(weightTable, "BASEMATERIAL", i);
337  }
338  double weight = db()->getDouble(weightTable, "WEIGHT", i) * GeoModelKernelUnits::gram;
339  //std::cout << materialName << " " << materialBase << " " << weight/CLHEP::g << std::endl;
340 
341  bool linearWeightFlag = false;
342  if (m_extraFunctionality && db()->testField(weightTable, "LINWEIGHTFLAG", i)) {
343  linearWeightFlag = db()->getInt(weightTable, "LINWEIGHTFLAG", i);
344  }
345 
346  if (m_weightMap.find(materialName) != m_weightMap.end()) {
347  ATH_MSG_WARNING("Material: " << materialName << " already exists in weight table");
348  } else {
349  ATH_MSG_DEBUG("Adding " << materialName
350  << " weight " << weight
351  << " linearWeightFlag " << linearWeightFlag
352  << " raw weight " << db()->getDouble(weightTable, "WEIGHT", i)
353  << " m_extraFunctionality " << m_extraFunctionality
354  << " to weight table");
355  m_weightMap[materialName] = MaterialByWeight(materialBase, weight, linearWeightFlag);
356  }
357  }
358 }

◆ addWeightTableOld()

void InDetMaterialManager::addWeightTableOld ( const IRDBRecordset_ptr weightTable,
const std::string &  space 
)
private

Definition at line 378 of file InDetMaterialManager.cxx.

378  {
379  for (unsigned int i = 0; i < weightTable->size(); i++) {
380  const IRDBRecord* record = (*weightTable)[i];
381  std::string materialName = record->getString("MATERIAL");
382  if (!space.empty()) {
383  materialName = space + "::" + materialName;
384  }
385  std::string materialBase;
386  if (!record->isFieldNull("BASEMATERIAL")) {
387  materialBase = record->getString("BASEMATERIAL");
388  }
389  double weight = record->getDouble("WEIGHT") * GeoModelKernelUnits::gram;
390  //std::cout << materialName << " " << materialBase << " " << weight/CLHEP::g << std::endl;
391 
392  bool linearWeightFlag = false;
393  if (m_extraFunctionality) {
394  linearWeightFlag = record->getInt("LINWEIGHTFLAG");
395  }
396 
397  if (m_weightMap.find(materialName) != m_weightMap.end()) {
398  ATH_MSG_WARNING("Material: " << materialName << " already exists in weight table");
399  } else {
400  m_weightMap[materialName] = MaterialByWeight(materialBase, weight, linearWeightFlag);
401  }
402  }
403 }

◆ compareDensity()

bool InDetMaterialManager::compareDensity ( double  d1,
double  d2 
) const
private

Definition at line 316 of file InDetMaterialManager.cxx.

316  {
317  return(std::abs(d1 / d2 - 1.) < 1e-5);
318 }

◆ createMaterial()

void InDetMaterialManager::createMaterial ( const MaterialDef material)
private

Definition at line 845 of file InDetMaterialManager.cxx.

845  {
846  if (material.numComponents() == 0) {
847  ATH_MSG_ERROR("Material has no components: " << material.name());
848  return;
849  }
850 
851  // If total of fractions is greater than 1.1 then assume material is define by ratio of atoms.
852  double totWeight = material.totalFraction();
853  bool byAtomicRatio = false;
854  if (totWeight > 1.1) {
855  byAtomicRatio = true;
856  for (unsigned int i = 0; i < material.numComponents(); i++) {
857  if (material.compName(i).find("::") != std::string::npos) {
858  // If component name has "::" in it then its not an element.
859  ATH_MSG_ERROR("Material, " << material.name() <<
860  ", is assumed to be defined by atomic ratio (due to total fraction > 1)"
861  " but component is not an element: " << material.compName(i));
862  return;
863  }
864  const GeoElement* element = getElement(material.compName(i));
865  if (!element) {
866  ATH_MSG_ERROR("Error making material " << material.name() << ". Element not found: " <<
867  material.compName(i));
868  return;
869  }
870  totWeight += material.fraction(i) * element->getA();
871  }
872  } else {
873  // Check if total fraction is close to 1.
874  if (std::abs(totWeight - 1) > 0.01) {
875  ATH_MSG_WARNING("Total fractional weight does not sum to 1. Will renormalize. Total = " << totWeight);
876  }
877  }
878  // Now build the material
879  GeoIntrusivePtr<GeoMaterial> newMaterial{new GeoMaterial(material.name(), material.density())};
880  ATH_MSG_DEBUG("Creating material: " << material.name() << " with density: "
881  << material.density() / (Gaudi::Units::g / Gaudi::Units::cm3));
882  for (unsigned int i = 0; i < material.numComponents(); i++) {
883  double fracWeight = material.fraction(i) / totWeight;
884  if (material.compName(i).find("::") == std::string::npos) {
885  const GeoElement* element = getElement(material.compName(i));
886  if (!element) {
887  ATH_MSG_ERROR("Error making material " << material.name() << ". Element not found: " << material.compName(i));
888  // delete the partially created material
889  return;
890  }
891  if (byAtomicRatio) {
892  fracWeight = material.fraction(i) * element->getA() / totWeight;
893  }
894  newMaterial->add(const_cast<GeoElement*>(element), fracWeight);
895  ATH_MSG_DEBUG(" Component: " << material.compName(i) << " " << fracWeight);
896  } else {
897  GeoIntrusivePtr<const GeoMaterial> materialTmp{getMaterialInternal(material.compName(i))};
898  if (!materialTmp) {
899  ATH_MSG_ERROR("Error making material " << material.name() << ". Component not found: " << material.compName(i));
900  // delete the partially created material
901  return;
902  }
903  if (byAtomicRatio) {
904  // Should not happen as already checked that all components were elements.
905  ATH_MSG_ERROR("Unexpected Error");
906  }
907  newMaterial->add(const_cast<GeoMaterial*>(materialTmp.get()), fracWeight);
908  ATH_MSG_DEBUG(" Component: " << material.compName(i) << " " << fracWeight);
909  }
910  }
911  newMaterial->lock();
912  addMaterial(newMaterial);
913 }

◆ db()

const IGeometryDBSvc * InDetMaterialManager::db ( )
private

Definition at line 757 of file InDetMaterialManager.cxx.

757  {
758  if (m_athenaComps) return m_athenaComps->geomDB();
759 
760  return nullptr;
761 }

◆ extraScaledMaterial() [1/2]

const GeoMaterial * InDetMaterialManager::extraScaledMaterial ( const std::string &  materialName,
const GeoMaterial *  origMaterial 
)
private

Definition at line 961 of file InDetMaterialManager.cxx.

961  {
962  if (!origMaterial) throw std::runtime_error(std::string("Invalid material: ") + materialName);
963 
964  double scaleFactor = getExtraScaleFactor(materialName);
965  // -1 (or any -ve number) indicates material is not scaled. And if the scale factor
966  // is 1 then there is no need to create a new material.
967  if (scaleFactor < 0 || scaleFactor == 1 || materialName.find("Ether") != std::string::npos) return origMaterial;
968 
969  if (scaleFactor == 0) return getMaterialInternal("std::Vacuum");
970 
971  std::string newName = materialName + "_ExtraScaling";
972 
973  // Check if it is already made.
974  const GeoMaterial* newMaterial = getAdditionalMaterial(newName);
975 
976  // Already made so we return it.
977  if (newMaterial) return newMaterial;
978 
979  // Otherwise we need to make it.
980  double density = origMaterial->getDensity() * scaleFactor;
981 
982  // create new material
983  GeoMaterial* newMaterialTmp = new GeoMaterial(newName, density);
984  newMaterialTmp->add(const_cast<GeoMaterial*>(origMaterial), 1.);
985  addMaterial(newMaterialTmp);
986  newMaterial = newMaterialTmp;
987 
988  return newMaterial;
989 }

◆ extraScaledMaterial() [2/2]

const GeoMaterial * InDetMaterialManager::extraScaledMaterial ( const std::string &  materialName,
const std::string &  newName,
const GeoMaterial *  origMaterial 
)
private

Definition at line 950 of file InDetMaterialManager.cxx.

952  {
953  if (newName.empty()) {
954  return extraScaledMaterial(materialName, origMaterial);
955  } else {
956  return extraScaledMaterial(newName, origMaterial);
957  }
958 }

◆ getAdditionalMaterial()

const GeoMaterial * InDetMaterialManager::getAdditionalMaterial ( const std::string &  materialName) const
private

Definition at line 124 of file InDetMaterialManager.cxx.

124  {
125  MaterialStore::const_iterator iter;
126  if ((iter = m_store.find(materialName)) != m_store.end()) {
127  return iter->second;
128  } else {
129  return nullptr;
130  }
131 }

◆ getCompositeMaterialForVolume()

const GeoMaterial * InDetMaterialManager::getCompositeMaterialForVolume ( const std::string &  newMatName,
const double  volumeTot,
const double  volume1,
const std::string &  matName1,
const double  volume2,
const std::string &  matName2 
)

Definition at line 134 of file InDetMaterialManager.cxx.

138  {
139  std::vector<std::string> baseMaterials;
140  std::vector<double> fracWeight;
141  baseMaterials.reserve(2);
142  fracWeight.reserve(2);
143 
144  ATH_MSG_DEBUG("Composite material : " << volumeTot / Gaudi::Units::cm3 << " = " << volume1 / Gaudi::Units::cm3
145  << " + " << volume2 / Gaudi::Units::cm3);
146  ATH_MSG_DEBUG("Composite material : " << matName1 << " " << matName2);
147 
148  double density1, density2;
149 
150  MaterialWeightMap::const_iterator iter;
151  if ((iter = m_weightMap.find(matName1)) != m_weightMap.end()) {
152  const GeoMaterial* mat1 = getMaterialForVolume(matName1, volume1);
153  density1 = mat1->getDensity();
154  ATH_MSG_DEBUG("Composite material 1 - weight : " << density1 / (GeoModelKernelUnits::gram / Gaudi::Units::cm3));
155  } else {
156  const GeoMaterial* mat1 = getMaterial(matName1);
157  density1 = mat1->getDensity();
158  ATH_MSG_DEBUG("Composite material 1 - standard : " << density1 / (GeoModelKernelUnits::gram / Gaudi::Units::cm3));
159  }
160 
161  if ((iter = m_weightMap.find(matName2)) != m_weightMap.end()) {
162  const GeoMaterial* mat2 = getMaterialForVolume(matName2, volume2);
163  density2 = mat2->getDensity();
164  ATH_MSG_DEBUG("Composite material 2 - weight : " << density2 / (GeoModelKernelUnits::gram / Gaudi::Units::cm3));
165  } else {
166  const GeoMaterial* mat2 = getMaterial(matName2);
167  density2 = mat2->getDensity();
168  ATH_MSG_DEBUG("Composite material 2 - standard : " << density2 / (GeoModelKernelUnits::gram / Gaudi::Units::cm3));
169  }
170 
171  double weight1 = density1 * volume1;
172  double weight2 = density2 * volume2;
173  double invWeightTot = 1.0 / (weight1 + weight2);
174 
175  double density = (weight1 + weight2) / volumeTot;
176 
177  double frac1 = weight1 / (weight1 + weight2);
178  double frac2 = weight2 / (weight1 + weight2);
179  double density_2 = 1.0 / (frac1 / density1 + frac2 / density2);
180  double density_3 = (weight1 + weight2) / (volume1 + volume2);
181  ATH_MSG_DEBUG("-> weights : " << weight1 / (GeoModelKernelUnits::gram) << " " << weight2 / (GeoModelKernelUnits::gram));
182  ATH_MSG_DEBUG("-> density : " << density / (GeoModelKernelUnits::gram / Gaudi::Units::cm3) << " " << density_2 /
184 
185 
186  baseMaterials.push_back(matName1);
187  baseMaterials.push_back(matName2);
188  fracWeight.push_back(weight1 * invWeightTot);
189  fracWeight.push_back(weight2 * invWeightTot);
190 
191  return getMaterial(newMatName, baseMaterials, fracWeight, density);
192 }

◆ getElement()

const GeoElement * InDetMaterialManager::getElement ( const std::string &  elementName)

Get element from GeoModel material manager.

Definition at line 86 of file InDetMaterialManager.cxx.

86  {
87  if(!m_materialManager) {
88  std::string errorMessage("Null pointer to Stored Material Manager!");
89  ATH_MSG_FATAL(errorMessage);
90  throw std::runtime_error(errorMessage);
91  }
92  return m_materialManager->getElement(elementName);
93 }

◆ getExtraScaleFactor()

double InDetMaterialManager::getExtraScaleFactor ( const std::string &  materialName)
private

Definition at line 992 of file InDetMaterialManager.cxx.

992  {
993  // If name is found in map we return the corresponding scale factor.
994  // The special name "ALL" indicates all materials are scaled.
995  // Individual materials can be excluded from scaling by giving either
996  // a -ve scaling factor or just specifying a scaling factor of 1.
997  // A scaling factor of 0 means the material will be replaced by vacuum.
998 
999  ExtraScaleFactorMap::const_iterator iter = m_scalingMap.find(materialName);
1000  if (iter != m_scalingMap.end()) {
1001  return iter->second;
1002  } else {
1003  // Check for special names
1004  // ALL means everything scaled. Do not scale air or vacuum (unless explicity requested)
1005  iter = m_scalingMap.find("ALL");
1006  if (iter != m_scalingMap.end() && materialName != "std::Air" && materialName != "std::Vacuum") {
1007  return iter->second;
1008  }
1009  }
1010 
1011  // If not found then return -1 to indicate material is not to be scaled.
1012  return -1;
1013 }

◆ getMaterial() [1/3]

const GeoMaterial * InDetMaterialManager::getMaterial ( const std::string &  materialName)

Get material. First looks for locally defined material and if not found looks in GeoModel material manager.

Definition at line 96 of file InDetMaterialManager.cxx.

96  {
97  return extraScaledMaterial(materialName, getMaterialInternal(materialName));
98 }

◆ getMaterial() [2/3]

const GeoMaterial * InDetMaterialManager::getMaterial ( const std::string &  name,
const std::vector< std::string > &  materialComponents,
const std::vector< double > &  fractWeights,
double  density 
)

Definition at line 718 of file InDetMaterialManager.cxx.

721  {
722  return extraScaledMaterial(name, getMaterialInternal(name, materialComponents, fracWeight, density));
723 }

◆ getMaterial() [3/3]

const GeoMaterial * InDetMaterialManager::getMaterial ( const std::string &  origMaterialName,
double  density,
const std::string &  newName = "" 
)

Create and get material with a specified density based on an existing material.

If a newName is supplied it creates the new material even if the orginal material has the same density. It however first checks if the material with NewName exists. If no newName is supplied then it checks the density of the existing material. If it is consistent it returns the material. If it is different it creates a material with the string "Modified" added to the name.

Definition at line 206 of file InDetMaterialManager.cxx.

208  {
209  return extraScaledMaterial(origMaterialName, newName,
210  getMaterialInternal(origMaterialName, density, newName));
211 }

◆ getMaterialForVolume()

const GeoMaterial * InDetMaterialManager::getMaterialForVolume ( const std::string &  materialName,
double  volume,
const std::string &  newName = "" 
)

Create and get material with a density calculated to give weight in predefined weight table.

Definition at line 460 of file InDetMaterialManager.cxx.

460  {
461  // Make sure we have a valid volume size.
462  if (volume <= 0) {
463  ATH_MSG_ERROR("Invalid volume : " << volume);
464  return nullptr;
465  }
466 
467  // Find if material is in the weight table.
468  // If so we use the information to create a material with the
469  // density calculated from the volume and weight. If a base material
470  // is specified in the weight table, then a new material is made
471  // which is the same as the base material but with the new
472  // density. If no base material is specified then there should be a
473  // material already existing with that name. If the existing material already has the
474  // correct density it is used, otherwise a new material is created
475  // with the string "Modified" added to the material name.
476 
477  MaterialWeightMap::const_iterator iter;
478  if ((iter = m_weightMap.find(materialName)) != m_weightMap.end()) {
479  const std::string& materialBase = iter->second.name;
480  double weight = iter->second.weight;
481  double density = weight / volume;
482  if (iter->second.linearWeightFlag) {
483  ATH_MSG_ERROR("Material defined by linear weight cannot be created with getMaterialForVolume method: " <<
484  materialName);
485  }
486 
487  ATH_MSG_VERBOSE("Found material in weight table - name, base, weight(g), volume(cm3), density(g/cm3): "
488  << materialName << ", "
489  << materialBase << ", "
490  << weight / GeoModelKernelUnits::gram << ", "
491  << volume / Gaudi::Units::cm3 << ", "
492  << density / (Gaudi::Units::g / Gaudi::Units::cm3));
493 
494  if (materialBase.empty()) {
495  return getMaterial(materialName, density, newName);
496  } else {
497  if (newName.empty()) {
498  return getMaterial(materialBase, density, materialName);
499  } else {
500  return getMaterial(materialBase, density, newName);
501  }
502  }
503  } else {
504  // If not in the weight table we just return the material.
505  // This is not an error.
506  ATH_MSG_VERBOSE("Material not in weight table, using standard material: "
507  << materialName
508  << ", volume(cm3) = " << volume / Gaudi::Units::cm3);
509  return getMaterial(materialName);
510  }
511 }

◆ getMaterialForVolumeLength() [1/3]

const GeoMaterial * InDetMaterialManager::getMaterialForVolumeLength ( const std::string &  materialName,
double  volume,
double  length,
const std::string &  newName = "" 
)

Definition at line 514 of file InDetMaterialManager.cxx.

515  {
516  // In the case there is no material composition table (MaterialCompositionMap) and no linear weights are used this
517  // will
518  // behave the same way as getMaterialForVolume.
519  // If the material is in the MaterialCompositionMap it will build a material using the components
520  // from that table. If any components are defined as a linear weight the length is used to calculate the
521  // weight (ie linear weight * length).
522 
523 
524  std::string name;
525  if (newName.empty()) {
526  name = materialName;
527  } else {
528  name = newName;
529  }
530 
531  // Make sure we have a valid volume size.
532  if (volume <= 0 || length <= 0) {
533  ATH_MSG_ERROR("Invalid volume or length : " << volume << ", " << length);
534  return nullptr;
535  }
536 
537  // First look in the predefinded collections
538  std::pair<MaterialCompositionMap::const_iterator, MaterialCompositionMap::const_iterator> iterRange;
539  iterRange = m_matCompositionMap.equal_range(materialName);
540  if (iterRange.first != m_matCompositionMap.end()) {
541  ATH_MSG_VERBOSE("Found material in material composition table:" << materialName);
542 
543  std::vector<double> factors;
544  std::vector<std::string> components;
545  for (MaterialCompositionMap::const_iterator iter = iterRange.first; iter != iterRange.second; ++iter) {
546  double factorTmp = iter->second.factor;
547  if (iter->second.actualLength > 0) factorTmp *= iter->second.actualLength / length;
548  factors.push_back(factorTmp);
549  components.push_back(iter->second.name);
550  }
551  return getMaterialForVolumeLength(name, components, factors, volume, length);
552  }
553 
554  // Next look in weight table
555  MaterialWeightMap::const_iterator iter;
556  if ((iter = m_weightMap.find(materialName)) != m_weightMap.end()) {
557  const std::string& materialBase = iter->second.name;
558  double weight = iter->second.weight;
559  double density = weight / volume;
560  if (iter->second.linearWeightFlag) weight *= length;
561 
562  if (materialBase.empty()) {
563  return getMaterial(materialName, density, newName);
564  } else {
565  return getMaterial(materialBase, density, name);
566  }
567  } else {
568  // Otherwise we just return the material.
569  // This is not an error.
570  ATH_MSG_VERBOSE("Material not in weight table, using standard material: "
571  << materialName
572  << ", volume(cm3) = " << volume / Gaudi::Units::cm3);
573  return getMaterial(materialName);
574  }
575 }

◆ getMaterialForVolumeLength() [2/3]

const GeoMaterial * InDetMaterialManager::getMaterialForVolumeLength ( const std::string &  name,
const std::string &  materialComponent,
double  factor,
double  volume,
double  length 
)

Definition at line 578 of file InDetMaterialManager.cxx.

582  {
583  std::vector<std::string> tmpMaterialComponents(1, materialComponent);
584  std::vector<double> tmpFactors(1, factor);
585  return getMaterialForVolumeLength(name, tmpMaterialComponents, tmpFactors, volume, length);
586 }

◆ getMaterialForVolumeLength() [3/3]

const GeoMaterial * InDetMaterialManager::getMaterialForVolumeLength ( const std::string &  name,
const std::vector< std::string > &  materialComponents,
const std::vector< double > &  factors,
double  volume,
double  length 
)

Definition at line 589 of file InDetMaterialManager.cxx.

593  {
594  // Make sure we have a valid volume size.
595  if (volume <= 0 || length <= 0) {
596  ATH_MSG_ERROR("Invalid volume or length : " << volume << ", " << length);
597  return nullptr;
598  }
599 
600  if (!factors.empty() && factors.size() < materialComponents.size()) {
601  ATH_MSG_WARNING("getMaterialForVolumeLength: factor vector size too small. Setting remaining factors to 1.");
602  }
603 
604  std::vector<std::string> baseMaterials;
605  std::vector<double> fracWeight;
606  baseMaterials.reserve(materialComponents.size());
607  fracWeight.reserve(materialComponents.size());
608 
609  double totWeight = 0;
610  for (unsigned int iComp = 0; iComp < materialComponents.size(); ++iComp) {
611  const std::string& materialName = materialComponents[iComp];
612 
613  // First search in MaterialWeightMap
614  MaterialWeightMap::const_iterator iter;
615  if ((iter = m_weightMap.find(materialName)) != m_weightMap.end()) {
616  const std::string& materialBase = iter->second.name;
617  double weight = iter->second.weight;
618 
619  if (iComp < factors.size()) {
620  weight *= factors[iComp];
621  }
622  ATH_MSG_DEBUG("Material " << materialName
623  << " found in weight table, weight " << iter->second.weight / GeoModelKernelUnits::gram
624  << " factor " << factors[iComp]
625  << " w*fac*len " << weight * length / GeoModelKernelUnits::gram
626  << " basMat " << materialBase
627  << " linear? " << iter->second.linearWeightFlag);
628 
629  if (iter->second.linearWeightFlag) weight *= length;
630  if (materialBase.empty()) {
631  // If no base material then name should refer to an already defined material
632  baseMaterials.push_back(materialName);
633  } else {
634  baseMaterials.push_back(materialBase);
635  }
636  fracWeight.push_back(weight); // Will be normalized later.
637  totWeight += weight;
638  } else {
639  // If not in the weight table we look for a regular material.
640  // I don't think this would normally be intentional so we give a warning message.
641  /*
642  if (msgLvl(MSG::WARNING))
643  msg(MSG::WARNING)
644  << "Component material not in weight table, using standard material: "
645  << materialName << " with weight= "
646  << factors.at(iComp) * length
647  << endmsg;
648  const GeoMaterial * material = getMaterialInternal(materialName);
649  */
650 
651  // In this case the factor should correspond to the linear weight
652  double weight = factors.at(iComp) * length * GeoModelKernelUnits::gram;
653 
654  // If material not found, will get error message when attempting to make the material. So carry on here.
655  baseMaterials.push_back(materialName);
656  fracWeight.push_back(weight);
657  totWeight += weight;
658  }
659  }
660 
661  if (msgLvl(MSG::VERBOSE)) {
662  msg(MSG::VERBOSE) << "Creating material from multiple components: " << name << endmsg;
663  for (unsigned int i = 0; i < materialComponents.size(); ++i) {
664  msg(MSG::VERBOSE) << " Component " << i << ": Name = " << baseMaterials[i]
665  << " Weight(g) = " << fracWeight[i] / Gaudi::Units::g << endmsg;
666  }
667  }
668 
669  for (unsigned int i = 0; i < fracWeight.size(); ++i) {
670  fracWeight[i] /= totWeight;
671  }
672  double density = totWeight / volume;
673 
674  return getMaterial(name, baseMaterials, fracWeight, density);
675 }

◆ getMaterialInternal() [1/3]

const GeoMaterial * InDetMaterialManager::getMaterialInternal ( const std::string &  materialName)
private

Definition at line 106 of file InDetMaterialManager.cxx.

106  {
107  // First check local store of materials. If not found then get it from the GeoModel
108  // manager.
109  const GeoMaterial* material = getAdditionalMaterial(materialName);
110 
111  if (!material) {
112  if(!m_materialManager) {
113  std::string errorMessage("Null pointer to Stored Material Manager!");
114  ATH_MSG_FATAL(errorMessage);
115  throw std::runtime_error(errorMessage);
116  }
117  // This prints error message if not found.
118  material = m_materialManager->getMaterial(materialName);
119  }
120  return material;
121 }

◆ getMaterialInternal() [2/3]

const GeoMaterial * InDetMaterialManager::getMaterialInternal ( const std::string &  name,
const std::vector< std::string > &  materialComponents,
const std::vector< double > &  fractWeights,
double  density 
)
private

Definition at line 726 of file InDetMaterialManager.cxx.

729  {
730  const GeoMaterial* newMaterial = nullptr;
731 
732  // First see if we already have the material
733  const GeoMaterial* material = getAdditionalMaterial(name);
734 
735  if (material) {
736  if (!compareDensity(material->getDensity(), density)) {
737  ATH_MSG_WARNING("Density is not consistent for material " << name);
738  }
739  newMaterial = material;
740  } else {
741  GeoMaterial* newMaterialTmp = new GeoMaterial(name, density);
742  for (unsigned int i = 0; i < materialComponents.size(); i++) {
743  const GeoMaterial* origMaterial = getMaterialInternal(materialComponents[i]);
744  if (origMaterial) {
745  newMaterialTmp->add(const_cast<GeoMaterial*>(origMaterial), fracWeight[i]);
746  } else {
747  ATH_MSG_ERROR("Material component missing " << materialComponents[i]);
748  }
749  }
750  addMaterial(newMaterialTmp);
751  newMaterial = newMaterialTmp;
752  }
753  return newMaterial;
754 }

◆ getMaterialInternal() [3/3]

const GeoMaterial * InDetMaterialManager::getMaterialInternal ( const std::string &  origMaterialName,
double  density,
const std::string &  newName = "" 
)
private

Definition at line 214 of file InDetMaterialManager.cxx.

216  {
217  std::string newName2 = newName;
218  bool newNameProvided = !newName2.empty();
219  if (!newNameProvided) {
220  newName2 = origMaterialName + "Modified";
221  }
222 
223  const GeoMaterial* newMaterial = nullptr;
224 
225  // First see if we already have the modified material
226  const GeoMaterial* material = getAdditionalMaterial(newName2);
227  if (material) {
228  if (!compareDensity(material->getDensity(), density)) {
229  ATH_MSG_WARNING("Density is not consistent for material " << newName2
230  << " " << material->getDensity() / (GeoModelKernelUnits::gram / Gaudi::Units::cm3)
231  << " / " << density / (GeoModelKernelUnits::gram / Gaudi::Units::cm3));
232  }
233  newMaterial = material;
234  } else {
235  const GeoMaterial* origMaterial = getMaterialInternal(origMaterialName);
236  newMaterial = origMaterial;
237  if (origMaterial) {
238  // If no new name was provided we check if the density is compatible
239  // and if so we return the original material.
240  if (newNameProvided || !compareDensity(origMaterial->getDensity(), density)) {
241  // create new material
242  GeoMaterial* newMaterialTmp = new GeoMaterial(newName2, density);
243  newMaterialTmp->add(const_cast<GeoMaterial*>(origMaterial), 1.);
244  addMaterial(newMaterialTmp);
245  newMaterial = newMaterialTmp;
246  }
247  }
248  }
249  return newMaterial;
250 }

◆ getMaterialScaled()

const GeoMaterial * InDetMaterialManager::getMaterialScaled ( const std::string &  origMaterialName,
double  scaleFactor,
const std::string &  newName = "" 
)

Definition at line 253 of file InDetMaterialManager.cxx.

255  {
256  return extraScaledMaterial(origMaterialName, newName,
257  getMaterialScaledInternal(origMaterialName, scaleFactor, newName));
258 }

◆ getMaterialScaledInternal()

const GeoMaterial * InDetMaterialManager::getMaterialScaledInternal ( const std::string &  origMaterialName,
double  scaleFactor,
const std::string &  newName = "" 
)
private

Definition at line 261 of file InDetMaterialManager.cxx.

263  {
264  // Don't allow large scale factors
265  if (scaleFactor > 1000 || scaleFactor < 0.001) {
266  ATH_MSG_ERROR("Scale factor must be between 0.001 and 1000.");
267  return nullptr;
268  }
269 
270  const GeoMaterial* origMaterial = getMaterialInternal(origMaterialName);
271 
272  // If scalefactor is 1 and no new name is requested
273  // then just return the orginal material
274  if (newName.empty() && scaleFactor == 1.) return origMaterial;
275 
276  const GeoMaterial* newMaterial = nullptr;
277 
278  if (origMaterial) {
279  double density = origMaterial->getDensity() * scaleFactor;
280  std::string newName2 = newName;
281  if (newName2.empty()) {
282  // Create name using the scale factor.
283  int scaleInt = static_cast<int>(scaleFactor * 10000);
284  int scale1 = scaleInt / 10000;
285  int scale2 = scaleInt % 10000;
286 
287  std::ostringstream os;
288  os << origMaterialName << scale1 << "_" << std::setw(4) << std::setfill('0') << scale2;
289  newName2 = os.str();
290  }
291 
292  newMaterial = getMaterialInternal(origMaterialName, density, newName2);
293  }
294 
295  return newMaterial;
296 }

◆ hasMaterial()

bool InDetMaterialManager::hasMaterial ( const std::string &  materialName) const

Definition at line 101 of file InDetMaterialManager.cxx.

101  {
102  return m_weightMap.find(materialName) != m_weightMap.end();
103 }

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40 {
42  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 164 of file AthMessaging.h.

165 {
166  MsgStream* ms = m_msg_tls.get();
167  if (!ms) {
168  if (!m_initialized.test_and_set()) initMessaging();
169  ms = new MsgStream(m_imsg,m_nm);
170  m_msg_tls.reset( ms );
171  }
172 
173  ms->setLevel (m_lvl);
174  return *ms;
175 }

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level  lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 179 of file AthMessaging.h.

180 { return msg() << lvl; }

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152 {
153  if (!m_initialized.test_and_set()) initMessaging();
154  if (m_lvl <= lvl) {
155  msg() << lvl;
156  return true;
157  } else {
158  return false;
159  }
160 }

◆ retrieveManager()

StoredMaterialManager * InDetMaterialManager::retrieveManager ( const StoreGateSvc detStore)
inlineprivate

Definition at line 81 of file InDetMaterialManager.cxx.

81  {
82  return detStore->tryRetrieve<StoredMaterialManager>("MATERIALS");
83 }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level  lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29 {
30  m_lvl = lvl;
31 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_athenaComps

const InDetDD::AthenaComps* InDetMaterialManager::m_athenaComps
private

Definition at line 230 of file InDetMaterialManager.h.

◆ m_extraFunctionality

bool InDetMaterialManager::m_extraFunctionality
private

Definition at line 228 of file InDetMaterialManager.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_managerName

std::string InDetMaterialManager::m_managerName
private

Definition at line 213 of file InDetMaterialManager.h.

◆ m_matCompositionMap

MaterialCompositionMap InDetMaterialManager::m_matCompositionMap
private

Definition at line 222 of file InDetMaterialManager.h.

◆ m_materialManager

StoredMaterialManager* InDetMaterialManager::m_materialManager
private

Definition at line 212 of file InDetMaterialManager.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_scalingMap

ExtraScaleFactorMap InDetMaterialManager::m_scalingMap
private

Definition at line 225 of file InDetMaterialManager.h.

◆ m_store

MaterialStore InDetMaterialManager::m_store
private

Definition at line 216 of file InDetMaterialManager.h.

◆ m_weightMap

MaterialWeightMap InDetMaterialManager::m_weightMap
private

Definition at line 219 of file InDetMaterialManager.h.


The documentation for this class was generated from the following files:
IRDBRecord::getInt
virtual int getInt(const std::string &fieldName) const =0
Get int field value.
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
InDetMaterialManager::addMaterial
void addMaterial(GeoMaterial *material)
Add material.
Definition: InDetMaterialManager.cxx:299
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
InDetMaterialManager::addWeightTable
void addWeightTable(const IRDBRecordset_ptr &weightTable, const std::string &space="")
Definition: InDetMaterialManager.cxx:321
AddEmptyComponent.compName
compName
Definition: AddEmptyComponent.py:32
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
scale2
#define scale2
Definition: JetAttributeHisto.cxx:42
InDetMaterialManager::m_athenaComps
const InDetDD::AthenaComps * m_athenaComps
Definition: InDetMaterialManager.h:230
InDetMaterialManager::getAdditionalMaterial
const GeoMaterial * getAdditionalMaterial(const std::string &materialName) const
Definition: InDetMaterialManager.cxx:124
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
InDetMaterialManager::m_materialManager
StoredMaterialManager * m_materialManager
Definition: InDetMaterialManager.h:212
IRDBRecord::getString
virtual const std::string & getString(const std::string &fieldName) const =0
Get string field value.
StoredMaterialManager::getElement
virtual const GeoElement * getElement(const std::string &name)=0
cm3
#define cm3
dq_defect_virtual_defect_validation.d1
d1
Definition: dq_defect_virtual_defect_validation.py:79
InDetMaterialManager::getMaterialScaledInternal
const GeoMaterial * getMaterialScaledInternal(const std::string &origMaterialName, double scaleFactor, const std::string &newName="")
Definition: InDetMaterialManager.cxx:261
python.SystemOfUnits.gram
int gram
Definition: SystemOfUnits.py:165
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
InDetMaterialManager::m_matCompositionMap
MaterialCompositionMap m_matCompositionMap
Definition: InDetMaterialManager.h:222
IGeometryDBSvc::getTableSize
virtual unsigned int getTableSize(IRDBRecordset_ptr recordSet) const =0
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
InDetMaterialManager::getMaterialInternal
const GeoMaterial * getMaterialInternal(const std::string &materialName)
Definition: InDetMaterialManager.cxx:106
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
InDetMaterialManager::addTextFileMaterials
void addTextFileMaterials()
Definition: InDetMaterialManager.cxx:764
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
AthMessaging::AthMessaging
AthMessaging()
Default constructor:
InDetMaterialManager::m_store
MaterialStore m_store
Definition: InDetMaterialManager.h:216
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthMessaging::msgLvl
bool msgLvl(const MSG::Level lvl) const
Test the output level.
Definition: AthMessaging.h:151
lumiFormat.i
int i
Definition: lumiFormat.py:92
InDetMaterialManager::addWeightTableOld
void addWeightTableOld(const IRDBRecordset_ptr &weightTable, const std::string &space)
Definition: InDetMaterialManager.cxx:378
InDetMaterialManager::addCompositionTable
void addCompositionTable(const IRDBRecordset_ptr &compositionTable, const std::string &space="")
Definition: InDetMaterialManager.cxx:406
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
InDetMaterialManager::createMaterial
void createMaterial(const MaterialDef &material)
Definition: InDetMaterialManager.cxx:845
InDetMaterialManager::m_scalingMap
ExtraScaleFactorMap m_scalingMap
Definition: InDetMaterialManager.h:225
InDetMaterialManager::getMaterialForVolume
const GeoMaterial * getMaterialForVolume(const std::string &materialName, double volume, const std::string &newName="")
Create and get material with a density calculated to give weight in predefined weight table.
Definition: InDetMaterialManager.cxx:460
InDetMaterialManager::m_extraFunctionality
bool m_extraFunctionality
Definition: InDetMaterialManager.h:228
InDetMaterialManager::getMaterialForVolumeLength
const GeoMaterial * getMaterialForVolumeLength(const std::string &materialName, double volume, double length, const std::string &newName="")
Definition: InDetMaterialManager.cxx:514
InDetMaterialManager::extraScaledMaterial
const GeoMaterial * extraScaledMaterial(const std::string &materialName, const std::string &newName, const GeoMaterial *origMaterial)
Definition: InDetMaterialManager.cxx:950
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
IGeometryDBSvc::getDouble
virtual double getDouble(IRDBRecordset_ptr recordSet, const std::string &name, int index=0) const =0
The following methods will first look in the text file if provided and then look in the database.
Trk::MaterialComponent
std::pair< Material, double > MaterialComponent
Definition: VolumeConverter.h:31
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
InDetMaterialManager::getElement
const GeoElement * getElement(const std::string &elementName)
Get element from GeoModel material manager.
Definition: InDetMaterialManager.cxx:86
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
MakeNewFileFromOldAndSubstitution.newName
dictionary newName
Definition: ICHEP2016/MakeNewFileFromOldAndSubstitution.py:95
InDetMaterialManager::m_managerName
std::string m_managerName
Definition: InDetMaterialManager.h:213
InDetMaterialManager::retrieveManager
StoredMaterialManager * retrieveManager(const StoreGateSvc *detStore)
Definition: InDetMaterialManager.cxx:81
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
InDetDD::AthenaComps::geomDB
const IGeometryDBSvc * geomDB() const
Definition: InDetDDAthenaComps.h:63
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
IRDBRecord::isFieldNull
virtual bool isFieldNull(const std::string &fieldName) const =0
Check if the field value is NULL.
InDetMaterialManager::db
const IGeometryDBSvc * db()
Definition: InDetMaterialManager.cxx:757
IRDBRecord
IRDBRecord is one record in the IRDBRecordset object.
Definition: IRDBRecord.h:27
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
dq_defect_virtual_defect_validation.d2
d2
Definition: dq_defect_virtual_defect_validation.py:81
DEBUG
#define DEBUG
Definition: page_access.h:11
InDetMaterialManager::getExtraScaleFactor
double getExtraScaleFactor(const std::string &materialName)
Definition: InDetMaterialManager.cxx:992
IGeometryDBSvc::getInt
virtual int getInt(IRDBRecordset_ptr recordSet, const std::string &name, int index=0) const =0
StoredMaterialManager::getMaterial
virtual const GeoMaterial * getMaterial(const std::string &name)=0
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition: StoredMaterialManager.h:28
InDetMaterialManager::m_weightMap
MaterialWeightMap m_weightMap
Definition: InDetMaterialManager.h:219
IGeometryDBSvc::getString
virtual std::string getString(IRDBRecordset_ptr recordSet, const std::string &name, int index=0) const =0
IRDBRecord::getDouble
virtual double getDouble(const std::string &fieldName) const =0
Get double field value.
scale1
#define scale1
Definition: JetAttributeHisto.cxx:41
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
InDetMaterialManager::compareDensity
bool compareDensity(double d1, double d2) const
Definition: InDetMaterialManager.cxx:316
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
InDetDD::AthenaComps::detStore
const StoreGateSvc * detStore() const
Definition: InDetDDAthenaComps.h:53
InDetMaterialManager::getMaterial
const GeoMaterial * getMaterial(const std::string &materialName)
Get material. First looks for locally defined material and if not found looks in GeoModel material ma...
Definition: InDetMaterialManager.cxx:96
AthMessaging::m_msg_tls
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
Definition: AthMessaging.h:132
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26