ATLAS Offline Software
Loading...
Searching...
No Matches
TrigConf::HLTTEUtils Class Reference

HLTUtils is renamed in r22 to HLTTEUtils. More...

#include <HLTUtils.h>

Collaboration diagram for TrigConf::HLTTEUtils:

Static Public Member Functions

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::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 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 > allTEsProducedInL2Chain (const TrigConf::HLTChain &chain, const TrigConf::HLTSequenceList &sequenceList)
static std::set< std::string > allTEsProducedInEFChain (const TrigConf::HLTChain &chain, const TrigConf::HLTSequenceList &sequenceList, const std::set< std::string > &l2tes)
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::set< std::string > allTEsProduced (const TrigConf::HLTFrame &frame)
static std::string ChainCondenseDisplay (const HLTChain &chain, const HLTFrame &frame)
static std::vector< std::string > splitGroups (const std::string &s)
static HLTSequencebuildSequence (const std::string &desc)
static void mergeHLTChainList (TrigConf::HLTFrame &frame)
static void mergeHLTChainList2 (TrigConf::HLTFrame &frame)
static void mergeL2EFPrescales (TrigConf::HLTChain *hltchain, const TrigConf::HLTPrescale &l2ps, const TrigConf::HLTPrescale &efps)

Detailed Description

HLTUtils is renamed in r22 to HLTTEUtils.

The hashing functionality remains in HLTUtils, which moves to the standalone HLTUtils package

Definition at line 26 of file TrigConfHLTData/TrigConfHLTData/HLTUtils.h.

Member Function Documentation

◆ allTEsProduced()

std::set< std::string > TrigConf::HLTTEUtils::allTEsProduced ( const TrigConf::HLTFrame & frame)
static

Definition at line 211 of file TrigConfHLTData/Root/HLTUtils.cxx.

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}
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)

◆ allTEsProducedInEF()

std::set< std::string > TrigConf::HLTTEUtils::allTEsProducedInEF ( const TrigConf::HLTFrame & frame,
std::set< std::string > * l2tes = 0 )
static

Definition at line 191 of file TrigConfHLTData/Root/HLTUtils.cxx.

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}
const HLTSequenceList & getHLTSequenceList() const
const accessor to the list of HLT sequences
Definition HLTFrame.h:50
const HLTChainList & getHLTChainList() const
const accessor to the list of HLT chains
Definition HLTFrame.h:49
static std::set< std::string > allTEsProducedInEFChain(const TrigConf::HLTChain &chain, const TrigConf::HLTSequenceList &sequenceList, const std::set< std::string > &l2tes)
bool copy
Definition calibdata.py:26

◆ allTEsProducedInEFChain()

std::set< std::string > TrigConf::HLTTEUtils::allTEsProducedInEFChain ( const TrigConf::HLTChain & chain,
const TrigConf::HLTSequenceList & sequenceList,
const std::set< std::string > & l2tes )
static

Definition at line 297 of file TrigConfHLTData/Root/HLTUtils.cxx.

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}
HLTSequence * getSequence(unsigned int id) const
counts the number of sequences in the menu
std::vector< HLTTriggerElement * > & inputTEs()
accessor to the list of input trigger elements
Definition HLTSequence.h:48
void setEF(bool on=true)
Definition HLTSequence.h:71
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
void recursivelyFindOutputTEs(const std::string &tename, const TrigConf::HLTSequenceList &sequenceList, std::set< std::string > &tes, int level, const std::set< std::string > *veto=0)

◆ allTEsProducedInL2()

std::set< std::string > TrigConf::HLTTEUtils::allTEsProducedInL2 ( const TrigConf::HLTFrame & frame)
static

Definition at line 174 of file TrigConfHLTData/Root/HLTUtils.cxx.

174 {
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}
static std::set< std::string > allTEsProducedInL2Chain(const TrigConf::HLTChain &chain, const TrigConf::HLTSequenceList &sequenceList)

◆ allTEsProducedInL2Chain()

std::set< std::string > TrigConf::HLTTEUtils::allTEsProducedInL2Chain ( const TrigConf::HLTChain & chain,
const TrigConf::HLTSequenceList & sequenceList )
static

Definition at line 254 of file TrigConfHLTData/Root/HLTUtils.cxx.

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}
void setL2(bool on=true)
Definition HLTSequence.h:70

◆ allTEsProducedInLevel()

std::vector< unsigned int > HLTTEUtils::allTEsProducedInLevel ( const std::string & level,
const HLTChainList & chainList,
const HLTSequenceList & sequenceList )
static

returns list of TEids which can be poduced at given level (L2 or EF) in currecnt configuration

Warning
this method is dooing quite extensive menu inspection so it should not be executed to often ...
Parameters
levelL2 or EF name of trigger level
chainsListlist of configuration chains
sequenceListlist of configuration sequences
Returns
list of TE ids which according to the given configuration will be produced at level

Definition at line 115 of file TrigConfHLTData/Root/HLTUtils.cxx.

117 {
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}
void recursivelyFindInputTEs(unsigned int teId, const TrigConf::HLTSequenceList &seqList, std::vector< unsigned int > &tes)
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ buildSequence()

TrigConf::HLTSequence * TrigConf::HLTTEUtils::buildSequence ( const std::string & desc)
static

Definition at line 442 of file TrigConfHLTData/Root/HLTUtils.cxx.

443{
444 // builds a sequence from a string "inputTE1,inputTE2,outputTE", (can be just "outputTE")
445 std::vector<std::string> tes = TrigConf::split(desc,",");
446
447 vector<TrigConf::HLTTriggerElement*> input;
448 for(std::vector<std::string>::iterator teit = tes.begin(); teit!=tes.end(); ++teit) {
449 input.push_back(new TrigConf::HLTTriggerElement(0,*teit));
450 }
451 TrigConf::HLTTriggerElement* outte = input.back(); input.pop_back();
452
453 TrigConf::HLTSequence* seq = new TrigConf::HLTSequence( input, outte, vector<string>());
454
455 return seq;
456}
std::vector< std::string > split(const std::string &line, const std::string &del=" ")

◆ ChainCondenseDisplay()

std::string TrigConf::HLTTEUtils::ChainCondenseDisplay ( const HLTChain & chain,
const HLTFrame & frame )
static

Definition at line 341 of file TrigConfHLTData/Root/HLTUtils.cxx.

343{
344 using std::string; using std::set; using std::vector; using TrigConf::HLTTriggerElement;
345 using TrigConf::HLTSignature; using TrigConf::HLTSequenceList;
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 //this is unused if the in-loop usage is commented
397 for(set<string>::iterator teIt = allStillToWrite.begin(); teIt != allStillToWrite.end(); ++teIt) {
398 const std::string& outTEName(*teIt);
399 const TrigConf::HLTSequence* seq = sequenceList.getSequence(outTEName);
400 if(seq==0) continue;
401 teCat = seq->concise() + teCat;
402 }
403 return teCat;
404}
std::string concise() const
HLTTriggerElement * outputTE()
accessor to the list of output trigger elements (just 1)
Definition HLTSequence.h:49
const std::string & name() const
std::vector< std::string > signatures(const std::string &chain)
void recursivelyFindOutputTEsWithLevelFromSequence(const std::string &tename, const TrigConf::HLTSequenceList &sequenceList, std::set< std::string > &tes, int level)

◆ explicitChainTEs()

vector< string > HLTTEUtils::explicitChainTEs ( const HLTChain & ch)
static

returns list of TEids which are specified by Chain signatures

Definition at line 144 of file TrigConfHLTData/Root/HLTUtils.cxx.

144 {
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}
l
Printing final latex table to .tex output file.
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.

◆ implicitChainTEs()

std::vector< std::string > HLTTEUtils::implicitChainTEs ( const HLTChain & ch,
const HLTSequenceList & sequenceList )
static

returns list of TEids which are specified by Chain signatures and which are needed by this signatures

Definition at line 158 of file TrigConfHLTData/Root/HLTUtils.cxx.

158 {
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}
static std::vector< std::string > explicitChainTEs(const HLTChain &ch)
returns list of TEids which are specified by Chain signatures

◆ inputTEs()

std::set< std::string > TrigConf::HLTTEUtils::inputTEs ( const std::set< std::string > & TEs,
const TrigConf::HLTSequenceList & sequenceList )
static

returns set of input TEs for given set of TEs

Definition at line 230 of file TrigConfHLTData/Root/HLTUtils.cxx.

231 {
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}

◆ mergeHLTChainList()

void TrigConf::HLTTEUtils::mergeHLTChainList ( TrigConf::HLTFrame & frame)
static

Definition at line 460 of file TrigConfHLTData/Root/HLTUtils.cxx.

460 {
461
462 if(! frame.mergedHLT()) return;
463
464 vector<HLTChain*> tmpL2chains;
465 vector<HLTChain*> tmpEFchains;
466 for( TrigConf::HLTChain* aChain : frame.theHLTChainList() ){
467 if (aChain->level() == "L2"){
468 tmpL2chains.push_back( aChain ); //add in the tmp list
469 }
470 else if (aChain->level() == "EF"){
471 tmpEFchains.push_back( aChain ); //add in the tmp list
472 }
473 }
474 //delete the current chainlist content
475 frame.theHLTChainList().clear();
476
477 // for ( vector<HLTChain*>::iterator aChain = frame.getHLTChainList().begin(); aChain != frame.getHLTChainList().end(); ) {
478 // if ((*aChain)->level() == "L2"){
479 // tmpL2chains.push_back( *aChain ); //add in the tmp list
480 // frame.getHLTChainList().chains().erase(aChain); // erase L2 chains pointers
481 // }
482 // else aChain++; //iterate if not erase
483 // }
484
485
486 for ( vector<HLTChain*>::iterator cEF = tmpEFchains.begin(); cEF != tmpEFchains.end(); ++cEF ) {
487 // for ( vector<HLTChain*>::iterator cEF = frame.getHLTChainList().begin(); cEF != frame.getHLTChainList().end(); ++cEF ) {
488 // iterator of the signature list
489 std::vector<TrigConf::HLTSignature*>::iterator it = (*cEF)->signatureList().begin();
490 string cname = (*cEF)->chain_name();
491 if ( size_t index = ((*cEF)->chain_name().find("EF_")) != std::string::npos ){
492 cname.replace(index-1, 3, "HLT_");// why index must be scaled by 1 ?
493 (*cEF)->set_chain_name(cname);
494 }
495 (*cEF)->set_level("HLT");
496 (*cEF)->set_EB_after_step(0);//in case EF chain is not seeded by any L2 chain
497 for ( vector<HLTChain*>::iterator cL2 = tmpL2chains.begin(); cL2 != tmpL2chains.end(); ++cL2 ) {
498 if ((*cL2)->chain_name() == (*cEF)->lower_chain_name()){
499 // insert the L2 signatures:
500 (*cEF)->signatureList().insert (it,(*cL2)->signatureList().begin(),(*cL2)->signatureList().end()); // add the L2 signatures, before EF
501 // update the EF signature counters
502 for (unsigned int sig=0; sig < (*cEF)->signatureList().size(); sig++){
503 (*cEF)->signatureList()[ sig ]->set_signature_counter( sig + 1 );
504 }
505 // set the lower chain name as the L2 lower
506 (*cEF)->set_lower_chain_name((*cL2)->lower_chain_name());
507 (*cEF)->set_lower_chain_counter((*cL2)->lower_chain_counter());
508 // set the prescales, rerun_prescales and pass_through
509 int prescale(0);
510 if ((*cL2)->prescale()==-1. || (*cEF)->prescale()==-1.) prescale=-1.;
511 else prescale=(*cL2)->prescale()*(*cEF)->prescale();
512 (*cEF)->set_prescale(prescale);
513 int rerun_prescale(0);
514 if (((*cL2)->rerun_prescale("")).second<0 || ((*cEF)->rerun_prescale("")).second<0) rerun_prescale=-1.;
515 else rerun_prescale=((*cL2)->rerun_prescale("")).second * ((*cEF)->rerun_prescale("")).second;
516 (*cEF)->set_rerun_prescale(rerun_prescale);
517 int pass_through(0);
518 if ((*cL2)->pass_through()==-1. || (*cEF)->pass_through()==-1.) pass_through=-1.;
519 else pass_through=(*cL2)->pass_through()*(*cEF)->pass_through();
520 (*cEF)->set_pass_through(pass_through);
521 // add the EB_after_step
522 (*cEF)->set_EB_after_step( (*cL2)->signatureList().size());
523 /* std::cout << "FPP: changed name to " << (*cEF)->chain_name()
524 << " level to " << (*cEF)->level()
525 << "; set lower_chain_name to " << (*cEF)->lower_chain_name()
526 << "; set EB_after_step=" << (*cEF)->EB_after_step()
527 << "; set prescale=" << (*cEF)->prescale()
528 << "; set rerun_prescale=" << (*cEF)->rerun_prescale()
529 << "; set pass_through=" << (*cEF)->pass_through()
530 << "; added signatures tot=" << (*cEF)->signatureList().size()<< std::endl; */
531 break;
532 }
533 }
534 frame.theHLTChainList().addHLTChain(*cEF);
535 }
536
537 //std::cout<<"FPP HLTUtils::mergeHLTChains(): frame.getHLTChainList().chains().size()="<<frame.getHLTChainList().size()<<std::endl;
538 return;
539}
bool addHLTChain(HLTChain *ch)
adds an HLTChain to the menu
bool mergedHLT() const
Definition HLTFrame.h:53
HLTChainList & theHLTChainList()
accessor to the list of HLT chains
Definition HLTFrame.h:44

◆ mergeHLTChainList2()

void TrigConf::HLTTEUtils::mergeHLTChainList2 ( TrigConf::HLTFrame & frame)
static

Definition at line 557 of file TrigConfHLTData/Root/HLTUtils.cxx.

557 {
558
559 if(! frame.mergedHLT()) return;
560
561 // we need to keep the steps in sync so first we find the last step in L2
562 unsigned int lastL2step(0);
563 for( TrigConf::HLTChain* chain : frame.getHLTChainList() ) {
564 if(chain->level_enum() != L2) continue;
565 lastL2step = max(lastL2step, chain->lastStep());
566 }
567
568 // now make copies of all EF chains, the steps are
569 // 1. make a deep copy of all EF chains
570 // 2. give them level HLT and modify the name
571 // 3. insert the signatures (deep copies) of the matching L2 chains at the front
572 // 4. set the input L1Item condition
573 // 5. merge the prescales, streams
574
575 vector<HLTChain*> newHLTchains;
576 for( TrigConf::HLTChain* chain : frame.getHLTChainList() ) {
577 if( chain->level_enum() != EF ) continue;
578
579
580 // make the copy (deep copy of all signatures and output TEs)
581 HLTChain * hltChain = new HLTChain(*chain);
582 newHLTchains.push_back(hltChain);
583
584 // keep track of chain counters (for correct prescale merging)
585 hltChain->mergeCounter.ef = hltChain->chain_counter();
586
587 // set the name and level to HLT
588 // if name starts with EF_ it is replace with HLT_, otherwise HLT_ is prepended
589 hltChain->set_level("HLT");
590 string oldname = chain->name();
591 unsigned int basepos = (oldname.compare(0,3,"EF_")==0)?3:0;
592 hltChain->setName( "HLT_" + oldname.substr(basepos) );
593
594
595 hltChain->set_EB_after_step(0); //in case EF chain is not seeded by any L2 chain
596
597 // shift the step counters of by +lastL2Step (note that there is no step=0)
598 hltChain->shiftStepCounter(lastL2step);
599
600
601 // find the lower chain
602 const HLTChain * l2Chain = frame.getHLTChainList().chain( hltChain->lower_chain_name() );
603
604 // if no seeding l2 chain is found, nothing needs to be done
605 if(l2Chain) {
606
607 hltChain->mergeCounter.l2 = l2Chain->chain_counter();
608
609 // insert l2 steps at the beginning
610 // first need to create a deep copy
611 vector<HLTSignature*> l2sig_deepcopy;
612 for(HLTSignature* sig : l2Chain->signatures())
613 l2sig_deepcopy.push_back(new HLTSignature(*sig));
614
615 hltChain->signatureList().insert( hltChain->signatureList().begin(),
616 l2sig_deepcopy.begin(), l2sig_deepcopy.end());
617
618 // set L1 input
619 hltChain->set_lower_chain_name( l2Chain->lower_chain_name() );
620 hltChain->set_lower_chain_counter( l2Chain->lower_chain_counter() );
621
622 // set the EB start after old L2 chain
623 hltChain->set_EB_after_step( l2Chain->signatureList().size());
624
625 // set prescales, pass throughs, rerun prescales, stream prescales
626
627 // prescale (product of L2 and EF, disabled if either were disabled)
628
629 mergeL2EFPrescales(hltChain, l2Chain->prescales(), hltChain->prescales());
630// bool disabled = l2Chain->prescale()<0 || hltChain->prescale()<0;
631// float prescale = l2Chain->prescale() * hltChain->prescale();
632// prescale = fabs(prescale) * (disabled?-1:1);
633// hltChain->prescales().setPrescale(prescale);
634 }
635
636 // TODO: rerun prescales, streams,
637 // int rerun_prescale(0);
638 // if (((*cL2)->rerun_prescale("")).second<0 || ((*cEF)->rerun_prescale("")).second<0) rerun_prescale=-1.;
639 // else rerun_prescale=((*cL2)->rerun_prescale("")).second * ((*cEF)->rerun_prescale("")).second;
640 // (*cEF)->set_rerun_prescale(rerun_prescale);
641 // int pass_through(0);
642 // if ((*cL2)->pass_through()==-1. || (*cEF)->pass_through()==-1.) pass_through=-1.;
643 // else pass_through=(*cL2)->pass_through()*(*cEF)->pass_through();
644 // (*cEF)->set_pass_through(pass_through);
645 // // add the EB_after_step
646 // (*cEF)->set_EB_after_step( (*cL2)->signatureList().size());
647
648 // TODO deal with L2-only chains
649
650 }
651
652 // delete the current chainlist content
653 frame.theHLTChainList().clear();
654
655 // and add the new chains
656 for( HLTChain* chain : newHLTchains )
657 frame.theHLTChainList().addHLTChain(chain);
658
659 return;
660}
#define max(a, b)
Definition cfImp.cxx:41
HLTChain * chain(const std::string &chainname) const
access the chain by name returns null-pointer if chain not found
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_lower_chain_name(const std::string &lower_chain_name)
static void mergeL2EFPrescales(TrigConf::HLTChain *hltchain, const TrigConf::HLTPrescale &l2ps, const TrigConf::HLTPrescale &efps)
void setName(const std::string &name)

◆ mergeL2EFPrescales()

void TrigConf::HLTTEUtils::mergeL2EFPrescales ( TrigConf::HLTChain * hltchain,
const TrigConf::HLTPrescale & l2ps,
const TrigConf::HLTPrescale & efps )
static

Definition at line 545 of file TrigConfHLTData/Root/HLTUtils.cxx.

545 {
546 HLTPrescale hltps;
547
548 bool disabled = l2ps.disabled() || efps.disabled();
549
550 float prescale = fabs( l2ps.prescale() * efps.prescale() ) * (disabled?-1:1);
551 hltps.setPrescale(prescale);
552
553 hltchain->set_prescales(hltps);
554}
HLTChain & set_prescales(const HLTPrescale &prescales)
HLTPrescale & setPrescale(float prescale)
Definition HLTPrescale.h:46
float prescale() const
Definition HLTPrescale.h:52
bool disabled() const
Definition HLTPrescale.h:59

◆ splitGroups()

std::vector< std::string > TrigConf::HLTTEUtils::splitGroups ( const std::string & s)
static

Definition at line 409 of file TrigConfHLTData/Root/HLTUtils.cxx.

410{
411 // turns "(str1),(str2),(str3)" into ["str1", "str2", "str3"]
412 std::string::size_type currentOpen = 0;
413
414 std::vector< std::string > result;
415
416 bool openParenthesis = false;
417 for(std::string::size_type pos = 0; pos!=s.size(); ++pos) {
418 char cc = s[pos];
419 if(cc=='(') {
420 if(openParenthesis) {
421 std::stringstream str;
422 str << "Two many open parenthesis in " << s << std::endl;
423 throw std::runtime_error(str.str());
424 }
425 openParenthesis = true;
426 currentOpen = pos;
427 }
428 if(cc==')') {
429 if(!openParenthesis) {
430 std::stringstream str;
431 str << "Two many closing parenthesis in " << s << std::endl;
432 throw std::runtime_error(str.str());
433 }
434 openParenthesis = false;
435 result.push_back(std::string(s, currentOpen+1, pos-currentOpen-1));
436 }
437 }
438 return result;
439}

The documentation for this class was generated from the following files: