CMS 3D CMS Logo

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

#include <BPHParticleChargeSelect.h>

Inheritance diagram for BPHParticleChargeSelect:
BPHRecoSelect BPHMuonChargeSelect

Public Member Functions

bool accept (const reco::Candidate &cand) const override
 select particle More...
 
 BPHParticleChargeSelect (const BPHParticleChargeSelect &x)=delete
 
 BPHParticleChargeSelect (int c)
 
double getCharge () const
 get selection charge More...
 
BPHParticleChargeSelectoperator= (const BPHParticleChargeSelect &x)=delete
 
void setCharge (int c)
 set selection charge More...
 
 ~BPHParticleChargeSelect () override
 
- Public Member Functions inherited from BPHRecoSelect
virtual bool accept (const reco::Candidate &cand, const BPHRecoBuilder *build) const
 
 BPHRecoSelect ()
 
 BPHRecoSelect (const BPHRecoSelect &x)=delete
 
BPHRecoSelectoperator= (const BPHRecoSelect &x)=delete
 
virtual ~BPHRecoSelect ()
 

Private Attributes

int charge
 

Additional Inherited Members

- Public Types inherited from BPHRecoSelect
using AcceptArg = reco::Candidate
 
- Protected Member Functions inherited from BPHRecoSelect
const reco::Candidateget (const std::string &name, const BPHRecoBuilder *build) const
 

Detailed Description

Description: Class for particle selection by charge

Author
Paolo Ronchese INFN Padova

Definition at line 30 of file BPHParticleChargeSelect.h.

Constructor & Destructor Documentation

◆ BPHParticleChargeSelect() [1/2]

BPHParticleChargeSelect::BPHParticleChargeSelect ( int  c)
inline

Constructor

Definition at line 34 of file BPHParticleChargeSelect.h.

34 : charge(c ? (c > 0 ? 1 : -1) : 0) {}

◆ BPHParticleChargeSelect() [2/2]

BPHParticleChargeSelect::BPHParticleChargeSelect ( const BPHParticleChargeSelect x)
delete

◆ ~BPHParticleChargeSelect()

BPHParticleChargeSelect::~BPHParticleChargeSelect ( )
inlineoverride

Destructor

Definition at line 42 of file BPHParticleChargeSelect.h.

42 {}

Member Function Documentation

◆ accept()

bool BPHParticleChargeSelect::accept ( const reco::Candidate cand) const
inlineoverridevirtual

select particle

Operations

Implements BPHRecoSelect.

Definition at line 47 of file BPHParticleChargeSelect.h.

47  {
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  };

Referenced by esMonitoring.FDJsonServer::handle_accept().

◆ getCharge()

double BPHParticleChargeSelect::getCharge ( ) const
inline

get selection charge

Definition at line 67 of file BPHParticleChargeSelect.h.

67 { return charge; }

References charge.

◆ operator=()

BPHParticleChargeSelect& BPHParticleChargeSelect::operator= ( const BPHParticleChargeSelect x)
delete

◆ setCharge()

void BPHParticleChargeSelect::setCharge ( int  c)
inline

set selection charge

Definition at line 61 of file BPHParticleChargeSelect.h.

61  {
62  charge = (c ? (c > 0 ? 1 : -1) : 0);
63  return;
64  }

References c, and charge.

Member Data Documentation

◆ charge

int BPHParticleChargeSelect::charge
private

Definition at line 70 of file BPHParticleChargeSelect.h.

Referenced by getCharge(), and setCharge().

BPHParticleChargeSelect::charge
int charge
Definition: BPHParticleChargeSelect.h:70
cand
Definition: decayParser.h:32
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56