ATLAS Offline Software
Classes | Functions
RDBMaterialManager.cxx File Reference
#include "RDBMaterialManager.h"
#include "GeoModelUtilities/DecodeVersionKey.h"
#include "GeoModelInterfaces/IGeoModelSvc.h"
#include "GeoModelKernel/GeoMaterial.h"
#include "GeoModelKernel/Units.h"
#include "StoreGate/DataHandle.h"
#include "RDBAccessSvc/IRDBAccessSvc.h"
#include "RDBAccessSvc/IRDBRecordset.h"
#include "RDBAccessSvc/IRDBRecord.h"
#include "AthenaKernel/getMessageSvc.h"
#include "GaudiKernel/IMessageSvc.h"
#include "GaudiKernel/ISvcLocator.h"
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/SystemOfUnits.h"
#include "AthenaBaseComps/AthCheckMacros.h"
#include <algorithm>
#include <iostream>
#include <stdexcept>

Go to the source code of this file.

Classes

class  NameEquals
 
class  NumberEquals
 

Functions

int CheckElement (std::string &name)
 
int printElement (GeoElement *&p_element)
 
int printElement (const GeoElement *&p_element)
 
int printMaterial (GeoMaterial *&p_material)
 
int printFullMaterial (GeoMaterial *&p_material)
 

Function Documentation

◆ CheckElement()

int CheckElement ( std::string &  name)

Definition at line 50 of file RDBMaterialManager.cxx.

51 {
52  if(name.find("::",0) == std::string::npos) {
53  return 1;
54  }
55  else {
56  return 0;
57  }
58 }

◆ printElement() [1/2]

int printElement ( const GeoElement *&  p_element)

Definition at line 74 of file RDBMaterialManager.cxx.

75 {
76  std::string name = p_element->getName();
77  std::string symbol = p_element->getSymbol();
78  double a = p_element->getA();
79  double z = p_element->getZ();
80 
81  std::cout << " ***** PrintElement(): Print the Element: " << name << "\n";
82  std::cout << " ***** The Element: name, symbol, A, Z \n";
83  std::cout << " ***** "<<name <<" "<<symbol <<" "<< a * (Gaudi::Units::mole / GeoModelKernelUnits::gram) <<" "<< z <<" " << std::endl;
84 
85  return 1;
86 }

◆ printElement() [2/2]

int printElement ( GeoElement *&  p_element)

Definition at line 60 of file RDBMaterialManager.cxx.

61 {
62  std::string name = p_element->getName();
63  std::string symbol = p_element->getSymbol();
64  double a = p_element->getA();
65  double z = p_element->getZ();
66 
67  std::cout << " ***** CheckElement(): Print the Element: " << name << "\n";
68  std::cout << " ***** The Element: name, symbol, A, Z \n" ;
69  std::cout << " ***** "<<name <<" "<<symbol <<" "<< a * (Gaudi::Units::mole / GeoModelKernelUnits::gram) <<" "<< z <<" " << std::endl;
70 
71  return 1;
72 }

◆ printFullMaterial()

int printFullMaterial ( GeoMaterial *&  p_material)

Definition at line 100 of file RDBMaterialManager.cxx.

101 {
102  std::string name = p_material->getName();
103  double density = p_material->getDensity() * (Gaudi::Units::cm3 / GeoModelKernelUnits::gram);
104 
105  std::cout << " ***** PrintFullMaterial(): Print the Material: " << name << "\n";
106  std::cout << " ***** The Material: name, density\n" ;
107  std::cout << " ***** "<< name <<" "<<density <<" " << std::endl;
108 
109  p_material->lock();
110  int element_number = p_material->getNumElements();
111 
112 
113  if ( element_number == 0){
114  std::cout << " ***** No Elements now in this printMaterial( ) " << std::endl;
115  return 1;
116  }
117  else {
118  element_number = p_material->getNumElements();
119 
120  for(int i =0; i< element_number;i ++)
121  {
122  const GeoElement* tmp_element = p_material->getElement(i);
123  double element_fraction = p_material->getFraction(i);
124 
125  std::cout<<" ***** ***** Number: " << i << " Fraction: " << element_fraction<< std::endl;
126  printElement( tmp_element);
127  }
128  }
129  return 1;
130 }

◆ printMaterial()

int printMaterial ( GeoMaterial *&  p_material)

Definition at line 88 of file RDBMaterialManager.cxx.

89 {
90  std::string name = p_material->getName();
91  double density = p_material->getDensity() * (Gaudi::Units::cm3 / GeoModelKernelUnits::gram);
92 
93  std::cout << " ***** PrintMaterial(): Print the Material: " << name << "\n";
94  std::cout << " ***** The Material: name, density \n" ;
95  std::cout << " ***** "<< name <<" "<<density <<" " << std::endl;
96 
97  return 1;
98 }
cm3
#define cm3
python.SystemOfUnits.gram
int gram
Definition: SystemOfUnits.py:165
lumiFormat.i
int i
Definition: lumiFormat.py:92
z
#define z
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
a
TList * a
Definition: liststreamerinfos.cxx:10
mole
#define mole
printElement
int printElement(GeoElement *&p_element)
Definition: RDBMaterialManager.cxx:60