CMS 3D CMS Logo

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:
BPHDecayGenericBuilderBase BPHDecayGenericBuilder< BPHPlusMinusCandidate > BPHDecayGenericBuilderBase BPHDecayToV0DiffMassBuilder BPHDecayToV0SameMassBuilder BPHLambda0ToPPiBuilder BPHK0sToPiPiBuilder

Classes

struct  V0Info
 

Public Types

enum  v0Type { VertexCompositeCandidate, VertexCompositePtrCandidate }
 
- Public Types inherited from BPHDecayGenericBuilder< BPHPlusMinusCandidate >
typedef BPHPlusMinusCandidate ::const_pointer prod_ptr
 

Public Member Functions

 BPHDecayToV0Builder (const BPHEventSetupWrapper &es, const std::string &daug1Name, const std::string &daug2Name, const BPHRecoBuilder::BPHGenericCollection *daug1Collection, const BPHRecoBuilder::BPHGenericCollection *daug2Collection)
 
 BPHDecayToV0Builder (const BPHEventSetupWrapper &es, const std::string &daug1Name, const std::string &daug2Name, const std::vector< reco::VertexCompositeCandidate > *v0Collection, const std::string &searchList="cfp")
 
 BPHDecayToV0Builder (const BPHEventSetupWrapper &es, const std::string &daug1Name, const std::string &daug2Name, const std::vector< reco::VertexCompositePtrCandidate > *vpCollection, const std::string &searchList="cfp")
 
 BPHDecayToV0Builder (const BPHDecayToV0Builder &x)=delete
 
BPHDecayToV0Builderoperator= (const BPHDecayToV0Builder &x)=delete
 
 ~BPHDecayToV0Builder () override
 
- Public Member Functions inherited from BPHDecayGenericBuilderBase
 BPHDecayGenericBuilderBase ()
 
 BPHDecayGenericBuilderBase (const BPHEventSetupWrapper &es, BPHMassFitSelect *mfs=new BPHMassFitSelect(-2.0e+06, -1.0e+06))
 
 BPHDecayGenericBuilderBase (const BPHDecayGenericBuilderBase &x)=delete
 
double getMassFitMax () const
 
double getMassFitMin () const
 
double getMassMax () const
 
double getMassMin () const
 get current cuts More...
 
double getMinPDiff ()
 
double getProbMin () const
 
BPHDecayGenericBuilderBaseoperator= (const BPHDecayGenericBuilderBase &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 ~BPHDecayGenericBuilderBase ()
 
- Public Member Functions inherited from BPHDecayGenericBuilder< BPHPlusMinusCandidate >
 BPHDecayGenericBuilder (const BPHEventSetupWrapper &es, BPHMassFitSelect *mfs)
 
 BPHDecayGenericBuilder (const BPHDecayGenericBuilder &x)=delete
 
virtual std::vector< prod_ptrbuild ()
 build candidates More...
 
BPHDecayGenericBuilderoperator= (const BPHDecayGenericBuilder &x)=delete
 
 ~BPHDecayGenericBuilder () override=default
 

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 fillRecList () override
 build candidates More...
 
void v0Clear ()
 
- Protected Member Functions inherited from BPHDecayGenericBuilder< BPHPlusMinusCandidate >
 BPHDecayGenericBuilder ()
 

Protected Attributes

const BPHRecoBuilder::BPHGenericCollectionp1Collection
 
std::string p1Name
 
const BPHRecoBuilder::BPHGenericCollectionp2Collection
 
std::string p2Name
 
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 BPHDecayGenericBuilderBase
BPHChi2Selectchi2Sel
 
const BPHEventSetupWrapperevSetup
 
BPHMassSelectmassSel
 
BPHMassFitSelectmFitSel
 
double minPDiff
 
bool outdated
 
- Protected Attributes inherited from BPHDecayGenericBuilder< BPHPlusMinusCandidate >
std::vector< prod_ptrrecList
 

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 42 of file BPHDecayToV0Builder.h.

Member Enumeration Documentation

◆ v0Type

Constructor & Destructor Documentation

◆ BPHDecayToV0Builder() [1/4]

BPHDecayToV0Builder::BPHDecayToV0Builder ( const BPHEventSetupWrapper es,
const std::string &  daug1Name,
const std::string &  daug2Name,
const BPHRecoBuilder::BPHGenericCollection daug1Collection,
const BPHRecoBuilder::BPHGenericCollection daug2Collection 
)

Constructor

◆ BPHDecayToV0Builder() [2/4]

BPHDecayToV0Builder::BPHDecayToV0Builder ( const BPHEventSetupWrapper es,
const std::string &  daug1Name,
const std::string &  daug2Name,
const std::vector< reco::VertexCompositeCandidate > *  v0Collection,
const std::string &  searchList = "cfp" 
)

◆ BPHDecayToV0Builder() [3/4]

BPHDecayToV0Builder::BPHDecayToV0Builder ( const BPHEventSetupWrapper es,
const std::string &  daug1Name,
const std::string &  daug2Name,
const std::vector< reco::VertexCompositePtrCandidate > *  vpCollection,
const std::string &  searchList = "cfp" 
)

◆ BPHDecayToV0Builder() [4/4]

BPHDecayToV0Builder::BPHDecayToV0Builder ( const BPHDecayToV0Builder x)
delete

◆ ~BPHDecayToV0Builder()

BPHDecayToV0Builder::~BPHDecayToV0Builder ( )
override

Destructor

Definition at line 81 of file BPHDecayToV0Builder.cc.

References v0Clear().

Member Function Documentation

◆ buildCandidate()

virtual BPHPlusMinusCandidatePtr BPHDecayToV0Builder::buildCandidate ( const reco::Candidate c1,
const reco::Candidate c2,
const void *  v0,
v0Type  type 
)
protectedpure virtual

◆ buildFromBPHGenericCollection()

virtual void BPHDecayToV0Builder::buildFromBPHGenericCollection ( )
protectedpure virtual

build candidates and link to V0

Implemented in BPHDecayToV0DiffMassBuilder, and BPHDecayToV0SameMassBuilder.

Referenced by fillRecList().

◆ buildFromV0()

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

Definition at line 100 of file BPHDecayToV0Builder.cc.

References BPHMassSelect::accept(), BPHChi2Select::accept(), buildCandidate(), BPHDecayGenericBuilderBase::chi2Sel, l1ctLayer1_cff::dr, info(), BPHDecayGenericBuilderBase::massSel, BPHDecayGenericBuilder< BPHPlusMinusCandidate >::recList, V0Monitor_cff::v0, and v0Map.

Referenced by fillRecList().

100  {
101  int iv0;
102  int nv0 = v0Collection->size();
103  recList.reserve(nv0);
104 
105  // cycle over V0 collection
106  for (iv0 = 0; iv0 < nv0; ++iv0) {
107  const typename T::value_type& v0 = v0Collection->at(iv0);
108 
109  // every reco::VertexCompositeCandidate must have exactly two daughters
110  if (v0.numberOfDaughters() != 2)
111  continue;
112  const reco::Candidate* dr = v0.daughter(0);
113  const reco::Candidate* dl = v0.daughter(1);
114 
115  // filters
117  if (cand.get() == nullptr)
118  continue;
119  BPHPlusMinusCandidate* cptr = cand.get();
120  if (cand->daughters().size() != 2)
121  continue;
122  if (!massSel->accept(*cand))
123  continue;
124  if ((chi2Sel != nullptr) && (!chi2Sel->accept(*cand)))
125  continue;
126 
127  recList.push_back(cand);
128  V0Info* info = new V0Info;
129  info->type = type;
130  info->v0 = &v0;
131  v0Map[cptr] = info;
132  }
133 
134  return;
135 }
static const TGPicture * info(bool iBackgroundIsBlack)
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
virtual BPHPlusMinusCandidatePtr buildCandidate(const reco::Candidate *c1, const reco::Candidate *c2, const void *v0, v0Type type)=0

◆ fillRecList()

void BPHDecayToV0Builder::fillRecList ( )
overrideprotectedvirtual

build candidates

Implements BPHDecayGenericBuilderBase.

Reimplemented in BPHDecayToV0DiffMassBuilder, and BPHDecayToV0SameMassBuilder.

Definition at line 86 of file BPHDecayToV0Builder.cc.

References buildFromBPHGenericCollection(), buildFromV0(), p1Collection, p2Collection, rCollection, v0Clear(), vCollection, VertexCompositeCandidate, and VertexCompositePtrCandidate.

Referenced by BPHDecayToV0SameMassBuilder::fillRecList(), and BPHDecayToV0DiffMassBuilder::fillRecList().

86  {
87  v0Clear();
88 
89  if ((p1Collection != nullptr) && (p2Collection != nullptr))
91  else if (vCollection != nullptr)
93  else if (rCollection != nullptr)
95 
96  return;
97 }
virtual void buildFromBPHGenericCollection()=0
build candidates and link to V0
const BPHRecoBuilder::BPHGenericCollection * p2Collection
const BPHRecoBuilder::BPHGenericCollection * p1Collection
const std::vector< reco::VertexCompositeCandidate > * vCollection
void buildFromV0(const T *v0Collection, v0Type type)
const std::vector< reco::VertexCompositePtrCandidate > * rCollection

◆ operator=()

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

◆ v0Clear()

void BPHDecayToV0Builder::v0Clear ( )
protected

Definition at line 137 of file BPHDecayToV0Builder.cc.

References v0Map.

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

137  {
138  map<const BPHRecoCandidate*, const V0Info*>::iterator iter = v0Map.begin();
139  map<const BPHRecoCandidate*, const V0Info*>::iterator iend = v0Map.end();
140  while (iter != iend)
141  delete iter++->second;
142  return;
143 }
std::map< const BPHRecoCandidate *, const V0Info * > v0Map

Member Data Documentation

◆ p1Collection

const BPHRecoBuilder::BPHGenericCollection* BPHDecayToV0Builder::p1Collection
protected

Definition at line 81 of file BPHDecayToV0Builder.h.

Referenced by fillRecList().

◆ p1Name

std::string BPHDecayToV0Builder::p1Name
protected

◆ p2Collection

const BPHRecoBuilder::BPHGenericCollection* BPHDecayToV0Builder::p2Collection
protected

Definition at line 82 of file BPHDecayToV0Builder.h.

Referenced by fillRecList().

◆ p2Name

std::string BPHDecayToV0Builder::p2Name
protected

◆ rCollection

const std::vector<reco::VertexCompositePtrCandidate>* BPHDecayToV0Builder::rCollection
protected

Definition at line 84 of file BPHDecayToV0Builder.h.

Referenced by fillRecList().

◆ sList

std::string BPHDecayToV0Builder::sList
protected

Definition at line 85 of file BPHDecayToV0Builder.h.

Referenced by BPHDecayToV0DiffMassBuilder::buildCandidate().

◆ v0Map

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

Definition at line 87 of file BPHDecayToV0Builder.h.

Referenced by buildFromV0(), and v0Clear().

◆ vCollection

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

Definition at line 83 of file BPHDecayToV0Builder.h.

Referenced by fillRecList().