CMS 3D CMS Logo

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.1.2.2 2009/03/15 12:24:13 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 
00032 
00033 namespace pat {
00034 
00035   class TriggerPath {
00036     
00038       std::string                name_;
00039       unsigned                   index_;                // in trigger table
00040       unsigned                   prescale_;
00041       bool                       run_;
00042       bool                       accept_;
00043       bool                       error_;
00044       std::vector< std::string > modules_;              // filled in correct order by PATTriggerProducer; not necessarily in filter collection; consumes disc space
00045       std::vector< unsigned >    filterIndices_;        // also filled in correct order by PATTriggerProducer; indices of active filters in filter collection; needed, if 'modules_' kept empty
00046       unsigned                   lastActiveFilterSlot_; // index as from modules_
00047 
00048     public:
00049 
00051       TriggerPath();
00052       TriggerPath( const std::string & name);
00053       TriggerPath( const std::string & name, unsigned index, unsigned prescale, bool run, bool accept, bool error, unsigned lastActiveFilterSlot );
00054       virtual ~TriggerPath() {};
00055       
00057       void setName( const std::string & name )                      { name_                 = name; };
00058       void setIndex( unsigned index )                               { index_                = index; };
00059       void setPrescale( unsigned prescale )                         { prescale_             = prescale; };
00060       void setRun( bool run )                                       { run_                  = run; };
00061       void setAccept( bool accept )                                 { accept_               = accept; };
00062       void setError( bool error )                                   { error_                = error; };
00063       void setLastActiveFilterSlot( unsigned lastActiveFilterSlot ) { lastActiveFilterSlot_ = lastActiveFilterSlot; };
00064       void addModule( const std::string & name )                    { modules_.push_back( name ); };
00065       void addFilterIndex( const unsigned index )                   { filterIndices_.push_back( index ); };
00066       std::string                name() const                 { return name_; };
00067       unsigned                   index() const                { return index_; };
00068       unsigned                   prescale() const             { return prescale_; };
00069       bool                       wasRun() const               { return run_; };
00070       bool                       wasAccept() const            { return accept_; };
00071       bool                       wasError() const             { return error_; };
00072       unsigned                   lastActiveFilterSlot() const { return lastActiveFilterSlot_; };
00073       std::vector< std::string > modules() const              { return modules_; };
00074       std::vector< unsigned >    filterIndices() const        { return filterIndices_; };
00075       int                        indexModule( const std::string & name ) const;           // returns size of 'modules_' ( modules().size() ) if name unknown and -1 if 'modules_' not filled
00076     
00077   };
00078   
00079 
00081   typedef std::vector< TriggerPath >              TriggerPathCollection;
00083   typedef edm::Ref< TriggerPathCollection >       TriggerPathRef;
00085   typedef edm::RefProd< TriggerPathCollection >   TriggerPathRefProd;
00087   typedef edm::RefVector< TriggerPathCollection > TriggerPathRefVector;
00088 
00089 }
00090 
00091 
00092 #endif

Generated on Tue Jun 9 17:31:25 2009 for CMSSW by  doxygen 1.5.4