8 #include "CoolKernel/Record.h"
9 #include "CoolKernel/IFolder.h"
10 #include "CoralBase/Attribute.h"
11 #include "CoralBase/AttributeList.h"
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 <<
";"; }
50 payload[
"StreamInfo"].setValue<cool::String255>(streamCat.str());
62 for(
const string&
group :
ch.groups()) {
67 payload[
"ChainCounter"].setValue<cool::UInt32>(
ch.chain_counter());
74 uint hltPrescaleKey,
const string& configSource ) {
76 payload[
"MasterConfigurationKey"].setValue<cool::UInt32>(masterKey);
77 payload[
"HltPrescaleConfigurationKey"].setValue<cool::UInt32>(hltPrescaleKey);
78 payload[
"ConfigSource"].setValue<cool::String255>(configSource);
85 payload[
"MonConfigKey"].setValue<cool::UInt32>(mck);
92 float passthrough,
float rerunprescale) {
94 payload[
"Prescale"].setValue<cool::Float>(prescale);
95 payload[
"Passthrough"].setValue<cool::Float>(passthrough);
96 payload[
"RerunPrescale"].setValue<cool::Float>(rerunprescale);
104 payload[
"HltPrescaleKey"].setValue<cool::UInt32>(psk);
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>() );
127 if(al[
"LowerChainName"].specification().
type()==
typeid(cool::String4k)) {
128 ch->set_lower_chain_name( al[
"LowerChainName"].data<cool::String4k>() );
130 ch->set_lower_chain_name( al[
"LowerChainName"].data<cool::String255>() );
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) {
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);
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);
182 vector<string> sequenceDescriptions = HLTTEUtils::splitGroups(sigdef);
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()));
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],
",");
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>();