test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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...
 
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...
 
virtual ~BPHDecayVertex ()
 
- Public Member Functions inherited from BPHDecayMomentum
virtual const std::vector
< std::string > & 
compNames () const
 
virtual const
pat::CompositeCandidate
composite () 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)
 
virtual void setNotUpdated () const
 
- 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 40 of file BPHDecayVertex.h.

Constructor & Destructor Documentation

BPHDecayVertex::~BPHDecayVertex ( )
virtual

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, i, j, list(), visualization-live-secondInstance_cfg::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 }
int i
Definition: DBlmapReader.cc:9
virtual const std::vector< const reco::Candidate * > & daughters() const
const std::vector< Component > & componentList() const
int j
Definition: DBlmapReader.cc:9
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

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

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

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

209  {
210  oldVertex = false;
211  if ( oldTracks ) tTracks();
212  if ( trTracks.size() < 2 ) return;
213  KalmanVertexFitter kvf( true );
214  TransientVertex tv = kvf.vertex( trTracks );
215  fittedVertex = tv;
216  return;
217 }
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 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 : 0 );
122 }
virtual void tTracks() const
std::map< const reco::Candidate *, const reco::Track * > tkMap
reco::TransientTrack * BPHDecayVertex::getTransientTrack ( const reco::Candidate cand) const

get TransientTrack for a daughter

Definition at line 131 of file BPHDecayVertex.cc.

References 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 : 0 );
139 }
virtual void tTracks() const
std::map< const reco::Candidate *, reco::TransientTrack * > ttMap
void BPHDecayVertex::setNotUpdated ( ) const
protectedvirtual

Reimplemented from BPHDecayMomentum.

Reimplemented in BPHKinematicFit, BPHPlusMinusCandidate, and BPHPlusMinusVertex.

Definition at line 161 of file BPHDecayVertex.cc.

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

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

161  {
163  oldTracks = oldVertex = true;
164  validTks = false;
165  return;
166 }
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 169 of file BPHDecayVertex.cc.

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

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

169  {
170  oldTracks = false;
171  rTracks.clear();
172  trTracks.clear();
173  tkMap.clear();
174  ttMap.clear();
176  evSetup->get<TransientTrackRecord>().get( "TransientTrackBuilder", ttB );
177  const vector<const reco::Candidate*>& dL = daughFull();
178  int n = dL.size();
179  trTracks.reserve( n );
180  validTks = true;
181  while ( n-- ) {
182  const reco::Candidate* rp = dL[n];
183  tkMap[rp] = 0;
184  ttMap[rp] = 0;
185  if ( !rp->charge() ) continue;
186  const reco::Track* tp;
187  const char* searchList = "cfhp";
188  map<const reco::Candidate*,string>::const_iterator iter =
189  searchMap.find( rp );
190  if ( iter != searchMap.end() ) searchList = iter->second.c_str();
191  tp = BPHTrackReference::getTrack( *rp, searchList );
192  if ( tp == 0 ) {
193  edm::LogPrint( "DataNotFound" )
194  << "BPHDecayVertex::tTracks: "
195  << "no track for reco::(PF)Candidate";
196  validTks = false;
197  continue;
198  }
199  rTracks.push_back( tp );
200  trTracks.push_back( ttB->build( tp ) );
201  reco::TransientTrack* ttp = &trTracks.back();
202  tkMap[rp] = tp;
203  ttMap[rp] = ttp;
204  }
205  return;
206 }
std::vector< reco::TransientTrack > trTracks
virtual int charge() const =0
electric charge
std::map< const reco::Candidate *, std::string > searchMap
std::map< const reco::Candidate *, const reco::Track * > tkMap
const T & get() const
Definition: EventSetup.h:56
const edm::EventSetup * evSetup
std::map< const reco::Candidate *, reco::TransientTrack * > ttMap
static const reco::Track * getTrack(const reco::Candidate &rc, const char *modeList="cfhbpmnigse")
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(), and oldVertex.

96  {
97  if ( oldVertex ) fitVertex();
98  return 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(), and BPHWriteSpecificDecay::fill().

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 98 of file BPHDecayVertex.h.

Referenced by tTracks().

reco::Vertex BPHDecayVertex::fittedVertex
mutableprivate

Definition at line 111 of file BPHDecayVertex.h.

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

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

Definition at line 105 of file BPHDecayVertex.h.

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

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

Definition at line 107 of file BPHDecayVertex.h.

Referenced by tracks(), and tTracks().

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

Definition at line 101 of file BPHDecayVertex.h.

Referenced by BPHDecayVertex(), and tTracks().

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

Definition at line 109 of file BPHDecayVertex.h.

Referenced by getTrack(), and tTracks().

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

Definition at line 108 of file BPHDecayVertex.h.

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

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

Definition at line 110 of file BPHDecayVertex.h.

Referenced by getTransientTrack(), and tTracks().

bool BPHDecayVertex::validTks
mutableprivate

Definition at line 106 of file BPHDecayVertex.h.

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