Fireworks
ParticleFlow
plugins
FWPFCandidatesLegoProxyBuilder.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: ParticleFlow
4
// Class : FWCandidatesLegoProxyBuilder
5
//
6
// Implementation:
7
// <Notes on implementation>
8
//
9
// Original Author: Colin Bernet
10
// Created: Fri May 28 14:54:19 CEST 2010
11
// Edited: sharris, Wed 10 Feb 2011, 13:00
12
//
13
14
// User include files
15
#include "
Fireworks/Core/interface/FWSimpleProxyBuilderTemplate.h
"
16
#include "
Fireworks/Core/interface/Context.h
"
17
#include "
Fireworks/Core/interface/FWEventItem.h
"
18
#include "
DataFormats/ParticleFlowCandidate/interface/PFCandidate.h
"
19
#include "
Fireworks/Candidates/interface/FWLegoCandidate.h
"
20
#include "
Fireworks/ParticleFlow/interface/setTrackTypePF.h
"
// NB: This has to come after FWLegoCandidate include
21
22
//-----------------------------------------------------------------------------
23
// FWCandidate3DProxyBuilder
24
//-----------------------------------------------------------------------------
25
26
class
FWPFCandidatesLegoProxyBuilder
:
public
FWSimpleProxyBuilderTemplate
<reco::PFCandidate> {
27
public
:
28
FWPFCandidatesLegoProxyBuilder
();
29
~FWPFCandidatesLegoProxyBuilder
()
override
;
30
31
// --------------------- Member Functions --------------------------
32
bool
havePerViewProduct
(
FWViewType::EType
)
const override
{
return
true
; }
33
void
scaleProduct
(TEveElementList*
parent
,
FWViewType::EType
,
const
FWViewContext
* vc)
override
;
34
void
localModelChanges
(
const
FWModelId
& iId,
35
TEveElement* iCompound,
36
FWViewType::EType
viewType,
37
const
FWViewContext
* vc)
override
;
38
39
REGISTER_PROXYBUILDER_METHODS
();
40
41
private
:
42
FWPFCandidatesLegoProxyBuilder
(
const
FWPFCandidatesLegoProxyBuilder
&) =
delete
;
// stop default
43
const
FWPFCandidatesLegoProxyBuilder
&
operator=
(
const
FWPFCandidatesLegoProxyBuilder
&) =
delete
;
// stop default
44
45
// --------------------- Member Functions --------------------------
46
using
FWSimpleProxyBuilderTemplate<reco::PFCandidate>::build
;
47
void
build
(
const
reco::PFCandidate
&,
unsigned
int
, TEveElement&,
const
FWViewContext
*)
override
;
48
};
49
//=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_
50
51
//
52
// constructors and destructor
53
//
54
//______________________________________________________________________________
55
FWPFCandidatesLegoProxyBuilder::FWPFCandidatesLegoProxyBuilder
() {}
56
FWPFCandidatesLegoProxyBuilder::~FWPFCandidatesLegoProxyBuilder
() {}
57
58
//
59
// member functions
60
//
61
//______________________________________________________________________________
62
void
FWPFCandidatesLegoProxyBuilder::build
(
const
reco::PFCandidate
& iData,
63
unsigned
int
iIndex,
64
TEveElement& oItemHolder,
65
const
FWViewContext
* vc) {
66
FWLegoCandidate
* candidate =
67
new
FWLegoCandidate
(vc,
context
(), iData.
energy
(), iData.
et
(), iData.
pt
(), iData.
eta
(), iData.
phi
());
68
candidate->SetMarkerColor(
item
()->defaultDisplayProperties().color());
69
fireworks::setTrackTypePF
(iData, candidate);
70
71
context
().
voteMaxEtAndEnergy
(iData.
et
(), iData.
et
());
72
73
setupAddElement
(candidate, &oItemHolder);
74
}
75
76
//______________________________________________________________________________
77
void
FWPFCandidatesLegoProxyBuilder::scaleProduct
(TEveElementList*
parent
,
78
FWViewType::EType
type
,
79
const
FWViewContext
* vc) {
80
for
(TEveElement::List_i
i
=
parent
->BeginChildren();
i
!=
parent
->EndChildren(); ++
i
) {
81
if
((*i)->HasChildren()) {
82
TEveElement* el = (*i)->FirstChild();
// there is only one child added in this proxy builder
83
FWLegoCandidate
* candidate = dynamic_cast<FWLegoCandidate*>(el);
84
candidate->
updateScale
(vc,
context
());
85
}
86
}
87
}
88
89
//______________________________________________________________________________
90
void
FWPFCandidatesLegoProxyBuilder::localModelChanges
(
const
FWModelId
& iId,
91
TEveElement*
parent
,
92
FWViewType::EType
viewType,
93
const
FWViewContext
* vc) {
94
// line set marker is not same color as line, have to fix it here
95
if
((
parent
)->HasChildren()) {
96
TEveElement* el = (
parent
)->FirstChild();
// we know there is only one child added in this proxy builder
97
FWLegoCandidate
* candidate = dynamic_cast<FWLegoCandidate*>(el);
98
candidate->SetMarkerColor(
item
()->modelInfo(iId.
index
()).displayProperties().color());
99
candidate->ElementChanged();
100
}
101
}
102
103
//______________________________________________________________________________
104
REGISTER_FWPROXYBUILDER
(
FWPFCandidatesLegoProxyBuilder
,
105
reco::PFCandidate
,
106
"PF Candidates"
,
107
FWViewType::kLegoPFECALBit
|
FWViewType::kLegoBit
);
FWPFCandidatesLegoProxyBuilder::operator=
const FWPFCandidatesLegoProxyBuilder & operator=(const FWPFCandidatesLegoProxyBuilder &)=delete
mps_fire.i
i
Definition:
mps_fire.py:428
FWViewType::kLegoBit
Definition:
FWViewType.h:55
FWSimpleProxyBuilderTemplate.h
FWViewType::EType
EType
Definition:
FWViewType.h:31
PFCandidate.h
FWPFCandidatesLegoProxyBuilder::localModelChanges
void localModelChanges(const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc) override
Definition:
FWPFCandidatesLegoProxyBuilder.cc:90
REGISTER_FWPROXYBUILDER
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
Definition:
FWProxyBuilderFactory.h:33
FWModelId
Definition:
FWModelId.h:28
FWViewType::kLegoPFECALBit
Definition:
FWViewType.h:57
REGISTER_PROXYBUILDER_METHODS
#define REGISTER_PROXYBUILDER_METHODS()
Definition:
register_dataproxybuilder_macro.h:28
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition:
LeafCandidate.h:146
FWPFCandidatesLegoProxyBuilder::scaleProduct
void scaleProduct(TEveElementList *parent, FWViewType::EType, const FWViewContext *vc) override
Definition:
FWPFCandidatesLegoProxyBuilder.cc:77
fireworks::setTrackTypePF
void setTrackTypePF(const reco::PFCandidate &pfCand, TAttLine *track)
Definition:
setTrackTypePF.cc:16
FWLegoCandidate
Definition:
FWLegoCandidate.h:28
FWPFCandidatesLegoProxyBuilder::havePerViewProduct
bool havePerViewProduct(FWViewType::EType) const override
Definition:
FWPFCandidatesLegoProxyBuilder.cc:32
fireworks::Context::voteMaxEtAndEnergy
void voteMaxEtAndEnergy(float Et, float energy) const
Definition:
Context.cc:162
FWModelId::index
int index() const
Definition:
FWModelId.h:41
FWPFCandidatesLegoProxyBuilder
Definition:
FWPFCandidatesLegoProxyBuilder.cc:26
FWPFCandidatesLegoProxyBuilder::FWPFCandidatesLegoProxyBuilder
FWPFCandidatesLegoProxyBuilder()
Definition:
FWPFCandidatesLegoProxyBuilder.cc:55
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition:
LeafCandidate.h:152
type
type
Definition:
SiPixelVCal_PayloadInspector.cc:37
setTrackTypePF.h
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
FWEventItem.h
FWViewContext
Definition:
FWViewContext.h:32
FWProxyBuilderBase::item
const FWEventItem * item() const
Definition:
FWProxyBuilderBase.h:64
reco::LeafCandidate::et
double et() const final
transverse energy
Definition:
LeafCandidate.h:127
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition:
LeafCandidate.h:148
FWPFCandidatesLegoProxyBuilder::~FWPFCandidatesLegoProxyBuilder
~FWPFCandidatesLegoProxyBuilder() override
Definition:
FWPFCandidatesLegoProxyBuilder.cc:56
FWLegoCandidate.h
FWLegoCandidate::updateScale
void updateScale(const FWViewContext *vc, const fireworks::Context &)
Definition:
FWLegoCandidate.cc:41
reco::LeafCandidate::energy
double energy() const final
energy
Definition:
LeafCandidate.h:125
FWProxyBuilderBase::context
const fireworks::Context & context() const
Definition:
FWProxyBuilderBase.cc:412
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition:
PFCandidate.h:41
FWSimpleProxyBuilderTemplate
Definition:
FWSimpleProxyBuilderTemplate.h:30
class-composition.parent
parent
Definition:
class-composition.py:88
Context.h
Generated for CMSSW Reference Manual by
1.8.16