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 private:
31  FWCandidatePtrProxyBuilder(const FWCandidatePtrProxyBuilder&) = delete; // stop default
32  const FWCandidatePtrProxyBuilder& operator=(const FWCandidatePtrProxyBuilder&) = delete; // stop default
33 
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",
FWSimpleProxyBuilderTemplate.h
FWViewType::kAllRPZBits
static const int kAllRPZBits
Definition: FWViewType.h:67
REGISTER_FWPROXYBUILDER
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
Definition: FWProxyBuilderFactory.h:33
REGISTER_PROXYBUILDER_METHODS
#define REGISTER_PROXYBUILDER_METHODS()
Definition: register_dataproxybuilder_macro.h:28
FWCandidatePtrProxyBuilder::~FWCandidatePtrProxyBuilder
~FWCandidatePtrProxyBuilder() override
Definition: FWCandidatePtrProxyBuilder.cc:26
FWViewType::kAll3DBits
static const int kAll3DBits
Definition: FWViewType.h:68
FWCandidatePtrProxyBuilder::operator=
const FWCandidatePtrProxyBuilder & operator=(const FWCandidatePtrProxyBuilder &)=delete
OrderedSet.t
t
Definition: OrderedSet.py:90
FWCandidatePtrProxyBuilder
Definition: FWCandidatePtrProxyBuilder.cc:23
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition: FWProxyBuilderBase.cc:350
FWProxyBuilderBase::build
void build()
Definition: FWProxyBuilderBase.cc:110
FWViewContext
Definition: FWViewContext.h:32
edm::Ptr< Candidate >
CandidateUtils.h
fireworks::prepareCandidate
TEveTrack * prepareCandidate(const reco::Candidate &track, TEveTrackPropagator *propagator)
Definition: CandidateUtils.cc:9
FWProxyBuilderBase::context
const fireworks::Context & context() const
Definition: FWProxyBuilderBase.cc:412
FWSimpleProxyBuilderTemplate
Definition: FWSimpleProxyBuilderTemplate.h:30
Candidate.h
FWCandidatePtrProxyBuilder::FWCandidatePtrProxyBuilder
FWCandidatePtrProxyBuilder()
Definition: FWCandidatePtrProxyBuilder.cc:25
Context.h