CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/DataFormats/PatCandidates/interface/TriggerPath.h

Go to the documentation of this file.
00001 #ifndef DataFormats_PatCandidates_TriggerPath_h
00002 #define DataFormats_PatCandidates_TriggerPath_h
00003 
00004 
00005 // -*- C++ -*-
00006 //
00007 // Package:    PatCandidates
00008 // Class:      pat::TriggerPath
00009 //
00010 // $Id: TriggerPath.h,v 1.11 2011/05/28 13:40:57 vadler Exp $
00011 //
00025 #include <string>
00026 #include <vector>
00027 
00028 #include "DataFormats/Common/interface/Ref.h"
00029 #include "DataFormats/Common/interface/RefProd.h"
00030 #include "DataFormats/Common/interface/RefVector.h"
00031 #include "DataFormats/Common/interface/RefVectorIterator.h"
00032 
00033 
00034 namespace pat {
00035 
00037   typedef std::pair< bool, std::string > L1Seed;
00039   typedef std::vector< L1Seed >          L1SeedCollection;
00040 
00041   class TriggerPath {
00042 
00044 
00046       std::string name_;
00048       unsigned index_;
00050       unsigned prescale_;
00052       bool run_;
00054       bool accept_;
00056       bool error_;
00061       std::vector< std::string > modules_;
00066       std::vector< unsigned > filterIndices_;
00068       unsigned lastActiveFilterSlot_;
00071       unsigned l3Filters_;
00073       L1SeedCollection l1Seeds_;
00074 
00075     public:
00076 
00078 
00080       TriggerPath();
00082       TriggerPath( const std::string & name );
00084       TriggerPath( const std::string & name, unsigned index, unsigned prescale, bool run, bool accept, bool error, unsigned lastActiveFilterSlot, unsigned l3Filters = 0 );
00085 
00087       virtual ~TriggerPath() {};
00088 
00090 
00092       void setName( const std::string & name ) { name_ = name; };
00094       void setIndex( unsigned index ) { index_ = index; };
00096       void setPrescale( unsigned prescale ) { prescale_ = prescale; };
00098       void setRun( bool run ) { run_ = run; };
00100       void setAccept( bool accept ) { accept_ = accept; };
00102       void setError( bool error ) { error_ = error; };
00104       void setLastActiveFilterSlot( unsigned lastActiveFilterSlot ) { lastActiveFilterSlot_ = lastActiveFilterSlot; };
00106       void setL3Filters( unsigned l3Filters ) { l3Filters_ = l3Filters; };
00108       void addModule( const std::string & name ) { modules_.push_back( name ); };
00110       void addFilterIndex( const unsigned index ) { filterIndices_.push_back( index ); };
00112       void addL1Seed( const L1Seed & seed )                           { l1Seeds_.push_back( seed ); };
00113       void addL1Seed( bool decision, const std::string & expression ) { l1Seeds_.push_back( L1Seed( decision, expression ) ); };
00115       std::string name() const { return name_; };
00117       unsigned index() const { return index_; };
00119       unsigned prescale() const { return prescale_; };
00121       bool wasRun() const { return run_; };
00123       bool wasAccept() const { return accept_; };
00125       bool wasError() const { return error_; };
00127       unsigned lastActiveFilterSlot() const { return lastActiveFilterSlot_; };
00130       unsigned l3Filters() const { return l3Filters_; };
00133       bool xTrigger() const { return ( l3Filters_ > 2 ); };
00135       std::vector< std::string > modules() const { return modules_; };
00137       std::vector< unsigned > filterIndices() const { return filterIndices_; };
00141       int indexModule( const std::string & name ) const;
00143       L1SeedCollection l1Seeds() const { return l1Seeds_; };
00145       std::vector< std::string > l1Seeds( const bool decision ) const;
00147       std::vector< std::string > acceptedL1Seeds() const { return l1Seeds( true ); };
00149       std::vector< std::string > failedL1Seeds() const { return l1Seeds( false ); };
00150 
00151   };
00152 
00153 
00155   typedef std::vector< TriggerPath >                      TriggerPathCollection;
00157   typedef edm::Ref< TriggerPathCollection >               TriggerPathRef;
00159   typedef edm::RefProd< TriggerPathCollection >           TriggerPathRefProd;
00161   typedef edm::RefVector< TriggerPathCollection >         TriggerPathRefVector;
00163   typedef edm::RefVectorIterator< TriggerPathCollection > TriggerPathRefVectorIterator;
00164 
00165 }
00166 
00167 
00168 #endif