ATLAS Offline Software
Loading...
Searching...
No Matches
TrigConfHLTData/Root/HLTUtils.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include <iostream>
6#include <set>
7#include <sstream>
8#include <stdexcept>
9#include <string>
10#include <algorithm>
11#include <iterator>
12#include <vector>
13
15
24
26
27using namespace TrigConf;
28using namespace std;
29
30/*****
31 * This is to support discover in configuration recursively called sequences
32 ****/
34public:
35 CompareSequenceOutput( unsigned int hashId ) { m_hashId = hashId; }
36 CompareSequenceOutput( const std::string& name ) { m_hashId = HLTUtils::string2hash(name, "TE"); }
37 bool operator()( TrigConf::HLTSequence* const & s ) { return s->outputTE()->hashId() == m_hashId; }
38private:
39 unsigned int m_hashId;
40};
41
42
43void
44recursivelyFindInputTEs( unsigned int teId, const TrigConf::HLTSequenceList& seqList, std::vector<unsigned int>& tes ) {
45 const TrigConf::HLTSequence * seq = seqList.getSequence(teId);
46 if ( seq==0 ) return;
47 for(TrigConf::HLTTriggerElement* te : seq->inputTEs() ) {
48 tes.push_back(te->hashId());
49 recursivelyFindInputTEs( te->hashId(), seqList, tes);
50 }
51}
52
53void recursivelyFindInputTEs( const std::string& tename, const TrigConf::HLTSequenceList& seqList, std::vector<std::string>& tes ) {
54 const TrigConf::HLTSequence* seq = seqList.getSequence(tename);
55 if ( seq==0 ) return;
56
57 for( TrigConf::HLTTriggerElement* te : seq->inputTEs() ) {
58 tes.push_back(te->name());
59 recursivelyFindInputTEs(te->name(), seqList, tes);
60 }
61}
62
63namespace TrigConf {
64
65 void
66 recursivelyFindOutputTEs( const std::string& tename,
67 const TrigConf::HLTSequenceList& sequenceList,
68 std::set<std::string>& tes,
69 int level,
70 const std::set<std::string>* veto = 0 )
71 {
72 if ( veto && veto->find(tename) != veto->end() ) return;
73 TrigConf::HLTSequence* seq = sequenceList.getSequence(tename);
74 if ( seq==0 ) return;
75
76 if(level==2) seq->setL2();
77 else if(level==3) seq->setEF();
78 else if(level==4) seq->setHLT();
79
80 tes.insert(tename);
81 for( TrigConf::HLTTriggerElement* te : seq->inputTEs() )
82 recursivelyFindOutputTEs( te->name(), sequenceList, tes, level, veto);
83 }
84
85 void
87 const TrigConf::HLTSequenceList& sequenceList,
88 std::set<std::string>& tes, int level ) {
89
90 // check if sequence exists that outputs this TE
91 const TrigConf::HLTSequence* seq = sequenceList.getSequence(tename);
92 if ( seq==0 ) return;
93
94 // it must know in which level it is running
95 if(! seq->isSet()) {
96 std::stringstream str;
97 str << "Sequence " << seq->outputTE()->name() << " has no level set " << std::endl;
98 throw std::runtime_error(str.str());
99 }
100
101 // it must be the level that is requested
102 if( (level==2 && !seq->inL2()) || (level==3 && !seq->inEF()) || (level==4 && !seq->inHLT()) ) return;
103
104 // now insert the te and continue to check
105 tes.insert(tename);
106 for( TrigConf::HLTTriggerElement* te : seq->inputTEs() )
107 recursivelyFindOutputTEsWithLevelFromSequence( te->name(), sequenceList, tes, level);
108 }
109}
110
111/*****************************/
112
113
114std::vector<unsigned int>
115HLTTEUtils::allTEsProducedInLevel( const std::string& level,
116 const HLTChainList& chainList,
117 const HLTSequenceList& sequenceList) {
118
119
120 set<unsigned int> outTEs;
121 for( HLTChain* ch : chainList) {
122 if ( ch->level() != level ) continue;
123 for( HLTSignature* sig : ch->signatureList() ) {
124 for( HLTTriggerElement* te : sig->outputTEs() )
125 outTEs.insert( te->hashId() );
126 }
127 }
128 // we have now big list of TEs mentioned in chains ... what with this which are not mentioned
129 // but are executed because recursion in sequences
130 std::vector<unsigned int> newTEs;
131 for( unsigned int teId : outTEs )
132 recursivelyFindInputTEs(teId, sequenceList, newTEs);
133 copy(newTEs.begin(), newTEs.end(),inserter(outTEs,outTEs.begin()));
134
135 // now turn into vector and order (unnecessary) but I don't want to break the interface
136 std::vector<unsigned int> tes;
137 copy(outTEs.begin(), outTEs.end(), inserter(tes,tes.begin()));
138 sort(tes.begin(), tes.end());
139 return tes;
140}
141
142
143vector<string>
145 vector<string> tes;
146 for( HLTSignature* sig : ch.signatureList() ) {
147 for( HLTTriggerElement* te : sig->outputTEs() )
148 tes.push_back( te->name() );
149 }
150 sort(tes.begin(), tes.end());
151 std::vector<std::string>::iterator l = unique(tes.begin(), tes.end());
152 tes.erase(l, tes.end());
153 return tes;
154}
155
156
157std::vector<std::string>
159 vector<string> tes = explicitChainTEs(ch);
160
161 vector<string> newTes;
162 for(const string& teId : tes )
163 recursivelyFindInputTEs(teId, sequenceList, newTes);
164
165 sort(tes.begin(), tes.end());
166 vector<string>::iterator l = unique(tes.begin(), tes.end());
167 tes.erase(l, tes.end());
168 return tes;
169}
170
171
172// ________________________________________________________________________________
173std::set<std::string>
175
176 const HLTChainList& chainList = frame.getHLTChainList();
177 const HLTSequenceList& sequenceList = frame.getHLTSequenceList();
178
179 set<string> l2tes;
180 for( HLTChain* chain : chainList ) {
181 if ( chain->level() == "EF" ) continue;
182 set<string> tes = allTEsProducedInL2Chain( *chain, sequenceList);
183 copy(tes.begin(), tes.end(), std::inserter(l2tes,l2tes.begin()));
184 }
185 return l2tes;
186}
187
188
189// ________________________________________________________________________________
190std::set<std::string>
192 std::set<std::string>* l2tes )
193{
194 const HLTChainList& chainList = frame.getHLTChainList();
195 const HLTSequenceList& sequenceList = frame.getHLTSequenceList();
196
197 set<string> level2TEs = l2tes?*l2tes:allTEsProducedInL2(frame);
198
199 set<string> eftes;
200 for( HLTChain* chain : chainList ) {
201 if ( chain->level() == "L2" ) continue;
202 set<string> tes = allTEsProducedInEFChain( *chain, sequenceList, level2TEs);
203 copy(tes.begin(), tes.end(), std::inserter(eftes,eftes.begin()));
204 }
205 return eftes;
206}
207
208
209// ________________________________________________________________________________
210std::set<std::string>
212{
213 using std::set; using std::string; using std::vector;
214
215 set<string> tes = allTEsProducedInL2( frame );
216 set<string> eftes = allTEsProducedInEF( frame, &tes );
217
218 std::copy(eftes.begin(),eftes.end(),
219 std::inserter(tes,tes.begin()));
220 return tes;
221}
222
223
224
225
226
227
228// ________________________________________________________________________________
229std::set<std::string>
230TrigConf::HLTTEUtils::inputTEs( const std::set<std::string>& TEs,
231 const TrigConf::HLTSequenceList& sequenceList) {
232
233 using std::set; using std::string;
234
235 // get the input TEs
236 set<string> inputTEs;
237 for(set<string>::iterator te = TEs.begin(); te != TEs.end(); ++te) {
238 const TrigConf::HLTSequence* seq = sequenceList.getSequence(*te);
239 if(seq==0) {
240 std::stringstream str;
241 str << "TE " << *te << " is not produced by any sequence " << std::endl;
242 throw std::runtime_error(str.str());
243 }
244 for(vector<HLTTriggerElement*>::const_iterator teIt = seq->inputTEs().begin(); teIt != seq->inputTEs().end(); ++teIt)
245 inputTEs.insert((*teIt)->name());
246 }
247 return inputTEs;
248}
249
250
251
252// ________________________________________________________________________________
253std::set<std::string>
255 const TrigConf::HLTSequenceList& sequenceList)
256{
257 using std::set; using std::string; using std::vector;
258
259 set<string> l2tes;
260 // explicitly produced TEs
261 const vector< HLTSignature * >& sigVec = chain.signatureList();
262 for ( vector< HLTSignature * >::const_iterator sig = sigVec.begin(); sig != sigVec.end(); ++sig ) {
263 const vector< HLTTriggerElement * >& teVec = (*sig)->outputTEs();
264 for ( vector< HLTTriggerElement * >::const_iterator te = teVec.begin(); te != teVec.end(); ++te)
265 l2tes.insert((*te)->name());
266 }
267
268 // get the input TEs
269 set<string> inputTEs;
270 for(set<string>::iterator outTEIt = l2tes.begin(); outTEIt != l2tes.end(); ++outTEIt) {
271 TrigConf::HLTSequence* seq = sequenceList.getSequence(*outTEIt);
272 if(seq==0) {
273 std::stringstream str;
274 str << "TE " << *outTEIt << " is not produced by any sequence " << std::endl;
275 throw std::runtime_error(str.str());
276 }
277 seq->setL2();
278 for(vector<HLTTriggerElement*>::const_iterator teIt = seq->inputTEs().begin(); teIt != seq->inputTEs().end(); ++teIt)
279 inputTEs.insert((*teIt)->name());
280 }
281
282 // still to check
283 set<string> check;
284 std::set_difference(inputTEs.begin(),inputTEs.end(), l2tes.begin(),l2tes.end(), std::inserter(check,check.begin()));
285
286 for(set<string>::iterator teIt = check.begin(); teIt != check.end(); ++teIt)
287 recursivelyFindOutputTEs( *teIt, sequenceList, l2tes, 2 );
288
289 return l2tes;
290}
291
292
293
294
295// ________________________________________________________________________________
296std::set<std::string>
298 const TrigConf::HLTSequenceList& sequenceList,
299 const std::set<std::string>& l2tes )
300{
301 using std::set; using std::string; using std::vector;
302
303 set<string> eftes;
304 // explicitly produced TEs
305 const vector< HLTSignature * >& sigVec = chain.signatureList();
306 for ( vector< HLTSignature * >::const_iterator sig = sigVec.begin(); sig != sigVec.end(); ++sig ) {
307 const vector< HLTTriggerElement * >& teVec = (*sig)->outputTEs();
308 for ( vector< HLTTriggerElement * >::const_iterator te = teVec.begin(); te != teVec.end(); ++te)
309 eftes.insert((*te)->name());
310 }
311
312 // get the input TEs
313 set<string> inputTEs;
314 for(set<string>::iterator outTEIt = eftes.begin(); outTEIt != eftes.end(); ++outTEIt) {
315 TrigConf::HLTSequence* seq = sequenceList.getSequence(*outTEIt);
316 if(seq==0) {
317 std::stringstream str;
318 str << "TE " << *outTEIt << " is not produced by any sequence " << std::endl;
319 throw std::runtime_error(str.str());
320 }
321 seq->setEF();
322 for(vector<HLTTriggerElement*>::const_iterator teIt = seq->inputTEs().begin(); teIt != seq->inputTEs().end(); ++teIt)
323 inputTEs.insert((*teIt)->name());
324 }
325
326 // still to check
327 set<string> check;
328 std::set_difference(inputTEs.begin(),inputTEs.end(), eftes.begin(), eftes.end(), std::inserter(check,check.begin()));
329
330 for(const string& te : check)
331 recursivelyFindOutputTEs( te, sequenceList, eftes, 3, &l2tes );
332
333 return eftes;
334}
335
336
337
338
339// ________________________________________________________________________________
340std::string
342 const HLTFrame& frame )
343{
344 using std::string; using std::set; using std::vector; using TrigConf::HLTTriggerElement;
346
347 const HLTSequenceList& sequenceList = frame.getHLTSequenceList();
348
349 std::string teCat("");
350
351 set<string> writtenOutput;
352 set<string> neededInput;
353
354 unsigned int currentSigPos = 1;
355
356 const vector<HLTSignature*> & signatures = chain.signatureList();
357 vector<HLTSignature*>::const_iterator sigIt = signatures.begin();
358 for(; sigIt!=signatures.end(); ++sigIt) {
359 unsigned int sigCounter = (*sigIt)->signature_counter();
360 while(sigCounter>currentSigPos) {
361 teCat +=";"; // separate signature by ';'
362 currentSigPos++;
363 }
364 const vector<HLTTriggerElement*> & outputTEs = (*sigIt)->outputTEs();
365 vector<HLTTriggerElement*>::const_iterator teIt = outputTEs.begin();
366 for(;teIt!=outputTEs.end();++teIt) {
367 if(teIt!=outputTEs.begin()) teCat +=","; // separate sequences by ','
368 const std::string& outTEName((*teIt)->name());
369 const TrigConf::HLTSequence* seq = sequenceList.getSequence(outTEName);
370 if(seq==0) {
371 std::stringstream str;
372 str << "Chain " << chain.chain_name() << " at step " << sigCounter
373 << " requires TE " << outTEName << ", which is not produced by any sequence " << std::endl;
374 throw std::runtime_error(str.str());
375 }
376 teCat += seq->concise();
377
378 // store info about input and output TE's
379 for(vector<HLTTriggerElement*>::const_iterator teIt = seq->inputTEs().begin(); teIt != seq->inputTEs().end(); ++teIt)
380 neededInput.insert((*teIt)->name());
381 writtenOutput.insert(seq->outputTE()->name());
382 }
383 }
384
385 teCat = "|" + teCat;
386
387 set<string> stillToWrite;
388 std::set_difference(neededInput.begin(),neededInput.end(),
389 writtenOutput.begin(),writtenOutput.end(),
390 std::inserter(stillToWrite,stillToWrite.begin()));
391
392 set<string> allStillToWrite(stillToWrite);
393 int ilevel = (chain.level()=="L2")?2:3;
394 for( const string& te : stillToWrite)
395 recursivelyFindOutputTEsWithLevelFromSequence( te, sequenceList, allStillToWrite, ilevel );
396
397 bool first=true;
398 for(set<string>::iterator teIt = allStillToWrite.begin(); teIt != allStillToWrite.end(); ++teIt) {
399 const std::string& outTEName(*teIt);
400 const TrigConf::HLTSequence* seq = sequenceList.getSequence(outTEName);
401 if(seq==0) continue;
402 if(!first) { first=false; teCat = "," + teCat; } // separate sequences by ',' // TODO careful not to change COOL format JS
403 teCat = seq->concise() + teCat;
404 }
405 return teCat;
406}
407
408
409// ________________________________________________________________________________
410std::vector< std::string >
412{
413 // turns "(str1),(str2),(str3)" into ["str1", "str2", "str3"]
414 std::string::size_type currentOpen = 0;
415
416 std::vector< std::string > result;
417
418 bool openParenthesis = false;
419 for(std::string::size_type pos = 0; pos!=s.size(); ++pos) {
420 char cc = s[pos];
421 if(cc=='(') {
422 if(openParenthesis) {
423 std::stringstream str;
424 str << "Two many open parenthesis in " << s << std::endl;
425 throw std::runtime_error(str.str());
426 }
427 openParenthesis = true;
428 currentOpen = pos;
429 }
430 if(cc==')') {
431 if(!openParenthesis) {
432 std::stringstream str;
433 str << "Two many closing parenthesis in " << s << std::endl;
434 throw std::runtime_error(str.str());
435 }
436 openParenthesis = false;
437 result.push_back(std::string(s, currentOpen+1, pos-currentOpen-1));
438 }
439 }
440 return result;
441}
442
445{
446 // builds a sequence from a string "inputTE1,inputTE2,outputTE", (can be just "outputTE")
447 std::vector<std::string> tes = TrigConf::split(desc,",");
448
449 vector<TrigConf::HLTTriggerElement*> input;
450 for(std::vector<std::string>::iterator teit = tes.begin(); teit!=tes.end(); ++teit) {
451 input.push_back(new TrigConf::HLTTriggerElement(0,*teit));
452 }
453 TrigConf::HLTTriggerElement* outte = input.back(); input.pop_back();
454
455 TrigConf::HLTSequence* seq = new TrigConf::HLTSequence( input, outte, vector<string>());
456
457 return seq;
458}
459
460
461//merge L2 and EF chains
463
464 if(! frame.mergedHLT()) return;
465
466 vector<HLTChain*> tmpL2chains;
467 vector<HLTChain*> tmpEFchains;
468 for( TrigConf::HLTChain* aChain : frame.theHLTChainList() ){
469 if (aChain->level() == "L2"){
470 tmpL2chains.push_back( aChain ); //add in the tmp list
471 }
472 else if (aChain->level() == "EF"){
473 tmpEFchains.push_back( aChain ); //add in the tmp list
474 }
475 }
476 //delete the current chainlist content
477 frame.theHLTChainList().clear();
478
479 // for ( vector<HLTChain*>::iterator aChain = frame.getHLTChainList().begin(); aChain != frame.getHLTChainList().end(); ) {
480 // if ((*aChain)->level() == "L2"){
481 // tmpL2chains.push_back( *aChain ); //add in the tmp list
482 // frame.getHLTChainList().chains().erase(aChain); // erase L2 chains pointers
483 // }
484 // else aChain++; //iterate if not erase
485 // }
486
487
488 for ( vector<HLTChain*>::iterator cEF = tmpEFchains.begin(); cEF != tmpEFchains.end(); ++cEF ) {
489 // for ( vector<HLTChain*>::iterator cEF = frame.getHLTChainList().begin(); cEF != frame.getHLTChainList().end(); ++cEF ) {
490 // iterator of the signature list
491 std::vector<TrigConf::HLTSignature*>::iterator it = (*cEF)->signatureList().begin();
492 string cname = (*cEF)->chain_name();
493 if ( size_t index = ((*cEF)->chain_name().find("EF_")) != std::string::npos ){
494 cname.replace(index-1, 3, "HLT_");// why index must be scaled by 1 ?
495 (*cEF)->set_chain_name(cname);
496 }
497 (*cEF)->set_level("HLT");
498 (*cEF)->set_EB_after_step(0);//in case EF chain is not seeded by any L2 chain
499 for ( vector<HLTChain*>::iterator cL2 = tmpL2chains.begin(); cL2 != tmpL2chains.end(); ++cL2 ) {
500 if ((*cL2)->chain_name() == (*cEF)->lower_chain_name()){
501 // insert the L2 signatures:
502 (*cEF)->signatureList().insert (it,(*cL2)->signatureList().begin(),(*cL2)->signatureList().end()); // add the L2 signatures, before EF
503 // update the EF signature counters
504 for (unsigned int sig=0; sig < (*cEF)->signatureList().size(); sig++){
505 (*cEF)->signatureList()[ sig ]->set_signature_counter( sig + 1 );
506 }
507 // set the lower chain name as the L2 lower
508 (*cEF)->set_lower_chain_name((*cL2)->lower_chain_name());
509 (*cEF)->set_lower_chain_counter((*cL2)->lower_chain_counter());
510 // set the prescales, rerun_prescales and pass_through
511 int prescale(0);
512 if ((*cL2)->prescale()==-1. || (*cEF)->prescale()==-1.) prescale=-1.;
513 else prescale=(*cL2)->prescale()*(*cEF)->prescale();
514 (*cEF)->set_prescale(prescale);
515 int rerun_prescale(0);
516 if (((*cL2)->rerun_prescale("")).second<0 || ((*cEF)->rerun_prescale("")).second<0) rerun_prescale=-1.;
517 else rerun_prescale=((*cL2)->rerun_prescale("")).second * ((*cEF)->rerun_prescale("")).second;
518 (*cEF)->set_rerun_prescale(rerun_prescale);
519 int pass_through(0);
520 if ((*cL2)->pass_through()==-1. || (*cEF)->pass_through()==-1.) pass_through=-1.;
521 else pass_through=(*cL2)->pass_through()*(*cEF)->pass_through();
522 (*cEF)->set_pass_through(pass_through);
523 // add the EB_after_step
524 (*cEF)->set_EB_after_step( (*cL2)->signatureList().size());
525 /* std::cout << "FPP: changed name to " << (*cEF)->chain_name()
526 << " level to " << (*cEF)->level()
527 << "; set lower_chain_name to " << (*cEF)->lower_chain_name()
528 << "; set EB_after_step=" << (*cEF)->EB_after_step()
529 << "; set prescale=" << (*cEF)->prescale()
530 << "; set rerun_prescale=" << (*cEF)->rerun_prescale()
531 << "; set pass_through=" << (*cEF)->pass_through()
532 << "; added signatures tot=" << (*cEF)->signatureList().size()<< std::endl; */
533 break;
534 }
535 }
536 frame.theHLTChainList().addHLTChain(*cEF);
537 }
538
539 //std::cout<<"FPP HLTUtils::mergeHLTChains(): frame.getHLTChainList().chains().size()="<<frame.getHLTChainList().size()<<std::endl;
540 return;
541}
542
543
544
545
546void
548 HLTPrescale hltps;
549
550 bool disabled = l2ps.disabled() || efps.disabled();
551
552 float prescale = fabs( l2ps.prescale() * efps.prescale() ) * (disabled?-1:1);
553 hltps.setPrescale(prescale);
554
555 hltchain->set_prescales(hltps);
556}
557
558void
560
561 if(! frame.mergedHLT()) return;
562
563 // we need to keep the steps in sync so first we find the last step in L2
564 unsigned int lastL2step(0);
565 for( TrigConf::HLTChain* chain : frame.getHLTChainList() ) {
566 if(chain->level_enum() != L2) continue;
567 lastL2step = max(lastL2step, chain->lastStep());
568 }
569
570 // now make copies of all EF chains, the steps are
571 // 1. make a deep copy of all EF chains
572 // 2. give them level HLT and modify the name
573 // 3. insert the signatures (deep copies) of the matching L2 chains at the front
574 // 4. set the input L1Item condition
575 // 5. merge the prescales, streams
576
577 vector<HLTChain*> newHLTchains;
578 for( TrigConf::HLTChain* chain : frame.getHLTChainList() ) {
579 if( chain->level_enum() != EF ) continue;
580
581
582 // make the copy (deep copy of all signatures and output TEs)
583 HLTChain * hltChain = new HLTChain(*chain);
584 newHLTchains.push_back(hltChain);
585
586 // keep track of chain counters (for correct prescale merging)
587 hltChain->mergeCounter.ef = hltChain->chain_counter();
588
589 // set the name and level to HLT
590 // if name starts with EF_ it is replace with HLT_, otherwise HLT_ is prepended
591 hltChain->set_level("HLT");
592 string oldname = chain->name();
593 unsigned int basepos = (oldname.compare(0,3,"EF_")==0)?3:0;
594 hltChain->setName( "HLT_" + oldname.substr(basepos) );
595
596
597 hltChain->set_EB_after_step(0); //in case EF chain is not seeded by any L2 chain
598
599 // shift the step counters of by +lastL2Step (note that there is no step=0)
600 hltChain->shiftStepCounter(lastL2step);
601
602
603 // find the lower chain
604 const HLTChain * l2Chain = frame.getHLTChainList().chain( hltChain->lower_chain_name() );
605
606 // if no seeding l2 chain is found, nothing needs to be done
607 if(l2Chain) {
608
609 hltChain->mergeCounter.l2 = l2Chain->chain_counter();
610
611 // insert l2 steps at the beginning
612 // first need to create a deep copy
613 vector<HLTSignature*> l2sig_deepcopy;
614 for(HLTSignature* sig : l2Chain->signatures())
615 l2sig_deepcopy.push_back(new HLTSignature(*sig));
616
617 hltChain->signatureList().insert( hltChain->signatureList().begin(),
618 l2sig_deepcopy.begin(), l2sig_deepcopy.end());
619
620 // set L1 input
621 hltChain->set_lower_chain_name( l2Chain->lower_chain_name() );
622 hltChain->set_lower_chain_counter( l2Chain->lower_chain_counter() );
623
624 // set the EB start after old L2 chain
625 hltChain->set_EB_after_step( l2Chain->signatureList().size());
626
627 // set prescales, pass throughs, rerun prescales, stream prescales
628
629 // prescale (product of L2 and EF, disabled if either were disabled)
630
631 mergeL2EFPrescales(hltChain, l2Chain->prescales(), hltChain->prescales());
632// bool disabled = l2Chain->prescale()<0 || hltChain->prescale()<0;
633// float prescale = l2Chain->prescale() * hltChain->prescale();
634// prescale = fabs(prescale) * (disabled?-1:1);
635// hltChain->prescales().setPrescale(prescale);
636 }
637
638 // TODO: rerun prescales, streams,
639 // int rerun_prescale(0);
640 // if (((*cL2)->rerun_prescale("")).second<0 || ((*cEF)->rerun_prescale("")).second<0) rerun_prescale=-1.;
641 // else rerun_prescale=((*cL2)->rerun_prescale("")).second * ((*cEF)->rerun_prescale("")).second;
642 // (*cEF)->set_rerun_prescale(rerun_prescale);
643 // int pass_through(0);
644 // if ((*cL2)->pass_through()==-1. || (*cEF)->pass_through()==-1.) pass_through=-1.;
645 // else pass_through=(*cL2)->pass_through()*(*cEF)->pass_through();
646 // (*cEF)->set_pass_through(pass_through);
647 // // add the EB_after_step
648 // (*cEF)->set_EB_after_step( (*cL2)->signatureList().size());
649
650 // TODO deal with L2-only chains
651
652 }
653
654 // delete the current chainlist content
655 frame.theHLTChainList().clear();
656
657 // and add the new chains
658 for( HLTChain* chain : newHLTchains )
659 frame.theHLTChainList().addHLTChain(chain);
660
661 return;
662}
void recursivelyFindInputTEs(unsigned int teId, const TrigConf::HLTSequenceList &seqList, std::vector< unsigned int > &tes)
#define max(a, b)
Definition cfImp.cxx:41
CompareSequenceOutput(const std::string &name)
bool operator()(TrigConf::HLTSequence *const &s)
list of all HLT chains in a trigger menu
bool addHLTChain(HLTChain *ch)
adds an HLTChain to the menu
HLTChain * chain(const std::string &chainname) const
access the chain by name returns null-pointer if chain not found
HLT chain configuration information.
const std::string & lower_chain_name() const
std::vector< HLTSignature * > & signatureList()
HLTChain & set_EB_after_step(int EB_after_step)
HLTChain & set_lower_chain_counter(int lower_chain_counter)
HLTChain & set_level(const std::string &level)
struct TrigConf::HLTChain::@145022354365266131341076355027225065251152241206 mergeCounter
const std::vector< HLTSignature * > & signatures() const
HLTChain & set_prescales(const HLTPrescale &prescales)
HLTChain & set_lower_chain_name(const std::string &lower_chain_name)
The HLT trigger menu,.
Definition HLTFrame.h:33
const HLTSequenceList & getHLTSequenceList() const
const accessor to the list of HLT sequences
Definition HLTFrame.h:50
bool mergedHLT() const
Definition HLTFrame.h:53
HLTChainList & theHLTChainList()
accessor to the list of HLT chains
Definition HLTFrame.h:44
const HLTChainList & getHLTChainList() const
const accessor to the list of HLT chains
Definition HLTFrame.h:49
HLTPrescale & setPrescale(float prescale)
Definition HLTPrescale.h:46
float prescale() const
Definition HLTPrescale.h:52
bool disabled() const
Definition HLTPrescale.h:59
list of HLT sequences
HLTSequence * getSequence(unsigned int id) const
counts the number of sequences in the menu
HLT sequence configuration information.
Definition HLTSequence.h:28
HLT signature configuration information.
static std::set< std::string > inputTEs(const std::set< std::string > &TEs, const TrigConf::HLTSequenceList &sequenceList)
returns set of input TEs for given set of TEs
static std::set< std::string > allTEsProduced(const TrigConf::HLTFrame &frame)
static std::vector< std::string > splitGroups(const std::string &s)
static std::set< std::string > allTEsProducedInL2Chain(const TrigConf::HLTChain &chain, const TrigConf::HLTSequenceList &sequenceList)
static std::vector< std::string > explicitChainTEs(const HLTChain &ch)
returns list of TEids which are specified by Chain signatures
static std::vector< std::string > implicitChainTEs(const HLTChain &ch, const HLTSequenceList &sequenceList)
returns list of TEids which are specified by Chain signatures and which are needed by this signatures
static HLTSequence * buildSequence(const std::string &desc)
static void mergeHLTChainList(TrigConf::HLTFrame &frame)
static std::set< std::string > allTEsProducedInEFChain(const TrigConf::HLTChain &chain, const TrigConf::HLTSequenceList &sequenceList, const std::set< std::string > &l2tes)
static void mergeHLTChainList2(TrigConf::HLTFrame &frame)
static void mergeL2EFPrescales(TrigConf::HLTChain *hltchain, const TrigConf::HLTPrescale &l2ps, const TrigConf::HLTPrescale &efps)
static std::set< std::string > allTEsProducedInL2(const TrigConf::HLTFrame &frame)
static std::set< std::string > allTEsProducedInEF(const TrigConf::HLTFrame &frame, std::set< std::string > *l2tes=0)
static std::vector< unsigned int > allTEsProducedInLevel(const std::string &level, const HLTChainList &chainList, const HLTSequenceList &sequenceList)
returns list of TEids which can be poduced at given level (L2 or EF) in currecnt configuration
static std::string ChainCondenseDisplay(const HLTChain &chain, const HLTFrame &frame)
HLT trigger element configuration information.
void setName(const std::string &name)
STL iterator class.
std::vector< std::string > veto
these patterns are anded
Definition listroot.cxx:191
string2hash(string)
Definition HLTUtils.py:5
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22
void recursivelyFindOutputTEsWithLevelFromSequence(const std::string &tename, const TrigConf::HLTSequenceList &sequenceList, std::set< std::string > &tes, int level)
std::vector< std::string > split(const std::string &line, const std::string &del=" ")
void recursivelyFindOutputTEs(const std::string &tename, const TrigConf::HLTSequenceList &sequenceList, std::set< std::string > &tes, int level, const std::set< std::string > *veto=0)
Definition index.py:1
STL namespace.
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.