CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
pat::TriggerObjectStandAlone Class Reference

Analysis-level trigger object class (stand-alone) More...

#include "DataFormats/PatCandidates/interface/TriggerObjectStandAlone.h"

Inheritance diagram for pat::TriggerObjectStandAlone:
pat::TriggerObject reco::LeafCandidate reco::Candidate

Public Member Functions

void addAlgorithmName (const std::string &algorithmName, bool algoCondAccepted=true)
 Adds a new L1 algorithm name. More...
 
void addConditionName (const std::string &conditionName)
 Adds a new L1 condition name. More...
 
void addFilterLabel (const std::string &filterLabel)
 Adds a new HLT filter label. More...
 
void addPathName (const std::string &pathName, bool pathLastFilterAccepted=true, bool pathL3FilterAccepted=true)
 Adds a new HLT path name. More...
 
bool algo (const std::string &algorithmName, unsigned algoCondAccepted=1) const
 Calls 'hasAlgorithmName(...)'. More...
 
std::vector< std::string > algorithmNames (bool algoCondAccepted=true) const
 Gets all L1 algorithm names. More...
 
const std::vector< std::string > * allLabels (edm::ParameterSetID const &psetid, const edm::EventBase &event, const edm::TriggerResults &res) const
 
bool coll (const std::string &collName) const override
 Calls 'hasCollection(...)' (method override) More...
 
bool cond (const std::string &conditionName) const
 Calls 'hasConditionName(...)'. More...
 
const std::vector< std::string > & conditionNames () const
 Gets all L1 condition names. More...
 
TriggerObjectStandAlone copy () const
 Methods. More...
 
bool filter (const std::string &filterLabel) const
 Calls 'hasFilterLabel(...)'. More...
 
const std::vector< std::string > & filterLabels () const
 Gets all HLT filter labels. More...
 
bool hasAlgoCondAccepted () const
 
bool hasAlgorithmName (const std::string &algorithmName, bool algoCondAccepted=true) const
 Checks, if a certain L1 algorithm name is assigned. More...
 
bool hasCollection (const edm::InputTag &collName) const override
 
bool hasCollection (const std::string &collName) const override
 Checks, if a certain label of original collection is assigned (method overrides) More...
 
bool hasConditionName (const std::string &conditionName) const
 Checks, if a certain L1 condition name is assigned. More...
 
bool hasFilterLabel (const std::string &filterLabel) const
 Checks, if a certain HLT filter label is assigned. More...
 
bool hasPathL3FilterAccepted () const
 
bool hasPathLastFilterAccepted () const
 Checks, if the usage indicator vector has been filled. More...
 
bool hasPathName (const std::string &pathName, bool pathLastFilterAccepted=false, bool pathL3FilterAccepted=true) const
 Checks, if a certain HLT path name is assigned. More...
 
void packFilterLabels (const edm::EventBase &event, const edm::TriggerResults &res)
 
void packFilterLabels (const std::vector< std::string > &labels)
 pack filter labels into indices; note that the labels must be sorted! More...
 
void packP4 ()
 reduce the precision on the 4-vector More...
 
void packPathNames (const edm::TriggerNames &names)
 pack trigger names into indices More...
 
bool path (const std::string &pathName, unsigned pathLastFilterAccepted=0, unsigned pathL3FilterAccepted=1) const
 Calls 'hasPathName(...)'. More...
 
std::vector< std::string > pathNames (bool pathLastFilterAccepted=false, bool pathL3FilterAccepted=true) const
 Gets all HLT path names. More...
 
const edm::ParameterSetIDpsetID () const
 
void setPSetID (const edm::ParameterSetID &psetId)
 set the psetid of the trigger process More...
 
TriggerObject triggerObject ()
 Gets the pat::TriggerObject (parent class) More...
 
 TriggerObjectStandAlone ()
 Constructors and Destructor. More...
 
 TriggerObjectStandAlone (const reco::LeafCandidate &leafCand)
 Constructor from reco::Candidate. More...
 
 TriggerObjectStandAlone (const reco::Particle::LorentzVector &vec, int id=0)
 Constructors from Lorentz-vectors and (optional) PDG ID. More...
 
 TriggerObjectStandAlone (const reco::Particle::PolarLorentzVector &vec, int id=0)
 
 TriggerObjectStandAlone (const trigger::TriggerObject &trigObj)
 Constructor from trigger::TriggerObject. More...
 
 TriggerObjectStandAlone (const TriggerObject &trigObj)
 Constructor from pat::TriggerObject. More...
 
 TriggerObjectStandAlone (const TriggerObjectStandAlone &)=default
 
void unpackFilterLabels (const edm::EventBase &event, const edm::TriggerResults &res)
 unpack filter labels from indices More...
 
void unpackFilterLabels (const std::vector< std::string > &labels)
 unpack filter labels from indices More...
 
void unpackNamesAndLabels (const edm::EventBase &event, const edm::TriggerResults &res)
 unpack both filter labels and trigger names More...
 
void unpackPathNames (const edm::TriggerNames &names)
 unpack trigger names into indices More...
 
 ~TriggerObjectStandAlone () override
 Destructor. More...
 
- Public Member Functions inherited from pat::TriggerObject
void addFilterId (int triggerObjectType)
 
void addFilterId (trigger::TriggerObjectType triggerObjectType)
 
void addTriggerObjectType (int triggerObjectType)
 
void addTriggerObjectType (trigger::TriggerObjectType triggerObjectType)
 Add a new trigger object type identifier. More...
 
const std::string & collection () const
 Get the label of the collection the trigger object originates from. More...
 
std::vector< int > filterIds () const
 
bool hasFilterId (int triggerObjectType) const
 
bool hasFilterId (trigger::TriggerObjectType triggerObjectType) const
 
bool hasTriggerObjectType (int triggerObjectType) const
 
bool hasTriggerObjectType (trigger::TriggerObjectType triggerObjectType) const
 Checks, if a certain trigger object type identifier is assigned. More...
 
bool id (int triggerObjectType) const
 
bool id (trigger::TriggerObjectType triggerObjectType) const
 
const l1extra::L1EmParticleRef origL1EmRef () const
 
const l1extra::L1EtMissParticleRef origL1EtMissRef () const
 
const L1GctEmCandorigL1GctEmCand () const
 
const L1GctEtHadorigL1GctEtHad () const
 
const L1GctEtMissorigL1GctEtMiss () const
 
const L1GctEtTotalorigL1GctEtTotal () const
 
const L1GctHtMissorigL1GctHtMiss () const
 
const L1GctJetCandorigL1GctJetCand () const
 
const L1MuGMTExtendedCandorigL1GmtMuonCand () const
 
const l1extra::L1JetParticleRef origL1JetRef () const
 
const l1extra::L1MuonParticleRef origL1MuonRef () const
 
const reco::CandidateorigObjCand () const
 
const reco::CandidateBaseReforigObjRef () const
 Special methods for 'l1extra' particles. More...
 
void setCollection (const edm::InputTag &collName)
 
void setCollection (const std::string &collName)
 Methods. More...
 
 TriggerObject ()
 Constructors and Destructor. More...
 
 TriggerObject (const reco::CandidateBaseRef &candRef)
 Constructors from base candidate reference (for 'l1extra' particles) More...
 
 TriggerObject (const reco::LeafCandidate &leafCand)
 Constructors from base class object. More...
 
 TriggerObject (const reco::Particle::LorentzVector &vec, int id=0)
 Constructors from Lorentz-vectors and (optional) PDG ID. More...
 
 TriggerObject (const reco::Particle::PolarLorentzVector &vec, int id=0)
 
 TriggerObject (const trigger::TriggerObject &trigObj)
 Constructor from trigger::TriggerObject. More...
 
std::vector< int > triggerObjectTypes () const
 Get all trigger object type identifiers. More...
 
bool type (int triggerObjectType) const
 
bool type (trigger::TriggerObjectType triggerObjectType) const
 Calls 'hasTriggerObjectType(...)'. More...
 
 ~TriggerObject () override
 Destructor. More...
 
- Public Member Functions inherited from reco::LeafCandidate
Vector boostToCM () const final
 
int charge () const final
 electric charge More...
 
LeafCandidateclone () const override
 returns a clone of the Candidate object More...
 
void construct (int qx3, float pt, float eta, float phi, float mass, const Point &vtx, int pdgId, int status)
 
const Candidatedaughter (const std::string &s) const override
 return daughter with a specified role name More...
 
Candidatedaughter (const std::string &s) override
 return daughter with a specified role name More...
 
const Candidatedaughter (size_type) const override
 return daughter at a given position (throws an exception) More...
 
Candidatedaughter (size_type) override
 return daughter at a given position (throws an exception) More...
 
double energy () const final
 energy More...
 
double et () const final
 transverse energy More...
 
double et2 () const final
 transverse energy squared (use this for cut!) More...
 
double eta () const final
 momentum pseudorapidity More...
 
void fillVertexCovariance (CovarianceMatrix &v) const override
 fill SMatrix More...
 
template<typename T >
T get () const
 get a component More...
 
template<typename T , typename Tag >
T get () const
 get a component More...
 
template<typename T >
T get (size_type i) const
 get a component More...
 
template<typename T , typename Tag >
T get (size_type i) const
 get a component More...
 
bool hasMasterClone () const override
 
bool hasMasterClonePtr () const override
 
bool isCaloMuon () const override
 
bool isConvertedPhoton () const override
 
bool isElectron () const override
 
bool isGlobalMuon () const override
 
bool isJet () const override
 
bool isMuon () const override
 
bool isPhoton () const override
 
bool isStandAloneMuon () const override
 
bool isTrackerMuon () const override
 
 LeafCandidate ()
 
template<typename... Args>
 LeafCandidate (Args &&... args)
 
 LeafCandidate (const Candidate &c)
 
 LeafCandidate (LeafCandidate &&)=default
 
 LeafCandidate (LeafCandidate &rh)
 
 LeafCandidate (LeafCandidate const &)=default
 
bool longLived () const final
 is long lived? More...
 
double mass () const final
 mass More...
 
bool massConstraint () const final
 do mass constraint? More...
 
double massSqr () const final
 mass squared More...
 
const CandidateBaseRefmasterClone () const override
 
const CandidatePtrmasterClonePtr () const override
 
template<typename Ref >
Ref masterRef () const
 cast master clone reference to a concrete type More...
 
Vector momentum () const final
 spatial momentum vector More...
 
const Candidatemother (size_type) const override
 return mother at a given position (throws an exception) More...
 
double mt () const final
 transverse mass More...
 
double mtSqr () const final
 transverse mass squared More...
 
template<typename T >
size_type numberOf () const
 number of components More...
 
template<typename T , typename Tag >
size_type numberOf () const
 number of components More...
 
size_t numberOfDaughters () const override
 number of daughters More...
 
size_t numberOfMothers () const override
 number of mothers More...
 
size_t numberOfSourceCandidatePtrs () const override
 
LeafCandidateoperator= (LeafCandidate &&)=default
 
LeafCandidateoperator= (LeafCandidate const &)=default
 
double p () const final
 magnitude of momentum vector More...
 
const LorentzVectorp4 () const final
 four-momentum Lorentz vector More...
 
int pdgId () const final
 PDG identifier. More...
 
double phi () const final
 momentum azimuthal angle More...
 
const PolarLorentzVectorpolarP4 () const final
 four-momentum Lorentz vector More...
 
double pt () const final
 transverse momentum More...
 
double px () const final
 x coordinate of momentum vector More...
 
double py () const final
 y coordinate of momentum vector More...
 
double pz () const final
 z coordinate of momentum vector More...
 
double rapidity () const final
 rapidity More...
 
void setCharge (Charge q) final
 set electric charge More...
 
void setLongLived () final
 
void setMass (double m) final
 set particle mass More...
 
void setMassConstraint () final
 
void setP4 (const LorentzVector &p4) final
 set 4-momentum More...
 
void setP4 (const PolarLorentzVector &p4) final
 set 4-momentum More...
 
void setPdgId (int pdgId) final
 
void setPz (double pz) final
 
void setStatus (int status) final
 set status word More...
 
void setThreeCharge (Charge qx3) final
 set electric charge More...
 
void setVertex (const Point &vertex) override
 set vertex More...
 
CandidatePtr sourceCandidatePtr (size_type i) const override
 
int status () const final
 status word More...
 
double theta () const final
 momentum polar angle More...
 
int threeCharge () const final
 electric charge More...
 
const Pointvertex () const override
 vertex position (overwritten by PF...) More...
 
double vertexChi2 () const override
 chi-squares More...
 
CovarianceMatrix vertexCovariance () const final
 return SMatrix More...
 
double vertexCovariance (int i, int j) const override
 (i, j)-th element of error matrix, i, j = 0, ... 2 More...
 
double vertexNdof () const override
 
double vertexNormalizedChi2 () const override
 chi-squared divided by n.d.o.f. More...
 
double vx () const override
 x coordinate of vertex position More...
 
double vy () const override
 y coordinate of vertex position More...
 
double vz () const override
 z coordinate of vertex position More...
 
double y () const final
 rapidity More...
 
 ~LeafCandidate () override
 destructor More...
 
- Public Member Functions inherited from reco::Candidate
iterator begin ()
 first daughter iterator More...
 
const_iterator begin () const
 first daughter const_iterator More...
 
virtual const TrackbestTrack () const
 
 Candidate ()
 default constructor More...
 
virtual float dxyError () const
 uncertainty on dxy More...
 
virtual float dzError () const
 uncertainty on dz More...
 
iterator end ()
 last daughter iterator More...
 
const_iterator end () const
 last daughter const_iterator More...
 
template<typename T >
T get () const
 get a component More...
 
template<typename T , typename Tag >
T get () const
 get a component More...
 
template<typename T >
T get (size_type i) const
 get a component More...
 
template<typename T , typename Tag >
T get (size_type i) const
 get a component More...
 
template<typename Ref >
Ref masterRef () const
 cast master clone reference to a concrete type More...
 
template<typename T >
size_type numberOf () const
 number of components More...
 
template<typename T , typename Tag >
size_type numberOf () const
 number of components More...
 
virtual void setSourceCandidatePtr (const CandidatePtr &ptr)
 Set the ptr to the source Candidate. More...
 
virtual ~Candidate ()
 destructor More...
 

Private Member Functions

void addFilterOrCondition (const std::string &name)
 Adds a new HLT filter label or L1 condition name. More...
 
void addPathOrAlgorithm (const std::string &name, bool pathLastFilterAccepted, bool pathL3FilterAccepted)
 Adds a new HLT path or L1 algorithm name. More...
 
bool checkIfFiltersAreUnpacked (bool throwIfPacked=true) const
 Check if trigger names have been packed by calling packFilterLabels() and not yet unpacked. More...
 
bool checkIfPathsAreUnpacked (bool throwIfPacked=true) const
 Check if trigger names have been packed by calling packPathNames() and not yet unpacked. More...
 
const std::vector< std::string > & filtersOrConditions () const
 Gets all HLT filter labels or L1 condition names. More...
 
bool hasAnyName (const std::string &name, const std::vector< std::string > &nameVec) const
 Private methods. More...
 
bool hasFilterOrCondition (const std::string &name) const
 Checks, if a certain HLT filter label or L1 condition name is assigned. More...
 
bool hasL3Filter () const
 
bool hasLastFilter () const
 Check, if the usage indicator vectors have been filled. More...
 
bool hasPathOrAlgorithm (const std::string &name, bool pathLastFilterAccepted, bool pathL3FilterAccepted) const
 Checks, if a certain HLT path or L1 algorithm name is assigned. More...
 
std::vector< std::string > pathsOrAlgorithms (bool pathLastFilterAccepted, bool pathL3FilterAccepted) const
 Gets all HLT path or L1 algorithm names. More...
 

Private Attributes

std::vector< uint16_t > filterLabelIndices_
 
std::vector< std::string > filterLabels_
 Vector of labels of all HLT filters or names of L1 conditions the trigger objects has been used in. More...
 
std::vector< uint16_t > pathIndices_
 
std::vector< bool > pathL3FilterAccepted_
 
std::vector< bool > pathLastFilterAccepted_
 
std::vector< std::string > pathNames_
 Vector of names of all HLT paths or L1 algorithms the trigger objects has been used in. More...
 
edm::ParameterSetID psetId_
 

Static Private Attributes

static const char wildcard_ = '*'
 Constants. More...
 

Additional Inherited Members

- Public Types inherited from reco::LeafCandidate
typedef int Charge
 electric charge type More...
 
typedef CandidateCollection daughters
 collection of daughter candidates More...
 
typedef unsigned int index
 
typedef math::XYZTLorentzVector LorentzVector
 Lorentz vector. More...
 
typedef math::XYZPoint Point
 point in the space More...
 
typedef math::PtEtaPhiMLorentzVector PolarLorentzVector
 Lorentz vector. More...
 
typedef math::XYZVector Vector
 point in the space More...
 
- Public Types inherited from reco::Candidate
enum  { dimension = 3 }
 
enum  { size = dimension * (dimension + 1) / 2 }
 matix size More...
 
typedef int Charge
 electric charge type More...
 
typedef candidate::const_iterator const_iterator
 
typedef math::Error< dimension >::type CovarianceMatrix
 covariance error matrix (3x3) More...
 
typedef unsigned int index
 index type More...
 
typedef candidate::iterator iterator
 
typedef math::XYZTLorentzVector LorentzVector
 Lorentz vector. More...
 
typedef math::XYZPoint Point
 point in the space More...
 
typedef math::PtEtaPhiMLorentzVector PolarLorentzVector
 Lorentz vector. More...
 
typedef size_t size_type
 
typedef math::XYZVector Vector
 point in the space More...
 

Detailed Description

Analysis-level trigger object class (stand-alone)

TriggerObjectStandAlone implements a container for trigger objects' information within the 'pat' namespace. These Trigger objects keep also information on filters and paths to be saved independently or embedded into PAT objects. The TriggerObjectStandAlone is also the data format used in the PAT trigger object matching. For detailed information, consult https://twiki.cern.ch/twiki/bin/view/CMS/SWGuidePATTrigger#TriggerObjectStandAlone

Author
Volker Adler

Definition at line 32 of file TriggerObjectStandAlone.h.

Constructor & Destructor Documentation

◆ TriggerObjectStandAlone() [1/7]

TriggerObjectStandAlone::TriggerObjectStandAlone ( )

Constructors and Destructor.

Default constructor

Definition at line 23 of file TriggerObjectStandAlone.cc.

23  : TriggerObject() {
24  filterLabels_.clear();
25  filterLabelIndices_.clear();
26  pathNames_.clear();
28  pathL3FilterAccepted_.clear();
29 }

References filterLabelIndices_, filterLabels_, pathL3FilterAccepted_, pathLastFilterAccepted_, and pathNames_.

◆ TriggerObjectStandAlone() [2/7]

TriggerObjectStandAlone::TriggerObjectStandAlone ( const TriggerObject trigObj)

Constructor from pat::TriggerObject.

Definition at line 32 of file TriggerObjectStandAlone.cc.

32  : TriggerObject(trigObj) {
33  filterLabels_.clear();
34  filterLabelIndices_.clear();
35  pathNames_.clear();
37  pathL3FilterAccepted_.clear();
38 }

References filterLabelIndices_, filterLabels_, pathL3FilterAccepted_, pathLastFilterAccepted_, and pathNames_.

◆ TriggerObjectStandAlone() [3/7]

TriggerObjectStandAlone::TriggerObjectStandAlone ( const trigger::TriggerObject trigObj)

Constructor from trigger::TriggerObject.

Definition at line 41 of file TriggerObjectStandAlone.cc.

41  : TriggerObject(trigObj) {
42  filterLabels_.clear();
43  filterLabelIndices_.clear();
44  pathNames_.clear();
46  pathL3FilterAccepted_.clear();
47 }

References filterLabelIndices_, filterLabels_, pathL3FilterAccepted_, pathLastFilterAccepted_, and pathNames_.

◆ TriggerObjectStandAlone() [4/7]

TriggerObjectStandAlone::TriggerObjectStandAlone ( const reco::LeafCandidate leafCand)

Constructor from reco::Candidate.

Definition at line 50 of file TriggerObjectStandAlone.cc.

50  : TriggerObject(leafCand) {
51  filterLabels_.clear();
52  filterLabelIndices_.clear();
53  pathNames_.clear();
55  pathL3FilterAccepted_.clear();
56 }

References filterLabelIndices_, filterLabels_, pathL3FilterAccepted_, pathLastFilterAccepted_, and pathNames_.

◆ TriggerObjectStandAlone() [5/7]

TriggerObjectStandAlone::TriggerObjectStandAlone ( const reco::Particle::LorentzVector vec,
int  id = 0 
)

Constructors from Lorentz-vectors and (optional) PDG ID.

Definition at line 59 of file TriggerObjectStandAlone.cc.

60  : TriggerObject(vec, id) {
61  filterLabels_.clear();
62  filterLabelIndices_.clear();
63  pathNames_.clear();
65  pathL3FilterAccepted_.clear();
66 }

References filterLabelIndices_, filterLabels_, pathL3FilterAccepted_, pathLastFilterAccepted_, and pathNames_.

◆ TriggerObjectStandAlone() [6/7]

TriggerObjectStandAlone::TriggerObjectStandAlone ( const reco::Particle::PolarLorentzVector vec,
int  id = 0 
)

Definition at line 67 of file TriggerObjectStandAlone.cc.

68  : TriggerObject(vec, id) {
69  filterLabels_.clear();
70  filterLabelIndices_.clear();
71  pathNames_.clear();
73  pathL3FilterAccepted_.clear();
74 }

References filterLabelIndices_, filterLabels_, pathL3FilterAccepted_, pathLastFilterAccepted_, and pathNames_.

◆ TriggerObjectStandAlone() [7/7]

pat::TriggerObjectStandAlone::TriggerObjectStandAlone ( const TriggerObjectStandAlone )
default

◆ ~TriggerObjectStandAlone()

pat::TriggerObjectStandAlone::~TriggerObjectStandAlone ( )
inlineoverride

Destructor.

Definition at line 114 of file TriggerObjectStandAlone.h.

114 {};

Member Function Documentation

◆ addAlgorithmName()

void pat::TriggerObjectStandAlone::addAlgorithmName ( const std::string &  algorithmName,
bool  algoCondAccepted = true 
)
inline

Adds a new L1 algorithm name.

Definition at line 131 of file TriggerObjectStandAlone.h.

131  {
132  addPathOrAlgorithm(algorithmName, algoCondAccepted, false);
133  };

References addPathOrAlgorithm().

◆ addConditionName()

void pat::TriggerObjectStandAlone::addConditionName ( const std::string &  conditionName)
inline

Adds a new L1 condition name.

Definition at line 123 of file TriggerObjectStandAlone.h.

123 { addFilterOrCondition(conditionName); };

References addFilterOrCondition().

◆ addFilterLabel()

void pat::TriggerObjectStandAlone::addFilterLabel ( const std::string &  filterLabel)
inline

Adds a new HLT filter label.

Definition at line 121 of file TriggerObjectStandAlone.h.

References addFilterOrCondition(), and HLT_FULL_cff::filterLabel.

Referenced by pat::PATTriggerProducer::produce().

◆ addFilterOrCondition()

void pat::TriggerObjectStandAlone::addFilterOrCondition ( const std::string &  name)
inlineprivate

Adds a new HLT filter label or L1 condition name.

Definition at line 67 of file TriggerObjectStandAlone.h.

67  {
69  filterLabels_.push_back(name);
70  };

References filterLabels_, hasFilterOrCondition(), and Skims_PA_cff::name.

Referenced by addConditionName(), and addFilterLabel().

◆ addPathName()

void pat::TriggerObjectStandAlone::addPathName ( const std::string &  pathName,
bool  pathLastFilterAccepted = true,
bool  pathL3FilterAccepted = true 
)
inline

Adds a new HLT path name.

Definition at line 125 of file TriggerObjectStandAlone.h.

127  {
128  addPathOrAlgorithm(pathName, pathLastFilterAccepted, pathL3FilterAccepted);
129  };

References addPathOrAlgorithm(), and hltMonBTagIPClient_cfi::pathName.

Referenced by pat::PATTriggerProducer::produce().

◆ addPathOrAlgorithm()

void TriggerObjectStandAlone::addPathOrAlgorithm ( const std::string &  name,
bool  pathLastFilterAccepted,
bool  pathL3FilterAccepted 
)
private

Adds a new HLT path or L1 algorithm name.

Definition at line 128 of file TriggerObjectStandAlone.cc.

130  {
132 
133  // Check, if path is already assigned
134  if (!hasPathOrAlgorithm(name, false, false)) {
135  // The path itself
136  pathNames_.push_back(name);
137  // The corresponding usage of the trigger objects
138  pathLastFilterAccepted_.push_back(pathLastFilterAccepted);
139  pathL3FilterAccepted_.push_back(pathL3FilterAccepted);
140  // Enable status updates
141  } else if (pathLastFilterAccepted || pathL3FilterAccepted) {
142  // Search for path
143  unsigned index(0);
144  while (index < pathNames_.size()) {
145  if (pathNames_.at(index) == name)
146  break;
147  ++index;
148  }
149  // Status update
150  if (index < pathNames_.size()) {
151  pathLastFilterAccepted_.at(index) = pathLastFilterAccepted_.at(index) || pathLastFilterAccepted;
152  pathL3FilterAccepted_.at(index) = pathL3FilterAccepted_.at(index) || pathL3FilterAccepted;
153  }
154  }
155 }

References checkIfPathsAreUnpacked(), hasPathOrAlgorithm(), Skims_PA_cff::name, pathL3FilterAccepted_, pathLastFilterAccepted_, and pathNames_.

Referenced by addAlgorithmName(), and addPathName().

◆ algo()

bool pat::TriggerObjectStandAlone::algo ( const std::string &  algorithmName,
unsigned  algoCondAccepted = 1 
) const
inline

Calls 'hasAlgorithmName(...)'.

Definition at line 185 of file TriggerObjectStandAlone.h.

185  {
186  return hasAlgorithmName(algorithmName, bool(algoCondAccepted));
187  };

References hasAlgorithmName().

◆ algorithmNames()

std::vector<std::string> pat::TriggerObjectStandAlone::algorithmNames ( bool  algoCondAccepted = true) const
inline

Gets all L1 algorithm names.

Definition at line 143 of file TriggerObjectStandAlone.h.

143  {
144  return pathsOrAlgorithms(algoCondAccepted, false);
145  };

References pathsOrAlgorithms().

◆ allLabels()

const std::vector< std::string > * TriggerObjectStandAlone::allLabels ( edm::ParameterSetID const &  psetid,
const edm::EventBase event,
const edm::TriggerResults res 
) const

Definition at line 395 of file TriggerObjectStandAlone.cc.

397  {
398  // If TriggerNames was already created and cached here in the map,
399  // then look it up and return that one
400  AllLabelsMap::const_iterator iter = allLabelsMap.find(psetid);
401  if (iter != allLabelsMap.end()) {
402  return &iter->second;
403  }
404 
405  const auto &triggerNames = event.triggerNames(res);
406  edm::ParameterSet const *pset = nullptr;
407  //getting the ParameterSet from the event ensures that the registry is filled
408  if (nullptr != (pset = event.parameterSet(psetid))) {
409  using namespace std;
410  using namespace edm;
411  using namespace trigger;
412 
413  const unsigned int n(triggerNames.size());
414  std::set<std::string> saveTags;
415  for (unsigned int i = 0; i != n; ++i) {
416  if (pset->existsAs<vector<string> >(triggerNames.triggerName(i), true)) {
417  auto modules = pset->getParameter<vector<string> >(triggerNames.triggerName(i));
418  for (size_t m = 0; m < modules.size(); m++) {
419  auto module = modules[m];
420  auto moduleStrip = module.front() != '-' ? module : module.substr(1);
421 
422  if (pset->exists(moduleStrip)) {
423  const auto &modulePSet = pset->getParameterSet(moduleStrip);
424  if (modulePSet.existsAs<bool>("saveTags", true) and modulePSet.getParameter<bool>("saveTags")) {
425  saveTags.insert(moduleStrip);
426  }
427  }
428  }
429  }
430  }
431  std::vector<std::string> allModules(saveTags.begin(), saveTags.end());
432  std::pair<AllLabelsMap::iterator, bool> ret =
433  allLabelsMap.insert(std::pair<edm::ParameterSetID, std::vector<std::string> >(psetid, allModules));
434  return &(ret.first->second);
435  }
436  return nullptr;
437 }

References edmTracerLogToSimpleConfig::allModules, mps_fire::i, visualization-live-secondInstance_cfg::m, dqmiodumpmetadata::n, muonDTDigis_cfi::pset, runTheMatrix::ret, BeamBkgSkim_cff::saveTags, and L1TEGammaOffline_cfi::triggerNames.

Referenced by packFilterLabels(), and unpackFilterLabels().

◆ checkIfFiltersAreUnpacked()

bool TriggerObjectStandAlone::checkIfFiltersAreUnpacked ( bool  throwIfPacked = true) const
private

Check if trigger names have been packed by calling packFilterLabels() and not yet unpacked.

Definition at line 268 of file TriggerObjectStandAlone.cc.

268  {
269  bool unpacked = filterLabelIndices_.empty();
270  if (!unpacked && throwIfPacked)
271  throw cms::Exception("RuntimeError",
272  "This TriggerObjectStandAlone object has packed trigger filter labels. Before accessing path "
273  "names you must call unpackFilterLabels with an edm::EventBase object. Both the edm::Event or "
274  "fwlite::Event are derived from edm::EventBase and can be passed\n");
275  return unpacked;
276 }

References Exception, and filterLabelIndices_.

Referenced by filtersOrConditions(), and hasFilterOrCondition().

◆ checkIfPathsAreUnpacked()

bool TriggerObjectStandAlone::checkIfPathsAreUnpacked ( bool  throwIfPacked = true) const
private

Check if trigger names have been packed by calling packPathNames() and not yet unpacked.

Definition at line 259 of file TriggerObjectStandAlone.cc.

259  {
260  bool unpacked = (!pathNames_.empty() || pathIndices_.empty());
261  if (!unpacked && throwIfPacked)
262  throw cms::Exception("RuntimeError",
263  "This TriggerObjectStandAlone object has packed trigger path names. Before accessing path "
264  "names you must call unpackPathNames with an edm::TriggerNames object. You can get the latter "
265  "from the edm::Event or fwlite::Event and the TriggerResults\n");
266  return unpacked;
267 }

References Exception, pathIndices_, and pathNames_.

Referenced by addPathOrAlgorithm(), hasPathOrAlgorithm(), and pathsOrAlgorithms().

◆ coll()

bool pat::TriggerObjectStandAlone::coll ( const std::string &  collName) const
inlineoverridevirtual

Calls 'hasCollection(...)' (method override)

Reimplemented from pat::TriggerObject.

Definition at line 189 of file TriggerObjectStandAlone.h.

189 { return hasCollection(collName); };

References trigObjTnPSource_cfi::collName, and hasCollection().

◆ cond()

bool pat::TriggerObjectStandAlone::cond ( const std::string &  conditionName) const
inline

Calls 'hasConditionName(...)'.

Definition at line 177 of file TriggerObjectStandAlone.h.

177 { return hasConditionName(conditionName); };

References hasConditionName().

◆ conditionNames()

const std::vector<std::string>& pat::TriggerObjectStandAlone::conditionNames ( ) const
inline

Gets all L1 condition names.

Definition at line 137 of file TriggerObjectStandAlone.h.

137 { return filtersOrConditions(); };

References filtersOrConditions().

◆ copy()

TriggerObjectStandAlone pat::TriggerObjectStandAlone::copy ( ) const
inline

Methods.

Definition at line 118 of file TriggerObjectStandAlone.h.

118 { return *this; }

◆ filter()

bool pat::TriggerObjectStandAlone::filter ( const std::string &  filterLabel) const
inline

Calls 'hasFilterLabel(...)'.

Special methods for the cut string parser

  • argument types usable in the cut string parser
  • short names for readable configuration files

Definition at line 175 of file TriggerObjectStandAlone.h.

175 { return hasFilterLabel(filterLabel); };

References HLT_FULL_cff::filterLabel, and hasFilterLabel().

◆ filterLabels()

const std::vector<std::string>& pat::TriggerObjectStandAlone::filterLabels ( ) const
inline

Gets all HLT filter labels.

Definition at line 135 of file TriggerObjectStandAlone.h.

135 { return filtersOrConditions(); };

References filtersOrConditions().

◆ filtersOrConditions()

const std::vector<std::string>& pat::TriggerObjectStandAlone::filtersOrConditions ( ) const
inlineprivate

Gets all HLT filter labels or L1 condition names.

Definition at line 74 of file TriggerObjectStandAlone.h.

74  {
76  return filterLabels_;
77  };

References checkIfFiltersAreUnpacked(), and filterLabels_.

Referenced by conditionNames(), and filterLabels().

◆ hasAlgoCondAccepted()

bool pat::TriggerObjectStandAlone::hasAlgoCondAccepted ( ) const
inline

Definition at line 167 of file TriggerObjectStandAlone.h.

167 { return hasLastFilter(); };

References hasLastFilter().

◆ hasAlgorithmName()

bool pat::TriggerObjectStandAlone::hasAlgorithmName ( const std::string &  algorithmName,
bool  algoCondAccepted = true 
) const
inline

Checks, if a certain L1 algorithm name is assigned.

Definition at line 159 of file TriggerObjectStandAlone.h.

159  {
160  return hasPathOrAlgorithm(algorithmName, algoCondAccepted, false);
161  };

References hasPathOrAlgorithm().

Referenced by algo().

◆ hasAnyName()

bool TriggerObjectStandAlone::hasAnyName ( const std::string &  name,
const std::vector< std::string > &  nameVec 
) const
private

Private methods.

Checks a string vector for occurence of a certain string, incl. wild-card mechanism

Definition at line 79 of file TriggerObjectStandAlone.cc.

79  {
80  // Special cases first
81  // Always false for empty vector to check
82  if (nameVec.empty())
83  return false;
84  // Always true for general wild-card(s)
85  if (name.find_first_not_of(wildcard_) == std::string::npos)
86  return true;
87  // Split name to evaluate in parts, seperated by wild-cards
88  std::vector<std::string> namePartsVec;
89  boost::split(namePartsVec, name, boost::is_any_of(std::string(1, wildcard_)), boost::token_compress_on);
90  // Iterate over vector of names to search
91  for (std::vector<std::string>::const_iterator iVec = nameVec.begin(); iVec != nameVec.end(); ++iVec) {
92  // Not failed yet
93  bool failed(false);
94  // Start searching at the first character
95  size_type index(0);
96  // Iterate over evaluation name parts
97  for (std::vector<std::string>::const_iterator iName = namePartsVec.begin(); iName != namePartsVec.end(); ++iName) {
98  // Empty parts due to
99  // - wild-card at beginning/end or
100  // - multiple wild-cards (should be supressed by 'boost::token_compress_on')
101  if (iName->length() == 0)
102  continue;
103  // Search from current index and
104  // set index to found occurence
105  index = iVec->find(*iName, index);
106  // Failed and exit loop, if
107  // - part not found
108  // - part at beginning not found there
109  if (index == std::string::npos || (iName == namePartsVec.begin() && index > 0)) {
110  failed = true;
111  break;
112  }
113  // Increase index by length of found part
114  index += iName->length();
115  }
116  // Failed, if end of name not reached
117  if (index < iVec->length() && namePartsVec.back().length() != 0)
118  failed = true;
119  // Match found!
120  if (!failed)
121  return true;
122  }
123  // No match found!
124  return false;
125 }

References runEdmFileComparison::failed, Skims_PA_cff::name, submitPVValidationJobs::split(), AlCaHLTBitMon_QueryRunRegistry::string, and wildcard_.

Referenced by hasCollection(), hasFilterOrCondition(), and hasPathOrAlgorithm().

◆ hasCollection() [1/2]

bool pat::TriggerObjectStandAlone::hasCollection ( const edm::InputTag collName) const
inlineoverridevirtual

Reimplemented from pat::TriggerObject.

Definition at line 164 of file TriggerObjectStandAlone.h.

164 { return hasCollection(collName.encode()); };

References trigObjTnPSource_cfi::collName, and hasCollection().

Referenced by hasCollection().

◆ hasCollection() [2/2]

bool TriggerObjectStandAlone::hasCollection ( const std::string &  collName) const
overridevirtual

Checks, if a certain label of original collection is assigned (method overrides)

Reimplemented from pat::TriggerObject.

Definition at line 235 of file TriggerObjectStandAlone.cc.

235  {
236  // Move to wild-card parser, if needed only
237  if (collName.find(wildcard_) != std::string::npos) {
238  // True, if collection name is simply fine
239  if (hasAnyName(collName, std::vector<std::string>(1, collection())))
240  return true;
241  // Check, if collection name possibly fits in an edm::InputTag approach
242  const edm::InputTag collectionTag(collection());
243  const edm::InputTag collTag(collName);
244  // If evaluated collection tag contains a process name, it must have been found already by identity check
245  if (collTag.process().empty()) {
246  // Check instance ...
247  if ((collTag.instance().empty() && collectionTag.instance().empty()) ||
248  hasAnyName(collTag.instance(), std::vector<std::string>(1, collectionTag.instance()))) {
249  // ... and label
250  return hasAnyName(collTag.label(), std::vector<std::string>(1, collectionTag.label()));
251  }
252  }
253  return false;
254  }
255  // Use parent class's method otherwise
257 }

References pat::TriggerObject::collection(), trigObjTnPSource_cfi::collName, hasAnyName(), pat::TriggerObject::hasCollection(), edm::InputTag::instance(), edm::InputTag::label(), edm::InputTag::process(), and wildcard_.

Referenced by coll(), and pat::PATTriggerProducer::produce().

◆ hasConditionName()

bool pat::TriggerObjectStandAlone::hasConditionName ( const std::string &  conditionName) const
inline

Checks, if a certain L1 condition name is assigned.

Definition at line 151 of file TriggerObjectStandAlone.h.

151 { return hasFilterOrCondition(conditionName); };

References hasFilterOrCondition().

Referenced by cond().

◆ hasFilterLabel()

bool pat::TriggerObjectStandAlone::hasFilterLabel ( const std::string &  filterLabel) const
inline

Checks, if a certain HLT filter label is assigned.

Definition at line 149 of file TriggerObjectStandAlone.h.

149 { return hasFilterOrCondition(filterLabel); };

References HLT_FULL_cff::filterLabel, and hasFilterOrCondition().

Referenced by filter().

◆ hasFilterOrCondition()

bool TriggerObjectStandAlone::hasFilterOrCondition ( const std::string &  name) const
private

Checks, if a certain HLT filter label or L1 condition name is assigned.

Definition at line 183 of file TriggerObjectStandAlone.cc.

183  {
185 
186  // Move to wild-card parser, if needed
187  if (name.find(wildcard_) != std::string::npos)
188  return hasAnyName(name, filterLabels_);
189  // Return, if filter label is assigned
190  return (std::find(filterLabels_.begin(), filterLabels_.end(), name) != filterLabels_.end());
191 }

References checkIfFiltersAreUnpacked(), filterLabels_, spr::find(), hasAnyName(), Skims_PA_cff::name, and wildcard_.

Referenced by addFilterOrCondition(), hasConditionName(), and hasFilterLabel().

◆ hasL3Filter()

bool pat::TriggerObjectStandAlone::hasL3Filter ( ) const
inlineprivate

Definition at line 88 of file TriggerObjectStandAlone.h.

88  {
89  return (!pathL3FilterAccepted_.empty() && pathL3FilterAccepted_.size() == pathNames_.size());
90  };

References pathL3FilterAccepted_, and pathNames_.

Referenced by hasPathL3FilterAccepted(), hasPathOrAlgorithm(), and pathsOrAlgorithms().

◆ hasLastFilter()

bool pat::TriggerObjectStandAlone::hasLastFilter ( ) const
inlineprivate

Check, if the usage indicator vectors have been filled.

Definition at line 85 of file TriggerObjectStandAlone.h.

85  {
86  return (!pathLastFilterAccepted_.empty() && pathLastFilterAccepted_.size() == pathNames_.size());
87  };

References pathLastFilterAccepted_, and pathNames_.

Referenced by hasAlgoCondAccepted(), hasPathLastFilterAccepted(), hasPathOrAlgorithm(), and pathsOrAlgorithms().

◆ hasPathL3FilterAccepted()

bool pat::TriggerObjectStandAlone::hasPathL3FilterAccepted ( ) const
inline

Definition at line 168 of file TriggerObjectStandAlone.h.

168 { return hasL3Filter(); };

References hasL3Filter().

◆ hasPathLastFilterAccepted()

bool pat::TriggerObjectStandAlone::hasPathLastFilterAccepted ( ) const
inline

Checks, if the usage indicator vector has been filled.

Definition at line 166 of file TriggerObjectStandAlone.h.

166 { return hasLastFilter(); };

References hasLastFilter().

◆ hasPathName()

bool pat::TriggerObjectStandAlone::hasPathName ( const std::string &  pathName,
bool  pathLastFilterAccepted = false,
bool  pathL3FilterAccepted = true 
) const
inline

Checks, if a certain HLT path name is assigned.

Definition at line 153 of file TriggerObjectStandAlone.h.

155  {
156  return hasPathOrAlgorithm(pathName, pathLastFilterAccepted, pathL3FilterAccepted);
157  };

References hasPathOrAlgorithm(), and hltMonBTagIPClient_cfi::pathName.

Referenced by path().

◆ hasPathOrAlgorithm()

bool TriggerObjectStandAlone::hasPathOrAlgorithm ( const std::string &  name,
bool  pathLastFilterAccepted,
bool  pathL3FilterAccepted 
) const
private

Checks, if a certain HLT path or L1 algorithm name is assigned.

Definition at line 194 of file TriggerObjectStandAlone.cc.

196  {
198 
199  // Move to wild-card parser, if needed
200  if (name.find(wildcard_) != std::string::npos)
201  return hasAnyName(name, pathsOrAlgorithms(pathLastFilterAccepted, pathL3FilterAccepted));
202  // Deal with older PAT-tuples, where trigger object usage is not available
203  if (!hasLastFilter())
204  pathLastFilterAccepted = false;
205  if (!hasL3Filter())
206  pathL3FilterAccepted = false;
207  // Check, if path name is assigned at all
208  std::vector<std::string>::const_iterator match(std::find(pathNames_.begin(), pathNames_.end(), name));
209  // False, if path name not assigned
210  if (match == pathNames_.end())
211  return false;
212  if (!pathLastFilterAccepted && !pathL3FilterAccepted)
213  return true;
214  bool foundLastFilter(pathLastFilterAccepted ? pathLastFilterAccepted_.at(match - pathNames_.begin()) : true);
215  bool foundL3Filter(pathL3FilterAccepted ? pathL3FilterAccepted_.at(match - pathNames_.begin()) : true);
216  // Return for assigned path name, if trigger object usage meets requirement
217  return (foundLastFilter && foundL3Filter);
218 }

References checkIfPathsAreUnpacked(), spr::find(), hasAnyName(), hasL3Filter(), hasLastFilter(), match(), Skims_PA_cff::name, pathL3FilterAccepted_, pathLastFilterAccepted_, pathNames_, pathsOrAlgorithms(), and wildcard_.

Referenced by addPathOrAlgorithm(), hasAlgorithmName(), and hasPathName().

◆ packFilterLabels() [1/2]

void TriggerObjectStandAlone::packFilterLabels ( const edm::EventBase event,
const edm::TriggerResults res 
)

Definition at line 376 of file TriggerObjectStandAlone.cc.

376  {
378 }

References allLabels(), and psetId_.

◆ packFilterLabels() [2/2]

void TriggerObjectStandAlone::packFilterLabels ( const std::vector< std::string > &  labels)

pack filter labels into indices; note that the labels must be sorted!

Definition at line 327 of file TriggerObjectStandAlone.cc.

327  {
328  if (!filterLabelIndices_.empty()) {
329  throw cms::Exception("RuntimeError",
330  "Error, trying to pack filter labels for an already packed TriggerObjectStandAlone");
331  }
332  std::vector<std::string> unmatched;
333  std::vector<uint16_t> indices;
334  indices.reserve(filterLabels_.size());
335 
336  auto nStart = names.begin(), nEnd = names.end();
337  for (unsigned int i = 0, n = filterLabels_.size(); i < n; ++i) {
338  auto match = std::lower_bound(nStart, nEnd, filterLabels_[i]);
339  if (match != nEnd && *match == filterLabels_[i]) {
340  indices.push_back(match - nStart);
341  } else {
342  static std::atomic<int> _warn(0);
343  if (++_warn < 5)
344  edm::LogWarning("TriggerObjectStandAlone::packFilterLabels()")
345  << "Warning: can't resolve '" << filterLabels_[i] << "' to a label index. idx: " << i << std::endl;
346  unmatched.push_back(std::move(filterLabels_[i]));
347  }
348  }
349  std::sort(indices.begin(), indices.end()); // try reduce enthropy
351  filterLabels_.swap(unmatched);
352 }

References Exception, filterLabelIndices_, filterLabels_, mps_fire::i, bTagCombinedSVVariables_cff::indices, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, match(), eostools::move(), dqmiodumpmetadata::n, names, and jetUpdater_cfi::sort.

◆ packP4()

void TriggerObjectStandAlone::packP4 ( )

reduce the precision on the 4-vector

Definition at line 380 of file TriggerObjectStandAlone.cc.

380  {
381  setP4(reco::Particle::PolarLorentzVector(MiniFloatConverter::reduceMantissaToNbitsRounding<14>(pt()),
382  MiniFloatConverter::reduceMantissaToNbitsRounding<11>(eta()),
383  MiniFloatConverter::reduceMantissaToNbits<11>(phi()),
384  MiniFloatConverter::reduceMantissaToNbitsRounding<8>(mass())));
385 }

References reco::LeafCandidate::eta(), reco::LeafCandidate::mass(), reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), and reco::LeafCandidate::setP4().

◆ packPathNames()

void TriggerObjectStandAlone::packPathNames ( const edm::TriggerNames names)

pack trigger names into indices

Definition at line 278 of file TriggerObjectStandAlone.cc.

278  {
279  if (!pathIndices_.empty()) {
280  if (!pathNames_.empty()) {
281  throw cms::Exception("RuntimeError", "Error, trying to pack a partially packed TriggerObjectStandAlone");
282  } else {
283  return;
284  }
285  }
286  bool ok = true;
287  unsigned int n = pathNames_.size(), end = names.size();
288  std::vector<uint16_t> indices(n);
289  for (unsigned int i = 0; i < n; ++i) {
290  uint16_t id = names.triggerIndex(pathNames_[i]);
291  if (id >= end) {
292  static std::atomic<int> _warn(0);
293  if (++_warn < 5)
294  edm::LogWarning("TriggerObjectStandAlone::packPathNames()")
295  << "Warning: can't resolve '" << pathNames_[i] << "' to a path index" << std::endl;
296  ok = false;
297  break;
298  } else {
299  indices[i] = id;
300  }
301  }
302  if (ok) {
303  pathIndices_.swap(indices);
304  pathNames_.clear();
305  }
306 }

References reco::Candidate::end(), Exception, mps_fire::i, pat::TriggerObject::id(), bTagCombinedSVVariables_cff::indices, dqmiodumpmetadata::n, names, convertSQLiteXML::ok, pathIndices_, and pathNames_.

◆ path()

bool pat::TriggerObjectStandAlone::path ( const std::string &  pathName,
unsigned  pathLastFilterAccepted = 0,
unsigned  pathL3FilterAccepted = 1 
) const
inline

Calls 'hasPathName(...)'.

Definition at line 179 of file TriggerObjectStandAlone.h.

181  {
182  return hasPathName(pathName, bool(pathLastFilterAccepted), bool(pathL3FilterAccepted));
183  };

References hasPathName(), and hltMonBTagIPClient_cfi::pathName.

◆ pathNames()

std::vector<std::string> pat::TriggerObjectStandAlone::pathNames ( bool  pathLastFilterAccepted = false,
bool  pathL3FilterAccepted = true 
) const
inline

Gets all HLT path names.

Definition at line 139 of file TriggerObjectStandAlone.h.

139  {
140  return pathsOrAlgorithms(pathLastFilterAccepted, pathL3FilterAccepted);
141  };

References pathsOrAlgorithms().

◆ pathsOrAlgorithms()

std::vector< std::string > TriggerObjectStandAlone::pathsOrAlgorithms ( bool  pathLastFilterAccepted,
bool  pathL3FilterAccepted 
) const
private

Gets all HLT path or L1 algorithm names.

Definition at line 158 of file TriggerObjectStandAlone.cc.

159  {
161 
162  // Deal with older PAT-tuples, where trigger object usage is not available
163  if (!hasLastFilter())
164  pathLastFilterAccepted = false;
165  if (!hasL3Filter())
166  pathL3FilterAccepted = false;
167  // All path names, if usage not restricted (not required or not available)
168  if (!pathLastFilterAccepted && !pathL3FilterAccepted)
169  return pathNames_;
170  // Temp vector of path names
171  std::vector<std::string> paths;
172  // Loop over usage vector and fill corresponding paths into temp vector
173  for (unsigned iPath = 0; iPath < pathNames_.size(); ++iPath) {
174  if ((!pathLastFilterAccepted || pathLastFilterAccepted_.at(iPath)) &&
175  (!pathL3FilterAccepted || pathL3FilterAccepted_.at(iPath)))
176  paths.push_back(pathNames_.at(iPath)); // order matters in order to protect from empty vectors in old data
177  }
178  // Return temp vector
179  return paths;
180 }

References checkIfPathsAreUnpacked(), hasL3Filter(), hasLastFilter(), pathL3FilterAccepted_, pathLastFilterAccepted_, pathNames_, and Skims_PA_cff::paths.

Referenced by algorithmNames(), hasPathOrAlgorithm(), and pathNames().

◆ psetID()

const edm::ParameterSetID& pat::TriggerObjectStandAlone::psetID ( ) const
inline

Definition at line 194 of file TriggerObjectStandAlone.h.

194 { return psetId_; }

References psetId_.

◆ setPSetID()

void pat::TriggerObjectStandAlone::setPSetID ( const edm::ParameterSetID psetId)
inline

set the psetid of the trigger process

Definition at line 192 of file TriggerObjectStandAlone.h.

192 { psetId_ = psetId; }

References psetId_.

◆ triggerObject()

TriggerObject TriggerObjectStandAlone::triggerObject ( )

Gets the pat::TriggerObject (parent class)

Definition at line 223 of file TriggerObjectStandAlone.cc.

223  {
224  // Create a TriggerObjects
225  TriggerObject theObj(p4(), pdgId());
226  // Set its collection and trigger objects types (no c'tor for that)
227  theObj.setCollection(collection());
228  for (size_t i = 0; i < triggerObjectTypes().size(); ++i)
229  theObj.addTriggerObjectType(triggerObjectTypes().at(i));
230  // Return TriggerObject
231  return theObj;
232 }

References pat::TriggerObject::addTriggerObjectType(), pat::TriggerObject::collection(), mps_fire::i, reco::LeafCandidate::p4(), reco::LeafCandidate::pdgId(), pat::TriggerObject::setCollection(), and pat::TriggerObject::triggerObjectTypes().

◆ unpackFilterLabels() [1/2]

void TriggerObjectStandAlone::unpackFilterLabels ( const edm::EventBase event,
const edm::TriggerResults res 
)

unpack filter labels from indices

Definition at line 359 of file TriggerObjectStandAlone.cc.

359  {
361 }

References allLabels(), psetId_, and unpackFilterLabels().

◆ unpackFilterLabels() [2/2]

void TriggerObjectStandAlone::unpackFilterLabels ( const std::vector< std::string > &  labels)

unpack filter labels from indices

Definition at line 363 of file TriggerObjectStandAlone.cc.

363  {
364  if (filterLabelIndices_.empty())
365  return;
366 
367  std::vector<std::string> mylabels(filterLabels_);
368  for (unsigned int i = 0, n = filterLabelIndices_.size(), m = labels.size(); i < n; ++i) {
369  if (filterLabelIndices_[i] >= m)
370  throw cms::Exception("RuntimeError", "Error, filter label index out of bounds");
371  mylabels.push_back(labels[filterLabelIndices_[i]]);
372  }
373  filterLabelIndices_.clear();
374  filterLabels_.swap(mylabels);
375 }

References Exception, filterLabelIndices_, filterLabels_, mps_fire::i, SummaryClient_cfi::labels, visualization-live-secondInstance_cfg::m, and dqmiodumpmetadata::n.

Referenced by unpackFilterLabels(), and unpackNamesAndLabels().

◆ unpackNamesAndLabels()

void TriggerObjectStandAlone::unpackNamesAndLabels ( const edm::EventBase event,
const edm::TriggerResults res 
)

unpack both filter labels and trigger names

Definition at line 354 of file TriggerObjectStandAlone.cc.

354  {
355  unpackPathNames(event.triggerNames(res));
357 }

References unpackFilterLabels(), and unpackPathNames().

◆ unpackPathNames()

void TriggerObjectStandAlone::unpackPathNames ( const edm::TriggerNames names)

unpack trigger names into indices

Definition at line 308 of file TriggerObjectStandAlone.cc.

308  {
309  if (!pathNames_.empty()) {
310  if (!pathIndices_.empty()) {
311  throw cms::Exception("RuntimeError", "Error, trying to unpack a partially unpacked TriggerObjectStandAlone");
312  } else {
313  return;
314  }
315  }
316  unsigned int n = pathIndices_.size(), end = names.size();
317  std::vector<std::string> paths(n);
318  for (unsigned int i = 0; i < n; ++i) {
319  if (pathIndices_[i] >= end)
320  throw cms::Exception("RuntimeError", "Error, path index out of bounds");
321  paths[i] = names.triggerName(pathIndices_[i]);
322  }
323  pathIndices_.clear();
324  pathNames_.swap(paths);
325 }

References reco::Candidate::end(), Exception, mps_fire::i, dqmiodumpmetadata::n, names, pathIndices_, pathNames_, and Skims_PA_cff::paths.

Referenced by unpackNamesAndLabels().

Member Data Documentation

◆ filterLabelIndices_

std::vector<uint16_t> pat::TriggerObjectStandAlone::filterLabelIndices_
private

◆ filterLabels_

std::vector<std::string> pat::TriggerObjectStandAlone::filterLabels_
private

Vector of labels of all HLT filters or names of L1 conditions the trigger objects has been used in.

Data Members Keeping the old names of the data members for backward compatibility, although they refer only to HLT objects.

Definition at line 38 of file TriggerObjectStandAlone.h.

Referenced by addFilterOrCondition(), filtersOrConditions(), hasFilterOrCondition(), packFilterLabels(), TriggerObjectStandAlone(), and unpackFilterLabels().

◆ pathIndices_

std::vector<uint16_t> pat::TriggerObjectStandAlone::pathIndices_
private

◆ pathL3FilterAccepted_

std::vector<bool> pat::TriggerObjectStandAlone::pathL3FilterAccepted_
private

Vector alligned with 'pathNames_' of boolean indicating the usage of the trigger object An element is true, if the corresponding path succeeded and the trigger object was used in an L3 filter (HLT only) The vector is empty for data (size 0), if the according information is not available.

Definition at line 53 of file TriggerObjectStandAlone.h.

Referenced by addPathOrAlgorithm(), hasL3Filter(), hasPathOrAlgorithm(), pathsOrAlgorithms(), and TriggerObjectStandAlone().

◆ pathLastFilterAccepted_

std::vector<bool> pat::TriggerObjectStandAlone::pathLastFilterAccepted_
private

Vector alligned with 'pathNames_' of boolean indicating the usage of the trigger object An element is true, if the corresponding path succeeded and the trigger object was used in the last filter (HLT) or the corresponding algorithm succeeded as well as the corresponding condition (L1). The vector is empty for data (size 0), if the according information is not available.

Definition at line 49 of file TriggerObjectStandAlone.h.

Referenced by addPathOrAlgorithm(), hasLastFilter(), hasPathOrAlgorithm(), pathsOrAlgorithms(), and TriggerObjectStandAlone().

◆ pathNames_

std::vector<std::string> pat::TriggerObjectStandAlone::pathNames_
private

Vector of names of all HLT paths or L1 algorithms the trigger objects has been used in.

Definition at line 42 of file TriggerObjectStandAlone.h.

Referenced by addPathOrAlgorithm(), checkIfPathsAreUnpacked(), hasL3Filter(), hasLastFilter(), hasPathOrAlgorithm(), packPathNames(), pathsOrAlgorithms(), TriggerObjectStandAlone(), and unpackPathNames().

◆ psetId_

edm::ParameterSetID pat::TriggerObjectStandAlone::psetId_
private

Definition at line 55 of file TriggerObjectStandAlone.h.

Referenced by packFilterLabels(), psetID(), setPSetID(), and unpackFilterLabels().

◆ wildcard_

const char TriggerObjectStandAlone::wildcard_ = '*'
staticprivate

Constants.

Constant defining the wild-card used in 'hasAnyName()'

Definition at line 60 of file TriggerObjectStandAlone.h.

Referenced by hasAnyName(), hasCollection(), hasFilterOrCondition(), and hasPathOrAlgorithm().

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:542
TriggerObject
Definition: TriggerObject.py:1
bTagCombinedSVVariables_cff.indices
indices
Definition: bTagCombinedSVVariables_cff.py:67
SummaryClient_cfi.labels
labels
Definition: SummaryClient_cfi.py:61
pat::TriggerObjectStandAlone::hasAlgorithmName
bool hasAlgorithmName(const std::string &algorithmName, bool algoCondAccepted=true) const
Checks, if a certain L1 algorithm name is assigned.
Definition: TriggerObjectStandAlone.h:159
pat::TriggerObjectStandAlone::hasPathName
bool hasPathName(const std::string &pathName, bool pathLastFilterAccepted=false, bool pathL3FilterAccepted=true) const
Checks, if a certain HLT path name is assigned.
Definition: TriggerObjectStandAlone.h:153
pat::TriggerObjectStandAlone::unpackFilterLabels
void unpackFilterLabels(const std::vector< std::string > &labels)
unpack filter labels from indices
Definition: TriggerObjectStandAlone.cc:363
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
pat::TriggerObject::id
bool id(trigger::TriggerObjectType triggerObjectType) const
Definition: TriggerObject.h:164
reco::LeafCandidate::index
unsigned int index
Definition: LeafCandidate.h:31
modules
Definition: MuonCleanerBySegments.cc:35
edm
HLT enums.
Definition: AlignableModifier.h:19
pat::TriggerObjectStandAlone::hasFilterOrCondition
bool hasFilterOrCondition(const std::string &name) const
Checks, if a certain HLT filter label or L1 condition name is assigned.
Definition: TriggerObjectStandAlone.cc:183
pat::TriggerObjectStandAlone::checkIfFiltersAreUnpacked
bool checkIfFiltersAreUnpacked(bool throwIfPacked=true) const
Check if trigger names have been packed by calling packFilterLabels() and not yet unpacked.
Definition: TriggerObjectStandAlone.cc:268
pat::TriggerObjectStandAlone::allLabels
const std::vector< std::string > * allLabels(edm::ParameterSetID const &psetid, const edm::EventBase &event, const edm::TriggerResults &res) const
Definition: TriggerObjectStandAlone.cc:395
runEdmFileComparison.failed
failed
Definition: runEdmFileComparison.py:225
trigObjTnPSource_cfi.collName
collName
Definition: trigObjTnPSource_cfi.py:66
pat::TriggerObject::TriggerObject
TriggerObject()
Constructors and Destructor.
pat::TriggerObjectStandAlone::hasFilterLabel
bool hasFilterLabel(const std::string &filterLabel) const
Checks, if a certain HLT filter label is assigned.
Definition: TriggerObjectStandAlone.h:149
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
pat::TriggerObjectStandAlone::addFilterOrCondition
void addFilterOrCondition(const std::string &name)
Adds a new HLT filter label or L1 condition name.
Definition: TriggerObjectStandAlone.h:67
pat::TriggerObjectStandAlone::addPathOrAlgorithm
void addPathOrAlgorithm(const std::string &name, bool pathLastFilterAccepted, bool pathL3FilterAccepted)
Adds a new HLT path or L1 algorithm name.
Definition: TriggerObjectStandAlone.cc:128
pat::TriggerObjectStandAlone::filterLabelIndices_
std::vector< uint16_t > filterLabelIndices_
Definition: TriggerObjectStandAlone.h:39
pat::TriggerObjectStandAlone::hasPathOrAlgorithm
bool hasPathOrAlgorithm(const std::string &name, bool pathLastFilterAccepted, bool pathL3FilterAccepted) const
Checks, if a certain HLT path or L1 algorithm name is assigned.
Definition: TriggerObjectStandAlone.cc:194
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
pat::TriggerObjectStandAlone::hasLastFilter
bool hasLastFilter() const
Check, if the usage indicator vectors have been filled.
Definition: TriggerObjectStandAlone.h:85
hltMonBTagIPClient_cfi.pathName
pathName
Definition: hltMonBTagIPClient_cfi.py:5
names
const std::string names[nVars_]
Definition: PhotonIDValueMapProducer.cc:124
submitPVValidationJobs.split
def split(sequence, size)
Definition: submitPVValidationJobs.py:352
L1TEGammaOffline_cfi.triggerNames
triggerNames
Definition: L1TEGammaOffline_cfi.py:40
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
pat::TriggerObjectStandAlone::pathL3FilterAccepted_
std::vector< bool > pathL3FilterAccepted_
Definition: TriggerObjectStandAlone.h:53
edm::Hash< ParameterSetType >
reco::Particle::PolarLorentzVector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Particle.h:23
pat::TriggerObjectStandAlone::hasConditionName
bool hasConditionName(const std::string &conditionName) const
Checks, if a certain L1 condition name is assigned.
Definition: TriggerObjectStandAlone.h:151
pat::TriggerObjectStandAlone::psetId_
edm::ParameterSetID psetId_
Definition: TriggerObjectStandAlone.h:55
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLT_FULL_cff.filterLabel
filterLabel
Definition: HLT_FULL_cff.py:89702
BeamBkgSkim_cff.saveTags
saveTags
Definition: BeamBkgSkim_cff.py:9
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
pat::TriggerObjectStandAlone::wildcard_
static const char wildcard_
Constants.
Definition: TriggerObjectStandAlone.h:60
edm::ParameterSet
Definition: ParameterSet.h:47
reco::LeafCandidate::mass
double mass() const final
mass
Definition: LeafCandidate.h:131
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
reco::Candidate::end
const_iterator end() const
last daughter const_iterator
Definition: Candidate.h:145
pat::TriggerObjectStandAlone::pathsOrAlgorithms
std::vector< std::string > pathsOrAlgorithms(bool pathLastFilterAccepted, bool pathL3FilterAccepted) const
Gets all HLT path or L1 algorithm names.
Definition: TriggerObjectStandAlone.cc:158
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
reco::LeafCandidate::pdgId
int pdgId() const final
PDG identifier.
Definition: LeafCandidate.h:176
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
reco::LeafCandidate::p4
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:114
pat::TriggerObjectStandAlone::unpackPathNames
void unpackPathNames(const edm::TriggerNames &names)
unpack trigger names into indices
Definition: TriggerObjectStandAlone.cc:308
pat::TriggerObject::triggerObjectTypes
std::vector< int > triggerObjectTypes() const
Get all trigger object type identifiers.
res
Definition: Electron.h:6
reco::LeafCandidate::setP4
void setP4(const LorentzVector &p4) final
set 4-momentum
Definition: LeafCandidate.h:158
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
pat::TriggerObjectStandAlone::filterLabels_
std::vector< std::string > filterLabels_
Vector of labels of all HLT filters or names of L1 conditions the trigger objects has been used in.
Definition: TriggerObjectStandAlone.h:38
pat::TriggerObjectStandAlone::filtersOrConditions
const std::vector< std::string > & filtersOrConditions() const
Gets all HLT filter labels or L1 condition names.
Definition: TriggerObjectStandAlone.h:74
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
pat::TriggerObject::hasCollection
virtual bool hasCollection(const std::string &collName) const
Checks, if a certain label of original collection is assigned.
Exception
Definition: hltDiff.cc:245
pat::TriggerObjectStandAlone::hasCollection
bool hasCollection(const std::string &collName) const override
Checks, if a certain label of original collection is assigned (method overrides)
Definition: TriggerObjectStandAlone.cc:235
pat::TriggerObjectStandAlone::pathLastFilterAccepted_
std::vector< bool > pathLastFilterAccepted_
Definition: TriggerObjectStandAlone.h:49
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
pat::TriggerObjectStandAlone::hasL3Filter
bool hasL3Filter() const
Definition: TriggerObjectStandAlone.h:88
Skims_PA_cff.paths
paths
Definition: Skims_PA_cff.py:18
pat::TriggerObjectStandAlone::hasAnyName
bool hasAnyName(const std::string &name, const std::vector< std::string > &nameVec) const
Private methods.
Definition: TriggerObjectStandAlone.cc:79
pat::TriggerObjectStandAlone::pathNames_
std::vector< std::string > pathNames_
Vector of names of all HLT paths or L1 algorithms the trigger objects has been used in.
Definition: TriggerObjectStandAlone.h:42
trigger
Definition: HLTPrescaleTableCond.h:8
pat::TriggerObject::collection
const std::string & collection() const
Get the label of the collection the trigger object originates from.
Definition: TriggerObject.h:96
edmTracerLogToSimpleConfig.allModules
allModules
Definition: edmTracerLogToSimpleConfig.py:132
event
Definition: event.py:1
pat::TriggerObjectStandAlone::pathIndices_
std::vector< uint16_t > pathIndices_
Definition: TriggerObjectStandAlone.h:43
edm::InputTag
Definition: InputTag.h:15
pat::TriggerObjectStandAlone::packFilterLabels
void packFilterLabels(const edm::EventBase &event, const edm::TriggerResults &res)
Definition: TriggerObjectStandAlone.cc:376
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
pat::TriggerObjectStandAlone::checkIfPathsAreUnpacked
bool checkIfPathsAreUnpacked(bool throwIfPacked=true) const
Check if trigger names have been packed by calling packPathNames() and not yet unpacked.
Definition: TriggerObjectStandAlone.cc:259