CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWCandidatePtrProxyBuilder.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CandidatePtrs
4 // Class : FWCandidatePtrProxyBuilder
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Fri Dec 5 09:56:09 EST 2008
11 //
12 
13 #include "TEveTrack.h"
14 
15 // user include files
18 
20 
22 
23 class FWCandidatePtrProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::CandidatePtr> {
24 
25 public:
28 
30 
31 private:
34 
36  void build(const reco::CandidatePtr& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext*) override;
37 };
38 
39 
40 void
41 FWCandidatePtrProxyBuilder::build(const reco::CandidatePtr& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext*)
42 {
43  TEveTrack* trk = fireworks::prepareCandidate( *iData, context().getTrackPropagator() );
44 
45  trk->MakeTrack();
46  setupAddElement(trk, &oItemHolder);
47  {
48  TEveRecTrack t;
49  t.fBeta = 1.;
50  t.fV = TEveVector(iData->vx(),iData->vy(),iData->vz());
51  t.fP = TEveVector(-iData->p4().px(), -iData->p4().py(), -iData->p4().pz());
52  t.fSign = iData->charge();
53  TEveTrack* trk2= new TEveTrack(&t, context().getTrackPropagator());
54  trk2->SetLineStyle(7);
55  trk2->MakeTrack();
56  setupAddElement(trk2, &oItemHolder);
57 
58  }
59 
60 }
61 
62 //
63 // static member functions
64 //
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
const FWCandidatePtrProxyBuilder & operator=(const FWCandidatePtrProxyBuilder &)
TEveTrack * prepareCandidate(const reco::Candidate &track, TEveTrackPropagator *propagator)