CMS 3D CMS Logo

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

Go to the documentation of this file.
00001 //
00002 // $Id: TriggerPath.cc,v 1.7 2011/05/24 15:56:25 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   l3Filters_( 0 )
00025 {
00026   modules_.clear();
00027   filterIndices_.clear();
00028 }
00029 
00030 
00031 // Constructor from path name only
00032 TriggerPath::TriggerPath( const std::string & name ) :
00033   name_( name ),
00034   index_(),
00035   prescale_(),
00036   run_(),
00037   accept_(),
00038   error_(),
00039   lastActiveFilterSlot_(),
00040   l3Filters_( 0 )
00041 {
00042   modules_.clear();
00043   filterIndices_.clear();
00044 }
00045 
00046 
00047 // Constructor from values
00048 TriggerPath::TriggerPath( const std::string & name, unsigned index, unsigned prescale, bool run, bool accept, bool error, unsigned lastActiveFilterSlot, unsigned l3Filters ) :
00049   name_( name ),
00050   index_( index ),
00051   prescale_( prescale ),
00052   run_( run ),
00053   accept_( accept ),
00054   error_( error ),
00055   lastActiveFilterSlot_( lastActiveFilterSlot ),
00056   l3Filters_( l3Filters )
00057 {
00058   modules_.clear();
00059   filterIndices_.clear();
00060 }
00061 
00062 
00063 // Methods
00064 
00065 
00066 // Get the index of a certain module
00067 int TriggerPath::indexModule( const std::string & name ) const
00068 {
00069   if ( modules_.begin() == modules_.end() ) return -1;
00070   return ( std::find( modules_.begin(), modules_.end(), name ) - modules_.begin() );
00071 }
00072 
00073 
00074 // Get names of all L1 seeds with a certain decision
00075 std::vector< std::string > TriggerPath::l1Seeds( const bool decision ) const
00076 {
00077 
00078   std::vector< std::string > seeds;
00079   for ( L1SeedCollection::const_iterator iSeed = l1Seeds().begin(); iSeed != l1Seeds().end(); ++iSeed ) {
00080     if ( iSeed->first == decision ) seeds.push_back( iSeed->second );
00081   }
00082   return seeds;
00083 
00084 }