ATLAS Offline Software
Loading...
Searching...
No Matches
TrigConfVar.cxx File Reference
#include <sstream>
#include "AthenaKernel/errorcheck.h"
#include "TrigMonitoringEvent/TrigConfVar.h"
Include dependency graph for TrigConfVar.cxx:

Go to the source code of this file.

Namespaces

namespace  TrigVar

Functions

std::string str (const TrigConfVar &o)
uint16_t Trig::ReserveVarId ATLAS_NOT_THREAD_SAFE (const std::string &name)
uint16_t Trig::ReserveVarId ATLAS_NOT_THREAD_SAFE (const std::string &name, uint16_t id)
bool Trig::FindVarId ATLAS_NOT_THREAD_SAFE (const std::string &name, uint16_t &id)
bool Trig::FindVarName ATLAS_NOT_THREAD_SAFE (const uint16_t id, std::string &name)
std::vector< TrigConfVar > Trig::GetCurrentTrigConfVarVector ATLAS_NOT_THREAD_SAFE ()
 Install fatal handler with default options.

Variables

static std::vector< TrigConfVarTrigVar::gVarVec
static unsigned int TrigVar::gCounter = 60000

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE() [1/5]

std::vector< TrigConfVar > Trig::GetCurrentTrigConfVarVector ATLAS_NOT_THREAD_SAFE ( void )
inline

Install fatal handler with default options.

This is meant to be easy to call from python via ctypes.

Install fatal handler with default options.

getLorentzAngle() Read LorentzAngle from HIST and write out into local DB

getBSErrors() Read BSErrors from Monitoring HIST and write out into local DB

getEfficiency() Read Efficiency from Monitoring HIST and write out into local DB

getRawOccupancy() Read RawOccupancy from Monitoring HIST and write out into local DB

getNoiseOccupancy() Read NoiseOccupancy from HIST and write out into local DB

getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats

Install fatal handler with default options.

called at the end of each athena event (can be used for eg.

called at the beginning of each athena event (can be used for eg.

return the simulation service ID

resetting dynamic selectors)

beginning of the loop of channels

bad bit newly found

known bad bit

for low noisy cells

for high noisy cells

0.01 is used to scale "PER" to the same order of magnitude to "SIG"

smaller deviation: distorted

checking TmaxAmp, Not mixed with MaxAmp and Width

channel information output

Only dead or distorted, or short known BCs are considered below.

index of bc

now add branches and leaves to the tree

Definition at line 164 of file TrigConfVar.cxx.

165{
166 //
167 // Return copy of static vector
168 //
169 return TrigVar::gVarVec;
170}
static std::vector< TrigConfVar > gVarVec

◆ ATLAS_NOT_THREAD_SAFE() [2/5]

uint16_t Trig::ReserveVarId ATLAS_NOT_THREAD_SAFE ( const std::string & name)

Definition at line 47 of file TrigConfVar.cxx.

48{
49 //
50 // Return matching id, if it does not exist then create new id
51 //
52 for(unsigned int i = 0; i < TrigVar::gVarVec.size(); i++) {
53 //
54 // Check name already exists
55 //
56 if(TrigVar::gVarVec[i].getName() == name) {
57 return TrigVar::gVarVec[i].getId();
58 }
59 }
60
61 if(TrigVar::gCounter+1 >= 65535) {
62 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "ReserveVarId") << "Overflow of 16 bits key.";
63 return 0;
64 }
65
66 //
67 // Add new configuration
68 //
70
71 return TrigVar::gVarVec.back().getId();
72}
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
static unsigned int gCounter

◆ ATLAS_NOT_THREAD_SAFE() [3/5]

bool Trig::FindVarId ATLAS_NOT_THREAD_SAFE ( const std::string & name,
uint16_t & id )

Definition at line 130 of file TrigConfVar.cxx.

131{
132 //
133 // Find id for variable name
134 //
135 for(unsigned int i = 0; i < TrigVar::gVarVec.size(); i++) {
136
137 if(TrigVar::gVarVec[i].getName() == name) {
138 id = TrigVar::gVarVec[i].getId();
139 return true;
140 }
141 }
142
143 return false;
144}

◆ ATLAS_NOT_THREAD_SAFE() [4/5]

uint16_t Trig::ReserveVarId ATLAS_NOT_THREAD_SAFE ( const std::string & name,
uint16_t id )

Definition at line 75 of file TrigConfVar.cxx.

76{
77 //
78 // Create new id using input id as suggestion.
79 //
80 bool matched_id = false;
81
82 for(unsigned int i = 0; i < TrigVar::gVarVec.size(); i++) {
83
84 if(TrigVar::gVarVec[i].getName() == name) {
85 //
86 // Check if already stored id matches
87 //
88 if(TrigVar::gVarVec[i].getId() != id) {
89 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "ReserveVarId")
90 << "ReserveVarId - error! Existing var with " << name << " and id=" << TrigVar::gVarVec[i].getId() << ": new id=" << id;
91 }
92
93 return TrigVar::gVarVec[i].getId();
94 }
95 else if(TrigVar::gVarVec[i].getId() == id) {
96 //
97 // Check if already stored name matches
98 //
99 matched_id = true;
100
101 if(TrigVar::gVarVec[i].getName() != name) {
102 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "ReserveVarId")
103 << "ReserveVarId - error! Existing var with " << name << " and id=" << TrigVar::gVarVec[i].getId() << ": new name=" << name;
104 }
105 else {
106 return id;
107 }
108 }
109 }
110
111 //
112 // Add new configuration
113 //
114 if(matched_id) {
115 if(TrigVar::gCounter+1 >= 65535) {
116 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "ReserveVarId") << "Overflow of 16 bits key";
117 return 0;
118 }
119
121 }
122 else {
123 TrigVar::gVarVec.push_back(TrigConfVar(name, id));
124 }
125
126 return TrigVar::gVarVec.back().getId();
127}

◆ ATLAS_NOT_THREAD_SAFE() [5/5]

bool Trig::FindVarName ATLAS_NOT_THREAD_SAFE ( const uint16_t id,
std::string & name )

Definition at line 147 of file TrigConfVar.cxx.

148{
149 //
150 // Find id for variable name
151 //
152 for(unsigned int i = 0; TrigVar::gVarVec.size(); i++) {
153
154 if(TrigVar::gVarVec[i].getId() == id) {
155 name = TrigVar::gVarVec[i].getName();
156 return true;
157 }
158 }
159
160 return false;
161}

◆ str()

std::string str ( const TrigConfVar & o)

Definition at line 38 of file TrigConfVar.cxx.

39{
40 std::stringstream s;
41 s << "TrigConfVar: " << o.name() << "=" << o.id();
42
43 return s.str();
44}
uint32_t id() const
Definition TrigConfVar.h:39
const std::string & name() const
Definition TrigConfVar.h:36