CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions
BPHRecoCandidate Class Reference

#include <BPHRecoCandidate.h>

Inheritance diagram for BPHRecoCandidate:
BPHKinematicFit BPHDecayVertex BPHDecayMomentum BPHPlusMinusCandidate

Classes

struct  BuilderParameters
 

Public Types

typedef BPHRecoConstCandPtr const_pointer
 
enum  esType { transientTrackBuilder }
 
typedef BPHRecoCandidatePtr pointer
 

Public Member Functions

virtual void add (const std::string &name, const reco::Candidate *daug, double mass=-1.0, double sigma=-1.0)
 
virtual void add (const std::string &name, const reco::Candidate *daug, const std::string &searchList, double mass=-1.0, double sigma=-1.0)
 
virtual void add (const std::string &name, const BPHRecoConstCandPtr &comp)
 
 BPHRecoCandidate (const BPHEventSetupWrapper *es, int daugNum=2, int compNum=2)
 
 BPHRecoCandidate (const BPHEventSetupWrapper *es, const BPHRecoBuilder::ComponentSet &compSet)
 create an object with daughters as specified in the ComponentSet More...
 
 BPHRecoCandidate (const BPHRecoCandidate &x)=delete
 
virtual BPHRecoCandidateclone (int level=-1) const
 
BPHRecoCandidateoperator= (const BPHRecoCandidate &x)=delete
 
 ~BPHRecoCandidate () override=default
 
- Public Member Functions inherited from BPHKinematicFit
 BPHKinematicFit (const BPHKinematicFit &x)=delete
 
double constrMass () const
 retrieve the constraint More...
 
double constrSigma () const
 
virtual const RefCountedKinematicVertex currentDecayVertex () const
 
virtual const RefCountedKinematicParticle currentParticle () const
 get current particle More...
 
bool getIndependentFit (const std::string &name, double &mass, double &sigma) const
 retrieve independent fit flag More...
 
double getMassSigma (const reco::Candidate *cand) const
 retrieve particle mass sigma More...
 
virtual bool isEmpty () const
 get fit status More...
 
virtual bool isValidFit () const
 
virtual const RefCountedKinematicTreekinematicTree () const
 perform the kinematic fit and get the result More...
 
virtual const RefCountedKinematicTreekinematicTree (const std::string &name, double mass, double sigma) const
 
virtual const RefCountedKinematicTreekinematicTree (const std::string &name, double mass) const
 
virtual const RefCountedKinematicTreekinematicTree (const std::string &name) const
 
virtual const RefCountedKinematicTreekinematicTree (const std::string &name, KinematicConstraint *kc) const
 
virtual const RefCountedKinematicTreekinematicTree (const std::string &name, MultiTrackKinematicConstraint *kc) const
 
virtual const std::vector< RefCountedKinematicParticle > & kinParticles () const
 get kinematic particles More...
 
virtual std::vector< RefCountedKinematicParticlekinParticles (const std::vector< std::string > &names) const
 
virtual ParticleMass mass () const
 
BPHKinematicFitoperator= (const BPHKinematicFit &x)=delete
 
virtual const math::XYZTLorentzVectorp4 () const
 compute total momentum after the fit More...
 
virtual void resetKinematicFit () const
 reset the kinematic fit More...
 
void setConstraint (double mass, double sigma)
 apply a mass constraint More...
 
void setIndependentFit (const std::string &name, bool flag=true, double mass=-1.0, double sigma=-1.0)
 set a decaying daughter as an unique particle fitted independently More...
 
virtual const RefCountedKinematicVertex topDecayVertex () const
 
virtual const RefCountedKinematicParticle topParticle () const
 get top particle More...
 
 ~BPHKinematicFit () override=default
 
- Public Member Functions inherited from BPHDecayVertex
 BPHDecayVertex (const BPHDecayVertex &x)=delete
 
const BPHEventSetupWrappergetEventSetup () const
 retrieve EventSetup More...
 
char getTMode (const reco::Candidate *cand) const
 get Track mode for a daughter More...
 
const reco::TrackgetTrack (const reco::Candidate *cand) const
 get Track for a daughter More...
 
const std::string & getTrackSearchList (const reco::Candidate *cand) const
 retrieve track search list More...
 
reco::TransientTrackgetTransientTrack (const reco::Candidate *cand) const
 get TransientTrack for a daughter More...
 
BPHDecayVertexoperator= (const BPHDecayVertex &x)=delete
 
const std::vector< const reco::Track * > & tracks () const
 get list of Tracks More...
 
const std::vector< reco::TransientTrack > & transientTracks () const
 get list of TransientTracks More...
 
virtual bool validTracks () const
 check for valid reconstructed vertex More...
 
virtual bool validVertex () const
 
virtual const reco::Vertexvertex (VertexFitter< 5 > *fitter=nullptr, const reco::BeamSpot *bs=nullptr, const GlobalPoint *priorPos=nullptr, const GlobalError *priorError=nullptr) const
 get reconstructed vertex More...
 
 ~BPHDecayVertex () override
 
- Public Member Functions inherited from BPHDecayMomentum
 BPHDecayMomentum (const BPHDecayMomentum &x)=delete
 
const std::map< std::string, BPHRecoConstCandPtr > & compMap () const
 
virtual const std::vector< std::string > & compNames () const
 
virtual const pat::CompositeCandidatecomposite () const
 get a composite by the simple sum of simple particles More...
 
virtual const std::vector< BPHRecoConstCandPtr > & daughComp () const
 
virtual const std::vector< const reco::Candidate * > & daughFull () const
 
virtual const std::vector< const reco::Candidate * > & daughters () const
 
const std::map< std::string, const reco::Candidate * > & daugMap () const
 
virtual const std::vector< std::string > & daugNames () const
 
virtual BPHRecoConstCandPtr getComp (const std::string &name) const
 
virtual const reco::CandidategetDaug (const std::string &name) const
 
BPHDecayMomentumoperator= (const BPHDecayMomentum &x)=delete
 
virtual const reco::CandidateoriginalReco (const reco::Candidate *daug) const
 get the original particle from the clone More...
 
virtual ~BPHDecayMomentum ()
 

Static Public Member Functions

static std::vector< BPHRecoConstCandPtrbuild (const BPHRecoBuilder &builder, const BuilderParameters &par)
 
static std::vector< BPHRecoConstCandPtrbuild (const BPHRecoBuilder &builder, double mass=-1, double msig=-1)
 

Protected Member Functions

void fill (BPHRecoCandidate *ptr, int level) const override
 
- Protected Member Functions inherited from BPHKinematicFit
virtual void addK (const std::string &name, const reco::Candidate *daug, double mass=-1.0, double sigma=-1.0)
 
virtual void addK (const std::string &name, const reco::Candidate *daug, const std::string &searchList, double mass=-1.0, double sigma=-1.0)
 
virtual void addK (const std::string &name, const BPHRecoConstCandPtr &comp)
 
 BPHKinematicFit (int daugNum=2, int compNum=2)
 
 BPHKinematicFit (const BPHKinematicFit *ptr)
 
void setNotUpdated () const override
 
- Protected Member Functions inherited from BPHDecayVertex
virtual void addV (const std::string &name, const reco::Candidate *daug, const std::string &searchList, double mass)
 
virtual void addV (const std::string &name, const BPHRecoConstCandPtr &comp)
 
 BPHDecayVertex (const BPHEventSetupWrapper *es, int daugNum=2, int compNum=2)
 
 BPHDecayVertex (const BPHDecayVertex *ptr, const BPHEventSetupWrapper *es)
 
- Protected Member Functions inherited from BPHDecayMomentum
virtual void addP (const std::string &name, const reco::Candidate *daug, double mass=-1.0)
 
virtual void addP (const std::string &name, const BPHRecoConstCandPtr &comp)
 
 BPHDecayMomentum (int daugNum=2, int compNum=2)
 
 BPHDecayMomentum (const std::map< std::string, Component > &daugMap, int compNum=2)
 
 BPHDecayMomentum (const std::map< std::string, Component > &daugMap, const std::map< std::string, BPHRecoConstCandPtr > compMap)
 
const std::vector< Component > & componentList () const
 

Static Protected Member Functions

template<class T >
static void fill (std::vector< typename BPHGenericPtr< const T >::type > &cList, const BPHRecoBuilder &builder, double mass=-1, double msig=-1)
 

Detailed Description

Description: High level class for reconstructed decay candidates:

Author
Paolo Ronchese INFN Padova

Definition at line 44 of file BPHRecoCandidate.h.

Member Typedef Documentation

◆ const_pointer

Definition at line 47 of file BPHRecoCandidate.h.

◆ pointer

Definition at line 46 of file BPHRecoCandidate.h.

Member Enumeration Documentation

◆ esType

Enumerator
transientTrackBuilder 

Definition at line 102 of file BPHRecoCandidate.h.

Constructor & Destructor Documentation

◆ BPHRecoCandidate() [1/3]

BPHRecoCandidate::BPHRecoCandidate ( const BPHEventSetupWrapper es,
int  daugNum = 2,
int  compNum = 2 
)

Constructorcreate an "empty" object to add daughters later (see BPHDecayMomentum)

Definition at line 31 of file BPHRecoCandidate.cc.

Referenced by clone().

32  : BPHDecayMomentum(daugNum, compNum), BPHDecayVertex(es), BPHKinematicFit() {}
BPHKinematicFit(const BPHKinematicFit &x)=delete
BPHDecayMomentum(const BPHDecayMomentum &x)=delete
BPHDecayVertex(const BPHDecayVertex &x)=delete

◆ BPHRecoCandidate() [2/3]

BPHRecoCandidate::BPHRecoCandidate ( const BPHEventSetupWrapper es,
const BPHRecoBuilder::ComponentSet compSet 
)

create an object with daughters as specified in the ComponentSet

Definition at line 34 of file BPHRecoCandidate.cc.

35  : BPHDecayMomentum(compList.daugMap, compList.compMap), BPHDecayVertex(this, es), BPHKinematicFit(this) {}
BPHKinematicFit(const BPHKinematicFit &x)=delete
std::vector< Component > compList
BPHDecayMomentum(const BPHDecayMomentum &x)=delete
BPHDecayVertex(const BPHDecayVertex &x)=delete

◆ BPHRecoCandidate() [3/3]

BPHRecoCandidate::BPHRecoCandidate ( const BPHRecoCandidate x)
delete

◆ ~BPHRecoCandidate()

BPHRecoCandidate::~BPHRecoCandidate ( )
overridedefault

Destructor

Member Function Documentation

◆ add() [1/3]

virtual void BPHRecoCandidate::add ( const std::string &  name,
const reco::Candidate daug,
double  mass = -1.0,
double  sigma = -1.0 
)
inlinevirtual

Operationsadd a simple particle giving it a name particles are cloned, eventually specifying a different mass and a sigma

Reimplemented in BPHPlusMinusCandidate.

Definition at line 70 of file BPHRecoCandidate.h.

Referenced by fill(), and counter.Counter::register().

70  {
71  addK(name, daug, "cfhpmig", mass, sigma);
72  return;
73  }
virtual void addK(const std::string &name, const reco::Candidate *daug, double mass=-1.0, double sigma=-1.0)
virtual ParticleMass mass() const

◆ add() [2/3]

virtual void BPHRecoCandidate::add ( const std::string &  name,
const reco::Candidate daug,
const std::string &  searchList,
double  mass = -1.0,
double  sigma = -1.0 
)
inlinevirtual

Reimplemented in BPHPlusMinusCandidate.

Definition at line 74 of file BPHRecoCandidate.h.

References BPHKinematicFit::addK(), BPHKinematicFit::mass(), Skims_PA_cff::name, and newFWLiteAna::searchList.

Referenced by counter.Counter::register().

78  {
79  addK(name, daug, searchList, mass, sigma);
80  return;
81  }
virtual void addK(const std::string &name, const reco::Candidate *daug, double mass=-1.0, double sigma=-1.0)
virtual ParticleMass mass() const

◆ add() [3/3]

virtual void BPHRecoCandidate::add ( const std::string &  name,
const BPHRecoConstCandPtr comp 
)
inlinevirtual

Definition at line 82 of file BPHRecoCandidate.h.

References BPHKinematicFit::addK(), AlCaHLTBitMon_QueryRunRegistry::comp, and Skims_PA_cff::name.

Referenced by counter.Counter::register().

82  {
83  addK(name, comp);
84  return;
85  }
virtual void addK(const std::string &name, const reco::Candidate *daug, double mass=-1.0, double sigma=-1.0)

◆ build() [1/2]

static std::vector<BPHRecoConstCandPtr> BPHRecoCandidate::build ( const BPHRecoBuilder builder,
const BuilderParameters par 
)
inlinestatic

Definition at line 93 of file BPHRecoCandidate.h.

References BPHRecoCandidate::BuilderParameters::constrMass, and BPHRecoCandidate::BuilderParameters::constrSigma.

93  {
94  return build(builder, par.constrMass, par.constrSigma);
95  }
static std::vector< BPHRecoConstCandPtr > build(const BPHRecoBuilder &builder, const BuilderParameters &par)

◆ build() [2/2]

vector< BPHRecoConstCandPtr > BPHRecoCandidate::build ( const BPHRecoBuilder builder,
double  mass = -1,
double  msig = -1 
)
static

Definition at line 40 of file BPHRecoCandidate.cc.

References BPHDecayMomentum::cList, and BPHKinematicFit::mass().

40  {
41  // create a list of pointers to BPHRecoCandidate and fill it
42  // with particle combinations selected by the BPHRecoBuilder
43  vector<BPHRecoConstCandPtr> cList;
44  fill<BPHRecoCandidate>(cList, builder, mass, msig);
45  return cList;
46 }
std::vector< BPHRecoConstCandPtr > cList
virtual ParticleMass mass() const

◆ clone()

BPHRecoCandidate * BPHRecoCandidate::clone ( int  level = -1) const
virtual

clone object, cloning daughters as well up to required depth level = -1 to clone all levels

Reimplemented in BPHPlusMinusCandidate.

Definition at line 50 of file BPHRecoCandidate.cc.

References BPHRecoCandidate(), fill(), BPHDecayVertex::getEventSetup(), and personalPlayback::level.

Referenced by BPHKinematicFit::addParticles().

50  {
52  fill(ptr, level);
53  return ptr;
54 }
const BPHEventSetupWrapper * getEventSetup() const
retrieve EventSetup
void fill(BPHRecoCandidate *ptr, int level) const override
BPHRecoCandidate(const BPHEventSetupWrapper *es, int daugNum=2, int compNum=2)

◆ fill() [1/2]

void BPHRecoCandidate::fill ( BPHRecoCandidate ptr,
int  level 
) const
overrideprotectedvirtual

Implements BPHDecayMomentum.

Definition at line 58 of file BPHRecoCandidate.cc.

References add(), HltBtagPostValidation_cff::c, BPHDecayMomentum::compNames(), BPHKinematicFit::constrMass(), BPHKinematicFit::constrSigma(), ztail::d, BPHDecayMomentum::daugNames(), BPHDecayMomentum::getComp(), BPHDecayMomentum::getDaug(), BPHKinematicFit::getIndependentFit(), BPHKinematicFit::getMassSigma(), BPHDecayVertex::getTrackSearchList(), l1ctLayer2EG_cff::id, personalPlayback::level, visualization-live-secondInstance_cfg::m, dqmiodumpmetadata::n, BPHDecayMomentum::nComp, BPHDecayMomentum::originalReco(), alignCSCRings::s, BPHKinematicFit::setConstraint(), and BPHKinematicFit::setIndependentFit().

Referenced by BPHPlusMinusCandidate::clone(), and clone().

58  {
60  const vector<string>& nDaug = daugNames();
61  int id;
62  int nd = nDaug.size();
63  for (id = 0; id < nd; ++id) {
64  const string& n = nDaug[id];
65  const reco::Candidate* d = getDaug(n);
66  ptr->add(n, originalReco(d), getTrackSearchList(d), d->mass(), getMassSigma(d));
67  }
68  const vector<string>& nComp = compNames();
69  int ic;
70  int nc = nComp.size();
71  for (ic = 0; ic < nc; ++ic) {
72  const string& n = nComp[ic];
74  if (level)
75  ptr->add(n, BPHRecoConstCandPtr(c->clone(level - 1)));
76  else
77  ptr->add(n, c);
78  double m = -1;
79  double s = -1;
80  if (getIndependentFit(n, m, s))
81  ptr->setIndependentFit(n, true, m, s);
82  }
83  return;
84 }
virtual const reco::Candidate * originalReco(const reco::Candidate *daug) const
get the original particle from the clone
BPHGenericPtr< const BPHRecoCandidate >::type BPHRecoConstCandPtr
bool getIndependentFit(const std::string &name, double &mass, double &sigma) const
retrieve independent fit flag
void setIndependentFit(const std::string &name, bool flag=true, double mass=-1.0, double sigma=-1.0)
set a decaying daughter as an unique particle fitted independently
const std::string & getTrackSearchList(const reco::Candidate *cand) const
retrieve track search list
virtual const reco::Candidate * getDaug(const std::string &name) const
virtual void add(const std::string &name, const reco::Candidate *daug, double mass=-1.0, double sigma=-1.0)
d
Definition: ztail.py:151
virtual const std::vector< std::string > & compNames() const
virtual BPHRecoConstCandPtr getComp(const std::string &name) const
virtual const std::vector< std::string > & daugNames() const
double constrMass() const
retrieve the constraint
void setConstraint(double mass, double sigma)
apply a mass constraint
double getMassSigma(const reco::Candidate *cand) const
retrieve particle mass sigma
std::vector< std::string > nComp
double constrSigma() const

◆ fill() [2/2]

template<class T >
void BPHRecoCandidate::fill ( std::vector< typename BPHGenericPtr< const T >::type > &  cList,
const BPHRecoBuilder builder,
double  mass = -1,
double  msig = -1 
)
staticprotected

Definition at line 119 of file BPHRecoCandidate.h.

References BPHRecoBuilder::accept(), BPHRecoBuilder::build(), BPHDecayMomentum::cList, BPHRecoBuilder::eventSetup(), mps_fire::i, BPHKinematicFit::mass(), and dqmiodumpmetadata::n.

122  {
123  // create particle combinations
124  const std::vector<BPHRecoBuilder::ComponentSet> dll = builder.build();
125  // loop over combinations and create reconstructed particles
126  int i;
127  int n = dll.size();
128  cList.reserve(n);
129  T* rc = nullptr;
130  for (i = 0; i < n; ++i) {
131  // create reconstructed particle
132  rc = new T(builder.eventSetup(), dll[i]);
133  // apply mass constraint, if requested
134  if (mass > 0)
135  rc->setConstraint(mass, msig);
136  // apply post selection
137  if (builder.accept(*rc))
138  cList.push_back(typename BPHGenericPtr<const T>::type(rc));
139  else
140  delete rc;
141  }
142  return;
143 }
std::vector< BPHRecoConstCandPtr > cList
std::shared_ptr< T > type
Definition: BPHGenericPtr.h:8
bool accept(const BPHRecoCandidate &cand) const
std::vector< ComponentSet > build() const
build a set of combinations of particles fulfilling the selections
const BPHEventSetupWrapper * eventSetup() const
get the EventSetup set in the constructor
virtual ParticleMass mass() const
long double T

◆ operator=()

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