CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWPFPatJetLegoProxyBuilder.cc
Go to the documentation of this file.
3 
4 //______________________________________________________________________________
7 
8 //______________________________________________________________________________
9 template<class T> void
10 FWPFPatJetLegoProxyBuilder<T>::build( const T& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* vc )
11 {
12  std::vector<reco::PFCandidatePtr > consts = iData.getPFConstituents();
13 
14  typedef std::vector<reco::PFCandidatePtr >::const_iterator IC;
15 
16  for( IC ic = consts.begin(); ic != consts.end(); ++ic )
17  {
18  const reco::PFCandidatePtr pfCandPtr = *ic;
19 
20  FWLegoCandidate *candidate = new FWLegoCandidate( vc, FWProxyBuilderBase::context(), pfCandPtr->energy(), pfCandPtr->et(),
21  pfCandPtr->pt(), pfCandPtr->eta(), pfCandPtr->phi() );
22  candidate->SetMarkerColor( FWProxyBuilderBase::item()->defaultDisplayProperties().color() );
23  fireworks::setTrackTypePF( (*pfCandPtr), candidate );
24  FWProxyBuilderBase::setupAddElement( candidate, &oItemHolder );
25 
26  FWProxyBuilderBase::context().voteMaxEtAndEnergy( pfCandPtr->et(), pfCandPtr->energy() );
27  }
28 }
29 
30 //______________________________________________________________________________
31 template<class T> void
33 {
34  // loop items in product
35  for( TEveElement::List_i i = parent->BeginChildren(); i!= parent->EndChildren(); ++i )
36  {
37  if ( ( *i )->HasChildren() )
38  {
39  // loop elements for the reco::PFJet item
40  for( TEveElement::List_i j = (*i)->BeginChildren(); j != (*i)->EndChildren(); ++j )
41  {
42  FWLegoCandidate *cand = dynamic_cast<FWLegoCandidate*> ( *j );
44  }
45  }
46  }
47 }
48 
49 //______________________________________________________________________________
50 template<class T> void
52 {
53  // line set marker is not same color as line, have to fix it here
54  if ( ( parent )->HasChildren() )
55  {
56  for( TEveElement::List_i j = parent->BeginChildren(); j != parent->EndChildren(); ++j )
57  {
58  FWLegoCandidate *cand = dynamic_cast<FWLegoCandidate*> ( *j );
59  const FWDisplayProperties &dp = FWProxyBuilderBase::item()->modelInfo( iId.index() ).displayProperties();
60  cand->SetMarkerColor( dp.color() );
61  cand->ElementChanged();
62  }
63  }
64 }
65 
66 //____________________________PAT_______________________________________________
68 {
69  public:
72 
74 };
75 
76 //____________________________PF________________________________________________
78 {
79  public:
82 
84 };
85 
86 //______________________________________________________________________________
89 
90 //______________________________________________________________________________
type
Definition: HCALResponse.h:22
const fireworks::Context & context() const
int i
Definition: DBlmapReader.cc:9
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
list parent
Definition: dbtoconf.py:74
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:185
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Jets made from PFObjects.
Definition: PFJet.h:22
const FWEventItem * item() const
Color_t color() const
int index() const
Definition: FWModelId.h:50
virtual void localModelChanges(const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
int j
Definition: DBlmapReader.cc:9
void updateScale(const FWViewContext *vc, const fireworks::Context &)
Analysis-level calorimeter jet class.
Definition: Jet.h:71
void setTrackTypePF(const reco::PFCandidate &pfCand, TAttLine *track)
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:535
virtual void scaleProduct(TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
long double T