ATLAS Offline Software
Loading...
Searching...
No Matches
TrigConf::TrigConfCoolHLTPayloadConverters Namespace Reference

Functions

cool::Record createHltMenuPayload (cool::IFolderPtr, const TrigConf::HLTChain &, const std::string &concise)
 build a COOL db record from a HLT chain
cool::Record createHltChainGroupPayload (cool::IFolderPtr, const TrigConf::HLTChain &ch)
 build a COOL db record from a HLT chain
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
cool::Record createMonConfigKeyPayload (cool::IFolderPtr fld, uint MCK, std::string &info)
 build a COOL db record from a HLT monitoring configuration key
cool::Record createHltPrescalesPayload (cool::IFolderPtr, float prescale, float passthrough, float rerunprescale)
 build a COOL db record from a HLT prescale value
cool::Record createHltPrescaleKeyPayload (cool::IFolderPtr, int psk)
 build a COOL db record from a HLT prescale value
HLTChaincreateHLTChain (const coral::AttributeList &al, TrigConf::HLTSequenceList *sequences=0)
 build an HLT chain from a COOL db record
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
void readHltPrescale (const coral::AttributeList &al, float &ps, float &pt, float &rrps)
 build the HLT prescale value from a COOL db record
int readHltPrescaleKey (const coral::AttributeList &al)
 build the HLT prescale key from a COOL db record

Function Documentation

◆ addGroupsToHltChain()

void TrigConf::TrigConfCoolHLTPayloadConverters::addGroupsToHltChain ( const coral::AttributeList & al,
const TrigConf::HLTChainList & chl )

add the groups to and HLT chain from a AttributeList

Definition at line 222 of file TrigConfCoolHLTPayloadConverters.cxx.

224{
225 int cc = al["ChainCounter"].data<cool::UInt32>();
226 vector<string> lvlGrp = split(al["Groups"].data<cool::String4k>(),";");
227 string level = lvlGrp[0];
228 if(lvlGrp.size()==2) {
229 vector<string> grV = split(lvlGrp[1],",");
230 for(HLTChain* ch : chl) {
231 if( ch->chain_counter()==cc && ch->level()==level) {
232 for(const string& gr : grV) ch->addGroup(gr);
233 break;
234 }
235 }
236 }
237}
#define gr
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
static Double_t al
HLT chain configuration information.
std::vector< std::string > split(const std::string &line, const std::string &del=" ")

◆ createHLTChain()

HLTChain * TrigConf::TrigConfCoolHLTPayloadConverters::createHLTChain ( const coral::AttributeList & al,
TrigConf::HLTSequenceList * sequences = 0 )

build an HLT chain from a COOL db record

Definition at line 110 of file TrigConfCoolHLTPayloadConverters.cxx.

110 {
112
113 // this information of a chain is not in COOL:
114 // int lower_chain_counter, vector<HLTTriggerType*>& trigList
115
116 ch->set_chain_name ( al["ChainName"]. data<cool::String255>() );
117 ch->set_chain_version ( al["ChainVersion"]. data<cool::UInt32>() );
118 ch->set_chain_counter ( al["ChainCounter"]. data<cool::UInt32>() );
119 ch->set_level ( al["TriggerLevel"]. data<cool::String255>() );
120 if( typeid(cool::UInt32) == al["Prescale"].specification().type()) {
121 ch->set_prescale ( al["Prescale"]. data<cool::UInt32>() );
122 ch->set_pass_through ( al["PassThrough"]. data<cool::UInt32>() );
123 } else if( typeid(cool::Float) == al["Prescale"].specification().type()) {
124 ch->set_prescale ( al["Prescale"]. data<cool::Float>() );
125 ch->set_pass_through ( al["PassThrough"]. data<cool::Float>() );
126 }
127 if(al["LowerChainName"].specification().type()==typeid(cool::String4k)) {
128 ch->set_lower_chain_name( al["LowerChainName"].data<cool::String4k>() );
129 } else {
130 ch->set_lower_chain_name( al["LowerChainName"].data<cool::String255>() );
131 }
132 // read the trigger elements
133 string fullTeString = al["TriggerElements"].data<cool::String4k>();
134
135 if(fullTeString.find("|")==string::npos ) {
136 // old style
137 int sc(0); // signature counter
138 vector<string> singleSigStrings = split(fullTeString,";");
139 for(const string& sigdef : singleSigStrings ) {
140 if(sigdef=="") { ++sc; continue; } // empty signature (when signaturCounter is not continuious)
141 // the information available in the signature will be the signature counter and the list of TEs
142 HLTSignature * signature = new HLTSignature();
143 ch->signatureList().push_back(signature);
144 signature->set_signature_counter(++sc);
145
146 vector<string> teStrings = split(sigdef,",");
147 for( const string& te : teStrings) {
148 HLTTriggerElement * outte = new HLTTriggerElement( te );
149 signature->outputTEs().push_back( outte );
150 if(sequences && !sequences->hasTE(te) )
151 sequences->addHLTSequence(new HLTSequence( vector<HLTTriggerElement*>(), outte, vector<string>()) );
152 }
153 }
154 } else {
155
156 // new style
157 vector<string> singleSigStrings = split(fullTeString,"|");
158 if(singleSigStrings.size()==2) {
159
160 // the part in front of the '|'
161 vector< string > splitRecursive = HLTTEUtils::splitGroups( singleSigStrings[0] );
162 for( string outtename : splitRecursive ) {
163 if(outtename.find(',')!=string::npos)
164 outtename.erase(0,outtename.rfind(',')+1);
165
166 if(sequences && !sequences->hasTE(outtename)) {
167 HLTSequence* seq = HLTTEUtils::buildSequence( outtename );
168 sequences->addHLTSequence( seq );
169 }
170 }
171
172 // the part after the '|'
173 int sc(0); // signature counter
174 vector<string> signatureDesc = split(singleSigStrings[1],";");
175 for(const string& sigdef : signatureDesc) {
176 if(sigdef=="") { sc++; continue; } // empty signature (when signaturCounter is not continous)
177 // the information available in the signature will be the signature counter and the list of TEs
178 HLTSignature * signature = new HLTSignature();
179 ch->signatureList().push_back(signature);
180 signature->set_signature_counter(++sc);
181
182 vector<string> sequenceDescriptions = HLTTEUtils::splitGroups(sigdef);
183 for(string outtename : sequenceDescriptions) {
184
185 if(outtename.find(',') != string::npos)
186 outtename.erase(0,outtename.rfind(',')+1);
187
188 HLTTriggerElement * outte = new HLTTriggerElement( outtename );
189 signature->outputTEs().push_back( outte );
190 if(sequences && !sequences->hasTE(outtename)) {
191 HLTSequence* seq = HLTTEUtils::buildSequence(outtename);
192 sequences->addHLTSequence( seq );
193 }
194 }
195 }
196 }
197 } // new style
198
199 // read the stream tag info
200 string fullStreamString = al["StreamInfo"].data<cool::String255>();
201 vector<string> singleStreams = split( fullStreamString, ";" );
202
203 for( const string& stream_def : singleStreams ) {
204 HLTStreamTag * stream = new HLTStreamTag();
205 vector<string> streamInfo = split(stream_def,",");
206 if(streamInfo.size()==2) {
207 stream->set_stream(streamInfo[0]); // old version: name,prescale
208 stream->set_prescale(atoi(streamInfo[1].c_str()));
209 } else if(streamInfo.size()==3) { // new version: name,type,version
210 stream->set_stream(streamInfo[0]);
211 stream->set_type(streamInfo[1]);
212 stream->set_prescale(atoi(streamInfo[2].c_str()));
213 }
214 ch->addStream(stream);
215 }
216
217 return ch;
218}
static Double_t sc
bool hasTE(const std::string &name)
void addHLTSequence(HLTSequence *sequence)
adds an HLTSequence to the menu
std::vector< HLTTriggerElement * > & outputTEs()
accessor to the list of trigger elements
void set_signature_counter(unsigned int sc)
static std::vector< std::string > splitGroups(const std::string &s)
static HLTSequence * buildSequence(const std::string &desc)
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
seq
filter configuration ## -> we use the special sequence 'AthMasterSeq' which is run before any other a...

◆ createHltChainGroupPayload()

Record TrigConf::TrigConfCoolHLTPayloadConverters::createHltChainGroupPayload ( cool::IFolderPtr fld,
const TrigConf::HLTChain & ch )

build a COOL db record from a HLT chain

Parameters
chthe HLT trigger chain
Returns
a COOL db record

Definition at line 57 of file TrigConfCoolHLTPayloadConverters.cxx.

57 {
58 Record payload(fld->payloadSpecification());
59 string groups(ch.level());
60 groups += ";";
61 bool start(true);
62 for(const string& group : ch.groups()) {
63 if(start) { start=false; } else { groups += ","; }
64 groups += group;
65 }
66 payload["Groups"].setValue<cool::String4k>(groups);
67 payload["ChainCounter"].setValue<cool::UInt32>(ch.chain_counter());
68 return payload;
69}

◆ createHltConfigKeysPayload()

Record TrigConf::TrigConfCoolHLTPayloadConverters::createHltConfigKeysPayload ( cool::IFolderPtr fld,
unsigned int masterKey,
unsigned int hltPrescaleKey,
const std::string & configSource )

build a COOL db record from a set of HLT configuration keys

Parameters
masterKeythe configuration super master key
hltPrescaleKeythe HLT prescale key
configSourcethe source of configuration information (DB connection string or XML file name)
Returns
a COOL db record

Definition at line 73 of file TrigConfCoolHLTPayloadConverters.cxx.

74 {
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);
79 return payload;
80}

◆ createHltMenuPayload()

Record TrigConf::TrigConfCoolHLTPayloadConverters::createHltMenuPayload ( cool::IFolderPtr fld,
const TrigConf::HLTChain & ch,
const std::string & concise )

build a COOL db record from a HLT chain

Parameters
chthe HLT trigger chain
Returns
a COOL db record

Definition at line 28 of file TrigConfCoolHLTPayloadConverters.cxx.

28 {
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());
39 } else {
40 payload["LowerChainName"].setValue<cool::String255>(ch.lower_chain_name());
41 }
42
43 // stream info
44 stringstream streamCat;
45 bool first(true);
46 for(HLTStreamTag* stream : ch.streams()) {
47 if(first) { first = false; } else { streamCat << ";"; }
48 streamCat << stream->stream() << "," << stream->type() << "," << stream->prescale();
49 }
50 payload["StreamInfo"].setValue<cool::String255>(streamCat.str());
51
52 return payload;
53}
HLT stream configuration information.

◆ createHltPrescaleKeyPayload()

Record TrigConf::TrigConfCoolHLTPayloadConverters::createHltPrescaleKeyPayload ( cool::IFolderPtr fld,
int psk )

build a COOL db record from a HLT prescale value

Parameters
prescalethe prescale value
Returns
a COOL db record

Note that the prescale values are inserted in the same order as the trigger items, the matching between them depends on their position in the list (COOL channel ID)

Definition at line 102 of file TrigConfCoolHLTPayloadConverters.cxx.

102 {
103 Record payload(fld->payloadSpecification());
104 payload["HltPrescaleKey"].setValue<cool::UInt32>(psk);
105 return payload;
106}

◆ createHltPrescalesPayload()

Record TrigConf::TrigConfCoolHLTPayloadConverters::createHltPrescalesPayload ( cool::IFolderPtr fld,
float prescale,
float passthrough,
float rerunprescale )

build a COOL db record from a HLT prescale value

Parameters
prescalethe prescale value
Returns
a COOL db record

Note that the prescale values are inserted in the same order as the trigger items, the matching between them depends on their position in the list (COOL channel ID)

Definition at line 91 of file TrigConfCoolHLTPayloadConverters.cxx.

92 {
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);
97 return payload;
98}

◆ createMonConfigKeyPayload()

Record TrigConf::TrigConfCoolHLTPayloadConverters::createMonConfigKeyPayload ( cool::IFolderPtr fld,
uint MCK,
std::string & info )

build a COOL db record from a HLT monitoring configuration key

Parameters
MCKthe monitoring configuration key
configSourcethe source of configuration information (DB connection string or XML file name)
Returns
a COOL db record

Definition at line 83 of file TrigConfCoolHLTPayloadConverters.cxx.

83 {
84 Record payload(fld->payloadSpecification());
85 payload["MonConfigKey"].setValue<cool::UInt32>(mck);
86 payload["Info"].setValue<cool::String4k>(info);
87 return payload;
88}

◆ readHltConfigKeys()

void TrigConf::TrigConfCoolHLTPayloadConverters::readHltConfigKeys ( const coral::AttributeList & al,
unsigned int & masterConfigKey,
unsigned int & hltPrescaleKey,
std::string & configSource )

read the HLT configuration keys from a coral::AttributeList

Definition at line 241 of file TrigConfCoolHLTPayloadConverters.cxx.

243{
244 masterConfigKey = al["MasterConfigurationKey"].data<cool::UInt32>();
245 hltPrescaleKey = al["HltPrescaleConfigurationKey"].data<cool::UInt32>();
246 configSource = al["ConfigSource"].data<cool::String255>();
247}

◆ readHltPrescale()

void TrigConf::TrigConfCoolHLTPayloadConverters::readHltPrescale ( const coral::AttributeList & al,
float & ps,
float & pt,
float & rrps )

build the HLT prescale value from a COOL db record

Definition at line 251 of file TrigConfCoolHLTPayloadConverters.cxx.

253{
254 ps = al["Prescale"].data<cool::Float>();
255 pt = al["Passthrough"].data<cool::Float>();
256 rrps = al["RerunPrescale"].data<cool::Float>();
257}

◆ readHltPrescaleKey()

int TrigConf::TrigConfCoolHLTPayloadConverters::readHltPrescaleKey ( const coral::AttributeList & al)

build the HLT prescale key from a COOL db record

Definition at line 261 of file TrigConfCoolHLTPayloadConverters.cxx.

262{
263 return al["HltPrescaleKey"].data<cool::UInt32>();
264}