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 84 of file BPHDecayVertex.cc.

84  {
85 }
BPHDecayVertex::BPHDecayVertex ( const edm::EventSetup es)
protected

Definition at line 45 of file BPHDecayVertex.cc.

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

Definition at line 53 of file BPHDecayVertex.cc.

References EnergyCorrector::c, BPHDecayMomentum::Component::cand, BPHDecayMomentum::componentList(), BPHDecayMomentum::daughComp(), BPHDecayMomentum::daughters(), BPHDecayMomentum::dMap, mps_fire::i, list(), funct::m, gen::n, BPHDecayMomentum::originalReco(), BPHDecayMomentum::Component::searchList, and searchMap.

54  :
55  evSetup( es ),
56  oldTracks( true ),
57  oldVertex( true ),
58  validTks( false ) {
59  map<const reco::Candidate*,const reco::Candidate*> iMap;
60  const vector<const reco::Candidate*>& daug = daughters();
61  const vector<Component>& list = ptr->componentList();
62  int i;
63  int n = daug.size();
64  for ( i = 0; i < n; ++i ) {
65  const reco::Candidate* cand = daug[i];
66  iMap[originalReco( cand )] = cand;
67  }
68  for ( i = 0; i < n; ++i ) {
69  const Component& c = list[i];
70  searchMap[iMap[c.cand]] = c.searchList;
71  }
72  const vector<BPHRecoConstCandPtr>& dComp = daughComp();
73  int j;
74  int m = dComp.size();
75  for ( j = 0; j < m; ++j ) {
76  const map<const reco::Candidate*,string>& dMap = dComp[j]->searchMap;
77  searchMap.insert( dMap.begin(), dMap.end() );
78  }
79 }
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
std::map< const reco::Candidate *, std::string > searchMap
std::map< std::string, const reco::Candidate * > dMap
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 219 of file BPHDecayVertex.cc.

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

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

219  {
220  oldVertex = false;
221  if ( oldTracks ) tTracks();
222  if ( trTracks.size() < 2 ) return;
223  KalmanVertexFitter kvf( true );
224  TransientVertex tv = kvf.vertex( trTracks );
225  fittedVertex = tv;
226  return;
227 }
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 114 of file BPHDecayVertex.cc.

References genParticles_cff::map, oldTracks, tkMap, and tTracks().

115  {
116  if ( oldTracks ) tTracks();
117  map<const reco::Candidate*,
118  const reco::Track*>::const_iterator iter = tkMap.find( cand );
119  map<const reco::Candidate*,
120  const reco::Track*>::const_iterator iend = tkMap.end();
121  return ( iter != iend ? iter->second : nullptr );
122 }
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 142 of file BPHDecayVertex.cc.

References searchMap.

143  {
144  static string dum = "";
145  map<const reco::Candidate*,string>::const_iterator iter =
146  searchMap.find( cand );
147  if ( iter != searchMap.end() ) return iter->second;
148  return dum;
149 }
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 131 of file BPHDecayVertex.cc.

References genParticles_cff::map, oldTracks, ttMap, and tTracks().

Referenced by BPHKinematicFit::buildParticles().

132  {
133  if ( oldTracks ) tTracks();
134  map<const reco::Candidate*,
135  reco::TransientTrack*>::const_iterator iter = ttMap.find( cand );
136  map<const reco::Candidate*,
137  reco::TransientTrack*>::const_iterator iend = ttMap.end();
138  return ( iter != iend ? iter->second : nullptr );
139 }
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 171 of file BPHDecayVertex.cc.

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

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

171  {
173  oldTracks = oldVertex = true;
174  validTks = false;
175  return;
176 }
virtual void setNotUpdated() const
const vector< const reco::Track * > & BPHDecayVertex::tracks ( void  ) const

get list of Tracks

Definition at line 108 of file BPHDecayVertex.cc.

References oldTracks, rTracks, and tTracks().

108  {
109  if ( oldTracks ) tTracks();
110  return rTracks;
111 }
virtual void tTracks() const
std::vector< const reco::Track * > rTracks
const vector< reco::TransientTrack > & BPHDecayVertex::transientTracks ( ) const

get list of TransientTracks

Definition at line 125 of file BPHDecayVertex.cc.

References oldTracks, trTracks, and tTracks().

Referenced by BPHPlusMinusVertex::computeApp().

125  {
126  if ( oldTracks ) tTracks();
127  return trTracks;
128 }
virtual void tTracks() const
std::vector< reco::TransientTrack > trTracks
void BPHDecayVertex::tTracks ( ) const
privatevirtual

Definition at line 179 of file BPHDecayVertex.cc.

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

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

179  {
180  oldTracks = false;
181  rTracks.clear();
182  trTracks.clear();
183  tkMap.clear();
184  ttMap.clear();
186  evSetup->get<TransientTrackRecord>().get( "TransientTrackBuilder", ttB );
187  const vector<const reco::Candidate*>& dL = daughFull();
188  int n = dL.size();
189  trTracks.reserve( n );
190  validTks = true;
191  while ( n-- ) {
192  const reco::Candidate* rp = dL[n];
193  tkMap[rp] = nullptr;
194  ttMap[rp] = nullptr;
195  if ( !rp->charge() ) continue;
196  const reco::Track* tp;
197  const char* searchList = "cfhp";
198  map<const reco::Candidate*,string>::const_iterator iter =
199  searchMap.find( rp );
200  if ( iter != searchMap.end() ) searchList = iter->second.c_str();
201  tp = BPHTrackReference::getTrack( *rp, searchList );
202  if ( tp == nullptr ) {
203  edm::LogPrint( "DataNotFound" )
204  << "BPHDecayVertex::tTracks: "
205  << "no track for reco::(PF)Candidate";
206  validTks = false;
207  continue;
208  }
209  rTracks.push_back( tp );
210  trTracks.push_back( ttB->build( tp ) );
211  reco::TransientTrack* ttp = &trTracks.back();
212  tkMap[rp] = tp;
213  ttMap[rp] = ttp;
214  }
215  return;
216 }
reco::TransientTrack build(const reco::Track *p) const
std::vector< reco::TransientTrack > trTracks
static const reco::Track * getTrack(const reco::Candidate &rc, const char *modeList="cfhbpmnigse", char *modeFlag=0)
std::map< const reco::Candidate *, std::string > searchMap
std::map< const reco::Candidate *, const reco::Track * > tkMap
const edm::EventSetup * evSetup
std::map< const reco::Candidate *, reco::TransientTrack * > ttMap
virtual int charge() const =0
electric charge
T get() const
Definition: EventSetup.h:71
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 90 of file BPHDecayVertex.cc.

References fitVertex(), oldVertex, and validTks.

90  {
91  if ( oldVertex ) fitVertex();
92  return validTks;
93 }
virtual void fitVertex() const
bool BPHDecayVertex::validVertex ( ) const
virtual

Definition at line 96 of file BPHDecayVertex.cc.

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

96  {
97  if ( oldVertex ) fitVertex();
98  return validTks && fittedVertex.isValid();
99 }
bool isValid() const
Tells whether the vertex is valid.
Definition: Vertex.h:68
virtual void fitVertex() const
reco::Vertex fittedVertex
const reco::Vertex & BPHDecayVertex::vertex ( ) const
virtual

get reconstructed vertex

Definition at line 102 of file BPHDecayVertex.cc.

References fittedVertex, fitVertex(), and oldVertex.

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

102  {
103  if ( oldVertex ) fitVertex();
104  return fittedVertex;
105 }
virtual void fitVertex() const
reco::Vertex fittedVertex

Member Data Documentation

const edm::EventSetup* BPHDecayVertex::evSetup
private

Definition at line 103 of file BPHDecayVertex.h.

Referenced by tTracks().

reco::Vertex BPHDecayVertex::fittedVertex
mutableprivate

Definition at line 116 of file BPHDecayVertex.h.

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

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

Definition at line 110 of file BPHDecayVertex.h.

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

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

Definition at line 112 of file BPHDecayVertex.h.

Referenced by tracks(), and tTracks().

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

Definition at line 106 of file BPHDecayVertex.h.

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

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

Definition at line 114 of file BPHDecayVertex.h.

Referenced by getTrack(), and tTracks().

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

Definition at line 113 of file BPHDecayVertex.h.

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

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

Definition at line 115 of file BPHDecayVertex.h.

Referenced by getTransientTrack(), and tTracks().

bool BPHDecayVertex::validTks
mutableprivate

Definition at line 111 of file BPHDecayVertex.h.

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