test
Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
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
13
public
:
14
FWGenParticleLegoProxyBuilder
() {}
15
virtual
~FWGenParticleLegoProxyBuilder
() {}
16
17
virtual
void
setItem
(
const
FWEventItem
* iItem)
override
18
{
19
FWProxyBuilderBase::setItem
(iItem);
20
if
(iItem)
21
{
22
iItem->
getConfig
()->
assertParam
(
"MarkerStyle"
, 0
l
, -1
l
, 3
l
);
23
iItem->
getConfig
()->
assertParam
(
"MarkerSize"
,2., 0.1, 10.);
24
}
25
}
26
27
// ---------- member functions ---------------------------
28
REGISTER_PROXYBUILDER_METHODS
();
29
30
private
:
31
FWGenParticleLegoProxyBuilder
(
const
FWGenParticleLegoProxyBuilder
&);
// stop default
32
33
const
FWGenParticleLegoProxyBuilder
&
operator=
(
const
FWGenParticleLegoProxyBuilder
&);
// stop default
34
35
using
FWSimpleProxyBuilderTemplate<reco::GenParticle>::build
;
36
void
build
(
const
reco::GenParticle
& iData,
unsigned
int
iIndex,TEveElement& oItemHolder,
const
FWViewContext
*)
override
;
37
};
38
39
//______________________________________________________________________________
40
41
42
void
43
FWGenParticleLegoProxyBuilder::build
(
const
reco::GenParticle
& iData,
unsigned
int
iIndex, TEveElement& oItemHolder,
const
FWViewContext
*)
44
{
45
long
markerStyle =
item
()->
getConfig
()->
value
<
long
>(
"MarkerStyle"
);
46
double
markerSize =
item
()->
getConfig
()->
value
<
double
>(
"MarkerSize"
);
47
48
49
// workaround around for TEvePointSet marker styles indices
50
if
(markerStyle == 0 )
51
markerStyle = 3;
52
else
if
(markerStyle == 1)
53
markerStyle = 4;
54
else
if
(markerStyle == 2)
55
markerStyle = 8;
56
std::cerr
<< std::endl;
57
58
// scale non-pixel size marker
59
if
(markerStyle == 3 )
60
markerSize /= 20;
61
62
TEvePointSet* ps =
new
TEvePointSet();
63
ps->SetMarkerStyle(markerStyle);
64
ps->SetMarkerSize(markerSize);
65
ps->SetNextPoint(iData.
eta
(), iData.
phi
(), 0.001);
66
setupAddElement
( ps, &oItemHolder );
67
68
}
69
70
REGISTER_FWPROXYBUILDER
(
FWGenParticleLegoProxyBuilder
,
reco::GenParticle
,
"GenParticles"
,
FWViewType::kLegoBit
);
71
FWSimpleProxyBuilderTemplate.h
FWEventItem::getConfig
FWProxyBuilderConfiguration * getConfig() const
Definition:
FWEventItem.h:170
REGISTER_PROXYBUILDER_METHODS
#define REGISTER_PROXYBUILDER_METHODS()
Definition:
register_dataproxybuilder_macro.h:28
REGISTER_FWPROXYBUILDER
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
Definition:
FWProxyBuilderFactory.h:33
FWGenParticleLegoProxyBuilder::setItem
virtual void setItem(const FWEventItem *iItem) override
Definition:
FWGenParticleLegoProxyBuilder.cc:17
FWProxyBuilderConfiguration.h
GenParticle.h
FWGenParticleLegoProxyBuilder::~FWGenParticleLegoProxyBuilder
virtual ~FWGenParticleLegoProxyBuilder()
Definition:
FWGenParticleLegoProxyBuilder.cc:15
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition:
FWProxyBuilderBase.cc:439
FWViewType::kLegoBit
Definition:
FWViewType.h:46
reco::LeafCandidate::phi
virtual double phi() const final
momentum azimuthal angle
Definition:
LeafCandidate.h:133
FWViewContext
Definition:
FWViewContext.h:32
cmsLHEtoEOSManager.l
tuple l
Definition:
cmsLHEtoEOSManager.py:192
FWGenParticleLegoProxyBuilder::operator=
const FWGenParticleLegoProxyBuilder & operator=(const FWGenParticleLegoProxyBuilder &)
FWProxyBuilderBase::item
const FWEventItem * item() const
Definition:
FWProxyBuilderBase.h:67
ecal_dqm_sourceclient-live_cfg.cerr
tuple cerr
Definition:
ecal_dqm_sourceclient-live_cfg.py:49
FWGenParticleLegoProxyBuilder::FWGenParticleLegoProxyBuilder
FWGenParticleLegoProxyBuilder()
Definition:
FWGenParticleLegoProxyBuilder.cc:14
FWGenParticleLegoProxyBuilder
Definition:
FWGenParticleLegoProxyBuilder.cc:11
FWProxyBuilderBase::setItem
virtual void setItem(const FWEventItem *iItem)
Definition:
FWProxyBuilderBase.cc:94
FWProxyBuilderBase::build
void build()
Definition:
FWProxyBuilderBase.cc:131
GenParticleFwd.h
FWProxyBuilderConfiguration::assertParam
FWGenericParameter< T > * assertParam(const std::string &name, T def)
Definition:
FWProxyBuilderConfiguration.cc:98
FWEventItem
Definition:
FWEventItem.h:56
FWEventItem.h
CandidateUtils.h
reco::GenParticle
Definition:
GenParticle.h:21
FWProxyBuilderConfiguration::value
T value(const std::string &name)
Definition:
FWProxyBuilderConfiguration.cc:137
reco::LeafCandidate::eta
virtual double eta() const final
momentum pseudorapidity
Definition:
LeafCandidate.h:137
FWSimpleProxyBuilderTemplate
Definition:
FWSimpleProxyBuilderTemplate.h:29
Generated for CMSSW Reference Manual by
1.8.5