CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
BPHDecayToV0Builder Class Referenceabstract

#include <BPHDecayToV0Builder.h>

Inheritance diagram for BPHDecayToV0Builder:
BPHDecayGenericBuilder BPHDecayToV0DiffMassBuilder BPHDecayToV0SameMassBuilder BPHLambda0ToPPiBuilder BPHK0sToPiPiBuilder

Classes

struct  V0Info
 

Public Types

enum  v0Type { VertexCompositeCandidate, VertexCompositePtrCandidate }
 

Public Member Functions

 BPHDecayToV0Builder (const edm::EventSetup &es, const std::string &d1Name, const std::string &d2Name, const BPHRecoBuilder::BPHGenericCollection *d1Collection, const BPHRecoBuilder::BPHGenericCollection *d2Collection)
 
 BPHDecayToV0Builder (const edm::EventSetup &es, const std::string &d1Name, const std::string &d2Name, const std::vector< reco::VertexCompositeCandidate > *v0Collection, const std::string &searchList="cfp")
 
 BPHDecayToV0Builder (const edm::EventSetup &es, const std::string &d1Name, const std::string &d2Name, const std::vector< reco::VertexCompositePtrCandidate > *vpCollection, const std::string &searchList="cfp")
 
 BPHDecayToV0Builder (const BPHDecayToV0Builder &x)=delete
 
std::vector
< BPHPlusMinusConstCandPtr
build ()
 build candidates More...
 
double getEtaMax () const
 
double getPtMin () const
 get current cuts More...
 
BPHDecayToV0Builderoperator= (const BPHDecayToV0Builder &x)=delete
 
void setEtaMax (double eta)
 
void setPtMin (double pt)
 set cuts More...
 
 ~BPHDecayToV0Builder () override
 
- Public Member Functions inherited from BPHDecayGenericBuilder
 BPHDecayGenericBuilder (const edm::EventSetup &es, BPHMassFitSelect *mfs=nullptr)
 
 BPHDecayGenericBuilder (const BPHDecayGenericBuilder &x)=delete
 
double getMassFitMax () const
 
double getMassFitMin () const
 
double getMassMax () const
 
double getMassMin () const
 get current cuts More...
 
double getMinPDiff ()
 
double getProbMin () const
 
BPHDecayGenericBuilderoperator= (const BPHDecayGenericBuilder &x)=delete
 
void setMassFitMax (double m)
 
void setMassFitMin (double m)
 
void setMassFitRange (double mMin, double mMax)
 
void setMassMax (double m)
 
void setMassMin (double m)
 set cuts More...
 
void setMassRange (double mMin, double mMax)
 
void setMinPDiff (double mpd)
 track min p difference More...
 
void setProbMin (double p)
 
virtual ~BPHDecayGenericBuilder ()
 

Protected Member Functions

virtual BPHPlusMinusCandidatePtr buildCandidate (const reco::Candidate *c1, const reco::Candidate *c2, const void *v0, v0Type type)=0
 
virtual void buildFromBPHGenericCollection ()=0
 build candidates and link to V0 More...
 
template<class T >
void buildFromV0 (const T *v0Collection, v0Type type)
 
void v0Clear ()
 

Protected Attributes

std::vector
< BPHPlusMinusConstCandPtr
cList
 
double etaMax
 
const
BPHRecoBuilder::BPHGenericCollection
p1Collection
 
std::string p1Name
 
const
BPHRecoBuilder::BPHGenericCollection
p2Collection
 
std::string p2Name
 
double ptMin
 
const std::vector
< reco::VertexCompositePtrCandidate > * 
rCollection
 
std::string sList
 
std::map< const
BPHRecoCandidate *, const
V0Info * > 
v0Map
 
const std::vector
< reco::VertexCompositeCandidate > * 
vCollection
 
- Protected Attributes inherited from BPHDecayGenericBuilder
BPHChi2Selectchi2Sel
 
const edm::EventSetupevSetup
 
BPHMassSelectmassSel
 
BPHMassFitSelectmFitSel
 
double minPDiff
 
bool updated
 

Detailed Description

Description: Class to build neutral particles decaying to a V0, starting from reco::Candidates or already reconstructed V0s

Author
Paolo Ronchese INFN Padova

Definition at line 41 of file BPHDecayToV0Builder.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

BPHDecayToV0Builder::BPHDecayToV0Builder ( const edm::EventSetup es,
const std::string &  d1Name,
const std::string &  d2Name,
const BPHRecoBuilder::BPHGenericCollection d1Collection,
const BPHRecoBuilder::BPHGenericCollection d2Collection 
)

Constructor

Definition at line 35 of file BPHDecayToV0Builder.cc.

41  p1Name(d1Name),
42  p2Name(d2Name),
43  p1Collection(d1Collection),
44  p2Collection(d2Collection),
45  vCollection(nullptr),
46  rCollection(nullptr),
47  sList(""),
48  ptMin(0.0),
49  etaMax(100.0) {}
BPHDecayGenericBuilder(const edm::EventSetup &es, BPHMassFitSelect *mfs=nullptr)
const BPHRecoBuilder::BPHGenericCollection * p2Collection
const BPHRecoBuilder::BPHGenericCollection * p1Collection
const std::vector< reco::VertexCompositeCandidate > * vCollection
const std::vector< reco::VertexCompositePtrCandidate > * rCollection
BPHDecayToV0Builder::BPHDecayToV0Builder ( const edm::EventSetup es,
const std::string &  d1Name,
const std::string &  d2Name,
const std::vector< reco::VertexCompositeCandidate > *  v0Collection,
const std::string &  searchList = "cfp" 
)

Definition at line 51 of file BPHDecayToV0Builder.cc.

57  p1Name(d1Name),
58  p2Name(d2Name),
59  p1Collection(nullptr),
60  p2Collection(nullptr),
61  vCollection(v0Collection),
62  rCollection(nullptr),
64  ptMin(0.0),
65  etaMax(100.0) {}
BPHDecayGenericBuilder(const edm::EventSetup &es, BPHMassFitSelect *mfs=nullptr)
const BPHRecoBuilder::BPHGenericCollection * p2Collection
const BPHRecoBuilder::BPHGenericCollection * p1Collection
const std::vector< reco::VertexCompositeCandidate > * vCollection
const std::vector< reco::VertexCompositePtrCandidate > * rCollection
BPHDecayToV0Builder::BPHDecayToV0Builder ( const edm::EventSetup es,
const std::string &  d1Name,
const std::string &  d2Name,
const std::vector< reco::VertexCompositePtrCandidate > *  vpCollection,
const std::string &  searchList = "cfp" 
)

Definition at line 67 of file BPHDecayToV0Builder.cc.

73  p1Name(d1Name),
74  p2Name(d2Name),
75  p1Collection(nullptr),
76  p2Collection(nullptr),
77  vCollection(nullptr),
78  rCollection(vpCollection),
80  ptMin(0.0),
81  etaMax(100.0) {}
BPHDecayGenericBuilder(const edm::EventSetup &es, BPHMassFitSelect *mfs=nullptr)
const BPHRecoBuilder::BPHGenericCollection * p2Collection
const BPHRecoBuilder::BPHGenericCollection * p1Collection
const std::vector< reco::VertexCompositeCandidate > * vCollection
const std::vector< reco::VertexCompositePtrCandidate > * rCollection
BPHDecayToV0Builder::BPHDecayToV0Builder ( const BPHDecayToV0Builder x)
delete
BPHDecayToV0Builder::~BPHDecayToV0Builder ( )
override

Destructor

Definition at line 86 of file BPHDecayToV0Builder.cc.

References v0Clear().

Member Function Documentation

vector< BPHPlusMinusConstCandPtr > BPHDecayToV0Builder::build ( )

build candidates

Operations

Definition at line 91 of file BPHDecayToV0Builder.cc.

References buildFromBPHGenericCollection(), buildFromV0(), cList, p1Collection, p2Collection, rCollection, BPHDecayGenericBuilder::updated, v0Clear(), vCollection, VertexCompositeCandidate, and VertexCompositePtrCandidate.

Referenced by BPHWriteSpecificDecay::fill().

91  {
92  if (updated)
93  return cList;
94  cList.clear();
95  v0Clear();
96 
97  if ((p1Collection != nullptr) && (p2Collection != nullptr))
99  else if (vCollection != nullptr)
101  else if (rCollection != nullptr)
103 
104  updated = true;
105  return cList;
106 }
virtual void buildFromBPHGenericCollection()=0
build candidates and link to V0
const BPHRecoBuilder::BPHGenericCollection * p2Collection
const BPHRecoBuilder::BPHGenericCollection * p1Collection
std::vector< BPHPlusMinusConstCandPtr > cList
const std::vector< reco::VertexCompositeCandidate > * vCollection
void buildFromV0(const T *v0Collection, v0Type type)
const std::vector< reco::VertexCompositePtrCandidate > * rCollection
virtual BPHPlusMinusCandidatePtr BPHDecayToV0Builder::buildCandidate ( const reco::Candidate c1,
const reco::Candidate c2,
const void *  v0,
v0Type  type 
)
protectedpure virtual
virtual void BPHDecayToV0Builder::buildFromBPHGenericCollection ( )
protectedpure virtual

build candidates and link to V0

Implemented in BPHDecayToV0DiffMassBuilder, and BPHDecayToV0SameMassBuilder.

Referenced by build().

template<class T >
void BPHDecayToV0Builder::buildFromV0 ( const T v0Collection,
v0Type  type 
)
protected

Definition at line 127 of file BPHDecayToV0Builder.cc.

References BPHMassSelect::accept(), BPHChi2Select::accept(), buildCandidate(), BPHDecayGenericBuilder::chi2Sel, cList, reco::Candidate::daughter(), runTauDisplay::dr, etaMax, info(), BPHDecayGenericBuilder::massSel, reco::Candidate::p4(), ptMin, BPHDecayToV0Builder::V0Info::type, BPHDecayToV0Builder::V0Info::v0, and v0Map.

Referenced by build().

127  {
128  int iv0;
129  int nv0 = v0Collection->size();
130  cList.reserve(nv0);
131 
132  // cycle over V0 collection
133  for (iv0 = 0; iv0 < nv0; ++iv0) {
134  const typename T::value_type& v0 = v0Collection->at(iv0);
135 
136  // every reco::VertexCompositeCandidate must have exactly two daughters
137  if (v0.numberOfDaughters() != 2)
138  continue;
139  const reco::Candidate* dr = v0.daughter(0);
140  const reco::Candidate* dl = v0.daughter(1);
141 
142  // filters
143  if (dr->p4().pt() < ptMin)
144  continue;
145  if (dl->p4().pt() < ptMin)
146  continue;
147  if (fabs(dr->p4().eta()) > etaMax)
148  continue;
149  if (fabs(dl->p4().eta()) > etaMax)
150  continue;
151 
152  BPHPlusMinusCandidatePtr cand = buildCandidate(dr, dl, &v0, type);
153  BPHPlusMinusCandidate* cptr = cand.get();
154  if (cand->daughters().size() != 2)
155  continue;
156  if (!massSel->accept(*cand))
157  continue;
158  if ((chi2Sel != nullptr) && (!chi2Sel->accept(*cand)))
159  continue;
160 
161  cList.push_back(cand);
162  V0Info* info = new V0Info;
163  info->type = type;
164  info->v0 = &v0;
165  v0Map[cptr] = info;
166  }
167 
168  return;
169 }
static const TGPicture * info(bool iBackgroundIsBlack)
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
bool accept(const BPHDecayVertex &cand) const override
select vertex
Definition: BPHChi2Select.h:48
bool accept(const BPHDecayMomentum &cand) const override
select particle
Definition: BPHMassSelect.h:48
BPHGenericPtr< BPHPlusMinusCandidate >::type BPHPlusMinusCandidatePtr
std::map< const BPHRecoCandidate *, const V0Info * > v0Map
std::vector< BPHPlusMinusConstCandPtr > cList
virtual BPHPlusMinusCandidatePtr buildCandidate(const reco::Candidate *c1, const reco::Candidate *c2, const void *v0, v0Type type)=0
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
double BPHDecayToV0Builder::getEtaMax ( ) const

Definition at line 124 of file BPHDecayToV0Builder.cc.

References etaMax.

124 { return etaMax; }
double BPHDecayToV0Builder::getPtMin ( ) const

get current cuts

Definition at line 122 of file BPHDecayToV0Builder.cc.

References ptMin.

122 { return ptMin; }
BPHDecayToV0Builder& BPHDecayToV0Builder::operator= ( const BPHDecayToV0Builder x)
delete
void BPHDecayToV0Builder::setEtaMax ( double  eta)
void BPHDecayToV0Builder::setPtMin ( double  pt)
void BPHDecayToV0Builder::v0Clear ( )
protected

Definition at line 171 of file BPHDecayToV0Builder.cc.

References v0Map.

Referenced by build(), and ~BPHDecayToV0Builder().

171  {
172  map<const BPHRecoCandidate*, const V0Info*>::iterator iter = v0Map.begin();
173  map<const BPHRecoCandidate*, const V0Info*>::iterator iend = v0Map.end();
174  while (iter != iend)
175  delete iter++->second;
176  return;
177 }
std::map< const BPHRecoCandidate *, const V0Info * > v0Map

Member Data Documentation

std::vector<BPHPlusMinusConstCandPtr> BPHDecayToV0Builder::cList
protected
double BPHDecayToV0Builder::etaMax
protected
const BPHRecoBuilder::BPHGenericCollection* BPHDecayToV0Builder::p1Collection
protected
std::string BPHDecayToV0Builder::p1Name
protected
const BPHRecoBuilder::BPHGenericCollection* BPHDecayToV0Builder::p2Collection
protected
std::string BPHDecayToV0Builder::p2Name
protected
double BPHDecayToV0Builder::ptMin
protected
const std::vector<reco::VertexCompositePtrCandidate>* BPHDecayToV0Builder::rCollection
protected

Definition at line 97 of file BPHDecayToV0Builder.h.

Referenced by build().

std::string BPHDecayToV0Builder::sList
protected

Definition at line 98 of file BPHDecayToV0Builder.h.

Referenced by BPHDecayToV0DiffMassBuilder::buildCandidate().

std::map<const BPHRecoCandidate*, const V0Info*> BPHDecayToV0Builder::v0Map
protected

Definition at line 103 of file BPHDecayToV0Builder.h.

Referenced by buildFromV0(), and v0Clear().

const std::vector<reco::VertexCompositeCandidate>* BPHDecayToV0Builder::vCollection
protected

Definition at line 96 of file BPHDecayToV0Builder.h.

Referenced by build().