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 (int c)
 
 BPHParticleChargeSelect (const BPHParticleChargeSelect &x)=delete
 
double getCharge () const
 get selection charge More...
 
BPHParticleChargeSelectoperator= (const BPHParticleChargeSelect &x)=delete
 
void setCharge (int c)
 set selection charge More...
 
 ~BPHParticleChargeSelect () override=default
 
- Public Member Functions inherited from BPHRecoSelect
virtual bool accept (const reco::Candidate &cand, const BPHRecoBuilder *builder) const
 
 BPHRecoSelect ()
 
 BPHRecoSelect (const BPHRecoSelect &x)=delete
 
BPHRecoSelectoperator= (const BPHRecoSelect &x)=delete
 
virtual ~BPHRecoSelect ()=default
 

Private Attributes

int charge
 

Additional Inherited Members

- Public Types inherited from BPHRecoSelect
using AcceptArg = reco::Candidate
 

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 ( )
overridedefault

Destructor

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.

Referenced by esMonitoring.FDJsonServer::handle_accept().

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

◆ getCharge()

double BPHParticleChargeSelect::getCharge ( ) const
inline

get selection charge

Definition at line 67 of file BPHParticleChargeSelect.h.

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.

References c, and charge.

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

Member Data Documentation

◆ charge

int BPHParticleChargeSelect::charge
private

Definition at line 70 of file BPHParticleChargeSelect.h.

Referenced by getCharge(), and setCharge().