src
HeavyFlavorAnalysis
SpecificDecay
interface
BPHParticleChargeSelect.h
Go to the documentation of this file.
1
#ifndef HeavyFlavorAnalysis_SpecificDecay_BPHParticleChargeSelect_h
2
#define HeavyFlavorAnalysis_SpecificDecay_BPHParticleChargeSelect_h
3
12
//----------------------
13
// Base Class Headers --
14
//----------------------
15
#include "
HeavyFlavorAnalysis/RecoDecay/interface/BPHRecoSelect.h
"
16
17
//------------------------------------
18
// Collaborating Class Declarations --
19
//------------------------------------
20
#include "
DataFormats/RecoCandidate/interface/RecoCandidate.h
"
21
22
//---------------
23
// C++ Headers --
24
//---------------
25
26
// ---------------------
27
// -- Class Interface --
28
// ---------------------
29
30
class
BPHParticleChargeSelect
:
public
BPHRecoSelect
{
31
public
:
34
BPHParticleChargeSelect
(
int
c
) :
charge
(
c
? (
c
> 0 ? 1 : -1) : 0) {}
35
36
// deleted copy constructor and assignment operator
37
BPHParticleChargeSelect
(
const
BPHParticleChargeSelect
&
x
) =
delete
;
38
BPHParticleChargeSelect
&
operator=
(
const
BPHParticleChargeSelect
&
x
) =
delete
;
39
42
~BPHParticleChargeSelect
()
override
=
default
;
43
46
bool
accept
(
const
reco::Candidate
&
cand
)
const override
{
48
switch
(
charge
) {
49
default
:
50
case
0:
51
return
(
cand
.charge() != 0);
52
case
1:
53
return
(
cand
.charge() > 0);
54
case
-1:
55
return
(
cand
.charge() < 0);
56
}
57
return
true
;
58
};
59
61
void
setCharge
(
int
c
) {
62
charge
= (
c
? (
c
> 0 ? 1 : -1) : 0);
63
return
;
64
}
65
67
double
getCharge
()
const
{
return
charge
; }
68
69
private
:
70
int
charge
;
71
};
72
73
#endif
BPHParticleChargeSelect::charge
int charge
Definition:
BPHParticleChargeSelect.h:70
BPHParticleChargeSelect
Definition:
BPHParticleChargeSelect.h:30
reco::Candidate
Definition:
Candidate.h:27
BPHParticleChargeSelect::getCharge
double getCharge() const
get selection charge
Definition:
BPHParticleChargeSelect.h:67
HltBtagPostValidation_cff.c
c
Definition:
HltBtagPostValidation_cff.py:35
BPHRecoSelect
Definition:
BPHRecoSelect.h:34
BPHParticleChargeSelect::accept
bool accept(const reco::Candidate &cand) const override
select particle
Definition:
BPHParticleChargeSelect.h:47
BPHRecoSelect.h
BPHParticleChargeSelect::~BPHParticleChargeSelect
~BPHParticleChargeSelect() override=default
BPHParticleChargeSelect::setCharge
void setCharge(int c)
set selection charge
Definition:
BPHParticleChargeSelect.h:61
cand
Definition:
decayParser.h:32
BPHParticleChargeSelect::operator=
BPHParticleChargeSelect & operator=(const BPHParticleChargeSelect &x)=delete
DDAxes::x
RecoCandidate.h
BPHParticleChargeSelect::BPHParticleChargeSelect
BPHParticleChargeSelect(int c)
Definition:
BPHParticleChargeSelect.h:34
Generated for CMSSW Reference Manual by
1.8.14