CMS 3D CMS Logo

FWElectronLegoProxyBuilder.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Muons
4 // Class : FWElectronLegoProxyBuilder
5 //
6 //
7 
8 #include "TEveStraightLineSet.h"
9 #include "TEveTrack.h"
10 
13 
16 
19 
20 class FWElectronLegoProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::GsfElectron> {
21 public:
24 
26 
27 private:
30 
32  void build(const reco::GsfElectron& iData,
33  unsigned int iIndex,
34  TEveElement& oItemHolder,
35  const FWViewContext*) override;
36 };
37 
39  unsigned int iIndex,
40  TEveElement& oItemHolder,
41  const FWViewContext*) {
42  TEveStraightLineSet* marker = new TEveStraightLineSet("marker");
43  setupAddElement(marker, &oItemHolder);
44 
45  TEveTrack* track(nullptr);
46 
47  if (iData.gsfTrack().isAvailable())
49  else
50  track = fireworks::prepareCandidate(iData, context().getTrackPropagator());
51 
52  track->MakeTrack();
53  const double delta = 0.1;
54  marker->AddLine(track->GetEndMomentum().Eta() - delta,
55  track->GetEndMomentum().Phi() - delta,
56  0.1,
57  track->GetEndMomentum().Eta() + delta,
58  track->GetEndMomentum().Phi() + delta,
59  0.1);
60  marker->AddLine(track->GetEndMomentum().Eta() - delta,
61  track->GetEndMomentum().Phi() + delta,
62  0.1,
63  track->GetEndMomentum().Eta() + delta,
64  track->GetEndMomentum().Phi() - delta,
65  0.1);
66  marker->AddLine(track->GetEndMomentum().Eta(),
67  track->GetEndMomentum().Phi() - delta,
68  0.1,
69  track->GetEndMomentum().Eta(),
70  track->GetEndMomentum().Phi() + delta,
71  0.1);
72  marker->AddLine(track->GetEndMomentum().Eta() - delta,
73  track->GetEndMomentum().Phi(),
74  0.1,
75  track->GetEndMomentum().Eta() + delta,
76  track->GetEndMomentum().Phi(),
77  0.1);
78 }
79 
FWElectronLegoProxyBuilder::~FWElectronLegoProxyBuilder
~FWElectronLegoProxyBuilder() override
Definition: FWElectronLegoProxyBuilder.cc:23
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11724
reco::GsfElectron::gsfTrack
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:164
FWSimpleProxyBuilderTemplate.h
edm::Ref::isAvailable
bool isAvailable() const
Definition: Ref.h:537
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:27
TrackUtils.h
FWElectronLegoProxyBuilder::FWElectronLegoProxyBuilder
FWElectronLegoProxyBuilder()
Definition: FWElectronLegoProxyBuilder.cc:22
FWViewType::kAllLegoBits
static const int kAllLegoBits
Definition: FWViewType.h:69
reco::GsfElectron
Definition: GsfElectron.h:35
GsfElectron.h
fireworks::prepareTrack
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:62
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition: FWProxyBuilderBase.cc:350
GsfTrack.h
FWElectronLegoProxyBuilder::operator=
const FWElectronLegoProxyBuilder & operator=(const FWElectronLegoProxyBuilder &)=delete
FWProxyBuilderBase::build
void build()
Definition: FWProxyBuilderBase.cc:110
FWEventItem.h
FWViewContext
Definition: FWViewContext.h:32
CandidateUtils.h
FWElectronLegoProxyBuilder
Definition: FWElectronLegoProxyBuilder.cc:20
fireworks::prepareCandidate
TEveTrack * prepareCandidate(const reco::Candidate &track, TEveTrackPropagator *propagator)
Definition: CandidateUtils.cc:9
fireworks::Context::getTrackPropagator
TEveTrackPropagator * getTrackPropagator() const
Definition: Context.h:62
FWProxyBuilderBase::context
const fireworks::Context & context() const
Definition: FWProxyBuilderBase.cc:412
FWSimpleProxyBuilderTemplate
Definition: FWSimpleProxyBuilderTemplate.h:30