CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/DataFormats/PatCandidates/src/TriggerPath.cc

Go to the documentation of this file.
00001 //
00002 // $Id: TriggerPath.cc,v 1.6 2010/12/16 18:39:17 vadler Exp $
00003 //
00004 
00005 
00006 #include "DataFormats/PatCandidates/interface/TriggerPath.h"
00007 
00008 
00009 using namespace pat;
00010 
00011 
00012 // Constructors and Destructor
00013 
00014 
00015 // Default constructor
00016 TriggerPath::TriggerPath() :
00017   name_(),
00018   index_(),
00019   prescale_(),
00020   run_(),
00021   accept_(),
00022   error_(),
00023   lastActiveFilterSlot_()
00024 {
00025   modules_.clear();
00026   filterIndices_.clear();
00027 }
00028 
00029 
00030 // Constructor from path name only
00031 TriggerPath::TriggerPath( const std::string & name ) :
00032   name_( name ),
00033   index_(),
00034   prescale_(),
00035   run_(),
00036   accept_(),
00037   error_(),
00038   lastActiveFilterSlot_()
00039 {
00040   modules_.clear();
00041   filterIndices_.clear();
00042 }
00043 
00044 
00045 // Constructor from values
00046 TriggerPath::TriggerPath( const std::string & name, unsigned index, unsigned prescale, bool run, bool accept, bool error, unsigned lastActiveFilterSlot ) :
00047   name_( name ),
00048   index_( index ),
00049   prescale_( prescale ),
00050   run_( run ),
00051   accept_( accept ),
00052   error_( error ),
00053   lastActiveFilterSlot_( lastActiveFilterSlot )
00054 {
00055   modules_.clear();
00056   filterIndices_.clear();
00057 }
00058 
00059 
00060 // Methods
00061 
00062 
00063 // Get the index of a certain module
00064 int TriggerPath::indexModule( const std::string & name ) const
00065 {
00066   if ( modules_.begin() == modules_.end() ) return -1;
00067   return ( std::find( modules_.begin(), modules_.end(), name ) - modules_.begin() );
00068 }
00069 
00070 
00071 // Get names of all L1 seeds with a certain decision
00072 std::vector< std::string > TriggerPath::l1Seeds( const bool decision ) const
00073 {
00074 
00075   std::vector< std::string > seeds;
00076   for ( L1SeedCollection::const_iterator iSeed = l1Seeds().begin(); iSeed != l1Seeds().end(); ++iSeed ) {
00077     if ( iSeed->first == decision ) seeds.push_back( iSeed->second );
00078   }
00079   return seeds;
00080 
00081 }