CMS 3D CMS Logo

FWPFPatJetLegoProxyBuilder.cc
Go to the documentation of this file.
3 
4 //______________________________________________________________________________
5 template <class T>
7 template <class T>
9 
10 //______________________________________________________________________________
11 template <class T>
13  unsigned int iIndex,
14  TEveElement& oItemHolder,
15  const FWViewContext* vc) {
16  std::vector<reco::PFCandidatePtr> consts = iData.getPFConstituents();
17 
18  typedef std::vector<reco::PFCandidatePtr>::const_iterator IC;
19 
20  for (IC ic = consts.begin(); ic != consts.end(); ++ic) {
21  const reco::PFCandidatePtr& pfCandPtr = *ic;
22 
23  FWLegoCandidate* candidate = new FWLegoCandidate(vc,
25  pfCandPtr->energy(),
26  pfCandPtr->et(),
27  pfCandPtr->pt(),
28  pfCandPtr->eta(),
29  pfCandPtr->phi());
30  candidate->SetMarkerColor(FWProxyBuilderBase::item()->defaultDisplayProperties().color());
31  fireworks::setTrackTypePF((*pfCandPtr), candidate);
32  FWProxyBuilderBase::setupAddElement(candidate, &oItemHolder);
33 
34  FWProxyBuilderBase::context().voteMaxEtAndEnergy(pfCandPtr->et(), pfCandPtr->energy());
35  }
36 }
37 
38 //______________________________________________________________________________
39 template <class T>
42  const FWViewContext* vc) {
43  // loop items in product
44  for (TEveElement::List_i i = parent->BeginChildren(); i != parent->EndChildren(); ++i) {
45  if ((*i)->HasChildren()) {
46  // loop elements for the reco::PFJet item
47  for (TEveElement::List_i j = (*i)->BeginChildren(); j != (*i)->EndChildren(); ++j) {
48  FWLegoCandidate* cand = dynamic_cast<FWLegoCandidate*>(*j);
49  cand->updateScale(vc, FWProxyBuilderBase::context());
50  }
51  }
52  }
53 }
54 
55 //______________________________________________________________________________
56 template <class T>
58  TEveElement* parent,
59  FWViewType::EType viewType,
60  const FWViewContext* vc) {
61  // line set marker is not same color as line, have to fix it here
62  if ((parent)->HasChildren()) {
63  for (TEveElement::List_i j = parent->BeginChildren(); j != parent->EndChildren(); ++j) {
64  FWLegoCandidate* cand = dynamic_cast<FWLegoCandidate*>(*j);
65  cand->SetMarkerColor(FWProxyBuilderBase::item()->modelInfo(iId.index()).displayProperties().color());
66  cand->ElementChanged();
67  }
68  }
69 }
70 
71 //____________________________PAT_______________________________________________
73 public:
76 
78 };
79 
80 //____________________________PF________________________________________________
82 public:
85 
87 };
88 
89 //______________________________________________________________________________
92 
93 //______________________________________________________________________________
96  "PF Jet",
99  pat::Jet,
100  "PF PatJet",
#define REGISTER_PROXYBUILDER_METHODS()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
int index() const
Definition: FWModelId.h:41
Jets made from PFObjects.
Definition: PFJet.h:20
const fireworks::Context & context() const
void scaleProduct(TEveElementList *parent, FWViewType::EType, const FWViewContext *vc) override
void localModelChanges(const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc) override
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:169
Analysis-level calorimeter jet class.
Definition: Jet.h:77
void setTrackTypePF(const reco::PFCandidate &pfCand, TAttLine *track)
long double T
const FWEventItem * item() const