ATLAS Offline Software
ServiceMaterial.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ServiceMaterial_H
6 #define ServiceMaterial_H
7 
8 #include <string>
9 #include <vector>
10 #include <iosfwd>
11 
13 public:
14 
21  struct Entry {
22  Entry( const std::string& nam, int num, bool lin) : name(nam), number(num), linear(lin), weight(1) {}
23  Entry( const std::string& nam, int num, bool lin, double w) : name(nam), number(num), linear(lin), weight(w) {}
24 
25  std::string name;
26  int number;
27  bool linear;
28  double weight;
29  };
30 
31  typedef std::vector< Entry> EntryContainer;
32  typedef EntryContainer::const_iterator EntryIter;
33 
35 
36  ServiceMaterial( const std::string& name, const std::vector< Entry>& cmp) :
38 
39  ServiceMaterial( const std::string& name) :
40  m_name(name), m_components() { m_components.reserve(6);}
41 
43  // ServiceMaterial( const std::string& name, double lw) :
44  // m_name(name), m_linearWeight(lw), m_components() {}
45 
46  const std::string& name() const {return m_name;}
47 
48  const std::vector< Entry>& components() const {return m_components;}
49 
50  void addEntry( const Entry& e) { m_components.push_back( e);}
51 
52  void addEntry( const std::string& nam, int num, bool lin, double w=1) {
53  m_components.push_back( Entry( nam, num, lin, w));
54  }
55 
56  //ServiceMaterial operator*( double len) const {return ServiceMaterial( name(), len*linearWeight(), m_components);}
57  void multiply( int factor) {
58  for ( std::vector< Entry>::iterator i=m_components.begin(); i!=m_components.end(); ++i) {
59  i->number *= factor;
60  }
61  }
62 
63  void dump( std::ostream& os) const;
64 
65 private:
66 
67  std::string m_name;
68  std::vector< Entry> m_components;
69 
70 };
71 
72 #endif
python.EI_Lib.cmp
def cmp(x, y)
Definition: EI_Lib.py:6
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
ServiceMaterial::Entry::weight
double weight
Definition: ServiceMaterial.h:28
ServiceMaterial::Entry::Entry
Entry(const std::string &nam, int num, bool lin)
Definition: ServiceMaterial.h:22
ServiceMaterial::ServiceMaterial
ServiceMaterial(const std::string &name)
Definition: ServiceMaterial.h:39
ServiceMaterial::multiply
void multiply(int factor)
Definition: ServiceMaterial.h:57
ServiceMaterial::name
const std::string & name() const
Constructor for elementary material (no components)
Definition: ServiceMaterial.h:46
ServiceMaterial::Entry::number
int number
Definition: ServiceMaterial.h:26
ServiceMaterial::dump
void dump(std::ostream &os) const
Definition: ServiceMaterial.cxx:8
lumiFormat.i
int i
Definition: lumiFormat.py:85
ServiceMaterial::components
const std::vector< Entry > & components() const
Definition: ServiceMaterial.h:48
ServiceMaterial::Entry::Entry
Entry(const std::string &nam, int num, bool lin, double w)
Definition: ServiceMaterial.h:23
ServiceMaterial::ServiceMaterial
ServiceMaterial(const std::string &name, const std::vector< Entry > &cmp)
Definition: ServiceMaterial.h:36
ServiceMaterial::m_name
std::string m_name
Definition: ServiceMaterial.h:67
ServiceMaterial::ServiceMaterial
ServiceMaterial()
Definition: ServiceMaterial.h:34
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
ServiceMaterial::EntryContainer
std::vector< Entry > EntryContainer
Definition: ServiceMaterial.h:31
ServiceMaterial::addEntry
void addEntry(const std::string &nam, int num, bool lin, double w=1)
Definition: ServiceMaterial.h:52
ServiceMaterial
Definition: ServiceMaterial.h:12
ServiceMaterial::EntryIter
EntryContainer::const_iterator EntryIter
Definition: ServiceMaterial.h:32
ServiceMaterial::m_components
std::vector< Entry > m_components
Definition: ServiceMaterial.h:68
ServiceMaterial::Entry::linear
bool linear
Definition: ServiceMaterial.h:27
ServiceMaterial::addEntry
void addEntry(const Entry &e)
Definition: ServiceMaterial.h:50
ServiceMaterial::Entry::name
std::string name
Definition: ServiceMaterial.h:25
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
ServiceMaterial::Entry
Structure holding one service material.
Definition: ServiceMaterial.h:21