Fireworks
Electrons
plugins
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
11
#include "
Fireworks/Core/interface/FWSimpleProxyBuilderTemplate.h
"
12
#include "
Fireworks/Core/interface/FWEventItem.h
"
13
14
#include "
Fireworks/Candidates/interface/CandidateUtils.h
"
15
#include "
Fireworks/Tracks/interface/TrackUtils.h
"
16
17
#include "
DataFormats/EgammaCandidates/interface/GsfElectron.h
"
18
#include "
DataFormats/GsfTrackReco/interface/GsfTrack.h
"
19
20
class
FWElectronLegoProxyBuilder
:
public
FWSimpleProxyBuilderTemplate
<reco::GsfElectron> {
21
public
:
22
FWElectronLegoProxyBuilder
() {}
23
~FWElectronLegoProxyBuilder
()
override
{}
24
25
REGISTER_PROXYBUILDER_METHODS
();
26
27
private
:
28
FWElectronLegoProxyBuilder
(
const
FWElectronLegoProxyBuilder
&) =
delete
;
29
const
FWElectronLegoProxyBuilder
&
operator=
(
const
FWElectronLegoProxyBuilder
&) =
delete
;
30
31
using
FWSimpleProxyBuilderTemplate<reco::GsfElectron>::build
;
32
void
build
(
const
reco::GsfElectron
& iData,
33
unsigned
int
iIndex,
34
TEveElement& oItemHolder,
35
const
FWViewContext
*)
override
;
36
};
37
38
void
FWElectronLegoProxyBuilder::build
(
const
reco::GsfElectron
& iData,
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
())
48
track
=
fireworks::prepareTrack
(*iData.
gsfTrack
(),
context
().
getTrackPropagator
());
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
80
REGISTER_FWPROXYBUILDER
(
FWElectronLegoProxyBuilder
,
reco::GsfElectron
,
"Electrons"
,
FWViewType::kAllLegoBits
);
FWElectronLegoProxyBuilder::~FWElectronLegoProxyBuilder
~FWElectronLegoProxyBuilder() override
Definition:
FWElectronLegoProxyBuilder.cc:23
HLT_FULL_cff.track
track
Definition:
HLT_FULL_cff.py:11713
reco::GsfElectron::gsfTrack
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition:
GsfElectron.h:163
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:28
TrackUtils.h
FWElectronLegoProxyBuilder::FWElectronLegoProxyBuilder
FWElectronLegoProxyBuilder()
Definition:
FWElectronLegoProxyBuilder.cc:22
FWViewType::kAllLegoBits
static const int kAllLegoBits
Definition:
FWViewType.h:69
reco::GsfElectron
Definition:
GsfElectron.h:34
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
Generated for CMSSW Reference Manual by
1.8.16