CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/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.9 2011/02/22 18:29:50 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_;
00070       L1SeedCollection l1Seeds_;
00071 
00072     public:
00073 
00075 
00077       TriggerPath();
00079       TriggerPath( const std::string & name );
00081       TriggerPath( const std::string & name, unsigned index, unsigned prescale, bool run, bool accept, bool error, unsigned lastActiveFilterSlot );
00082 
00084       virtual ~TriggerPath() {};
00085 
00087 
00089       void setName( const std::string & name ) { name_ = name; };
00091       void setIndex( unsigned index ) { index_ = index; };
00093       void setPrescale( unsigned prescale ) { prescale_ = prescale; };
00095       void setRun( bool run ) { run_ = run; };
00097       void setAccept( bool accept ) { accept_ = accept; };
00099       void setError( bool error ) { error_ = error; };
00101       void setLastActiveFilterSlot( unsigned lastActiveFilterSlot ) { lastActiveFilterSlot_ = lastActiveFilterSlot; };
00103       void addModule( const std::string & name ) { modules_.push_back( name ); };
00105       void addFilterIndex( const unsigned index ) { filterIndices_.push_back( index ); };
00107       void addL1Seed( const L1Seed & seed )                           { l1Seeds_.push_back( seed ); };
00108       void addL1Seed( bool decision, const std::string & expression ) { l1Seeds_.push_back( L1Seed( decision, expression ) ); };
00110       std::string name() const { return name_; };
00112       unsigned index() const { return index_; };
00114       unsigned prescale() const { return prescale_; };
00116       bool wasRun() const { return run_; };
00118       bool wasAccept() const { return accept_; };
00120       bool wasError() const { return error_; };
00122       unsigned lastActiveFilterSlot() const { return lastActiveFilterSlot_; };
00124       std::vector< std::string > modules() const { return modules_; };
00126       std::vector< unsigned > filterIndices() const { return filterIndices_; };
00130       int indexModule( const std::string & name ) const;
00132       L1SeedCollection l1Seeds() const { return l1Seeds_; };
00134       std::vector< std::string > l1Seeds( const bool decision ) const;
00136       std::vector< std::string > acceptedL1Seeds() const { return l1Seeds( true ); };
00138       std::vector< std::string > failedL1Seeds() const { return l1Seeds( false ); };
00139 
00140   };
00141 
00142 
00144   typedef std::vector< TriggerPath >                      TriggerPathCollection;
00146   typedef edm::Ref< TriggerPathCollection >               TriggerPathRef;
00148   typedef edm::RefProd< TriggerPathCollection >           TriggerPathRefProd;
00150   typedef edm::RefVector< TriggerPathCollection >         TriggerPathRefVector;
00152   typedef edm::RefVectorIterator< TriggerPathCollection > TriggerPathRefVectorIterator;
00153 
00154 }
00155 
00156 
00157 #endif