Fireworks
GenParticle
plugins
FWGenParticleLegoProxyBuilder.cc
Go to the documentation of this file.
1
#include "TEvePointSet.h"
2
3
#include "
Fireworks/Core/interface/FWEventItem.h
"
4
#include "
Fireworks/Core/interface/FWSimpleProxyBuilderTemplate.h
"
5
#include "
Fireworks/Core/interface/FWProxyBuilderConfiguration.h
"
6
#include "
Fireworks/Candidates/interface/CandidateUtils.h
"
7
8
#include "
DataFormats/HepMCCandidate/interface/GenParticle.h
"
9
#include "
DataFormats/HepMCCandidate/interface/GenParticleFwd.h
"
10
11
class
FWGenParticleLegoProxyBuilder
:
public
FWSimpleProxyBuilderTemplate
<reco::GenParticle> {
12
public
:
13
FWGenParticleLegoProxyBuilder
() {}
14
~FWGenParticleLegoProxyBuilder
()
override
{}
15
16
void
setItem
(
const
FWEventItem
* iItem)
override
{
17
FWProxyBuilderBase::setItem
(iItem);
18
if
(iItem) {
19
iItem->
getConfig
()->
assertParam
(
"MarkerStyle"
, 0
l
, -1
l
, 3
l
);
20
iItem->
getConfig
()->
assertParam
(
"MarkerSize"
, 2., 0.1, 10.);
21
}
22
}
23
24
// ---------- member functions ---------------------------
25
REGISTER_PROXYBUILDER_METHODS
();
26
27
private
:
28
FWGenParticleLegoProxyBuilder
(
const
FWGenParticleLegoProxyBuilder
&) =
delete
;
// stop default
29
30
const
FWGenParticleLegoProxyBuilder
&
operator=
(
const
FWGenParticleLegoProxyBuilder
&) =
delete
;
// stop default
31
32
using
FWSimpleProxyBuilderTemplate<reco::GenParticle>::build
;
33
void
build
(
const
reco::GenParticle
& iData,
34
unsigned
int
iIndex,
35
TEveElement& oItemHolder,
36
const
FWViewContext
*)
override
;
37
};
38
39
//______________________________________________________________________________
40
41
void
FWGenParticleLegoProxyBuilder::build
(
const
reco::GenParticle
& iData,
42
unsigned
int
iIndex,
43
TEveElement& oItemHolder,
44
const
FWViewContext
*) {
45
long
markerStyle
=
item
()->
getConfig
()->
value
<
long
>(
"MarkerStyle"
);
46
double
markerSize
=
item
()->
getConfig
()->
value
<
double
>(
"MarkerSize"
);
47
48
// workaround around for TEvePointSet marker styles indices
49
if
(
markerStyle
== 0)
50
markerStyle
= 3;
51
else
if
(
markerStyle
== 1)
52
markerStyle
= 4;
53
else
if
(
markerStyle
== 2)
54
markerStyle
= 8;
55
std::cerr
<< std::endl;
56
57
// scale non-pixel size marker
58
if
(
markerStyle
== 3)
59
markerSize
/= 20;
60
61
TEvePointSet* ps =
new
TEvePointSet();
62
ps->SetMarkerStyle(
markerStyle
);
63
ps->SetMarkerSize(
markerSize
);
64
ps->SetNextPoint(iData.
eta
(), iData.
phi
(), 0.001);
65
setupAddElement
(ps, &oItemHolder);
66
}
67
68
REGISTER_FWPROXYBUILDER
(
FWGenParticleLegoProxyBuilder
,
reco::GenParticle
,
"GenParticles"
,
FWViewType::kLegoBit
);
FWViewType::kLegoBit
Definition:
FWViewType.h:55
FWSimpleProxyBuilderTemplate.h
FWEventItem::getConfig
FWProxyBuilderConfiguration * getConfig() const
Definition:
FWEventItem.h:150
reco::GenParticle
Definition:
GenParticle.h:21
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
FWGenParticleLegoProxyBuilder::~FWGenParticleLegoProxyBuilder
~FWGenParticleLegoProxyBuilder() override
Definition:
FWGenParticleLegoProxyBuilder.cc:14
GenParticle.h
RecoTauValidation_cfi.markerStyle
markerStyle
Definition:
RecoTauValidation_cfi.py:302
FWGenParticleLegoProxyBuilder::operator=
const FWGenParticleLegoProxyBuilder & operator=(const FWGenParticleLegoProxyBuilder &)=delete
GenParticleFwd.h
FWGenParticleLegoProxyBuilder::FWGenParticleLegoProxyBuilder
FWGenParticleLegoProxyBuilder()
Definition:
FWGenParticleLegoProxyBuilder.cc:13
FWProxyBuilderConfiguration::assertParam
FWGenericParameter< T > * assertParam(const std::string &name, T def)
Definition:
FWProxyBuilderConfiguration.cc:83
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition:
LeafCandidate.h:152
FWProxyBuilderConfiguration.h
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition:
FWProxyBuilderBase.cc:350
RecoTauValidation_cfi.markerSize
markerSize
Definition:
RecoTauValidation_cfi.py:301
FWProxyBuilderBase::build
void build()
Definition:
FWProxyBuilderBase.cc:110
FWEventItem.h
FWViewContext
Definition:
FWViewContext.h:32
cmsLHEtoEOSManager.l
l
Definition:
cmsLHEtoEOSManager.py:204
FWProxyBuilderBase::item
const FWEventItem * item() const
Definition:
FWProxyBuilderBase.h:64
CandidateUtils.h
FWEventItem
Definition:
FWEventItem.h:56
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition:
LeafCandidate.h:148
FWProxyBuilderConfiguration::value
T value(const std::string &name)
Definition:
FWProxyBuilderConfiguration.cc:123
FWSimpleProxyBuilderTemplate
Definition:
FWSimpleProxyBuilderTemplate.h:30
FWGenParticleLegoProxyBuilder
Definition:
FWGenParticleLegoProxyBuilder.cc:11
FWProxyBuilderBase::setItem
virtual void setItem(const FWEventItem *iItem)
Definition:
FWProxyBuilderBase.cc:83
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition:
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
FWGenParticleLegoProxyBuilder::setItem
void setItem(const FWEventItem *iItem) override
Definition:
FWGenParticleLegoProxyBuilder.cc:16
Generated for CMSSW Reference Manual by
1.8.16