CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TriggerEvent.cc
Go to the documentation of this file.
1 //
2 // $Id: TriggerEvent.cc,v 1.14.2.1 2011/04/06 18:34:33 vadler Exp $
3 //
4 
5 
7 
8 
9 using namespace pat;
10 
11 
12 // Constructors and Destructor
13 
14 
15 // Constructor from values, HLT only
16 TriggerEvent::TriggerEvent( const std::string & nameHltTable, bool run, bool accept, bool error, bool physDecl ) :
17  nameHltTable_( nameHltTable ),
18  run_( run ),
19  accept_( accept ),
20  error_( error ),
21  physDecl_( physDecl )
22 {
23  objectMatchResults_.clear();
24 }
25 
26 
27 // Constructor from values, HLT and L1/GT
28 TriggerEvent::TriggerEvent( const std::string & nameL1Menu, const std::string & nameHltTable, bool run, bool accept, bool error, bool physDecl ) :
29  nameL1Menu_( nameL1Menu ),
30  nameHltTable_( nameHltTable ),
31  run_( run ),
32  accept_( accept ),
33  error_( error ),
34  physDecl_( physDecl )
35 {
36  objectMatchResults_.clear();
37 }
38 
39 
40 // Methods
41 
42 
43 // Get a pointer to a certain L1 algorithm by name
44 const TriggerAlgorithm * TriggerEvent::algorithm( const std::string & nameAlgorithm ) const
45 {
46  for ( TriggerAlgorithmCollection::const_iterator iAlgorithm = algorithms()->begin(); iAlgorithm != algorithms()->end(); ++iAlgorithm ) {
47  if ( nameAlgorithm == iAlgorithm->name() ) return &*iAlgorithm;
48  }
49  return 0;
50 }
51 
52 
53 // Get the name of a certain L1 algorithm in the event collection by bit number physics or technical algorithms,
54 std::string TriggerEvent::nameAlgorithm( const unsigned bitAlgorithm, const bool techAlgorithm ) const
55 {
56  for ( TriggerAlgorithmCollection::const_iterator iAlgorithm = algorithms()->begin(); iAlgorithm != algorithms()->end(); ++iAlgorithm ) {
57  if ( bitAlgorithm == iAlgorithm->bit() && techAlgorithm == iAlgorithm->techTrigger() ) return iAlgorithm->name();
58  }
59  return std::string( "" );
60 }
61 
62 
63 // Get the index of a certain L1 algorithm in the event collection by name
64 unsigned TriggerEvent::indexAlgorithm( const std::string & nameAlgorithm ) const
65 {
66  unsigned iAlgorithm( 0 );
67  while ( iAlgorithm < algorithms()->size() && algorithms()->at( iAlgorithm ).name() != nameAlgorithm ) ++iAlgorithm;
68  return iAlgorithm;
69 }
70 
71 
72 // Get a vector of references to all succeeding L1 algorithms
74 {
75  TriggerAlgorithmRefVector theAcceptedAlgorithms;
76  for ( TriggerAlgorithmCollection::const_iterator iAlgorithm = algorithms()->begin(); iAlgorithm != algorithms()->end(); ++iAlgorithm ) {
77  if ( iAlgorithm->decision() ) {
78  const std::string nameAlgorithm( iAlgorithm->name() );
80  theAcceptedAlgorithms.push_back( algorithmRef );
81  }
82  }
83  return theAcceptedAlgorithms;
84 }
85 
86 
87 // Get a vector of references to all L1 algorithms succeeding on the GTL board
89 {
90  TriggerAlgorithmRefVector theAcceptedAlgorithms;
91  for ( TriggerAlgorithmCollection::const_iterator iAlgorithm = algorithms()->begin(); iAlgorithm != algorithms()->end(); ++iAlgorithm ) {
92  if ( iAlgorithm->gtlResult() ) {
93  const std::string nameAlgorithm( iAlgorithm->name() );
95  theAcceptedAlgorithms.push_back( algorithmRef );
96  }
97  }
98  return theAcceptedAlgorithms;
99 }
100 
101 
102 // Get a vector of references to all technical L1 algorithms
104 {
105  TriggerAlgorithmRefVector theTechAlgorithms;
106  for ( TriggerAlgorithmCollection::const_iterator iAlgorithm = algorithms()->begin(); iAlgorithm != algorithms()->end(); ++iAlgorithm ) {
107  if ( iAlgorithm->techTrigger() ) {
108  const std::string nameAlgorithm( iAlgorithm->name() );
110  theTechAlgorithms.push_back( algorithmRef );
111  }
112  }
113  return theTechAlgorithms;
114 }
115 
116 
117 // Get a vector of references to all succeeding technical L1 algorithms
119 {
120  TriggerAlgorithmRefVector theAcceptedTechAlgorithms;
121  for ( TriggerAlgorithmCollection::const_iterator iAlgorithm = algorithms()->begin(); iAlgorithm != algorithms()->end(); ++iAlgorithm ) {
122  if ( iAlgorithm->techTrigger() && iAlgorithm->decision() ) {
123  const std::string nameAlgorithm( iAlgorithm->name() );
125  theAcceptedTechAlgorithms.push_back( algorithmRef );
126  }
127  }
128  return theAcceptedTechAlgorithms;
129 }
130 
131 
132 // Get a vector of references to all technical L1 algorithms succeeding on the GTL board
134 {
135  TriggerAlgorithmRefVector theAcceptedTechAlgorithms;
136  for ( TriggerAlgorithmCollection::const_iterator iAlgorithm = algorithms()->begin(); iAlgorithm != algorithms()->end(); ++iAlgorithm ) {
137  if ( iAlgorithm->techTrigger() && iAlgorithm->gtlResult() ) {
138  const std::string nameAlgorithm( iAlgorithm->name() );
140  theAcceptedTechAlgorithms.push_back( algorithmRef );
141  }
142  }
143  return theAcceptedTechAlgorithms;
144 }
145 
146 
147 // Get a vector of references to all physics L1 algorithms
149 {
150  TriggerAlgorithmRefVector thePhysAlgorithms;
151  for ( TriggerAlgorithmCollection::const_iterator iAlgorithm = algorithms()->begin(); iAlgorithm != algorithms()->end(); ++iAlgorithm ) {
152  if ( ! iAlgorithm->techTrigger() ) {
153  const std::string nameAlgorithm( iAlgorithm->name() );
155  thePhysAlgorithms.push_back( algorithmRef );
156  }
157  }
158  return thePhysAlgorithms;
159 }
160 
161 
162 // Get a vector of references to all succeeding physics L1 algorithms
164 {
165  TriggerAlgorithmRefVector theAcceptedPhysAlgorithms;
166  for ( TriggerAlgorithmCollection::const_iterator iAlgorithm = algorithms()->begin(); iAlgorithm != algorithms()->end(); ++iAlgorithm ) {
167  if ( ! iAlgorithm->techTrigger() && iAlgorithm->decision() ) {
168  const std::string nameAlgorithm( iAlgorithm->name() );
170  theAcceptedPhysAlgorithms.push_back( algorithmRef );
171  }
172  }
173  return theAcceptedPhysAlgorithms;
174 }
175 
176 
177 // Get a vector of references to all physics L1 algorithms succeeding on the GTL board
179 {
180  TriggerAlgorithmRefVector theAcceptedPhysAlgorithms;
181  for ( TriggerAlgorithmCollection::const_iterator iAlgorithm = algorithms()->begin(); iAlgorithm != algorithms()->end(); ++iAlgorithm ) {
182  if ( ! iAlgorithm->techTrigger() && iAlgorithm->gtlResult() ) {
183  const std::string nameAlgorithm( iAlgorithm->name() );
185  theAcceptedPhysAlgorithms.push_back( algorithmRef );
186  }
187  }
188  return theAcceptedPhysAlgorithms;
189 }
190 
191 
192 // Get a pointer to a certain L1 condition by name
193 const TriggerCondition * TriggerEvent::condition( const std::string & nameCondition ) const
194 {
195  for ( TriggerConditionCollection::const_iterator iCondition = conditions()->begin(); iCondition != conditions()->end(); ++iCondition ) {
196  if ( nameCondition == iCondition->name() ) return &*iCondition;
197  }
198  return 0;
199 }
200 
201 
202 // Get the index of a certain L1 condition in the event collection by name
203 unsigned TriggerEvent::indexCondition( const std::string & nameCondition ) const
204 {
205  unsigned iCondition( 0 );
206  while ( iCondition < conditions()->size() && conditions()->at( iCondition ).name() != nameCondition ) ++iCondition;
207  return iCondition;
208 }
209 
210 
211 // Get a vector of references to all succeeding L1 conditions
213 {
214  TriggerConditionRefVector theAcceptedConditions;
215  for ( TriggerConditionCollection::const_iterator iCondition = conditions()->begin(); iCondition != conditions()->end(); ++iCondition ) {
216  if ( iCondition->wasAccept() ) {
217  const std::string nameCondition( iCondition->name() );
218  const TriggerConditionRef conditionRef( conditions_, indexCondition( nameCondition ) );
219  theAcceptedConditions.push_back( conditionRef );
220  }
221  }
222  return theAcceptedConditions;
223 }
224 
225 
226 // Get a pointer to a certain HLT path by name
227 const TriggerPath * TriggerEvent::path( const std::string & namePath ) const
228 {
229  for ( TriggerPathCollection::const_iterator iPath = paths()->begin(); iPath != paths()->end(); ++iPath ) {
230  if ( namePath == iPath->name() ) return &*iPath;
231  }
232  return 0;
233 }
234 
235 
236 // Get the index of a certain HLT path in the event collection by name
237 unsigned TriggerEvent::indexPath( const std::string & namePath ) const
238 {
239  unsigned iPath( 0 );
240  while ( iPath < paths()->size() && paths()->at( iPath ).name() != namePath ) ++iPath;
241  return iPath;
242 }
243 
244 
245 // Get a vector of references to all succeeding HLT paths
247 {
248  TriggerPathRefVector theAcceptedPaths;
249  for ( TriggerPathCollection::const_iterator iPath = paths()->begin(); iPath != paths()->end(); ++iPath ) {
250  if ( iPath->wasAccept() ) {
251  const std::string namePath( iPath->name() );
252  const TriggerPathRef pathRef( paths_, indexPath( namePath ) );
253  theAcceptedPaths.push_back( pathRef );
254  }
255  }
256  return theAcceptedPaths;
257 }
258 
259 
260 // Get a pointer to a certain HLT filter by label
261 const TriggerFilter * TriggerEvent::filter( const std::string & labelFilter ) const
262 {
263  for ( TriggerFilterCollection::const_iterator iFilter = filters()->begin(); iFilter != filters()->end(); ++iFilter ) {
264  if ( iFilter->label() == labelFilter ) return &*iFilter;
265  }
266  return 0;
267 }
268 
269 
270 // Get the index of a certain HLT filter in the event collection by label
271 unsigned TriggerEvent::indexFilter( const std::string & labelFilter ) const
272 {
273  unsigned iFilter( 0 );
274  while ( iFilter < filters()->size() && filters()->at( iFilter ).label() != labelFilter ) ++iFilter;
275  return iFilter;
276 }
277 
278 
279 // Get a vector of references to all succeeding HLT filters
281 {
282  TriggerFilterRefVector theAcceptedFilters;
283  for ( TriggerFilterCollection::const_iterator iFilter = filters()->begin(); iFilter != filters()->end(); ++iFilter ) {
284  if ( iFilter->status() == 1 ) {
285  const std::string labelFilter( iFilter->label() );
286  const TriggerFilterRef filterRef( filters_, indexFilter( labelFilter ) );
287  theAcceptedFilters.push_back( filterRef );
288  }
289  }
290  return theAcceptedFilters;
291 }
292 
293 
294 // Get a vector of references to all trigger objects by trigger object type
296 {
297  TriggerObjectRefVector theObjects;
298  for ( unsigned iObject = 0; iObject < objects()->size(); ++iObject ) {
299  if ( objects()->at( iObject ).hasTriggerObjectType( triggerObjectType ) ) {
300  const TriggerObjectRef objectRef( objects_, iObject );
301  theObjects.push_back( objectRef );
302  }
303  }
304  return theObjects;
305 }
306 
307 
308 // Get a vector of references to all conditions assigned to a certain algorithm given by name
309 TriggerConditionRefVector TriggerEvent::algorithmConditions( const std::string & nameAlgorithm ) const
310 {
311  TriggerConditionRefVector theAlgorithmConditions;
312  if ( algorithm( nameAlgorithm ) ) {
313  for ( unsigned iC = 0; iC < algorithm( nameAlgorithm )->conditionKeys().size(); ++iC ) {
314  const TriggerConditionRef conditionRef( conditions_, algorithm( nameAlgorithm )->conditionKeys().at( iC ) );
315  theAlgorithmConditions.push_back( conditionRef );
316  }
317  }
318  return theAlgorithmConditions;
319 }
320 
321 
322 // Checks, if a condition is assigned to a certain algorithm given by name
323 bool TriggerEvent::conditionInAlgorithm( const TriggerConditionRef & conditionRef, const std::string & nameAlgorithm ) const
324 {
325  TriggerConditionRefVector theConditions = algorithmConditions( nameAlgorithm );
326  for ( TriggerConditionRefVectorIterator iCondition = theConditions.begin(); iCondition != theConditions.end(); ++iCondition ) {
327  if ( conditionRef == *iCondition ) return true;
328  }
329  return false;
330 }
331 
332 
333 // Get a vector of references to all algorithms, which have a certain condition assigned
335 {
336  TriggerAlgorithmRefVector theConditionAlgorithms;
337  size_t cAlgorithms( 0 );
338  for ( TriggerAlgorithmCollection::const_iterator iAlgorithm = algorithms()->begin(); iAlgorithm != algorithms()->end(); ++iAlgorithm ) {
339  const std::string nameAlgorithm( iAlgorithm->name() );
340  if ( conditionInAlgorithm( conditionRef, nameAlgorithm ) ) {
341  const TriggerAlgorithmRef algorithmRef( algorithms_, cAlgorithms );
342  theConditionAlgorithms.push_back( algorithmRef );
343  }
344  ++cAlgorithms;
345  }
346  return theConditionAlgorithms;
347 }
348 
349 
350 // Get a list of all trigger object collections used in a certain condition given by name
351 std::vector< std::string > TriggerEvent::conditionCollections( const std::string & nameCondition ) const
352 {
353  std::vector< std::string > theConditionCollections;
354  if ( condition( nameCondition ) ) {
355  for ( unsigned iObject = 0; iObject < objects()->size(); ++iObject ) {
356  if ( condition( nameCondition )->hasObjectKey( iObject ) ) {
357  bool found( false );
358  std::string objectCollection( objects()->at( iObject ).collection() );
359  for ( std::vector< std::string >::const_iterator iC = theConditionCollections.begin(); iC != theConditionCollections.end(); ++iC ) {
360  if ( *iC == objectCollection ) {
361  found = true;
362  break;
363  }
364  }
365  if ( ! found ) {
366  theConditionCollections.push_back( objectCollection );
367  }
368  }
369  }
370  }
371  return theConditionCollections;
372 }
373 
374 
375 // Get a vector of references to all objects, which were used in a certain condition given by name
376 TriggerObjectRefVector TriggerEvent::conditionObjects( const std::string & nameCondition ) const
377 {
378  TriggerObjectRefVector theConditionObjects;
379  if ( condition( nameCondition ) ) {
380  for ( unsigned iObject = 0; iObject < objects()->size(); ++iObject ) {
381  if ( condition( nameCondition )->hasObjectKey( iObject ) ) {
382  const TriggerObjectRef objectRef( objects_, iObject );
383  theConditionObjects.push_back( objectRef );
384  }
385  }
386  }
387  return theConditionObjects;
388 }
389 
390 
391 // Checks, if an object was used in a certain condition given by name
392 bool TriggerEvent::objectInCondition( const TriggerObjectRef & objectRef, const std::string & nameCondition ) const {
393  if ( condition( nameCondition ) ) return condition( nameCondition )->hasObjectKey( objectRef.key() );
394  return false;
395 }
396 
397 
398 // Get a vector of references to all conditions, which have a certain object assigned
400 {
401  TriggerConditionRefVector theObjectConditions;
402  for ( TriggerConditionCollection::const_iterator iCondition = conditions()->begin(); iCondition != conditions()->end(); ++iCondition ) {
403  const std::string nameCondition( iCondition->name() );
404  if ( objectInCondition( objectRef, nameCondition ) ) {
405  const TriggerConditionRef conditionRef( conditions_, indexCondition( nameCondition ) );
406  theObjectConditions.push_back( conditionRef );
407  }
408  }
409  return theObjectConditions;
410 }
411 
412 
413 // Get a vector of references to all objects, which were used in a certain algorithm given by name
414 TriggerObjectRefVector TriggerEvent::algorithmObjects( const std::string & nameAlgorithm ) const
415 {
416  TriggerObjectRefVector theAlgorithmObjects;
417  TriggerConditionRefVector theConditions = algorithmConditions( nameAlgorithm );
418  for ( TriggerConditionRefVectorIterator iCondition = theConditions.begin(); iCondition != theConditions.end(); ++iCondition ) {
419  const std::string nameCondition( ( *iCondition )->name() );
420  TriggerObjectRefVector theObjects = conditionObjects( nameCondition );
421  for ( TriggerObjectRefVectorIterator iObject = theObjects.begin(); iObject != theObjects.end(); ++iObject ) {
422  theAlgorithmObjects.push_back( *iObject );
423  }
424  }
425  return theAlgorithmObjects;
426 }
427 
428 
429 // Checks, if an object was used in a certain algorithm given by name
430 bool TriggerEvent::objectInAlgorithm( const TriggerObjectRef & objectRef, const std::string & nameAlgorithm ) const
431 {
432  TriggerConditionRefVector theConditions = algorithmConditions( nameAlgorithm );
433  for ( TriggerConditionRefVectorIterator iCondition = theConditions.begin(); iCondition != theConditions.end(); ++iCondition ) {
434  if ( objectInCondition( objectRef, ( *iCondition )->name() ) ) return true;
435  }
436  return false;
437 }
438 
439 
440 // Get a vector of references to all algorithms, which have a certain object assigned
442 {
443  TriggerAlgorithmRefVector theObjectAlgorithms;
444  for ( TriggerAlgorithmCollection::const_iterator iAlgorithm = algorithms()->begin(); iAlgorithm != algorithms()->end(); ++iAlgorithm ) {
445  const std::string nameAlgorithm( iAlgorithm->name() );
446  if ( objectInAlgorithm( objectRef, nameAlgorithm ) ) {
448  theObjectAlgorithms.push_back( algorithmRef );
449  }
450  }
451  return theObjectAlgorithms;
452 }
453 
454 
455 // Get a vector of references to all modules assigned to a certain path given by name
456 TriggerFilterRefVector TriggerEvent::pathModules( const std::string & namePath, bool all ) const
457 {
458  TriggerFilterRefVector thePathFilters;
459  if ( path( namePath ) && path( namePath )->modules().size() > 0 ) {
460  const unsigned onePastLastFilter = all ? path( namePath )->modules().size() : path( namePath )->lastActiveFilterSlot() + 1;
461  for ( unsigned iM = 0; iM < onePastLastFilter; ++iM ) {
462  const std::string labelFilter( path( namePath )->modules().at( iM ) );
463  const TriggerFilterRef filterRef( filters_, indexFilter( labelFilter ) );
464  thePathFilters.push_back( filterRef );
465  }
466  }
467  return thePathFilters;
468 }
469 
470 
471 // Get a vector of references to all active HLT filters assigned to a certain path given by name
472 TriggerFilterRefVector TriggerEvent::pathFilters( const std::string & namePath ) const
473 {
474  TriggerFilterRefVector thePathFilters;
475  if ( path( namePath ) ) {
476  for ( unsigned iF = 0; iF < path( namePath )->filterIndices().size(); ++iF ) {
477  const TriggerFilterRef filterRef( filters_, path( namePath )->filterIndices().at( iF ) );
478  thePathFilters.push_back( filterRef );
479  }
480  }
481  return thePathFilters;
482 }
483 
484 
485 // Checks, if a filter is assigned to and was run in a certain path given by name
486 bool TriggerEvent::filterInPath( const TriggerFilterRef & filterRef, const std::string & namePath ) const
487 {
488  TriggerFilterRefVector theFilters = pathFilters( namePath );
489  for ( TriggerFilterRefVectorIterator iFilter = theFilters.begin(); iFilter != theFilters.end(); ++iFilter ) {
490  if ( filterRef == *iFilter ) return true;
491  }
492  return false;
493 }
494 
495 
496 // Get a vector of references to all paths, which have a certain filter assigned
498 {
499  TriggerPathRefVector theFilterPaths;
500  size_t cPaths( 0 );
501  for ( TriggerPathCollection::const_iterator iPath = paths()->begin(); iPath != paths()->end(); ++iPath ) {
502  const std::string namePath( iPath->name() );
503  if ( filterInPath( filterRef, namePath ) ) {
504  const TriggerPathRef pathRef( paths_, cPaths );
505  theFilterPaths.push_back( pathRef );
506  }
507  ++cPaths;
508  }
509  return theFilterPaths;
510 }
511 
512 
513 // Get a list of all trigger object collections used in a certain filter given by name
514 std::vector< std::string > TriggerEvent::filterCollections( const std::string & labelFilter ) const
515 {
516  std::vector< std::string > theFilterCollections;
517  if ( filter( labelFilter ) ) {
518  for ( unsigned iObject = 0; iObject < objects()->size(); ++iObject ) {
519  if ( filter( labelFilter )->hasObjectKey( iObject ) ) {
520  bool found( false );
521  std::string objectCollection( objects()->at( iObject ).collection() );
522  for ( std::vector< std::string >::const_iterator iC = theFilterCollections.begin(); iC != theFilterCollections.end(); ++iC ) {
523  if ( *iC == objectCollection ) {
524  found = true;
525  break;
526  }
527  }
528  if ( ! found ) {
529  theFilterCollections.push_back( objectCollection );
530  }
531  }
532  }
533  }
534  return theFilterCollections;
535 }
536 
537 
538 // Get a vector of references to all objects, which were used in a certain filter given by name
539 TriggerObjectRefVector TriggerEvent::filterObjects( const std::string & labelFilter ) const
540 {
541  TriggerObjectRefVector theFilterObjects;
542  if ( filter( labelFilter ) ) {
543  for ( unsigned iObject = 0; iObject < objects()->size(); ++iObject ) {
544  if ( filter( labelFilter )->hasObjectKey( iObject ) ) {
545  const TriggerObjectRef objectRef( objects_, iObject );
546  theFilterObjects.push_back( objectRef );
547  }
548  }
549  }
550  return theFilterObjects;
551 }
552 
553 
554 // Checks, if an object was used in a certain filter given by name
555 bool TriggerEvent::objectInFilter( const TriggerObjectRef & objectRef, const std::string & labelFilter ) const {
556  if ( filter( labelFilter ) ) return filter( labelFilter )->hasObjectKey( objectRef.key() );
557  return false;
558 }
559 
560 
561 // Get a vector of references to all filters, which have a certain object assigned
563 {
564  TriggerFilterRefVector theObjectFilters;
565  for ( TriggerFilterCollection::const_iterator iFilter = filters()->begin(); iFilter != filters()->end(); ++iFilter ) {
566  const std::string labelFilter( iFilter->label() );
567  if ( objectInFilter( objectRef, labelFilter ) ) {
568  const TriggerFilterRef filterRef( filters_, indexFilter( labelFilter ) );
569  theObjectFilters.push_back( filterRef );
570  }
571  }
572  return theObjectFilters;
573 }
574 
575 
576 // Get a vector of references to all objects, which were used in a certain path given by name
577 TriggerObjectRefVector TriggerEvent::pathObjects( const std::string & namePath ) const
578 {
579  TriggerObjectRefVector thePathObjects;
580  TriggerFilterRefVector theFilters = pathFilters( namePath );
581  for ( TriggerFilterRefVectorIterator iFilter = theFilters.begin(); iFilter != theFilters.end(); ++iFilter ) {
582  const std::string labelFilter( ( *iFilter )->label() );
583  TriggerObjectRefVector theObjects = filterObjects( labelFilter );
584  for ( TriggerObjectRefVectorIterator iObject = theObjects.begin(); iObject != theObjects.end(); ++iObject ) {
585  thePathObjects.push_back( *iObject );
586  }
587  }
588  return thePathObjects;
589 }
590 
591 
592 // Checks, if an object was used in a certain path given by name
593 bool TriggerEvent::objectInPath( const TriggerObjectRef & objectRef, const std::string & namePath ) const
594 {
595  TriggerFilterRefVector theFilters = pathFilters( namePath );
596  for ( TriggerFilterRefVectorIterator iFilter = theFilters.begin(); iFilter != theFilters.end(); ++iFilter ) {
597  if ( objectInFilter( objectRef, ( *iFilter )->label() ) ) return true;
598  }
599  return false;
600 }
601 
602 
603 // Get a vector of references to all paths, which have a certain object assigned
605 {
606  TriggerPathRefVector theObjectPaths;
607  for ( TriggerPathCollection::const_iterator iPath = paths()->begin(); iPath != paths()->end(); ++iPath ) {
608  const std::string namePath( iPath->name() );
609  if ( objectInPath( objectRef, namePath ) ) {
610  const TriggerPathRef pathRef( paths_, indexPath( namePath ) );
611  theObjectPaths.push_back( pathRef );
612  }
613  }
614  return theObjectPaths;
615 }
616 
617 
618 // Add a pat::TriggerObjectMatch association
619 bool TriggerEvent::addObjectMatchResult( const TriggerObjectMatchRefProd & trigMatches, const std::string & labelMatcher )
620 {
621  if ( triggerObjectMatchResults()->find( labelMatcher ) == triggerObjectMatchResults()->end() ) {
622  objectMatchResults_[ labelMatcher ] = trigMatches;
623  return true;
624  }
625  return false;
626 }
627 
628 
629 // Get a list of all linked trigger matches
630 std::vector< std::string > TriggerEvent::triggerMatchers() const
631 {
632  std::vector< std::string > theMatchers;
633  for ( TriggerObjectMatchContainer::const_iterator iMatch = triggerObjectMatchResults()->begin(); iMatch != triggerObjectMatchResults()->end(); ++iMatch ) theMatchers.push_back( iMatch->first );
634  return theMatchers;
635 }
636 
637 
638 // Get a pointer to a certain trigger match given by label
639 const TriggerObjectMatch * TriggerEvent::triggerObjectMatchResult( const std::string & labelMatcher ) const
640 {
641  const TriggerObjectMatchContainer::const_iterator iMatch( triggerObjectMatchResults()->find( labelMatcher ) );
642  if ( iMatch != triggerObjectMatchResults()->end() ) return iMatch->second.get();
643  return 0;
644 }
const TriggerObjectMatchContainer * triggerObjectMatchResults() const
Get all trigger matches.
Definition: TriggerEvent.h:321
TriggerFilterRefVector objectFilters(const TriggerObjectRef &objectRef) const
Get a vector of references to all filters, which have a certain object assigned.
TriggerConditionRefVector algorithmConditions(const std::string &nameAlgorithm) const
bool hasObjectKey(unsigned objectKey) const
Checks, if a certain trigger object collection index is assigned.
Analysis-level L1 trigger algorithm class.
TriggerAlgorithmRefVector physAlgorithms() const
Get a vector of references to all physics L1 algorithms.
TriggerAlgorithmRefVector acceptedAlgorithmsGtl() const
Get a vector of references to all L1 algorithms succeeding on the GTL board.
Definition: TriggerEvent.cc:88
TriggerConditionRefVector objectConditions(const TriggerObjectRef &objectRef) const
Get a vector of references to all conditions, which have a certain object assigned.
TriggerConditionRefProd conditions_
Reference to pat::TriggerConditionCollection in event.
Definition: TriggerEvent.h:87
const std::string & label
Definition: MVAComputer.cc:186
std::vector< std::string > triggerMatchers() const
Get a list of all linked trigger matches.
TriggerPathRefVector filterPaths(const TriggerFilterRef &filterRef) const
Get a vector of references to all paths, which have a certain filter assigned.
const TriggerCondition * condition(const std::string &nameCondition) const
const TriggerConditionCollection * conditions() const
Definition: TriggerEvent.h:216
TriggerFilterRefVector acceptedFilters() const
Get a vector of references to all succeeding HLT filters.
TriggerAlgorithmRefVector acceptedTechAlgorithms() const
Get a vector of references to all succeeding technical L1 algorithms.
TriggerObjectRefVector pathObjects(const std::string &namePath) const
Get a vector of references to all objects, which were used in a certain path given by name...
std::vector< unsigned > filterIndices() const
Get all trigger fillter collection indeces.
Definition: TriggerPath.h:126
TriggerPathRefProd paths_
Reference to pat::TriggerPathCollection in event.
Definition: TriggerEvent.h:89
TriggerAlgorithmRefVector objectAlgorithms(const TriggerObjectRef &objectRef) const
Get a vector of references to all algorithms, which have a certain object assigned.
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:242
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:21
const TriggerPathCollection * paths() const
Definition: TriggerEvent.h:231
unsigned indexFilter(const std::string &labelFilter) const
TriggerFilterRefVector pathModules(const std::string &namePath, bool all=true) const
bool objectInAlgorithm(const TriggerObjectRef &objectRef, const std::string &nameAlgorithm) const
Checks, if an object was used in a certain algorithm given by name.
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:237
TriggerConditionRefVector acceptedConditions() const
Get a vector of references to all succeeding L1 condition.
TriggerAlgorithmRefProd algorithms_
Definition: TriggerEvent.h:85
TriggerObjectRefVector filterObjects(const std::string &labelFilter) const
Get a vector of references to all objects, which were used in a certain filter given by name...
const TriggerObjectCollection * objects() const
Definition: TriggerEvent.h:261
unsigned indexAlgorithm(const std::string &nameAlgorithm) const
Definition: TriggerEvent.cc:64
Analysis-level HLTrigger filter class.
Definition: TriggerFilter.h:37
unsigned indexCondition(const std::string &nameCondition) const
Analysis-level L1 trigger condition class.
Analysis-level HLTrigger path class.
Definition: TriggerPath.h:41
bool addObjectMatchResult(const TriggerObjectMatchRefProd &trigMatches, const std::string &labelMatcher)
const TriggerPath * path(const std::string &namePath) const
TriggerAlgorithmRefVector techAlgorithms() const
Get a vector of references to all technical L1 algorithms.
bool hasObjectKey(unsigned objectKey) const
Checks, if a certain trigger object collection index is assigned.
TriggerPathRefVector objectPaths(const TriggerObjectRef &objectRef) const
Get a vector of references to all paths, which have a certain object assigned.
bool objectInCondition(const TriggerObjectRef &objectRef, const std::string &nameCondition) const
Checks, if an object was used in a certain condition given by name.
TriggerAlgorithmRefVector acceptedPhysAlgorithms() const
Get a vector of references to all succeeding physics L1 algorithms.
const TriggerAlgorithmCollection * algorithms() const
Definition: TriggerEvent.h:184
#define end
Definition: vmac.h:38
TriggerAlgorithmRefVector acceptedAlgorithms() const
Get a vector of references to all succeeding L1 algorithms.
Definition: TriggerEvent.cc:73
TriggerEvent()
Constructors and Desctructor.
Definition: TriggerEvent.h:102
const TriggerObjectMatch * triggerObjectMatchResult(const std::string &labelMatcher) const
std::vector< std::string > conditionCollections(const std::string &nameAlgorithm) const
Get a list of all trigger object collections used in a certain condition given by name...
TriggerAlgorithmRefVector conditionAlgorithms(const TriggerConditionRef &conditionRef) const
Get a vector of references to all algorithms, which have a certain condition assigned.
TriggerFilterRefProd filters_
Reference to pat::TriggerAlgorithmCollection in event.
Definition: TriggerEvent.h:91
std::string nameAlgorithm(const unsigned bitAlgorithm, const bool techAlgorithm=true) const
Definition: TriggerEvent.cc:54
std::vector< std::string > filterCollections(const std::string &labelFilter) const
Get a list of all trigger object collections used in a certain filter given by name.
bool filterInPath(const TriggerFilterRef &filterRef, const std::string &namePath) const
Checks, if a filter is assigned to and was run in a certain path given by name.
const TriggerFilterCollection * filters() const
Definition: TriggerEvent.h:246
TriggerFilterRefVector pathFilters(const std::string &namePath) const
Get a vector of references to all active HLT filters assigned to a certain path given by name...
bool objectInFilter(const TriggerObjectRef &objectRef, const std::string &labelFilter) const
Checks, if an object was used in a certain filter given by name.
TriggerObjectRefVector conditionObjects(const std::string &nameCondition) const
Get a vector of references to all objects, which were used in a certain condition given by name...
key_type key() const
Accessor for product key.
Definition: Ref.h:264
TriggerObjectRefVector algorithmObjects(const std::string &nameAlgorithm) const
Get a vector of references to all objects, which were used in a certain algorithm given by name...
std::vector< std::string > modules() const
Get all module labels.
Definition: TriggerPath.h:124
TriggerAlgorithmRefVector acceptedPhysAlgorithmsGtl() const
Get a vector of references to all physics L1 algorithms succeeding on the GTL board.
TriggerAlgorithmRefVector acceptedTechAlgorithmsGtl() const
Get a vector of references to all technical L1 algorithms succeeding on the GTL board.
#define begin
Definition: vmac.h:31
const TriggerAlgorithm * algorithm(const std::string &nameAlgorithm) const
Definition: TriggerEvent.cc:44
bool objectInPath(const TriggerObjectRef &objectRef, const std::string &namePath) const
Checks, if an object was used in a certain path given by name.
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:61
TriggerObjectRefProd objects_
Reference to pat::TriggerObjectCollection in event.
Definition: TriggerEvent.h:93
const TriggerFilter * filter(const std::string &labelFilter) const
bool conditionInAlgorithm(const TriggerConditionRef &conditionRef, const std::string &nameAlgorithm) const
Checks, if a condition is assigned to a certain algorithm given by name.
TriggerObjectMatchContainer objectMatchResults_
Table of references to pat::TriggerObjectMatch associations in event.
Definition: TriggerEvent.h:95
unsigned lastActiveFilterSlot() const
Get the index of the last active filter.
Definition: TriggerPath.h:122
std::vector< unsigned > conditionKeys() const
Get all trigger condition collection indeces.
tuple size
Write out results.
TriggerPathRefVector acceptedPaths() const
Get a vector of references to all succeeding HLT paths.
unsigned indexPath(const std::string &namePath) const
list at
Definition: asciidump.py:428