CMS 3D CMS Logo

FWCandidateLegoProxyBuilder.cc
Go to the documentation of this file.
1 #ifndef _FWCANDIDATELEGOPROXYBUILDER_H_
2 #define _FWCANDIDATELEGOPROXYBUILDER_H_
3 
4 // -*- C++ -*-
5 //
6 // Package: Candidates
7 // Class : FWCandidateLegoProxyBuilder
8 //
9 // Implementation:
10 // <Notes on implementation>
11 //
12 // Original Author: Simon Harris
13 // Created: 24/06/2011
14 //
15 
16 // User include files
21 
23 
24 //-----------------------------------------------------------------------------
25 // FWCandidateLegoProxyBuilder
26 //-----------------------------------------------------------------------------
28 public:
29  // ---------------- Constructor(s)/Destructor ----------------------
32 
33  // --------------------- Member Functions --------------------------
34  bool havePerViewProduct(FWViewType::EType) const override { return true; }
35  void scaleProduct(TEveElementList *, FWViewType::EType, const FWViewContext *) override;
36  void localModelChanges(const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *) override;
37 
39 
40 private:
41  // ----------------------- Data Members ----------------------------
44 
45  // --------------------- Member Functions --------------------------
47  void build(const reco::Candidate &, unsigned int, TEveElement &, const FWViewContext *) override;
48 };
49 #endif
50 //=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_=_
51 
52 //______________________________________________________________________________
55  const FWViewContext *vc) {
56  for (TEveElement::List_i i = parent->BeginChildren(); i != parent->EndChildren(); ++i) {
57  if ((*i)->HasChildren()) {
58  TEveElement *el = (*i)->FirstChild(); // There is only one child
59  FWLegoCandidate *candidate = dynamic_cast<FWLegoCandidate *>(el);
60  candidate->updateScale(vc, context());
61  }
62  }
63 }
64 
65 //______________________________________________________________________________
67  TEveElement *parent,
69  const FWViewContext *vc) {
70  // Line set marker is nto the same color as line, have to fix it here
71  if ((parent)->HasChildren()) {
72  TEveElement *el = (parent)->FirstChild(); // There is only one child
73  FWLegoCandidate *candidate = dynamic_cast<FWLegoCandidate *>(el);
74  candidate->SetMarkerColor(item()->modelInfo(iId.index()).displayProperties().color());
75  candidate->ElementChanged();
76  }
77 }
78 
79 //______________________________________________________________________________
81  unsigned int iIndex,
82  TEveElement &oItemHolder,
83  const FWViewContext *vc) {
84  FWLegoCandidate *candidate =
85  new FWLegoCandidate(vc, context(), iData.energy(), iData.et(), iData.pt(), iData.eta(), iData.phi());
86 
87  candidate->SetMarkerColor(item()->defaultDisplayProperties().color());
88  context().voteMaxEtAndEnergy(iData.et(), iData.energy());
89 
90  setupAddElement(candidate, &oItemHolder);
91 }
92 
93 //______________________________________________________________________________
96  "Candidates",
reco::Candidate::energy
virtual double energy() const =0
energy
mps_fire.i
i
Definition: mps_fire.py:428
FWViewType::kLegoBit
Definition: FWViewType.h:55
FWSimpleProxyBuilderTemplate.h
FWViewType::EType
EType
Definition: FWViewType.h:31
REGISTER_FWPROXYBUILDER
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
Definition: FWProxyBuilderFactory.h:33
reco::Candidate::eta
virtual double eta() const =0
momentum pseudorapidity
FWModelId
Definition: FWModelId.h:28
FWViewType::kLegoPFECALBit
Definition: FWViewType.h:57
REGISTER_PROXYBUILDER_METHODS
#define REGISTER_PROXYBUILDER_METHODS()
Definition: register_dataproxybuilder_macro.h:27
reco::Candidate::pt
virtual double pt() const =0
transverse momentum
FWCandidateLegoProxyBuilder::havePerViewProduct
bool havePerViewProduct(FWViewType::EType) const override
Definition: FWCandidateLegoProxyBuilder.cc:34
FWLegoCandidate
Definition: FWLegoCandidate.h:28
FWCandidateLegoProxyBuilder::scaleProduct
void scaleProduct(TEveElementList *, FWViewType::EType, const FWViewContext *) override
Definition: FWCandidateLegoProxyBuilder.cc:53
fireworks::Context::voteMaxEtAndEnergy
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:162
FWModelId::index
int index() const
Definition: FWModelId.h:41
FWCandidateLegoProxyBuilder::~FWCandidateLegoProxyBuilder
~FWCandidateLegoProxyBuilder() override
Definition: FWCandidateLegoProxyBuilder.cc:31
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition: FWProxyBuilderBase.cc:350
FWCandidateLegoProxyBuilder::FWCandidateLegoProxyBuilder
FWCandidateLegoProxyBuilder()
Definition: FWCandidateLegoProxyBuilder.cc:30
FWProxyBuilderBase::build
void build()
Definition: FWProxyBuilderBase.cc:110
FWEventItem.h
FWViewContext
Definition: FWViewContext.h:32
reco::Candidate
Definition: Candidate.h:27
FWProxyBuilderBase::item
const FWEventItem * item() const
Definition: FWProxyBuilderBase.h:64
FWCandidateLegoProxyBuilder::localModelChanges
void localModelChanges(const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *) override
Definition: FWCandidateLegoProxyBuilder.cc:66
FWCandidateLegoProxyBuilder::operator=
const FWCandidateLegoProxyBuilder & operator=(const FWCandidateLegoProxyBuilder &)=delete
FWLegoCandidate.h
FWLegoCandidate::updateScale
void updateScale(const FWViewContext *vc, const fireworks::Context &)
Definition: FWLegoCandidate.cc:41
FWProxyBuilderBase::context
const fireworks::Context & context() const
Definition: FWProxyBuilderBase.cc:412
FWSimpleProxyBuilderTemplate
Definition: FWSimpleProxyBuilderTemplate.h:30
Candidate.h
FWCandidateLegoProxyBuilder
Definition: FWCandidateLegoProxyBuilder.cc:27
reco::Candidate::phi
virtual double phi() const =0
momentum azimuthal angle
class-composition.parent
parent
Definition: class-composition.py:98
Context.h
reco::Candidate::et
virtual double et() const =0
transverse energy