CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TriggerObjectStandAlone.h
Go to the documentation of this file.
1 #ifndef DataFormats_PatCandidates_TriggerObjectStandAlone_h
2 #define DataFormats_PatCandidates_TriggerObjectStandAlone_h
3 
4 
5 // -*- C++ -*-
6 //
7 // Package: PatCandidates
8 // Class: pat::TriggerObjectStandAlone
9 //
10 // $Id: TriggerObjectStandAlone.h,v 1.12 2010/12/20 20:05:52 vadler Exp $
11 //
28 
29 
30 namespace pat {
31 
33 
37 
39  std::vector< std::string > filterLabels_;
41  std::vector< std::string > pathNames_;
46  std::vector< bool > pathLastFilterAccepted_;
47 
49 
51  static const char wildcard_ = '*';
52 
54 
56  bool hasAnyName( const std::string & name, const std::vector< std::string > & nameVec ) const;
58  void addFilterOrCondition( const std::string & name ) { if ( ! hasFilterOrCondition( name ) ) filterLabels_.push_back( name ); };
60  void addPathOrAlgorithm( const std::string & name, bool firing = true );
62  std::vector< std::string > filtersOrConditions() const { return filterLabels_; };
64  std::vector< std::string > pathsOrAlgorithms( bool firing = true ) const;
66  bool hasFilterOrCondition( const std::string & name ) const;
68  bool hasPathOrAlgorithm( const std::string & name, bool firing = true ) const;
70  bool hasFiring() const { return ( pathLastFilterAccepted_.size() > 0 && pathLastFilterAccepted_.size() == pathNames_.size() ); };
71 
72  public:
73 
75 
79  TriggerObjectStandAlone( const TriggerObject & trigObj ) : TriggerObject( trigObj ) {};
81  TriggerObjectStandAlone( const trigger::TriggerObject & trigObj ) : TriggerObject( trigObj ) {};
83  TriggerObjectStandAlone( const reco::LeafCandidate & leafCand ) : TriggerObject( leafCand ) {};
85  TriggerObjectStandAlone( const reco::Particle::LorentzVector & vec, int id = 0 ) : TriggerObject( vec, id ) {};
87 
90 
92 
94  void addFilterLabel( const std::string & filterLabel ) { addFilterOrCondition( filterLabel ); };
96  void addConditionName( const std::string & conditionName ) { addFilterOrCondition( conditionName ); };
98  void addPathName( const std::string & pathName, bool pathLastFilterAccepted = true ) { addPathOrAlgorithm( pathName, pathLastFilterAccepted ); };
100  void addAlgorithmName( const std::string & algorithmName, bool algoCondAccepted = true ) { addPathOrAlgorithm( algorithmName, algoCondAccepted ); };
102  std::vector< std::string > filterLabels() const { return filtersOrConditions(); };
104  std::vector< std::string > conditionNames() const { return filtersOrConditions(); };
106  std::vector< std::string > pathNames( bool pathLastFilterAccepted = true ) const { return pathsOrAlgorithms( pathLastFilterAccepted ); };
108  std::vector< std::string > algorithmNames( bool algoCondAccepted = true ) const { return pathsOrAlgorithms( algoCondAccepted ); };
112  bool hasFilterLabel( const std::string & filterLabel ) const { return hasFilterOrCondition( filterLabel ); };
114  bool hasConditionName( const std::string & conditionName ) const { return hasFilterOrCondition( conditionName ); };
116  bool hasPathName( const std::string & pathName, bool pathLastFilterAccepted = true ) const { return hasPathOrAlgorithm( pathName, pathLastFilterAccepted ); };
118  bool hasAlgorithmName( const std::string & algorithmName, bool algoCondAccepted = true ) const { return hasPathOrAlgorithm( algorithmName, algoCondAccepted ); };
120  virtual bool hasCollection( const std::string & collName ) const;
121  virtual bool hasCollection( const edm::InputTag & collName ) const { return hasCollection( collName.encode() ); };
123  bool hasPathLastFilterAccepted() const { return hasFiring(); };
124  bool hasAlgoCondAccepted() const { return hasFiring(); };
125 
129 
131  bool filter( const std::string & filterLabel ) const { return hasFilterLabel( filterLabel ); };
133  bool cond( const std::string & conditionName ) const { return hasConditionName( conditionName ); };
135  bool path( const std::string & pathName, unsigned pathLastFilterAccepted = 1 ) const { return hasPathName( pathName, bool( pathLastFilterAccepted ) ); };
137  bool algo( const std::string & algorithmName, unsigned algoCondAccepted = 1 ) const { return hasAlgorithmName( algorithmName, bool( algoCondAccepted ) ); };
139  virtual bool coll( const std::string & collName ) const { return hasCollection( collName ); };
140 
141  };
142 
143 
145  typedef std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection;
156 
157 }
158 
159 
160 #endif
bool path(const std::string &pathName, unsigned pathLastFilterAccepted=1) const
Calls &#39;hasPathName(...)&#39;.
edm::RefVector< TriggerObjectStandAloneCollection > TriggerObjectStandAloneRefVector
Vector of persistent references to items in the same TriggerObjectStandAloneCollection.
bool hasFiring() const
Checks, if the usage indicator vector has been filled.
std::vector< std::string > filterLabels() const
Gets all HLT filter labels.
TriggerObjectStandAlone(const reco::Particle::LorentzVector &vec, int id=0)
Constructors from Lorentz-vectors and (optional) PDG ID.
TriggerObjectStandAlone()
Constructors and Destructor.
edm::RefVectorIterator< TriggerObjectStandAloneCollection > TriggerObjectStandAloneRefVectorIterator
Const iterator over vector of persistent references to items in the same TriggerObjectStandAloneColle...
bool id(trigger::TriggerObjectType triggerObjectType) const
virtual bool hasCollection(const std::string &collName) const
Checks, if a certain label of original collection is assigned (method overrides)
static const char wildcard_
Constants.
TriggerObjectStandAlone(const trigger::TriggerObject &trigObj)
Constructor from trigger::TriggerObject.
bool algo(const std::string &algorithmName, unsigned algoCondAccepted=1) const
Calls &#39;hasAlgorithmName(...)&#39;.
std::vector< std::string > pathNames_
Vector of names of all HLT paths or L1 algorithms the trigger objects has been used in...
bool hasPathName(const std::string &pathName, bool pathLastFilterAccepted=true) const
Checks, if a certain HLT path name is assigned.
std::vector< std::string > algorithmNames(bool algoCondAccepted=true) const
Gets all L1 algorithm names.
std::vector< std::string > filterLabels_
Vector of labels of all HLT filters or names od L1 conditions the trigger objects has been used in...
void addAlgorithmName(const std::string &algorithmName, bool algoCondAccepted=true)
Adds a new L1 algorithm name.
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
Analysis-level trigger object class.
Definition: TriggerObject.h:49
std::string encode() const
Definition: InputTag.cc:72
void addConditionName(const std::string &conditionName)
Adds a new L1 condition name.
void addFilterLabel(const std::string &filterLabel)
Methods.
bool hasAnyName(const std::string &name, const std::vector< std::string > &nameVec) const
Private methods.
TriggerObjectStandAlone(const TriggerObject &trigObj)
Constructor from pat::TriggerObject.
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:24
TriggerObject triggerObject()
Gets the pat::TriggerObject (parent class)
const std::string * pathName() const
Definition: HLTadd.h:31
bool hasAlgorithmName(const std::string &algorithmName, bool algoCondAccepted=true) const
Checks, if a certain L1 algorithm name is assigned.
std::vector< std::string > conditionNames() const
Gets all L1 condition names.
TriggerObjectStandAlone(const reco::LeafCandidate &leafCand)
Constructor from reco::Candidate.
std::vector< std::string > pathNames(bool pathLastFilterAccepted=true) const
Gets all HLT path names.
edm::Association< TriggerObjectStandAloneCollection > TriggerObjectStandAloneMatch
Association of TriggerObjectStandAlones to store matches to Candidates.
bool hasPathLastFilterAccepted() const
Checks, if the usage indicator vector has been filled.
bool hasFilterLabel(const std::string &filterLabel) const
Checks, if a certain HLT filter label is assigned.
bool hasConditionName(const std::string &conditionName) const
Checks, if a certain L1 condition name is assigned.
bool cond(const std::string &conditionName) const
Calls &#39;hasConditionName(...)&#39;.
void addFilterOrCondition(const std::string &name)
Adds a new HLT filter label or L1 condition name.
bool filter(const std::string &filterLabel) const
Calls &#39;hasFilterLabel(...)&#39;.
std::vector< std::string > filtersOrConditions() const
Gets all HLT filter labels or L1 condition names.
bool hasPathOrAlgorithm(const std::string &name, bool firing=true) const
Checks, if a certain HLT path or L1 algorithm name is assigned.
TriggerObjectStandAlone(const reco::Particle::PolarLorentzVector &vec, int id=0)
edm::RefProd< TriggerObjectStandAloneCollection > TriggerObjectStandAloneRefProd
Persistent reference to a TriggerObjectStandAloneCollection product.
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Particle.h:28
virtual bool coll(const std::string &collName) const
Calls &#39;hasCollection(...)&#39; (method override)
bool hasFilterOrCondition(const std::string &name) const
Checks, if a certain HLT filter label or L1 condition name is assigned.
virtual bool hasCollection(const edm::InputTag &collName) const
void addPathOrAlgorithm(const std::string &name, bool firing=true)
Adds a new HLT path or L1 algorithm name.
void addPathName(const std::string &pathName, bool pathLastFilterAccepted=true)
Adds a new HLT path name.
virtual ~TriggerObjectStandAlone()
Destructor.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:26
std::vector< bool > pathLastFilterAccepted_
std::vector< std::string > pathsOrAlgorithms(bool firing=true) const
Gets all HLT path or L1 algorithm names.
Analysis-level trigger object class (stand-alone)
edm::Ref< TriggerObjectStandAloneCollection > TriggerObjectStandAloneRef
Persistent reference to an item in a TriggerObjectStandAloneCollection.