CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PVObjectSelector Class Reference

#include <PVObjectSelector.h>

Inheritance diagram for PVObjectSelector:
Selector< reco::Vertex >

Public Member Functions

bool operator() (reco::Vertex const &pv, pat::strbitset &ret) override
 This provides the interface for base classes to select objects. More...
 
 PVObjectSelector ()
 
 PVObjectSelector (edm::ParameterSet const &params)
 
 PVObjectSelector (edm::ParameterSet const &params, edm::ConsumesCollector &&iC)
 
- Public Member Functions inherited from Selector< reco::Vertex >
void clear (index_type const &i)
 
void clear (std::string const &s)
 Turn off a given selection cut. More...
 
bool considerCut (index_type const &i) const
 
bool considerCut (std::string const &s) const
 consider the cut at index "s" More...
 
double cut (index_type const &i, double val) const
 Access the double cut values at index "s". More...
 
int cut (index_type const &i, int val) const
 Access the int cut values at index "s". More...
 
double cut (std::string s, double val) const
 Access the double cut values at index "s". More...
 
int cut (std::string s, int val) const
 Access the int cut values at index "s". More...
 
pat::strbitset getBitTemplate () const
 Get an empty bitset with the proper names. More...
 
double getPasses (index_type const &i) const
 
double getPasses (std::string const &s) const
 Return the number of passing cases. More...
 
bool ignoreCut (index_type const &i) const
 
bool ignoreCut (std::string const &s) const
 ignore the cut at index "s" More...
 
virtual bool operator() (reco::Vertex const &t)
 This provides an alternative signature without the second ret. More...
 
virtual bool operator() (reco::Vertex const &t, edm::EventBase const &e)
 This provides an alternative signature that includes extra information. More...
 
virtual bool operator() (reco::Vertex const &t, edm::EventBase const &e, pat::strbitset &ret)
 This provides an alternative signature that includes extra information. More...
 
bool operator[] (index_type const &i) const
 
bool operator[] (std::string const &s) const
 
void passCut (pat::strbitset &ret, index_type const &i)
 
void passCut (pat::strbitset &ret, std::string const &s)
 Passing cuts. More...
 
void print (std::ostream &out) const
 Print the cut flow. More...
 
void printActiveCuts (std::ostream &out) const
 Print the cuts being considered. More...
 
virtual void push_back (std::string const &s)
 This is the registration of an individual cut string. More...
 
virtual void push_back (std::string const &s, double cut)
 This is the registration of an individual cut string, with a double cut value. More...
 
virtual void push_back (std::string const &s, int cut)
 This is the registration of an individual cut string, with an int cut value. More...
 
 Selector ()
 Constructor clears the bits. More...
 
void set (index_type const &i, bool val=true)
 
void set (index_type const &i, double cut, bool val=true)
 
void set (index_type const &i, int cut, bool val=true)
 
void set (std::string const &s, bool val=true)
 Set a given selection cut, on or off. More...
 
void set (std::string const &s, double cut, bool val=true)
 Set a given selection cut, on or off, and reset int cut value. More...
 
void set (std::string const &s, int cut, bool val=true)
 Set a given selection cut, on or off, and reset int cut value. More...
 
void setIgnored (pat::strbitset &ret)
 set ignored bits More...
 
void setIgnoredCuts (std::vector< std::string > const &bitsToIgnore)
 set the bits to ignore from a vector More...
 
virtual ~Selector ()
 

Private Attributes

index_type indexNDOF_
 
index_type indexRho_
 
index_type indexZ_
 

Additional Inherited Members

- Public Types inherited from Selector< reco::Vertex >
typedef std::pair< index_type, size_t > cut_flow_item
 
typedef std::vector< cut_flow_itemcut_flow_map
 
typedef reco::Vertex data_type
 
typedef std::map< index_type, double > double_map
 
typedef pat::strbitset::index_type index_type
 
typedef std::map< index_type, int > int_map
 
- Protected Attributes inherited from Selector< reco::Vertex >
pat::strbitset bits_
 the bitset indexed by strings More...
 
cut_flow_map cutFlow_
 map of cut flows in "human" order More...
 
double_map doubleCuts_
 the double-value cut map More...
 
int_map intCuts_
 the int-value cut map More...
 
pat::strbitset retInternal_
 internal ret if users don't care about return bits More...
 

Detailed Description

Definition at line 17 of file PVObjectSelector.h.

Constructor & Destructor Documentation

◆ PVObjectSelector() [1/3]

PVObjectSelector::PVObjectSelector ( )
inline

Definition at line 19 of file PVObjectSelector.h.

19 {}

◆ PVObjectSelector() [2/3]

PVObjectSelector::PVObjectSelector ( edm::ParameterSet const &  params,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 22 of file PVObjectSelector.h.

◆ PVObjectSelector() [3/3]

PVObjectSelector::PVObjectSelector ( edm::ParameterSet const &  params)
inline

Definition at line 25 of file PVObjectSelector.h.

25  {
26  push_back("PV NDOF", params.getParameter<double>("minNdof"));
27  push_back("PV Z", params.getParameter<double>("maxZ"));
28  push_back("PV RHO", params.getParameter<double>("maxRho"));
29  set("PV NDOF");
30  set("PV Z");
31  set("PV RHO");
32 
33  indexNDOF_ = index_type(&bits_, "PV NDOF");
34  indexZ_ = index_type(&bits_, "PV Z");
35  indexRho_ = index_type(&bits_, "PV RHO");
36 
37  if (params.exists("cutsToIgnore"))
38  setIgnoredCuts(params.getParameter<std::vector<std::string> >("cutsToIgnore"));
39 
41  }

References Selector< reco::Vertex >::bits_, Selector< reco::Vertex >::getBitTemplate(), indexNDOF_, indexRho_, indexZ_, CalibrationSummaryClient_cfi::params, Selector< reco::Vertex >::push_back(), Selector< reco::Vertex >::retInternal_, Selector< reco::Vertex >::set(), and Selector< reco::Vertex >::setIgnoredCuts().

Member Function Documentation

◆ operator()()

bool PVObjectSelector::operator() ( reco::Vertex const &  t,
pat::strbitset ret 
)
inlineoverridevirtual

This provides the interface for base classes to select objects.

Implements Selector< reco::Vertex >.

Definition at line 43 of file PVObjectSelector.h.

43  {
44  if (pv.isFake())
45  return false;
46 
47  if (pv.ndof() >= cut(indexNDOF_, double()) || ignoreCut(indexNDOF_)) {
49  if (fabs(pv.z()) <= cut(indexZ_, double()) || ignoreCut(indexZ_)) {
51  if (fabs(pv.position().Rho()) <= cut(indexRho_, double()) || ignoreCut(indexRho_)) {
53  }
54  }
55  }
56 
57  setIgnored(ret);
58 
59  return (bool)ret;
60  }

References Selector< reco::Vertex >::cut(), Selector< reco::Vertex >::ignoreCut(), indexNDOF_, indexRho_, indexZ_, Selector< reco::Vertex >::passCut(), MetAnalyzer::pv(), runTheMatrix::ret, and Selector< reco::Vertex >::setIgnored().

Member Data Documentation

◆ indexNDOF_

index_type PVObjectSelector::indexNDOF_
private

Definition at line 65 of file PVObjectSelector.h.

Referenced by operator()(), and PVObjectSelector().

◆ indexRho_

index_type PVObjectSelector::indexRho_
private

Definition at line 67 of file PVObjectSelector.h.

Referenced by operator()(), and PVObjectSelector().

◆ indexZ_

index_type PVObjectSelector::indexZ_
private

Definition at line 66 of file PVObjectSelector.h.

Referenced by operator()(), and PVObjectSelector().

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:355
Selector< reco::Vertex >::setIgnored
void setIgnored(pat::strbitset &ret)
set ignored bits
Definition: Selector.h:181
Selector< reco::Vertex >::bits_
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:241
Selector< reco::Vertex >::index_type
pat::strbitset::index_type index_type
Definition: Selector.h:25
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
PVObjectSelector::indexRho_
index_type indexRho_
Definition: PVObjectSelector.h:67
Selector< reco::Vertex >::retInternal_
pat::strbitset retInternal_
internal ret if users don't care about return bits
Definition: Selector.h:242
Selector< reco::Vertex >::ignoreCut
bool ignoreCut(std::string const &s) const
ignore the cut at index "s"
Definition: Selector.h:127
PVObjectSelector::indexZ_
index_type indexZ_
Definition: PVObjectSelector.h:66
PVObjectSelector::indexNDOF_
index_type indexNDOF_
Definition: PVObjectSelector.h:65
Selector< reco::Vertex >::push_back
virtual void push_back(std::string const &s)
This is the registration of an individual cut string.
Definition: Selector.h:42
PVObjectSelector::PVObjectSelector
PVObjectSelector()
Definition: PVObjectSelector.h:19
Selector< reco::Vertex >::getBitTemplate
pat::strbitset getBitTemplate() const
Get an empty bitset with the proper names.
Definition: Selector.h:168
Selector< reco::Vertex >::passCut
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
Definition: Selector.h:142
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
Selector< reco::Vertex >::setIgnoredCuts
void setIgnoredCuts(std::vector< std::string > const &bitsToIgnore)
set the bits to ignore from a vector
Definition: Selector.h:131
Selector< reco::Vertex >::cut
int cut(index_type const &i, int val) const
Access the int cut values at index "s".
Definition: Selector.h:158
Selector< reco::Vertex >::set
void set(std::string const &s, bool val=true)
Set a given selection cut, on or off.
Definition: Selector.h:93