CMS 3D CMS Logo

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

#include <BPHDecayVertex.h>

Inheritance diagram for BPHDecayVertex:
BPHDecayMomentum BPHKinematicFit BPHPlusMinusVertex BPHRecoCandidate BPHPlusMinusCandidate BPHPlusMinusCandidate

Public Member Functions

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...
 
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 () const
 get reconstructed vertex More...
 
 ~BPHDecayVertex () override
 
- Public Member Functions inherited from BPHDecayMomentum
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
 
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
 
virtual const reco::CandidateoriginalReco (const reco::Candidate *daug) const
 get the original particle from the clone More...
 
virtual ~BPHDecayMomentum ()
 

Protected Member Functions

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)
 add a previously reconstructed particle giving it a name More...
 
 BPHDecayVertex (const edm::EventSetup *es)
 
 BPHDecayVertex (const BPHDecayVertex *ptr, const edm::EventSetup *es)
 
void setNotUpdated () const override
 
- 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)
 add a previously reconstructed particle giving it a name More...
 
 BPHDecayMomentum ()
 
 BPHDecayMomentum (const std::map< std::string, Component > &daugMap)
 
 BPHDecayMomentum (const std::map< std::string, Component > &daugMap, const std::map< std::string, BPHRecoConstCandPtr > compMap)
 
const std::vector< Component > & componentList () const
 

Private Member Functions

virtual void fitVertex () const
 
virtual void tTracks () const
 

Private Attributes

const edm::EventSetupevSetup
 
reco::Vertex fittedVertex
 
bool oldTracks
 
bool oldVertex
 
std::vector< const reco::Track * > rTracks
 
std::map< const reco::Candidate *, std::string > searchMap
 
std::map< const reco::Candidate *, const reco::Track * > tkMap
 
std::vector< reco::TransientTracktrTracks
 
std::map< const reco::Candidate *, reco::TransientTrack * > ttMap
 
bool validTks
 

Detailed Description

Description: Mid-level base class to reconstruct decay vertex

Author
Paolo Ronchese INFN Padova

Definition at line 42 of file BPHDecayVertex.h.

Constructor & Destructor Documentation

BPHDecayVertex::~BPHDecayVertex ( )
override

Constructor is protected this object can exist only as part of a derived classDestructor

Definition at line 74 of file BPHDecayVertex.cc.

74 {}
BPHDecayVertex::BPHDecayVertex ( const edm::EventSetup es)
protected

Definition at line 44 of file BPHDecayVertex.cc.

45  : evSetup(es), oldTracks(true), oldVertex(true), validTks(false) {}
const edm::EventSetup * evSetup
BPHDecayVertex::BPHDecayVertex ( const BPHDecayVertex ptr,
const edm::EventSetup es 
)
protected

Definition at line 47 of file BPHDecayVertex.cc.

References HltBtagPostValidation_cff::c, BPHDecayMomentum::Component::cand, BPHDecayMomentum::componentList(), BPHDecayMomentum::daughComp(), BPHDecayMomentum::daughters(), BPHDecayMomentum::dMap, mps_fire::i, dqmiolumiharvest::j, list(), visualization-live-secondInstance_cfg::m, dqmiodumpmetadata::n, BPHDecayMomentum::originalReco(), BPHDecayMomentum::Component::searchList, and searchMap.

48  : evSetup(es), oldTracks(true), oldVertex(true), validTks(false) {
49  map<const reco::Candidate*, const reco::Candidate*> iMap;
50  const vector<const reco::Candidate*>& daug = daughters();
51  const vector<Component>& list = ptr->componentList();
52  int i;
53  int n = daug.size();
54  for (i = 0; i < n; ++i) {
55  const reco::Candidate* cand = daug[i];
56  iMap[originalReco(cand)] = cand;
57  }
58  for (i = 0; i < n; ++i) {
59  const Component& c = list[i];
60  searchMap[iMap[c.cand]] = c.searchList;
61  }
62  const vector<BPHRecoConstCandPtr>& dComp = daughComp();
63  int j;
64  int m = dComp.size();
65  for (j = 0; j < m; ++j) {
66  const map<const reco::Candidate*, string>& dMap = dComp[j]->searchMap;
67  searchMap.insert(dMap.begin(), dMap.end());
68  }
69 }
std::map< std::string, const reco::Candidate * > dMap
std::map< const reco::Candidate *, std::string > searchMap
virtual const std::vector< const reco::Candidate * > & daughters() const
const std::vector< Component > & componentList() const
virtual const reco::Candidate * originalReco(const reco::Candidate *daug) const
get the original particle from the clone
const edm::EventSetup * evSetup
virtual const std::vector< BPHRecoConstCandPtr > & daughComp() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run

Member Function Documentation

virtual void BPHDecayVertex::addV ( const std::string &  name,
const reco::Candidate daug,
const std::string &  searchList,
double  mass 
)
protectedvirtual

add a simple particle giving it a name and specifying an option list to search for the associated track

Referenced by BPHKinematicFit::p4().

virtual void BPHDecayVertex::addV ( const std::string &  name,
const BPHRecoConstCandPtr comp 
)
protectedvirtual

add a previously reconstructed particle giving it a name

void BPHDecayVertex::fitVertex ( ) const
privatevirtual

Definition at line 192 of file BPHDecayVertex.cc.

References fittedVertex, oldTracks, oldVertex, trTracks, tTracks(), and KalmanVertexFitter::vertex().

Referenced by validTracks(), validVertex(), and vertex().

192  {
193  oldVertex = false;
194  if (oldTracks)
195  tTracks();
196  if (trTracks.size() < 2)
197  return;
198  KalmanVertexFitter kvf(true);
199  TransientVertex tv = kvf.vertex(trTracks);
200  fittedVertex = tv;
201  return;
202 }
virtual void tTracks() const
std::vector< reco::TransientTrack > trTracks
reco::Vertex fittedVertex
const reco::Track * BPHDecayVertex::getTrack ( const reco::Candidate cand) const

get Track for a daughter

Definition at line 103 of file BPHDecayVertex.cc.

References oldTracks, tkMap, and tTracks().

103  {
104  if (oldTracks)
105  tTracks();
106  map<const reco::Candidate*, const reco::Track*>::const_iterator iter = tkMap.find(cand);
107  map<const reco::Candidate*, const reco::Track*>::const_iterator iend = tkMap.end();
108  return (iter != iend ? iter->second : nullptr);
109 }
virtual void tTracks() const
std::map< const reco::Candidate *, const reco::Track * > tkMap
const string & BPHDecayVertex::getTrackSearchList ( const reco::Candidate cand) const

retrieve track search list

Definition at line 125 of file BPHDecayVertex.cc.

References searchMap.

125  {
126  static string dum = "";
127  map<const reco::Candidate*, string>::const_iterator iter = searchMap.find(cand);
128  if (iter != searchMap.end())
129  return iter->second;
130  return dum;
131 }
std::map< const reco::Candidate *, std::string > searchMap
reco::TransientTrack * BPHDecayVertex::getTransientTrack ( const reco::Candidate cand) const

get TransientTrack for a daughter

Definition at line 117 of file BPHDecayVertex.cc.

References oldTracks, ttMap, and tTracks().

Referenced by BPHKinematicFit::buildParticles().

117  {
118  if (oldTracks)
119  tTracks();
120  map<const reco::Candidate*, reco::TransientTrack*>::const_iterator iter = ttMap.find(cand);
121  map<const reco::Candidate*, reco::TransientTrack*>::const_iterator iend = ttMap.end();
122  return (iter != iend ? iter->second : nullptr);
123 }
virtual void tTracks() const
std::map< const reco::Candidate *, reco::TransientTrack * > ttMap
void BPHDecayVertex::setNotUpdated ( ) const
overrideprotectedvirtual

Reimplemented from BPHDecayMomentum.

Reimplemented in BPHKinematicFit, BPHPlusMinusCandidate, and BPHPlusMinusVertex.

Definition at line 146 of file BPHDecayVertex.cc.

References oldTracks, oldVertex, BPHDecayMomentum::setNotUpdated(), and validTks.

Referenced by BPHPlusMinusVertex::setNotUpdated(), and BPHKinematicFit::setNotUpdated().

146  {
148  oldTracks = oldVertex = true;
149  validTks = false;
150  return;
151 }
virtual void setNotUpdated() const
const vector< const reco::Track * > & BPHDecayVertex::tracks ( void  ) const

get list of Tracks

Definition at line 97 of file BPHDecayVertex.cc.

References oldTracks, rTracks, and tTracks().

97  {
98  if (oldTracks)
99  tTracks();
100  return rTracks;
101 }
virtual void tTracks() const
std::vector< const reco::Track * > rTracks
const vector< reco::TransientTrack > & BPHDecayVertex::transientTracks ( ) const

get list of TransientTracks

Definition at line 111 of file BPHDecayVertex.cc.

References oldTracks, trTracks, and tTracks().

Referenced by BPHPlusMinusVertex::computeApp().

111  {
112  if (oldTracks)
113  tTracks();
114  return trTracks;
115 }
virtual void tTracks() const
std::vector< reco::TransientTrack > trTracks
void BPHDecayVertex::tTracks ( ) const
privatevirtual

Definition at line 153 of file BPHDecayVertex.cc.

References TransientTrackBuilder::build(), reco::Candidate::charge(), BPHDecayMomentum::daughFull(), evSetup, edm::EventSetup::get(), BPHTrackReference::getTrack(), dqmiodumpmetadata::n, oldTracks, rTracks, searchMap, tkMap, trTracks, ttMap, and validTks.

Referenced by fitVertex(), getTrack(), getTransientTrack(), tracks(), and transientTracks().

153  {
154  oldTracks = false;
155  rTracks.clear();
156  trTracks.clear();
157  tkMap.clear();
158  ttMap.clear();
160  evSetup->get<TransientTrackRecord>().get("TransientTrackBuilder", ttB);
161  const vector<const reco::Candidate*>& dL = daughFull();
162  int n = dL.size();
163  trTracks.reserve(n);
164  validTks = true;
165  while (n--) {
166  const reco::Candidate* rp = dL[n];
167  tkMap[rp] = nullptr;
168  ttMap[rp] = nullptr;
169  if (!rp->charge())
170  continue;
171  const reco::Track* tp;
172  const char* searchList = "cfhp";
173  map<const reco::Candidate*, string>::const_iterator iter = searchMap.find(rp);
174  if (iter != searchMap.end())
175  searchList = iter->second.c_str();
176  tp = BPHTrackReference::getTrack(*rp, searchList);
177  if (tp == nullptr) {
178  edm::LogPrint("DataNotFound") << "BPHDecayVertex::tTracks: "
179  << "no track for reco::(PF)Candidate";
180  validTks = false;
181  continue;
182  }
183  rTracks.push_back(tp);
184  trTracks.push_back(ttB->build(tp));
185  reco::TransientTrack* ttp = &trTracks.back();
186  tkMap[rp] = tp;
187  ttMap[rp] = ttp;
188  }
189  return;
190 }
reco::TransientTrack build(const reco::Track *p) const
std::vector< reco::TransientTrack > trTracks
std::map< const reco::Candidate *, std::string > searchMap
static const reco::Track * getTrack(const reco::Candidate &rc, const char *modeList="cfhbpmnigse", char *modeFlag=0)
std::map< const reco::Candidate *, reco::TransientTrack * > ttMap
std::map< const reco::Candidate *, const reco::Track * > tkMap
const edm::EventSetup * evSetup
virtual int charge() const =0
electric charge
T get() const
Definition: EventSetup.h:73
virtual const std::vector< const reco::Candidate * > & daughFull() const
std::vector< const reco::Track * > rTracks
bool BPHDecayVertex::validTracks ( ) const
virtual

check for valid reconstructed vertex

Operations

Definition at line 79 of file BPHDecayVertex.cc.

References fitVertex(), oldVertex, and validTks.

79  {
80  if (oldVertex)
81  fitVertex();
82  return validTks;
83 }
virtual void fitVertex() const
bool BPHDecayVertex::validVertex ( ) const
virtual

Definition at line 85 of file BPHDecayVertex.cc.

References fittedVertex, fitVertex(), reco::Vertex::isValid(), oldVertex, and validTks.

85  {
86  if (oldVertex)
87  fitVertex();
88  return validTks && fittedVertex.isValid();
89 }
bool isValid() const
Tells whether the vertex is valid.
Definition: Vertex.h:71
virtual void fitVertex() const
reco::Vertex fittedVertex
const reco::Vertex & BPHDecayVertex::vertex ( ) const
virtual

get reconstructed vertex

Definition at line 91 of file BPHDecayVertex.cc.

References fittedVertex, fitVertex(), and oldVertex.

Referenced by Tau.Tau::dxy(), BPHWriteSpecificDecay::fill(), and BPHChi2Select::~BPHChi2Select().

91  {
92  if (oldVertex)
93  fitVertex();
94  return fittedVertex;
95 }
virtual void fitVertex() const
reco::Vertex fittedVertex

Member Data Documentation

const edm::EventSetup* BPHDecayVertex::evSetup
private

Definition at line 94 of file BPHDecayVertex.h.

Referenced by tTracks().

reco::Vertex BPHDecayVertex::fittedVertex
mutableprivate

Definition at line 107 of file BPHDecayVertex.h.

Referenced by fitVertex(), validVertex(), and vertex().

bool BPHDecayVertex::oldTracks
mutableprivate
bool BPHDecayVertex::oldVertex
mutableprivate

Definition at line 101 of file BPHDecayVertex.h.

Referenced by fitVertex(), setNotUpdated(), validTracks(), validVertex(), and vertex().

std::vector<const reco::Track*> BPHDecayVertex::rTracks
mutableprivate

Definition at line 103 of file BPHDecayVertex.h.

Referenced by tracks(), and tTracks().

std::map<const reco::Candidate*, std::string> BPHDecayVertex::searchMap
private

Definition at line 97 of file BPHDecayVertex.h.

Referenced by BPHDecayVertex(), getTrackSearchList(), and tTracks().

std::map<const reco::Candidate*, const reco::Track*> BPHDecayVertex::tkMap
mutableprivate

Definition at line 105 of file BPHDecayVertex.h.

Referenced by getTrack(), and tTracks().

std::vector<reco::TransientTrack> BPHDecayVertex::trTracks
mutableprivate

Definition at line 104 of file BPHDecayVertex.h.

Referenced by fitVertex(), transientTracks(), and tTracks().

std::map<const reco::Candidate*, reco::TransientTrack*> BPHDecayVertex::ttMap
mutableprivate

Definition at line 106 of file BPHDecayVertex.h.

Referenced by getTransientTrack(), and tTracks().

bool BPHDecayVertex::validTks
mutableprivate

Definition at line 102 of file BPHDecayVertex.h.

Referenced by setNotUpdated(), tTracks(), validTracks(), and validVertex().