CMS 3D CMS Logo

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

#include <BPHKx0ToKPiBuilder.h>

Public Member Functions

 BPHKx0ToKPiBuilder (const edm::EventSetup &es, const BPHRecoBuilder::BPHGenericCollection *posCollection, const BPHRecoBuilder::BPHGenericCollection *negCollection)
 
std::vector< BPHPlusMinusConstCandPtrbuild ()
 build Phi candidates More...
 
double getConstrMass () const
 
double getConstrSigma () const
 
double getEtaMax () const
 
double getMassMax () const
 
double getMassMin () const
 
double getProbMin () const
 
double getPtMin () const
 get current cuts More...
 
void setConstr (double mass, double sigma)
 
void setEtaMax (double eta)
 
void setMassMax (double m)
 
void setMassMin (double m)
 
void setProbMin (double p)
 
void setPtMin (double pt)
 set cuts More...
 
virtual ~BPHKx0ToKPiBuilder ()
 

Private Member Functions

 BPHKx0ToKPiBuilder (const BPHKx0ToKPiBuilder &x)
 
BPHKx0ToKPiBuilderoperator= (const BPHKx0ToKPiBuilder &x)
 

Private Attributes

BPHChi2Selectchi2Sel
 
double cMass
 
double cSigma
 
BPHParticleEtaSelectetaSel
 
const edm::EventSetupevSetup
 
std::string kaonName
 
std::vector< BPHPlusMinusConstCandPtrkx0List
 
BPHMassSelectmassSel
 
const BPHRecoBuilder::BPHGenericCollectionnCollection
 
const BPHRecoBuilder::BPHGenericCollectionpCollection
 
std::string pionName
 
BPHParticlePtSelectptSel
 
bool updated
 

Detailed Description

Description: Class to build K*0 to K+ pi- candidates

Author
Paolo Ronchese INFN Padova

Definition at line 41 of file BPHKx0ToKPiBuilder.h.

Constructor & Destructor Documentation

BPHKx0ToKPiBuilder::BPHKx0ToKPiBuilder ( const edm::EventSetup es,
const BPHRecoBuilder::BPHGenericCollection posCollection,
const BPHRecoBuilder::BPHGenericCollection negCollection 
)

Constructor

Definition at line 41 of file BPHKx0ToKPiBuilder.cc.

References chi2Sel, etaSel, massSel, ptSel, and updated.

44  :
45  kaonName( "Kaon" ),
46  pionName( "Pion" ),
47  evSetup( &es ),
48  pCollection( posCollection ),
49  nCollection( negCollection ) {
50  ptSel = new BPHParticlePtSelect ( 0.7 );
51  etaSel = new BPHParticleEtaSelect( 10.0 );
52  massSel = new BPHMassSelect( 0.75, 1.05 );
53  chi2Sel = new BPHChi2Select( 0.0 );
54  updated = false;
55 }
const BPHRecoBuilder::BPHGenericCollection * pCollection
BPHParticleEtaSelect * etaSel
const edm::EventSetup * evSetup
const BPHRecoBuilder::BPHGenericCollection * nCollection
BPHMassSelect * massSel
BPHChi2Select * chi2Sel
BPHParticlePtSelect * ptSel
BPHKx0ToKPiBuilder::~BPHKx0ToKPiBuilder ( )
virtual

Destructor

Definition at line 60 of file BPHKx0ToKPiBuilder.cc.

References chi2Sel, etaSel, massSel, and ptSel.

60  {
61  delete ptSel;
62  delete etaSel;
63  delete massSel;
64  delete chi2Sel;
65 }
BPHParticleEtaSelect * etaSel
BPHMassSelect * massSel
BPHChi2Select * chi2Sel
BPHParticlePtSelect * ptSel
BPHKx0ToKPiBuilder::BPHKx0ToKPiBuilder ( const BPHKx0ToKPiBuilder x)
private

Member Function Documentation

vector< BPHPlusMinusConstCandPtr > BPHKx0ToKPiBuilder::build ( )

build Phi candidates

Operations

Definition at line 70 of file BPHKx0ToKPiBuilder.cc.

References BPHChi2Select::accept(), BPHMassSelect::accept(), BPHPlusMinusCandidate::add(), BPHRecoBuilder::add(), BPHPlusMinusCandidate::build(), chi2Sel, BPHPlusMinusCandidate::composite(), etaSel, evSetup, BPHRecoBuilder::filter(), BPHDecayMomentum::getDaug(), BPHParticleMasses::kaonMass, BPHParticleMasses::kaonMSigma, kaonName, kx0List, BPHParticleMasses::kx0Mass, reco::LeafCandidate::mass(), massSel, nCollection, BPHDecayMomentum::originalReco(), pCollection, BPHParticleMasses::pionMass, BPHParticleMasses::pionMSigma, pionName, ptSel, and updated.

Referenced by BPHWriteSpecificDecay::fill().

70  {
71 
72  if ( updated ) return kx0List;
73 
74  BPHRecoBuilder bKx0( *evSetup );
79  bKx0.filter( kaonName, *ptSel );
80  bKx0.filter( pionName, *ptSel );
81  bKx0.filter( kaonName, *etaSel );
82  bKx0.filter( pionName, *etaSel );
84  bKx0.filter( mTmpSel );
85 
86  vector<BPHPlusMinusConstCandPtr>
88 
89  int ikx;
90  int nkx = tmpList.size();
91  kx0List.clear();
92  kx0List.reserve( nkx );
93  BPHPlusMinusConstCandPtr pxt( 0 );
94  for ( ikx = 0; ikx < nkx; ++ikx ) {
95  BPHPlusMinusConstCandPtr& px0 = tmpList[ikx];
97  const
98  BPHPlusMinusCandidate* kx0 = px0.get();
99  BPHPlusMinusCandidate* kxb = pxb.get();
100  kxb->add( pionName, kx0->originalReco( kx0->getDaug( kaonName ) ),
102  kxb->add( kaonName, kx0->originalReco( kx0->getDaug( pionName ) ),
104  if ( fabs( kx0->composite().mass() - BPHParticleMasses::kx0Mass ) <
105  fabs( kxb->composite().mass() - BPHParticleMasses::kx0Mass ) )
106  pxt = px0;
107  else pxt = pxb;
108  if ( !massSel->accept( *pxt ) ) continue;
109  if ( !chi2Sel->accept( *pxt ) ) continue;
110  kx0List.push_back( pxt );
111  }
112 
113  updated = true;
114  return kx0List;
115 
116 }
static std::vector< BPHPlusMinusConstCandPtr > build(const BPHRecoBuilder &builder, const std::string &nPos, const std::string &nNeg, double mass=-1, double msig=-1)
std::vector< BPHPlusMinusConstCandPtr > kx0List
static const double kaonMass
virtual double mass() const final
mass
const BPHRecoBuilder::BPHGenericCollection * pCollection
virtual const pat::CompositeCandidate & composite() const
get a composite by the simple sum of simple particles
BPHGenericPtr< BPHPlusMinusCandidate >::type BPHPlusMinusCandidatePtr
virtual bool accept(const BPHDecayMomentum &cand) const
select particle
Definition: BPHMassSelect.h:48
BPHParticleEtaSelect * etaSel
BPHGenericPtr< const BPHPlusMinusCandidate >::type BPHPlusMinusConstCandPtr
static const double kx0Mass
static const double pionMSigma
const edm::EventSetup * evSetup
virtual void add(const std::string &name, const reco::Candidate *daug, double mass=-1.0, double sigma=-1.0)
virtual bool accept(const BPHDecayVertex &cand) const
select vertex
Definition: BPHChi2Select.h:47
virtual const reco::Candidate * originalReco(const reco::Candidate *daug) const
get the original particle from the clone
static const double pionMass
const BPHRecoBuilder::BPHGenericCollection * nCollection
static const double kaonMSigma
BPHMassSelect * massSel
virtual const reco::Candidate * getDaug(const std::string &name) const
BPHChi2Select * chi2Sel
BPHParticlePtSelect * ptSel
double BPHKx0ToKPiBuilder::getConstrMass ( ) const

Definition at line 187 of file BPHKx0ToKPiBuilder.cc.

References cMass.

Referenced by BPHWriteSpecificDecay::fill().

187  {
188  return cMass;
189 }
double BPHKx0ToKPiBuilder::getConstrSigma ( ) const

Definition at line 192 of file BPHKx0ToKPiBuilder.cc.

References cSigma.

Referenced by BPHWriteSpecificDecay::fill().

192  {
193  return cSigma;
194 }
double BPHKx0ToKPiBuilder::getEtaMax ( ) const

Definition at line 167 of file BPHKx0ToKPiBuilder.cc.

References etaSel, and BPHParticleEtaSelect::getEtaMax().

167  {
168  return etaSel->getEtaMax();
169 }
BPHParticleEtaSelect * etaSel
double getEtaMax() const
get current eta max
double BPHKx0ToKPiBuilder::getMassMax ( ) const

Definition at line 177 of file BPHKx0ToKPiBuilder.cc.

References BPHMassCuts::getMassMax(), and massSel.

177  {
178  return massSel->getMassMax();
179 }
double getMassMax() const
Definition: BPHMassCuts.h:55
BPHMassSelect * massSel
double BPHKx0ToKPiBuilder::getMassMin ( ) const

Definition at line 172 of file BPHKx0ToKPiBuilder.cc.

References BPHMassCuts::getMassMin(), and massSel.

172  {
173  return massSel->getMassMin();
174 }
double getMassMin() const
get current mass cuts
Definition: BPHMassCuts.h:54
BPHMassSelect * massSel
double BPHKx0ToKPiBuilder::getProbMin ( ) const

Definition at line 182 of file BPHKx0ToKPiBuilder.cc.

References chi2Sel, and BPHChi2Select::getProbMin().

182  {
183  return chi2Sel->getProbMin();
184 }
double getProbMin() const
get current prob min
Definition: BPHChi2Select.h:58
BPHChi2Select * chi2Sel
double BPHKx0ToKPiBuilder::getPtMin ( ) const

get current cuts

Definition at line 162 of file BPHKx0ToKPiBuilder.cc.

References BPHParticlePtSelect::getPtMin(), and ptSel.

162  {
163  return ptSel->getPtMin();
164 }
double getPtMin() const
get current pt min
BPHParticlePtSelect * ptSel
BPHKx0ToKPiBuilder& BPHKx0ToKPiBuilder::operator= ( const BPHKx0ToKPiBuilder x)
private
void BPHKx0ToKPiBuilder::setConstr ( double  mass,
double  sigma 
)
void BPHKx0ToKPiBuilder::setEtaMax ( double  eta)

Definition at line 126 of file BPHKx0ToKPiBuilder.cc.

References etaSel, BPHParticleEtaSelect::setEtaMax(), and updated.

Referenced by BPHWriteSpecificDecay::fill().

126  {
127  updated = false;
128  etaSel->setEtaMax( eta );
129  return;
130 }
BPHParticleEtaSelect * etaSel
void setEtaMax(double eta)
set eta max
void BPHKx0ToKPiBuilder::setMassMax ( double  m)

Definition at line 140 of file BPHKx0ToKPiBuilder.cc.

References massSel, BPHMassCuts::setMassMax(), and updated.

Referenced by BPHWriteSpecificDecay::fill().

140  {
141  updated = false;
142  massSel->setMassMax( m );
143  return;
144 }
void setMassMax(double m)
Definition: BPHMassCuts.h:51
BPHMassSelect * massSel
void BPHKx0ToKPiBuilder::setMassMin ( double  m)

Definition at line 133 of file BPHKx0ToKPiBuilder.cc.

References massSel, BPHMassCuts::setMassMin(), and updated.

Referenced by BPHWriteSpecificDecay::fill().

133  {
134  updated = false;
135  massSel->setMassMin( m );
136  return;
137 }
void setMassMin(double m)
set mass cuts
Definition: BPHMassCuts.h:50
BPHMassSelect * massSel
void BPHKx0ToKPiBuilder::setProbMin ( double  p)

Definition at line 147 of file BPHKx0ToKPiBuilder.cc.

References chi2Sel, BPHChi2Select::setProbMin(), and updated.

Referenced by BPHWriteSpecificDecay::fill().

147  {
148  updated = false;
149  chi2Sel->setProbMin( p );
150  return;
151 }
void setProbMin(double p)
set prob min
Definition: BPHChi2Select.h:55
BPHChi2Select * chi2Sel
void BPHKx0ToKPiBuilder::setPtMin ( double  pt)

set cuts

Definition at line 119 of file BPHKx0ToKPiBuilder.cc.

References ptSel, BPHParticlePtSelect::setPtMin(), and updated.

Referenced by BPHWriteSpecificDecay::fill().

119  {
120  updated = false;
121  ptSel->setPtMin( pt );
122  return;
123 }
void setPtMin(double pt)
set pt min
BPHParticlePtSelect * ptSel

Member Data Documentation

BPHChi2Select* BPHKx0ToKPiBuilder::chi2Sel
private
double BPHKx0ToKPiBuilder::cMass
private

Definition at line 94 of file BPHKx0ToKPiBuilder.h.

Referenced by getConstrMass(), and setConstr().

double BPHKx0ToKPiBuilder::cSigma
private

Definition at line 95 of file BPHKx0ToKPiBuilder.h.

Referenced by getConstrSigma(), and setConstr().

BPHParticleEtaSelect* BPHKx0ToKPiBuilder::etaSel
private
const edm::EventSetup* BPHKx0ToKPiBuilder::evSetup
private

Definition at line 86 of file BPHKx0ToKPiBuilder.h.

Referenced by build().

std::string BPHKx0ToKPiBuilder::kaonName
private

Definition at line 83 of file BPHKx0ToKPiBuilder.h.

Referenced by build().

std::vector<BPHPlusMinusConstCandPtr> BPHKx0ToKPiBuilder::kx0List
private

Definition at line 98 of file BPHKx0ToKPiBuilder.h.

Referenced by build().

BPHMassSelect* BPHKx0ToKPiBuilder::massSel
private
const BPHRecoBuilder::BPHGenericCollection* BPHKx0ToKPiBuilder::nCollection
private

Definition at line 88 of file BPHKx0ToKPiBuilder.h.

Referenced by build().

const BPHRecoBuilder::BPHGenericCollection* BPHKx0ToKPiBuilder::pCollection
private

Definition at line 87 of file BPHKx0ToKPiBuilder.h.

Referenced by build().

std::string BPHKx0ToKPiBuilder::pionName
private

Definition at line 84 of file BPHKx0ToKPiBuilder.h.

Referenced by build().

BPHParticlePtSelect* BPHKx0ToKPiBuilder::ptSel
private
bool BPHKx0ToKPiBuilder::updated
private