CMS 3D CMS Logo

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 public:
27 
29 
30  FWCandidatePtrProxyBuilder(const FWCandidatePtrProxyBuilder&) = delete; // stop default
31  const FWCandidatePtrProxyBuilder& operator=(const FWCandidatePtrProxyBuilder&) = delete; // stop default
32 
33 private:
35  void build(const reco::CandidatePtr& iData,
36  unsigned int iIndex,
37  TEveElement& oItemHolder,
38  const FWViewContext*) override;
39 };
40 
42  unsigned int iIndex,
43  TEveElement& oItemHolder,
44  const FWViewContext*) {
45  TEveTrack* trk = fireworks::prepareCandidate(*iData, context().getTrackPropagator());
46 
47  trk->MakeTrack();
48  setupAddElement(trk, &oItemHolder);
49  {
50  TEveRecTrack t;
51  t.fBeta = 1.;
52  t.fV = TEveVector(iData->vx(), iData->vy(), iData->vz());
53  t.fP = TEveVector(-iData->p4().px(), -iData->p4().py(), -iData->p4().pz());
54  t.fSign = iData->charge();
55  TEveTrack* trk2 = new TEveTrack(&t, context().getTrackPropagator());
56  trk2->SetLineStyle(7);
57  trk2->MakeTrack();
58  setupAddElement(trk2, &oItemHolder);
59  }
60 }
61 
62 //
63 // static member functions
64 //
67  "CandidatePtrs",
#define REGISTER_PROXYBUILDER_METHODS()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:57
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
const FWCandidatePtrProxyBuilder & operator=(const FWCandidatePtrProxyBuilder &)=delete
static const int kAll3DBits
Definition: FWViewType.h:58
const fireworks::Context & context() const
TEveTrack * prepareCandidate(const reco::Candidate &track, TEveTrackPropagator *propagator)