ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
TrigConf::L1ThrExtraInfo_gXE Class Referencefinal

#include <L1ThrExtraInfo.h>

Inheritance diagram for TrigConf::L1ThrExtraInfo_gXE:
Collaboration diagram for TrigConf::L1ThrExtraInfo_gXE:

Public Types

using ptree = boost::property_tree::ptree
 

Public Member Functions

 L1ThrExtraInfo_gXE (const std::string &thrTypeName, const ptree &data)
 
virtual ~L1ThrExtraInfo_gXE () override=default
 
virtual std::string className () const override
 A string that is the name of the class. More...
 
float seedThr (const char fpga) const
 
unsigned int seedThrCounts (const char fpga) const
 
unsigned int seedThrMeV (const char fpga) const
 
unsigned int XERHO_param (const char fpga, const bool sigmapos) const
 
unsigned int JWOJ_param (const char fpga, const char param) const
 
const std::string & thresholdTypeName () const
 
bool hasExtraInfo (const std::string &key="") const
 
std::optional< std::reference_wrapper< const TrigConf::DataStructure > > getExtraInfo (const std::string &key) const
 
unsigned int resolutionMeV () const
 
void setData (const ptree &data)
 Setting the configuration data. More...
 
void setData (ptree &&data)
 
void setName (const std::string &n)
 Setting the configuration element name. More...
 
virtual const std::string & name () const final
 
virtual void clear ()
 Clearing the configuration data. More...
 
const ptreedata () const
 Access to the underlying data, if needed. More...
 
bool isValue () const
 Check for attribute. More...
 
std::string getValue () const
 Access to simple content. More...
 
template<class T >
getValue () const
 
template<class T >
std::optional< T > getValue_optional () const
 access to content of the note Will return false if the value could not be converted into T More...
 
bool hasAttribute (const std::string &key) const
 Check for attribute. More...
 
bool isNull (const std::string &key) const
 Check if an attribute is null. More...
 
bool hasChild (const std::string &path) const
 Check if child exists. More...
 
std::string operator[] (const std::string &key) const
 Access to simple attribute. More...
 
template<class T >
getAttribute (const std::string &key, bool ignoreIfMissing=false, const T &def=T()) const
 Access to simple attribute. More...
 
const std::string & getAttribute (const std::string &key, bool ignoreIfMissing=false, const std::string &def="") const
 
template<class T >
std::optional< T > getAttribute_optional (const std::string &key) const
 
std::vector< DataStructuregetList (const std::string &pathToChild, bool ignoreIfMissing=false) const
 Access to array structure. More...
 
std::optional< std::vector< DataStructure > > getList_optional (const std::string &pathToChild) const
 
DataStructure getObject (const std::string &pathToChild, bool ignoreIfMissing=false) const
 Access to configuration object. More...
 
std::optional< TrigConf::DataStructuregetObject_optional (const std::string &pathToChild) const
 
std::vector< std::string > getKeys () const
 Access to the keys of an DataStructure which presents a dictionary. More...
 
 operator bool () const
 Access to initialized state. More...
 
bool isValid () const
 
bool isInitialized () const
 
bool empty () const
 Check if children exist. More...
 
void printRaw (std::ostream &os=std::cout) const
 
virtual void print (std::ostream &os=std::cout) const
 
bool ownsData () const
 

Static Public Member Functions

static std::unique_ptr< L1ThrExtraInfoBasecreateExtraInfo (const std::string &thrTypeName, const ptree &data)
 
static void printElement (const std::string &key, const ptree &data, uint level=0, std::ostream &os=std::cout)
 Static function to print a ptree object. More...
 

Protected Member Functions

virtual void update () override
 Update the internal data after modification of the data object. More...
 

Protected Attributes

std::map< std::string, DataStructurem_extraInfo {}
 
bool m_initialized { false }
 if initialized, the underlying ptree is has been assigned to (can be empty) More...
 
std::shared_ptr< ptreem_dataSPtr { nullptr }
 
const ptreem_dataPtr { nullptr }
 
std::string m_name {""}
 

Private Member Functions

void load ()
 Update the internal members. More...
 

Private Attributes

unsigned int m_XERHO_sigmaPosA {0}
 gXE specific data More...
 
unsigned int m_XERHO_sigmaPosB {0}
 
unsigned int m_XERHO_sigmaPosC {0}
 
unsigned int m_XERHO_sigmaNegA {0}
 
unsigned int m_XERHO_sigmaNegB {0}
 
unsigned int m_XERHO_sigmaNegC {0}
 
unsigned int m_seedThrMeVA {0}
 
unsigned int m_seedThrMeVB {0}
 
unsigned int m_seedThrMeVC {0}
 
unsigned int m_XEJWOJ_a_A {0}
 
unsigned int m_XEJWOJ_a_B {0}
 
unsigned int m_XEJWOJ_a_C {0}
 
unsigned int m_XEJWOJ_b_A {0}
 
unsigned int m_XEJWOJ_b_B {0}
 
unsigned int m_XEJWOJ_b_C {0}
 
unsigned int m_XEJWOJ_c_A {0}
 
unsigned int m_XEJWOJ_c_B {0}
 
unsigned int m_XEJWOJ_c_C {0}
 
unsigned int m_resolutionMeV { 1000 }
 

Detailed Description

Definition at line 584 of file L1ThrExtraInfo.h.

Member Typedef Documentation

◆ ptree

using TrigConf::DataStructure::ptree = boost::property_tree::ptree
inherited

Definition at line 40 of file DataStructure.h.

Constructor & Destructor Documentation

◆ L1ThrExtraInfo_gXE()

TrigConf::L1ThrExtraInfo_gXE::L1ThrExtraInfo_gXE ( const std::string &  thrTypeName,
const ptree data 
)
inline

Definition at line 586 of file L1ThrExtraInfo.h.

586  :
587  L1ThrExtraInfoBase(thrTypeName, data) { load(); }

◆ ~L1ThrExtraInfo_gXE()

virtual TrigConf::L1ThrExtraInfo_gXE::~L1ThrExtraInfo_gXE ( )
overridevirtualdefault

Member Function Documentation

◆ className()

virtual std::string TrigConf::L1ThrExtraInfo_gXE::className ( ) const
inlineoverridevirtual

A string that is the name of the class.

Reimplemented from TrigConf::L1ThrExtraInfoBase.

Definition at line 589 of file L1ThrExtraInfo.h.

589 { return "L1ThrExtraInfo_gXE"; }

◆ clear()

void TrigConf::DataStructure::clear ( )
virtualinherited

Clearing the configuration data.

should be overloaded by derived object that have to clear data

leads to an uninitialized object

Reimplemented in TrigConf::L1Menu, TrigConf::L1BunchGroupSet, TrigConf::HLTMenu, TrigConf::HLTMonitoring, TrigConf::HLTPrescalesSet, TrigConf::L1CTP, and TrigConf::L1PrescalesSet.

Definition at line 65 of file DataStructure.cxx.

66 {
67  m_initialized = false;
68  m_dataSPtr = nullptr;
69  m_dataPtr = nullptr;
70 }

◆ createExtraInfo()

static std::unique_ptr<L1ThrExtraInfoBase> TrigConf::L1ThrExtraInfoBase::createExtraInfo ( const std::string &  thrTypeName,
const ptree data 
)
staticinherited

◆ data()

const ptree& TrigConf::DataStructure::data ( ) const
inlineinherited

Access to the underlying data, if needed.

Definition at line 83 of file DataStructure.h.

83  {
84  if( ! isInitialized() ) {
85  throw std::runtime_error("Trying to access data of uninitialized object of type " + className());
86  }
87  // Don't use ?: operator here: it confuses cppcheck.
88  if (ownsData()) {
89  return *m_dataSPtr.get();
90  }
91  return *m_dataPtr;
92  }

◆ empty()

bool TrigConf::DataStructure::empty ( ) const
inlineinherited

Check if children exist.

Definition at line 219 of file DataStructure.h.

219 { return data().empty(); }

◆ getAttribute() [1/2]

const std::string & TrigConf::DataStructure::getAttribute ( const std::string &  key,
bool  ignoreIfMissing = false,
const std::string &  def = "" 
) const
inherited

Definition at line 136 of file DataStructure.cxx.

137 {
138  const auto & obj = data().get_child_optional(key);
139  if( !obj ) {
140  if( ignoreIfMissing ) {
141  return def;
142  } else {
143  throw std::runtime_error(className() + "#" + name() + ": structure '" + key + "' does not exist" );
144  }
145  }
146  // check if the key points to a plain string value
147  if ( !obj.get().empty() ) {
148  if ( obj.get().front().first.empty() ) {
149  throw std::runtime_error(className() + "#" + name() + ": structure '" + key + "' is not a simple attribute but a list [], it needs to be accessed via getList(\"" + key + "\") -> vector<DataStructure>");
150  } else {
151  throw std::runtime_error(className() + "#" + name() + ": structure '" + key + "' is not a simple attribute but an object {}, it needs to be accessed via getObject(\"" + key + "\") -> DataStructure");
152  }
153  }
154  return obj.get().data();
155 }

◆ getAttribute() [2/2]

template<class T >
T TrigConf::DataStructure::getAttribute ( const std::string &  key,
bool  ignoreIfMissing = false,
const T &  def = T() 
) const
inlineinherited

Access to simple attribute.

Parameters
keyThe path to the attribute name, relative to the current one in form "path.to.child"
ignoreIfMissingControls the behavior in case of missing configuration child

Definition at line 152 of file DataStructure.h.

152  {
153  const auto & obj = data().get_child_optional(key);
154  if( !obj ) {
155  if( ignoreIfMissing ) {
156  return def;
157  } else {
158  throw std::runtime_error(className() + "#" + name() + ": structure '" + key + "' does not exist" );
159  }
160  }
161  return obj.get().get_value<T>();
162  }

◆ getAttribute_optional()

template<class T >
std::optional<T> TrigConf::DataStructure::getAttribute_optional ( const std::string &  key) const
inlineinherited

Definition at line 165 of file DataStructure.h.

165  {
166  const auto & obj = data().get_child_optional(key);
167  if( ! obj ) {
168  return std::nullopt;
169  }
170  auto v = obj.get().get_value_optional<T>();
171  return v ? std::optional(std::move(*v)) : std::nullopt;
172  }

◆ getExtraInfo()

std::optional< std::reference_wrapper< const TrigConf::DataStructure > > TrigConf::L1ThrExtraInfoBase::getExtraInfo ( const std::string &  key) const
inherited

Definition at line 199 of file L1ThresholdBase.cxx.

200 {
201  bool hasKey = m_extraInfo.count(key)>0;
202  return hasKey ? std::optional<std::reference_wrapper<const TrigConf::DataStructure>>{m_extraInfo.at(key)} : std::nullopt;
203 }

◆ getKeys()

std::vector< std::string > TrigConf::DataStructure::getKeys ( ) const
inherited

Access to the keys of an DataStructure which presents a dictionary.

In case the DataStructure is a list or a simple attribute, an empty vector is returned

Definition at line 250 of file DataStructure.cxx.

251 {
252  std::vector<std::string> keys;
253  if ( ! data().empty() &&
254  ! data().front().first.empty() )
255  {
256  keys.reserve(data().size());
257  for( auto & entry : data() ) {
258  keys.push_back(entry.first);
259  }
260  }
261  return keys;
262 }

◆ getList()

std::vector< TrigConf::DataStructure > TrigConf::DataStructure::getList ( const std::string &  pathToChild,
bool  ignoreIfMissing = false 
) const
inherited

Access to array structure.

Parameters
pathToChildThe path to the configuration child, relative to the current one in form "path.to.child"
ignoreIfMissingControls the behavior in case of missing configuration child

In case the child is missing and ignoreIfMissing is set to true, and empty vector will be returned. Otherwise a runtime exception will be thrown.

Definition at line 158 of file DataStructure.cxx.

159 {
160  std::vector<TrigConf::DataStructure> childList;
161  const auto & list = data().get_child_optional(pathToChild);
162  if( ! list ) {
163  if ( ignoreIfMissing ) {
164  return childList;
165  } else {
166  throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' does not exist.");
167  }
168  }
169 
170  // check if the pathToChild points to a list
171 
172  // this check is not complete, because boost::ptree can not
173  // distinguish between and empty list and an empty string. In both cases
174  // the value is empty and there are no children
175 
176  if ( list.get().empty() ) {
177  if ( list.get().get_value<std::string>() != "" ) {
178  // if the value is not empty, then it is for sure an attribute ("key" : "value")
179  throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' is not a list [] but a simple attribute, it needs to be accessed via [\"" + pathToChild + "\"] -> string");
180  }
181  // else: if the value is empty, we can not say for sure and will not
182  // give this debugging hint (an empty list will be returned
183  } else if ( ! list.get().front().first.empty() ) {
184  throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' is not a list [] but an object {}, it needs to be accessed via getObject(\"" + pathToChild + "\") -> DataStructure");
185  }
186 
187  childList.reserve(list.get().size());
188 
189  for( auto & childData : list.get() )
190  childList.emplace_back( childData.second );
191 
192  return childList;
193 }

◆ getList_optional()

std::optional< std::vector< TrigConf::DataStructure > > TrigConf::DataStructure::getList_optional ( const std::string &  pathToChild) const
inherited

Definition at line 197 of file DataStructure.cxx.

198 {
199  if(data().find(pathToChild) == data().not_found()) {
200  return std::nullopt;
201  }
202  return std::optional<std::vector<TrigConf::DataStructure> >(getList(pathToChild));
203 }

◆ getObject()

TrigConf::DataStructure TrigConf::DataStructure::getObject ( const std::string &  pathToChild,
bool  ignoreIfMissing = false 
) const
inherited

Access to configuration object.

Parameters
pathToChildThe path to the configuration child, relative to the current one
ignoreIfMissingControls the behavior in case of missing configuration child

In case the child is missing and ignoreIfMissing is set to true, an uninitialized DataStructure will be returned. Otherwise a runtime exception will be thrown.

*bool ignoreIfMissing = true;
*if( const DataStructure & child = ds.getObject("path.to.child", ignoreIfMissing) ) {
cout << child["key"] << endl;
}

Definition at line 207 of file DataStructure.cxx.

208 {
209  const auto & obj = data().get_child_optional(pathToChild);
210  if( ! obj ) {
211  if ( ignoreIfMissing ) {
212  return DataStructure();
213  } else {
214  throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' does not exist.");
215  }
216  }
217  // check if the pathToChild is an attribute
218  if( obj.get().get_value<std::string>() != "" ) {
219  throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' is not an object {} but a simple attribute, it needs to be accessed via [\"" + pathToChild + "\"] -> string");
220  }
221  // check if the pathToChild points to a list
222  if ( obj.get().front().first.empty() ) {
223  throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' is not an object {} but a list [], it needs to be accessed via getList(\"" + pathToChild + "\") -> vector<DataStructure>");
224  }
225  return { obj.get() };
226 }

◆ getObject_optional()

std::optional< TrigConf::DataStructure > TrigConf::DataStructure::getObject_optional ( const std::string &  pathToChild) const
inherited

Definition at line 230 of file DataStructure.cxx.

231 {
232 
233  if(const auto & obj = data().get_child_optional(pathToChild)) {
234  // check if the pathToChild is an attribute
235  if( obj.get().get_value<std::string>() != "" ) {
236  throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' is not an object {} but a simple attribute, it needs to be accessed via [\"" + pathToChild + "\"] -> string");
237  }
238  // check if the pathToChild points to a list
239  if ( obj.get().front().first.empty() ) {
240  throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' is not an object {} but a list [], it needs to be accessed via getList(\"" + pathToChild + "\") -> vector<DataStructure>");
241  }
242  return std::optional<TrigConf::DataStructure>(obj.get());
243  }
244  return std::nullopt;
245 }

◆ getValue() [1/2]

std::string TrigConf::DataStructure::getValue ( ) const
inherited

Access to simple content.

Returns
string that is the content of the structure

For instance when the json structure contains an array of values (ptree only works with strings) which one retrieved via getList, then the values in the vector<DataStructure> can be accessed using getValue

Definition at line 80 of file DataStructure.cxx.

80  {
81  const std::string value = data().get_value<std::string>();
82  return value;
83 }

◆ getValue() [2/2]

template<class T >
T TrigConf::DataStructure::getValue ( ) const
inlineinherited

Definition at line 108 of file DataStructure.h.

108  {
109  return data().get_value<T>();
110  }

◆ getValue_optional()

template<class T >
std::optional<T> TrigConf::DataStructure::getValue_optional ( ) const
inlineinherited

access to content of the note Will return false if the value could not be converted into T

Definition at line 116 of file DataStructure.h.

116  {
117  auto v = data().get_value_optional<T>();
118  return v ? std::optional<T>(std::move(*v)) : std::nullopt;
119  }

◆ hasAttribute()

bool TrigConf::DataStructure::hasAttribute ( const std::string &  key) const
inherited

Check for attribute.

Parameters
keyThe path to the attribute name, relative to the current one in form "path.to.child"
Returns
true if path key exists and is an attribute

Definition at line 86 of file DataStructure.cxx.

86  {
87  const auto & child = data().get_child_optional( key );
88  if( ! bool(child) ) // key does not exist
89  return false;
90  return child.get().empty(); // if empty then it is an attribute, otherwise a child note
91 }

◆ hasChild()

bool TrigConf::DataStructure::hasChild ( const std::string &  path) const
inherited

Check if child exists.

Parameters
pathThe path to the child, relative to the current one in form "path.to.child"
Returns
true if path exists

Definition at line 114 of file DataStructure.cxx.

114  {
115  const auto & child = data().get_child_optional( path );
116  return bool(child);
117 }

◆ hasExtraInfo()

bool TrigConf::L1ThrExtraInfoBase::hasExtraInfo ( const std::string &  key = "") const
inherited

Definition at line 190 of file L1ThresholdBase.cxx.

191 {
192  if( key.empty() ) {
193  return m_extraInfo.size()>0;
194  }
195  return m_extraInfo.count(key)>0;
196 }

◆ isInitialized()

bool TrigConf::DataStructure::isInitialized ( ) const
inlineinherited

Definition at line 216 of file DataStructure.h.

216 { return m_initialized; }

◆ isNull()

bool TrigConf::DataStructure::isNull ( const std::string &  key) const
inherited

Check if an attribute is null.

Parameters
keyThe path to the attribute name, relative to the current one in form "path.to.child"
Returns
true if path key exists and is null

If the attribute doesn't exist, the function returns false. To check if an attribute exists and is null, use it together with hasAttribute.

Definition at line 94 of file DataStructure.cxx.

94  {
95  auto child = data().get_child_optional( key );
96  if( ! child ) {
97  return false;
98  }
99  return child->get_value<std::string>() == "null";
100 }

◆ isValid()

bool TrigConf::DataStructure::isValid ( ) const
inlineinherited

Definition at line 215 of file DataStructure.h.

215 { return m_initialized; }

◆ isValue()

bool TrigConf::DataStructure::isValue ( ) const
inherited

Check for attribute.

Returns
true if the structure is just a value

Definition at line 74 of file DataStructure.cxx.

74  {
75  return data().empty(); // just a key->value pair, no children
76 }

◆ JWOJ_param()

unsigned int TrigConf::L1ThrExtraInfo_gXE::JWOJ_param ( const char  fpga,
const char  param 
) const
inline

Definition at line 607 of file L1ThrExtraInfo.h.

607  {
608  if(fpga=='A' && param=='a') return m_XEJWOJ_a_A;
609  if(fpga=='B' && param=='a') return m_XEJWOJ_a_B;
610  if(fpga=='C' && param=='a') return m_XEJWOJ_a_C;
611  if(fpga=='A' && param=='b') return m_XEJWOJ_b_A;
612  if(fpga=='B' && param=='b') return m_XEJWOJ_b_B;
613  if(fpga=='C' && param=='b') return m_XEJWOJ_b_C;
614  if(fpga=='A' && param=='c') return m_XEJWOJ_c_A;
615  if(fpga=='B' && param=='c') return m_XEJWOJ_c_B;
616  if(fpga=='C' && param=='c') return m_XEJWOJ_c_C;
617  throw std::runtime_error(std::string("L1ThrExtraInfo: ") + fpga + " and " + param + " not recongnised for gXE JWOJ_param");
618  }

◆ load()

void TrigConf::L1ThrExtraInfo_gXE::load ( )
private

Update the internal members.

Definition at line 661 of file L1ThrExtraInfo.cxx.

662 {
663  for( auto & x : m_extraInfo ) {
664  if( x.first == "seedThrA" ){
665  m_seedThrMeVA = 200*x.second.getValue<unsigned int>();
666  } else if( x.first == "seedThrB" ){
667  m_seedThrMeVB = 200*x.second.getValue<unsigned int>();
668  } else if( x.first == "seedThrC" ){
669  m_seedThrMeVC = 200*x.second.getValue<unsigned int>();
670  } else if( x.first == "XERHO_sigmaPosA" ){
671  m_XERHO_sigmaPosA = x.second.getValue<unsigned int>();
672  } else if( x.first == "XERHO_sigmaPosB" ){
673  m_XERHO_sigmaPosB = x.second.getValue<unsigned int>();
674  } else if( x.first == "XERHO_sigmaPosC" ){
675  m_XERHO_sigmaPosC = x.second.getValue<unsigned int>();
676  } else if( x.first == "XERHO_sigmaNegA" ){
677  m_XERHO_sigmaNegA = x.second.getValue<unsigned int>();
678  } else if( x.first == "XERHO_sigmaNegB" ){
679  m_XERHO_sigmaNegB = x.second.getValue<unsigned int>();
680  } else if( x.first == "XERHO_sigmaNegC" ){
681  m_XERHO_sigmaNegC = x.second.getValue<unsigned int>();
682  } else if( x.first == "XEJWOJ_a_A" ){
683  m_XEJWOJ_a_A = x.second.getValue<unsigned int>();
684  } else if( x.first == "XEJWOJ_a_B" ){
685  m_XEJWOJ_a_B = x.second.getValue<unsigned int>();
686  } else if( x.first == "XEJWOJ_a_C" ){
687  m_XEJWOJ_a_C = x.second.getValue<unsigned int>();
688  } else if( x.first == "XEJWOJ_b_A" ){
689  m_XEJWOJ_b_A = x.second.getValue<unsigned int>();
690  } else if( x.first == "XEJWOJ_b_B" ){
691  m_XEJWOJ_b_B = x.second.getValue<unsigned int>();
692  } else if( x.first == "XEJWOJ_b_C" ){
693  m_XEJWOJ_b_C = x.second.getValue<unsigned int>();
694  } else if( x.first == "XEJWOJ_c_A" ){
695  m_XEJWOJ_c_A = x.second.getValue<unsigned int>();
696  } else if( x.first == "XEJWOJ_c_B" ){
697  m_XEJWOJ_c_B = x.second.getValue<unsigned int>();
698  } else if( x.first == "XEJWOJ_c_C" ){
699  m_XEJWOJ_c_C = x.second.getValue<unsigned int>();
700  }
701  }
702 }

◆ name()

const std::string & TrigConf::DataStructure::name ( ) const
finalvirtualinherited

Definition at line 109 of file DataStructure.cxx.

109  {
110  return m_name;
111 }

◆ operator bool()

TrigConf::DataStructure::operator bool ( ) const
inlineexplicitinherited

Access to initialized state.

Definition at line 214 of file DataStructure.h.

214 { return m_initialized; }

◆ operator[]()

std::string TrigConf::DataStructure::operator[] ( const std::string &  key) const
inherited

Access to simple attribute.

Parameters
keyThe path to the attribute name, relative to the current one in form "path.to.child"

Definition at line 121 of file DataStructure.cxx.

122 {
123  const auto & obj = data().get_child(key);
124  // check if the key points to a plain string value
125  if ( !obj.empty() ) {
126  if ( obj.front().first.empty() ) {
127  throw std::runtime_error(className() + "#" + name() + ": structure '" + key + "' is not a simple attribute but a list [], it needs to be accessed via getList(\"" + key + "\") -> vector<DataStructure>");
128  } else {
129  throw std::runtime_error(className() + "#" + name() + ": structure '" + key + "' is not a simple attribute but an object {}, it needs to be accessed via getObject(\"" + key + "\") -> DataStructure");
130  }
131  }
132  return obj.data();
133 }

◆ ownsData()

bool TrigConf::DataStructure::ownsData ( ) const
inlineinherited

Definition at line 242 of file DataStructure.h.

242  {
243  return (bool)m_dataSPtr;
244  }

◆ print()

void TrigConf::DataStructure::print ( std::ostream &  os = std::cout) const
virtualinherited

Reimplemented in TrigConf::L1TopoAlgorithm, and TrigConf::L1Threshold_EM.

Definition at line 272 of file DataStructure.cxx.

273 {
274  printElement("", data(), 0, os);
275  os << std::endl;
276 }

◆ printElement()

void TrigConf::DataStructure::printElement ( const std::string &  key,
const ptree data,
uint  level = 0,
std::ostream &  os = std::cout 
)
staticinherited

Static function to print a ptree object.

Parameters
keyThe key of this data as found in the parent structure
dataThe ptree to print
levelThe substruture level used to indent the output
osThe output stream

Definition at line 279 of file DataStructure.cxx.

280 {
281  constexpr char del = '"';
282 
283  const std::string value = data.get_value<std::string>();
284 
285  if( data.empty() ) { // no children, so just a key->value pair
286  uint n(4*level); while(n--) os << " ";
287  os << del << key << del << ": " << del << value << del;
288  return;
289  }
290 
291 
292  bool isArray ( data.begin()->first.empty() ); // dictionaries have keys, arrays don't
293  { uint n(4*level); while(n--) os << " "; }
294  if ( ! key.empty() )
295  os << del << key << del << ": ";
296  os << (isArray ? "[" : "{") << std::endl;
297 
298  size_t childCounter = data.size();
299  for( const boost::property_tree::ptree::value_type & x : data ) {
300  printElement(x.first, x.second, level + 1, os);
301  if( --childCounter ) os << ",";
302  os << std::endl;
303  }
304  { uint n(4*level); while(n--) os << " "; }
305  os << (isArray ? "]" : "}");
306 
307 }

◆ printRaw()

void TrigConf::DataStructure::printRaw ( std::ostream &  os = std::cout) const
inherited

Definition at line 265 of file DataStructure.cxx.

266 {
267  boost::property_tree::json_parser::write_json( os, data() );
268 }

◆ resolutionMeV()

unsigned int TrigConf::L1ThrExtraInfoBase::resolutionMeV ( ) const
inlineinherited

Definition at line 101 of file L1ThresholdBase.h.

101  {
102  return m_resolutionMeV;
103  }

◆ seedThr()

float TrigConf::L1ThrExtraInfo_gXE::seedThr ( const char  fpga) const
inline

Definition at line 590 of file L1ThrExtraInfo.h.

590 { return energyInCounts(seedThrMeV(fpga), resolutionMeV()); }//seedThr is defined in counts

◆ seedThrCounts()

unsigned int TrigConf::L1ThrExtraInfo_gXE::seedThrCounts ( const char  fpga) const
inline

Definition at line 591 of file L1ThrExtraInfo.h.

591 { return energyInCounts(seedThrMeV(fpga), resolutionMeV()); }

◆ seedThrMeV()

unsigned int TrigConf::L1ThrExtraInfo_gXE::seedThrMeV ( const char  fpga) const
inline

Definition at line 592 of file L1ThrExtraInfo.h.

592  {
593  if(fpga=='A') return m_seedThrMeVA;
594  if(fpga=='B') return m_seedThrMeVB;
595  if(fpga=='C') return m_seedThrMeVC;
596  throw std::runtime_error(std::string("L1ThrExtraInfo: FPGA ") + fpga + " not recongnised for gXE seedThr");
597  }

◆ setData() [1/2]

void TrigConf::DataStructure::setData ( const ptree data)
inherited

Setting the configuration data.

Definition at line 39 of file DataStructure.cxx.

40 {
41  clear();
42  m_initialized = true;
43  m_dataSPtr.reset();
44  m_dataPtr = &data;
45  update();
46 }

◆ setData() [2/2]

void TrigConf::DataStructure::setData ( ptree &&  data)
inherited

Definition at line 50 of file DataStructure.cxx.

51 {
52  clear();
53  m_initialized = true;
54  m_dataSPtr = std::make_shared<ptree>(std::move(data));
55  m_dataPtr = nullptr;
56  update();
57 }

◆ setName()

void TrigConf::DataStructure::setName ( const std::string &  n)
inherited

Setting the configuration element name.

Definition at line 59 of file DataStructure.cxx.

59  {
60  m_name = n;
61 }

◆ thresholdTypeName()

const std::string & TrigConf::L1ThrExtraInfoBase::thresholdTypeName ( ) const
inherited

Definition at line 184 of file L1ThresholdBase.cxx.

185 {
186  return m_name;
187 }

◆ update()

virtual void TrigConf::L1ThrExtraInfoBase::update ( )
inlineoverrideprotectedvirtualinherited

Update the internal data after modification of the data object.

to be implemented by the derived class

Reimplemented from TrigConf::DataStructure.

Definition at line 106 of file L1ThresholdBase.h.

106  {
107  load();
108  }

◆ XERHO_param()

unsigned int TrigConf::L1ThrExtraInfo_gXE::XERHO_param ( const char  fpga,
const bool  sigmapos 
) const
inline

Definition at line 598 of file L1ThrExtraInfo.h.

598  {
599  if(fpga=='A' && sigmapos==true) return m_XERHO_sigmaPosA;
600  if(fpga=='B' && sigmapos==true) return m_XERHO_sigmaPosB;
601  if(fpga=='C' && sigmapos==true) return m_XERHO_sigmaPosC;
602  if(fpga=='A' && sigmapos==false) return m_XERHO_sigmaNegA;
603  if(fpga=='B' && sigmapos==false) return m_XERHO_sigmaNegB;
604  if(fpga=='C' && sigmapos==false) return m_XERHO_sigmaNegC;
605  throw std::runtime_error(std::string("L1ThrExtraInfo: ") + fpga + " and " + (sigmapos ? "pos" : "neg") + " not recongnised for gXE XERHO_param");
606  }

Member Data Documentation

◆ m_dataPtr

const ptree* TrigConf::DataStructure::m_dataPtr { nullptr }
protectedinherited

Definition at line 257 of file DataStructure.h.

◆ m_dataSPtr

std::shared_ptr<ptree> TrigConf::DataStructure::m_dataSPtr { nullptr }
protectedinherited

Definition at line 256 of file DataStructure.h.

◆ m_extraInfo

std::map<std::string, DataStructure> TrigConf::L1ThrExtraInfoBase::m_extraInfo {}
protectedinherited

Definition at line 109 of file L1ThresholdBase.h.

◆ m_initialized

bool TrigConf::DataStructure::m_initialized { false }
protectedinherited

if initialized, the underlying ptree is has been assigned to (can be empty)

Definition at line 254 of file DataStructure.h.

◆ m_name

std::string TrigConf::DataStructure::m_name {""}
protectedinherited

Definition at line 259 of file DataStructure.h.

◆ m_resolutionMeV

unsigned int TrigConf::L1ThrExtraInfoBase::m_resolutionMeV { 1000 }
privateinherited

Definition at line 115 of file L1ThresholdBase.h.

◆ m_seedThrMeVA

unsigned int TrigConf::L1ThrExtraInfo_gXE::m_seedThrMeVA {0}
private

Definition at line 629 of file L1ThrExtraInfo.h.

◆ m_seedThrMeVB

unsigned int TrigConf::L1ThrExtraInfo_gXE::m_seedThrMeVB {0}
private

Definition at line 630 of file L1ThrExtraInfo.h.

◆ m_seedThrMeVC

unsigned int TrigConf::L1ThrExtraInfo_gXE::m_seedThrMeVC {0}
private

Definition at line 631 of file L1ThrExtraInfo.h.

◆ m_XEJWOJ_a_A

unsigned int TrigConf::L1ThrExtraInfo_gXE::m_XEJWOJ_a_A {0}
private

Definition at line 632 of file L1ThrExtraInfo.h.

◆ m_XEJWOJ_a_B

unsigned int TrigConf::L1ThrExtraInfo_gXE::m_XEJWOJ_a_B {0}
private

Definition at line 633 of file L1ThrExtraInfo.h.

◆ m_XEJWOJ_a_C

unsigned int TrigConf::L1ThrExtraInfo_gXE::m_XEJWOJ_a_C {0}
private

Definition at line 634 of file L1ThrExtraInfo.h.

◆ m_XEJWOJ_b_A

unsigned int TrigConf::L1ThrExtraInfo_gXE::m_XEJWOJ_b_A {0}
private

Definition at line 635 of file L1ThrExtraInfo.h.

◆ m_XEJWOJ_b_B

unsigned int TrigConf::L1ThrExtraInfo_gXE::m_XEJWOJ_b_B {0}
private

Definition at line 636 of file L1ThrExtraInfo.h.

◆ m_XEJWOJ_b_C

unsigned int TrigConf::L1ThrExtraInfo_gXE::m_XEJWOJ_b_C {0}
private

Definition at line 637 of file L1ThrExtraInfo.h.

◆ m_XEJWOJ_c_A

unsigned int TrigConf::L1ThrExtraInfo_gXE::m_XEJWOJ_c_A {0}
private

Definition at line 638 of file L1ThrExtraInfo.h.

◆ m_XEJWOJ_c_B

unsigned int TrigConf::L1ThrExtraInfo_gXE::m_XEJWOJ_c_B {0}
private

Definition at line 639 of file L1ThrExtraInfo.h.

◆ m_XEJWOJ_c_C

unsigned int TrigConf::L1ThrExtraInfo_gXE::m_XEJWOJ_c_C {0}
private

Definition at line 640 of file L1ThrExtraInfo.h.

◆ m_XERHO_sigmaNegA

unsigned int TrigConf::L1ThrExtraInfo_gXE::m_XERHO_sigmaNegA {0}
private

Definition at line 626 of file L1ThrExtraInfo.h.

◆ m_XERHO_sigmaNegB

unsigned int TrigConf::L1ThrExtraInfo_gXE::m_XERHO_sigmaNegB {0}
private

Definition at line 627 of file L1ThrExtraInfo.h.

◆ m_XERHO_sigmaNegC

unsigned int TrigConf::L1ThrExtraInfo_gXE::m_XERHO_sigmaNegC {0}
private

Definition at line 628 of file L1ThrExtraInfo.h.

◆ m_XERHO_sigmaPosA

unsigned int TrigConf::L1ThrExtraInfo_gXE::m_XERHO_sigmaPosA {0}
private

gXE specific data

Definition at line 623 of file L1ThrExtraInfo.h.

◆ m_XERHO_sigmaPosB

unsigned int TrigConf::L1ThrExtraInfo_gXE::m_XERHO_sigmaPosB {0}
private

Definition at line 624 of file L1ThrExtraInfo.h.

◆ m_XERHO_sigmaPosC

unsigned int TrigConf::L1ThrExtraInfo_gXE::m_XERHO_sigmaPosC {0}
private

Definition at line 625 of file L1ThrExtraInfo.h.


The documentation for this class was generated from the following files:
TrigConf::DataStructure::data
const ptree & data() const
Access to the underlying data, if needed.
Definition: DataStructure.h:83
TrigConf::L1ThrExtraInfo_gXE::m_XEJWOJ_c_C
unsigned int m_XEJWOJ_c_C
Definition: L1ThrExtraInfo.h:640
TrigConf::L1ThrExtraInfo_gXE::seedThrMeV
unsigned int seedThrMeV(const char fpga) const
Definition: L1ThrExtraInfo.h:592
checkxAOD.ds
ds
Definition: Tools/PyUtils/bin/checkxAOD.py:260
TrigConf::DataStructure::isInitialized
bool isInitialized() const
Definition: DataStructure.h:216
TrigConf::L1ThrExtraInfo_gXE::m_XERHO_sigmaNegB
unsigned int m_XERHO_sigmaNegB
Definition: L1ThrExtraInfo.h:627
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
TrigConf::L1ThrExtraInfo_gXE::m_XEJWOJ_a_B
unsigned int m_XEJWOJ_a_B
Definition: L1ThrExtraInfo.h:633
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
TrigConf::DataStructure::empty
bool empty() const
Check if children exist.
Definition: DataStructure.h:219
TrigConf::DataStructure::printElement
static void printElement(const std::string &key, const ptree &data, uint level=0, std::ostream &os=std::cout)
Static function to print a ptree object.
Definition: DataStructure.cxx:279
TrigConf::L1ThrExtraInfo_gXE::m_XERHO_sigmaPosC
unsigned int m_XERHO_sigmaPosC
Definition: L1ThrExtraInfo.h:625
TrigConf::L1ThrExtraInfo_gXE::m_XEJWOJ_b_A
unsigned int m_XEJWOJ_b_A
Definition: L1ThrExtraInfo.h:635
TrigConf::L1ThrExtraInfo_gXE::m_XEJWOJ_a_A
unsigned int m_XEJWOJ_a_A
Definition: L1ThrExtraInfo.h:632
TrigConf::L1ThrExtraInfo_gXE::m_XEJWOJ_b_C
unsigned int m_XEJWOJ_b_C
Definition: L1ThrExtraInfo.h:637
athena.value
value
Definition: athena.py:124
TrigConf::DataStructure::m_dataSPtr
std::shared_ptr< ptree > m_dataSPtr
Definition: DataStructure.h:256
TrigConf::L1ThrExtraInfo_gXE::m_seedThrMeVA
unsigned int m_seedThrMeVA
Definition: L1ThrExtraInfo.h:629
TrigConf::DataStructure::name
virtual const std::string & name() const final
Definition: DataStructure.cxx:109
TrigConf::DataStructure::m_name
std::string m_name
Definition: DataStructure.h:259
x
#define x
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
TrigConf::L1ThrExtraInfoBase::m_extraInfo
std::map< std::string, DataStructure > m_extraInfo
Definition: L1ThresholdBase.h:109
TrigConf::L1ThrExtraInfo_gXE::m_XERHO_sigmaNegC
unsigned int m_XERHO_sigmaNegC
Definition: L1ThrExtraInfo.h:628
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
TrigConf::L1ThrExtraInfo_gXE::m_seedThrMeVB
unsigned int m_seedThrMeVB
Definition: L1ThrExtraInfo.h:630
TrigConf::L1ThrExtraInfo_gXE::load
void load()
Update the internal members.
Definition: L1ThrExtraInfo.cxx:661
beamspotman.n
n
Definition: beamspotman.py:731
TrigConf::L1ThrExtraInfoBase::L1ThrExtraInfoBase
L1ThrExtraInfoBase()=delete
TrigConf::DataStructure::className
virtual std::string className() const
A string that is the name of the class.
Definition: DataStructure.cxx:104
TrigConf::L1ThrExtraInfo_gXE::m_XEJWOJ_a_C
unsigned int m_XEJWOJ_a_C
Definition: L1ThrExtraInfo.h:634
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
TrigConf::L1ThrExtraInfo_gXE::m_XEJWOJ_c_A
unsigned int m_XEJWOJ_c_A
Definition: L1ThrExtraInfo.h:638
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
TrigConf::L1ThrExtraInfo_gXE::m_XEJWOJ_b_B
unsigned int m_XEJWOJ_b_B
Definition: L1ThrExtraInfo.h:636
TrigConf::L1ThrExtraInfo_gXE::m_seedThrMeVC
unsigned int m_seedThrMeVC
Definition: L1ThrExtraInfo.h:631
TrigConf::energyInCounts
unsigned int energyInCounts(unsigned int energyMeV, unsigned int energyResolutionMeV)
helper funtion to translate energies into counts
Definition: L1ThresholdBase.cxx:18
TrigConf::DataStructure::getList
std::vector< DataStructure > getList(const std::string &pathToChild, bool ignoreIfMissing=false) const
Access to array structure.
Definition: DataStructure.cxx:158
TrigConf::DataStructure::m_initialized
bool m_initialized
if initialized, the underlying ptree is has been assigned to (can be empty)
Definition: DataStructure.h:254
TrigConf::L1ThrExtraInfoBase::resolutionMeV
unsigned int resolutionMeV() const
Definition: L1ThresholdBase.h:101
TrigConf::L1ThrExtraInfo_gXE::m_XERHO_sigmaNegA
unsigned int m_XERHO_sigmaNegA
Definition: L1ThrExtraInfo.h:626
python.PyAthena.v
v
Definition: PyAthena.py:154
TrigConf::L1ThrExtraInfo_gXE::m_XEJWOJ_c_B
unsigned int m_XEJWOJ_c_B
Definition: L1ThrExtraInfo.h:639
TrigConf::L1ThrExtraInfoBase::load
void load()
Definition: L1ThresholdBase.cxx:157
DeMoScan.first
bool first
Definition: DeMoScan.py:536
TrigConf::L1ThrExtraInfoBase::m_resolutionMeV
unsigned int m_resolutionMeV
Definition: L1ThresholdBase.h:115
TrigConf::DataStructure::clear
virtual void clear()
Clearing the configuration data.
Definition: DataStructure.cxx:65
TrigConf::L1ThrExtraInfo_gXE::m_XERHO_sigmaPosB
unsigned int m_XERHO_sigmaPosB
Definition: L1ThrExtraInfo.h:624
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
TrigConf::DataStructure::ownsData
bool ownsData() const
Definition: DataStructure.h:242
python.PyAthena.obj
obj
Definition: PyAthena.py:132
TrigConf::DataStructure::DataStructure
DataStructure()
Default constructor, leading to an uninitialized configuration object.
Definition: DataStructure.cxx:11
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
TrigConf::L1ThrExtraInfo_gXE::m_XERHO_sigmaPosA
unsigned int m_XERHO_sigmaPosA
gXE specific data
Definition: L1ThrExtraInfo.h:623
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
TrigConf::DataStructure::m_dataPtr
const ptree * m_dataPtr
Definition: DataStructure.h:257
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
TrigConf::DataStructure::update
virtual void update()
Update the internal data after modification of the data object.
Definition: DataStructure.h:252