ATLAS Offline Software
Classes | Macros | Functions
TrigOperationalInfo.h File Reference
#include <map>
#include <string>
#include <vector>
#include "GaudiKernel/MsgStream.h"
#include "AthenaKernel/CLASS_DEF.h"
#include "TrigSteeringEvent/TrigOperationalInfoCollection.h"
Include dependency graph for TrigOperationalInfo.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TrigOperationalInfo
 This class defined generic object to store operational info available during triggering online i.e. More...
 

Macros

#define TRIGSTEERINGEVENT_TRIGOPERATIONALINFO_H
 

Functions

std::string str (const TrigOperationalInfo &d)
 
MsgStream & operator<< (MsgStream &m, const TrigOperationalInfo &d)
 
bool operator== (const TrigOperationalInfo &a, const TrigOperationalInfo &b)
 
bool operator!= (const TrigOperationalInfo &a, const TrigOperationalInfo &b)
 
void diff (const TrigOperationalInfo &a, const TrigOperationalInfo &b, std::map< std::string, double > &variableChange)
 

Macro Definition Documentation

◆ TRIGSTEERINGEVENT_TRIGOPERATIONALINFO_H

#define TRIGSTEERINGEVENT_TRIGOPERATIONALINFO_H

Definition at line 8 of file TrigOperationalInfo.h.

Function Documentation

◆ diff()

void diff ( const TrigOperationalInfo a,
const TrigOperationalInfo b,
std::map< std::string, double > &  variableChange 
)

Definition at line 90 of file TrigOperationalInfo.cxx.

90  {
91  std::pair<std::vector<std::string>, std::vector<float> > a_infos = a.infos();
92  std::pair<std::vector<std::string>, std::vector<float> > b_infos = b.infos();
93 
94  if ( a_infos.first.size() != b_infos.first.size())
95  variableChange["size"] = a_infos.first.size() - b_infos.first.size();
96 
97  std::vector<std::string>::const_iterator a_keyIt = a_infos.first.begin();
98  std::vector<float>::const_iterator a_valueIt = a_infos.second.begin();
99  for ( unsigned i = 0; i < a_infos.first.size(); i++ ) {
100  if ( b.defined(*a_keyIt) ) {
101  float b_val = b.get(*a_keyIt);
102  variableChange[*a_keyIt] = *a_valueIt - b_val;
103  } else {
104  variableChange[*a_keyIt+"_abs"] = *a_valueIt;
105  }
106 
107  ++a_keyIt;
108  ++a_valueIt;
109  }
110 }

◆ operator!=()

bool operator!= ( const TrigOperationalInfo a,
const TrigOperationalInfo b 
)
inline

Definition at line 53 of file TrigOperationalInfo.h.

53 { return !(a==b); }

◆ operator<<()

MsgStream& operator<< ( MsgStream &  m,
const TrigOperationalInfo d 
)

Definition at line 70 of file TrigOperationalInfo.cxx.

70  {
71  m << str(d);
72  return m;
73 }

◆ operator==()

bool operator== ( const TrigOperationalInfo a,
const TrigOperationalInfo b 
)

Definition at line 76 of file TrigOperationalInfo.cxx.

76  {
77 
78  std::pair<std::vector<std::string>, std::vector<float> > a_infos = a.infos();
79  std::pair<std::vector<std::string>, std::vector<float> > b_infos = b.infos();
80  if ( a_infos.first.size() != b_infos.first.size())
81  return false;
82  if ( ! (a_infos.first == b_infos.first))
83  return false;
84 
85  if ( ! (a_infos.second == b_infos.second))
86  return false;
87 
88  return true;
89 }

◆ str()

std::string str ( const TrigOperationalInfo d)

Definition at line 57 of file TrigOperationalInfo.cxx.

57  {
58  std::stringstream ss;
59  std::pair<std::vector<std::string>, std::vector<float> > quantities = d.infos();
60  std::vector<std::string>::const_iterator keyIt = quantities.first.begin();
61  std::vector<float>::const_iterator valueIt = quantities.second.begin();
62  for (unsigned int i = 0; i < quantities.first.size(); i++ ) {
63  ss << " " << *keyIt << ": " << *valueIt;
64  ++keyIt;
65  ++valueIt;
66  }
67  return ss.str();
68 }
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
hist_file_dump.d
d
Definition: hist_file_dump.py:137
str
std::string str(const TrigOperationalInfo &d)
Definition: TrigOperationalInfo.cxx:57
lumiFormat.i
int i
Definition: lumiFormat.py:85
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
a
TList * a
Definition: liststreamerinfos.cxx:10