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

#include <ServiceMaterial.h>

Collaboration diagram for ServiceMaterial:

Classes

struct  Entry
 Structure holding one service material. More...
 

Public Types

typedef std::vector< EntryEntryContainer
 
typedef EntryContainer::const_iterator EntryIter
 

Public Member Functions

 ServiceMaterial ()
 
 ServiceMaterial (const std::string &name, const std::vector< Entry > &cmp)
 
 ServiceMaterial (const std::string &name)
 
const std::string & name () const
 Constructor for elementary material (no components) More...
 
const std::vector< Entry > & components () const
 
void addEntry (const Entry &e)
 
void addEntry (const std::string &nam, int num, bool lin, double w=1)
 
void multiply (int factor)
 
void dump (std::ostream &os) const
 

Private Attributes

std::string m_name
 
std::vector< Entrym_components
 

Detailed Description

Definition at line 12 of file ServiceMaterial.h.

Member Typedef Documentation

◆ EntryContainer

typedef std::vector< Entry> ServiceMaterial::EntryContainer

Definition at line 31 of file ServiceMaterial.h.

◆ EntryIter

typedef EntryContainer::const_iterator ServiceMaterial::EntryIter

Definition at line 32 of file ServiceMaterial.h.

Constructor & Destructor Documentation

◆ ServiceMaterial() [1/3]

ServiceMaterial::ServiceMaterial ( )
inline

Definition at line 34 of file ServiceMaterial.h.

34 {}

◆ ServiceMaterial() [2/3]

ServiceMaterial::ServiceMaterial ( const std::string &  name,
const std::vector< Entry > &  cmp 
)
inline

Definition at line 36 of file ServiceMaterial.h.

36  :

◆ ServiceMaterial() [3/3]

ServiceMaterial::ServiceMaterial ( const std::string &  name)
inline

Definition at line 39 of file ServiceMaterial.h.

39  :
40  m_name(name), m_components() { m_components.reserve(6);}

Member Function Documentation

◆ addEntry() [1/2]

void ServiceMaterial::addEntry ( const Entry e)
inline

Definition at line 50 of file ServiceMaterial.h.

50 { m_components.push_back( e);}

◆ addEntry() [2/2]

void ServiceMaterial::addEntry ( const std::string &  nam,
int  num,
bool  lin,
double  w = 1 
)
inline

Definition at line 52 of file ServiceMaterial.h.

52  {
53  m_components.push_back( Entry( nam, num, lin, w));
54  }

◆ components()

const std::vector< Entry>& ServiceMaterial::components ( ) const
inline

Definition at line 48 of file ServiceMaterial.h.

48 {return m_components;}

◆ dump()

void ServiceMaterial::dump ( std::ostream &  os) const

Definition at line 8 of file ServiceMaterial.cxx.

9 {
10  os << std::endl << "Dump of ServiceMaterial " << name()
11  << " containing " << components().size() << " components" << std::endl;
12  double totalWeight = 0;
13  for (unsigned int i=0; i<components().size(); i++) {
15  os << "Comp. " << i << " name " << comp.name
16  << " number " << comp.number
17  << " weight " << comp.weight
18  << " is linear? " << comp.linear
19  << std::endl;
20  totalWeight += comp.weight * comp.number;
21  }
22  os << "Total weight: " << totalWeight << std::endl;
23 }

◆ multiply()

void ServiceMaterial::multiply ( int  factor)
inline

Definition at line 57 of file ServiceMaterial.h.

57  {
58  for ( std::vector< Entry>::iterator i=m_components.begin(); i!=m_components.end(); ++i) {
59  i->number *= factor;
60  }
61  }

◆ name()

const std::string& ServiceMaterial::name ( ) const
inline

Constructor for elementary material (no components)

Definition at line 46 of file ServiceMaterial.h.

46 {return m_name;}

Member Data Documentation

◆ m_components

std::vector< Entry> ServiceMaterial::m_components
private

Definition at line 68 of file ServiceMaterial.h.

◆ m_name

std::string ServiceMaterial::m_name
private

Definition at line 67 of file ServiceMaterial.h.


The documentation for this class was generated from the following files:
python.EI_Lib.cmp
def cmp(x, y)
Definition: EI_Lib.py:6
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
plotting.yearwise_luminosity_vs_mu.comp
comp
Definition: yearwise_luminosity_vs_mu.py:24
ServiceMaterial::name
const std::string & name() const
Constructor for elementary material (no components)
Definition: ServiceMaterial.h:46
lumiFormat.i
int i
Definition: lumiFormat.py:92
ServiceMaterial::components
const std::vector< Entry > & components() const
Definition: ServiceMaterial.h:48
ServiceMaterial::m_name
std::string m_name
Definition: ServiceMaterial.h:67
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
ServiceMaterial::m_components
std::vector< Entry > m_components
Definition: ServiceMaterial.h:68
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
ServiceMaterial::Entry
Structure holding one service material.
Definition: ServiceMaterial.h:21