8#include "CoolKernel/Record.h"
9#include "CoolKernel/IFolder.h"
10#include "CoralBase/Attribute.h"
11#include "CoralBase/AttributeList.h"
29 Record payload(fld->payloadSpecification());
30 payload[
"ChainName"] .setValue<cool::String255>(ch.chain_name());
31 payload[
"ChainVersion"] .setValue<cool::UInt32>(ch.chain_version());
32 payload[
"ChainCounter"] .setValue<cool::UInt32>(ch.chain_counter());
33 payload[
"TriggerLevel"] .setValue<cool::String255>(ch.level());
34 payload[
"Prescale"] .setValue<cool::Float>(ch.prescale());
35 payload[
"PassThrough"] .setValue<cool::Float>(ch.pass_through());
36 payload[
"TriggerElements"].setValue<cool::String4k>(concise);
37 if(payload[
"LowerChainName"].storageType()==cool::StorageType::String4k) {
38 payload[
"LowerChainName"].setValue<cool::String4k>(ch.lower_chain_name());
40 payload[
"LowerChainName"].setValue<cool::String255>(ch.lower_chain_name());
44 stringstream streamCat;
47 if(first) { first =
false; }
else { streamCat <<
";"; }
48 streamCat << stream->stream() <<
"," << stream->type() <<
"," << stream->prescale();
50 payload[
"StreamInfo"].setValue<cool::String255>(streamCat.str());
58 Record payload(fld->payloadSpecification());
59 string groups(ch.level());
62 for(
const string& group : ch.groups()) {
63 if(start) { start=
false; }
else { groups +=
","; }
66 payload[
"Groups"].setValue<cool::String4k>(groups);
67 payload[
"ChainCounter"].setValue<cool::UInt32>(ch.chain_counter());
74 uint hltPrescaleKey,
const string& configSource ) {
75 Record payload(fld->payloadSpecification());
76 payload[
"MasterConfigurationKey"].setValue<cool::UInt32>(masterKey);
77 payload[
"HltPrescaleConfigurationKey"].setValue<cool::UInt32>(hltPrescaleKey);
78 payload[
"ConfigSource"].setValue<cool::String255>(configSource);
84 Record payload(fld->payloadSpecification());
85 payload[
"MonConfigKey"].setValue<cool::UInt32>(mck);
86 payload[
"Info"].setValue<cool::String4k>(info);
92 float passthrough,
float rerunprescale) {
93 Record payload(fld->payloadSpecification());
94 payload[
"Prescale"].setValue<cool::Float>(prescale);
95 payload[
"Passthrough"].setValue<cool::Float>(passthrough);
96 payload[
"RerunPrescale"].setValue<cool::Float>(rerunprescale);
103 Record payload(fld->payloadSpecification());
104 payload[
"HltPrescaleKey"].setValue<cool::UInt32>(psk);
120 if(
typeid(cool::UInt32) ==
al[
"Prescale"].specification().
type()) {
123 }
else if(
typeid(cool::Float) ==
al[
"Prescale"].specification().
type()) {
127 if(
al[
"LowerChainName"].specification().
type()==
typeid(cool::String4k)) {
133 string fullTeString =
al[
"TriggerElements"].data<cool::String4k>();
135 if(fullTeString.find(
"|")==string::npos ) {
138 vector<string> singleSigStrings =
split(fullTeString,
";");
139 for(
const string& sigdef : singleSigStrings ) {
140 if(sigdef==
"") { ++
sc;
continue; }
143 ch->signatureList().push_back(signature);
146 vector<string> teStrings =
split(sigdef,
",");
147 for(
const string& te : teStrings) {
149 signature->
outputTEs().push_back( outte );
150 if(sequences && !sequences->
hasTE(te) )
157 vector<string> singleSigStrings =
split(fullTeString,
"|");
158 if(singleSigStrings.size()==2) {
162 for(
string outtename : splitRecursive ) {
163 if(outtename.find(
',')!=string::npos)
164 outtename.erase(0,outtename.rfind(
',')+1);
166 if(sequences && !sequences->
hasTE(outtename)) {
174 vector<string> signatureDesc =
split(singleSigStrings[1],
";");
175 for(
const string& sigdef : signatureDesc) {
176 if(sigdef==
"") {
sc++;
continue; }
179 ch->signatureList().push_back(signature);
183 for(
string outtename : sequenceDescriptions) {
185 if(outtename.find(
',') != string::npos)
186 outtename.erase(0,outtename.rfind(
',')+1);
189 signature->
outputTEs().push_back( outte );
190 if(sequences && !sequences->
hasTE(outtename)) {
200 string fullStreamString =
al[
"StreamInfo"].data<cool::String255>();
201 vector<string> singleStreams =
split( fullStreamString,
";" );
203 for(
const string& stream_def : singleStreams ) {
205 vector<string> streamInfo =
split(stream_def,
",");
206 if(streamInfo.size()==2) {
207 stream->set_stream(streamInfo[0]);
208 stream->set_prescale(atoi(streamInfo[1].c_str()));
209 }
else if(streamInfo.size()==3) {
210 stream->set_stream(streamInfo[0]);
211 stream->set_type(streamInfo[1]);
212 stream->set_prescale(atoi(streamInfo[2].c_str()));
214 ch->addStream(stream);
225 int cc =
al[
"ChainCounter"].data<cool::UInt32>();
227 string level = lvlGrp[0];
228 if(lvlGrp.size()==2) {
229 vector<string> grV =
split(lvlGrp[1],
",");
231 if( ch->chain_counter()==cc && ch->level()==level) {
232 for(
const string&
gr : grV) ch->addGroup(
gr);
242 unsigned int & hltPrescaleKey,
string & configSource)
244 masterConfigKey =
al[
"MasterConfigurationKey"].data<cool::UInt32>();
245 hltPrescaleKey =
al[
"HltPrescaleConfigurationKey"].data<cool::UInt32>();
246 configSource =
al[
"ConfigSource"].data<cool::String255>();
252 float& ps,
float& pt,
float& rrps)
254 ps =
al[
"Prescale"].data<cool::Float>();
255 pt =
al[
"Passthrough"].data<cool::Float>();
256 rrps =
al[
"RerunPrescale"].data<cool::Float>();
263 return al[
"HltPrescaleKey"].data<cool::UInt32>();
char data[hepevt_bytes_allocation_ATLAS]
list of all HLT chains in a trigger menu
HLT chain configuration information.
bool hasTE(const std::string &name)
void addHLTSequence(HLTSequence *sequence)
adds an HLTSequence to the menu
HLT sequence configuration information.
HLT signature configuration information.
std::vector< HLTTriggerElement * > & outputTEs()
accessor to the list of trigger elements
void set_signature_counter(unsigned int sc)
HLT stream configuration information.
static std::vector< std::string > splitGroups(const std::string &s)
static HLTSequence * buildSequence(const std::string &desc)
HLT trigger element configuration information.
cool::Record createHltPrescaleKeyPayload(cool::IFolderPtr, int psk)
build a COOL db record from a HLT prescale value
cool::Record createHltPrescalesPayload(cool::IFolderPtr, float prescale, float passthrough, float rerunprescale)
build a COOL db record from a HLT prescale value
int readHltPrescaleKey(const coral::AttributeList &al)
build the HLT prescale key from a COOL db record
void readHltPrescale(const coral::AttributeList &al, float &ps, float &pt, float &rrps)
build the HLT prescale value from a COOL db record
cool::Record createHltChainGroupPayload(cool::IFolderPtr, const TrigConf::HLTChain &ch)
build a COOL db record from a HLT chain
cool::Record createMonConfigKeyPayload(cool::IFolderPtr fld, uint MCK, std::string &info)
build a COOL db record from a HLT monitoring configuration key
void addGroupsToHltChain(const coral::AttributeList &al, const TrigConf::HLTChainList &chl)
add the groups to and HLT chain from a AttributeList
void readHltConfigKeys(const coral::AttributeList &al, unsigned int &masterConfigKey, unsigned int &hltPrescaleKey, std::string &configSource)
read the HLT configuration keys from a coral::AttributeList
cool::Record createHltConfigKeysPayload(cool::IFolderPtr, unsigned int masterKey, unsigned int hltPrescaleKey, const std::string &configSource)
build a COOL db record from a set of HLT configuration keys
HLTChain * createHLTChain(const coral::AttributeList &al, TrigConf::HLTSequenceList *sequences=0)
build an HLT chain from a COOL db record
cool::Record createHltMenuPayload(cool::IFolderPtr, const TrigConf::HLTChain &, const std::string &concise)
build a COOL db record from a HLT chain
Forward iterator to traverse the main components of the trigger configuration.
std::vector< std::string > split(const std::string &line, const std::string &del=" ")