CMS 3D CMS Logo

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
24 
25 //-----------------------------------------------------------------------------
26 // FWPFCandidate3DProxyBuilder
27 //-----------------------------------------------------------------------------
28 
29 class FWPFCandidate3DProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::PFCandidate> {
30 public:
31  // ---------------- Constructor(s)/Destructor ----------------------
34 
36 
37  FWPFCandidate3DProxyBuilder(const FWPFCandidate3DProxyBuilder&) = delete; // Stop default
38  const FWPFCandidate3DProxyBuilder& operator=(const FWPFCandidate3DProxyBuilder&) = delete; // Stop default
39 
40 private:
41  // --------------------- Member Functions --------------------------
43  void build(const reco::PFCandidate& iData,
44  unsigned int iIndex,
45  TEveElement& oItemHolder,
46  const FWViewContext*) override;
47 };
48 //=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_
49 
50 //______________________________________________________________________________
52 
53 //______________________________________________________________________________
55  unsigned int iIndex,
56  TEveElement& oItemHolder,
57  const FWViewContext*) {
58  TEveRecTrack t;
59  t.fBeta = 1.;
60  t.fP = TEveVector(iData.px(), iData.py(), iData.pz());
61  t.fV = TEveVector(iData.vertex().x(), iData.vertex().y(), iData.vertex().z());
62  t.fSign = iData.charge();
63  TEveTrack* trk = new TEveTrack(&t, context().getTrackPropagator());
64 
65  trk->MakeTrack();
66 
68  setupAddElement(trk, &oItemHolder);
69 }
70 
71 //______________________________________________________________________________
74  "PF Candidates",
#define REGISTER_PROXYBUILDER_METHODS()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
double pz() const final
z coordinate of momentum vector
static const int kAllRPZBits
Definition: FWViewType.h:57
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Trktree trk
Definition: Trktree.cc:2
static const int kAll3DBits
Definition: FWViewType.h:58
const fireworks::Context & context() const
double px() const final
x coordinate of momentum vector
double py() const final
y coordinate of momentum vector
const FWPFCandidate3DProxyBuilder & operator=(const FWPFCandidate3DProxyBuilder &)=delete
const Point & vertex() const override
vertex position (overwritten by PF...)
Definition: PFCandidate.cc:60
void setTrackTypePF(const reco::PFCandidate &pfCand, TAttLine *track)
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
int charge() const final
electric charge