Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:59

0001 #include "DataFormats/PatCandidates/interface/TriggerPath.h"
0002 
0003 // Constructors and Destructor
0004 
0005 // Default constructor
0006 pat::TriggerPath::TriggerPath()
0007     : name_(), index_(), prescale_(), run_(), accept_(), error_(), lastActiveFilterSlot_(), l3Filters_(0) {
0008   modules_.clear();
0009   filterIndices_.clear();
0010 }
0011 
0012 // Constructor from path name only
0013 pat::TriggerPath::TriggerPath(const std::string& name)
0014     : name_(name), index_(), prescale_(), run_(), accept_(), error_(), lastActiveFilterSlot_(), l3Filters_(0) {
0015   modules_.clear();
0016   filterIndices_.clear();
0017 }
0018 
0019 // Constructor from values
0020 pat::TriggerPath::TriggerPath(const std::string& name,
0021                               unsigned index,
0022                               double prescale,
0023                               bool run,
0024                               bool accept,
0025                               bool error,
0026                               unsigned lastActiveFilterSlot,
0027                               unsigned l3Filters)
0028     : name_(name),
0029       index_(index),
0030       prescale_(prescale),
0031       run_(run),
0032       accept_(accept),
0033       error_(error),
0034       lastActiveFilterSlot_(lastActiveFilterSlot),
0035       l3Filters_(l3Filters) {
0036   modules_.clear();
0037   filterIndices_.clear();
0038 }
0039 
0040 // Methods
0041 
0042 // Get the index of a certain module
0043 int pat::TriggerPath::indexModule(const std::string& name) const {
0044   if (modules_.begin() == modules_.end())
0045     return -1;
0046   return (std::find(modules_.begin(), modules_.end(), name) - modules_.begin());
0047 }
0048 
0049 // Get names of all L1 seeds with a certain decision
0050 std::vector<std::string> pat::TriggerPath::l1Seeds(const bool decision) const {
0051   std::vector<std::string> seeds;
0052   for (L1SeedCollection::const_iterator iSeed = l1Seeds().begin(); iSeed != l1Seeds().end(); ++iSeed) {
0053     if (iSeed->first == decision)
0054       seeds.push_back(iSeed->second);
0055   }
0056   return seeds;
0057 }