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 --------------------------
45  void build( const reco::PFCandidate& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* );
46 
47 };
48 //=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_
49 
50 
51 
52 //______________________________________________________________________________
54 
55 //______________________________________________________________________________
56 void
57 FWPFCandidate3DProxyBuilder::build( const reco::PFCandidate& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* )
58 {
59  TEveRecTrack t;
60  t.fBeta = 1.;
61  t.fP = TEveVector( iData.px(), iData.py(), iData.pz() );
62  t.fV = TEveVector( iData.vertex().x(), iData.vertex().y(), iData.vertex().z() );
63  t.fSign = iData.charge();
64  TEveTrack* trk = new TEveTrack(&t, context().getTrackPropagator() );
65 
66  trk->MakeTrack();
67 
68  fireworks::setTrackTypePF( iData, trk );
69  setupAddElement( trk, &oItemHolder );
70 }
71 
72 //______________________________________________________________________________
const fireworks::Context & context() const
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:59
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
static const int kAll3DBits
Definition: FWViewType.h:60
virtual int charge() const
electric charge
virtual const Point & vertex() const
vertex position
Definition: PFCandidate.cc:546
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:33
virtual double py() const
y coordinate of momentum vector
const FWPFCandidate3DProxyBuilder & operator=(const FWPFCandidate3DProxyBuilder &)