CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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);
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",
const fireworks::Context & context() const
#define REGISTER_PROXYBUILDER_METHODS()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:162
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Jets made from PFObjects.
Definition: PFJet.h:20
const FWEventItem * item() const
void scaleProduct(TEveElementList *parent, FWViewType::EType, const FWViewContext *vc) override
int index() const
Definition: FWModelId.h:41
void localModelChanges(const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc) override
void updateScale(const FWViewContext *vc, const fireworks::Context &)
Analysis-level calorimeter jet class.
Definition: Jet.h:77
void setTrackTypePF(const reco::PFCandidate &pfCand, TAttLine *track)
long double T