test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWPFCandidate3DProxyBuilder.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: ParticleFlow
4 // Class : FWCandidate3DProxyBuilder
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Colin Bernet
10 // Created: Fri May 28 15:58:19 CEST 2010
11 // Edited: sharris, Wed 9 Feb 2011, 17:34
12 //
13 
14 // System include files
15 #include "TEveTrack.h"
16 #include "TEveTrackPropagator.h"
18 
19 // User include files
25 
26 //-----------------------------------------------------------------------------
27 // FWPFCandidate3DProxyBuilder
28 //-----------------------------------------------------------------------------
29 
31 {
32 
33  public:
34  // ---------------- Constructor(s)/Destructor ----------------------
37 
39 
40  private:
42  const FWPFCandidate3DProxyBuilder& operator=( const FWPFCandidate3DProxyBuilder& ); // Stop default
43 
44  // --------------------- Member Functions --------------------------
46  void build( const reco::PFCandidate& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* );
47 
48 };
49 //=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_
50 
51 
52 
53 //______________________________________________________________________________
55 
56 //______________________________________________________________________________
57 void
58 FWPFCandidate3DProxyBuilder::build( const reco::PFCandidate& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* )
59 {
60  TEveRecTrack t;
61  t.fBeta = 1.;
62  t.fP = TEveVector( iData.px(), iData.py(), iData.pz() );
63  t.fV = TEveVector( iData.vertex().x(), iData.vertex().y(), iData.vertex().z() );
64  t.fSign = iData.charge();
65  TEveTrack* trk = new TEveTrack(&t, context().getTrackPropagator() );
66 
67  trk->MakeTrack();
68 
69  fireworks::setTrackTypePF( iData, trk );
70  setupAddElement( trk, &oItemHolder );
71 }
72 
73 //______________________________________________________________________________
const fireworks::Context & context() const
#define REGISTER_PROXYBUILDER_METHODS()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:58
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
static const int kAll3DBits
Definition: FWViewType.h:59
virtual int charge() const
electric charge
virtual const Point & vertex() const
vertex position (overwritten by PF...)
Definition: PFCandidate.cc:643
virtual double px() const
x coordinate of momentum vector
virtual double pz() const
z coordinate of momentum vector
void setTrackTypePF(const reco::PFCandidate &pfCand, TAttLine *track)
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:38
virtual double py() const
y coordinate of momentum vector
const FWPFCandidate3DProxyBuilder & operator=(const FWPFCandidate3DProxyBuilder &)