CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWPFCandidateTowerProxyBuilder.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Calo
4 // Class : FWCaloTowerProxyBuilderBase
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Wed Dec 3 11:28:28 EST 2008
11 //
12 
13 // system includes
14 #include <math.h>
15 
16 // user includes
17 #include "TEveCaloData.h"
18 #include "TEveCalo.h"
19 #include "TH2F.h"
20 
24 
28 
30 
31 
32 
33 //
34 // constructors , dectructors
35 //
37 m_towers(0)
38 {
39 }
40 
42 {
43 }
44 
45 //
46 // member functions
47 //
48 
49 
50 
51 void
52 FWPFCandidateTowerProxyBuilder::build(const FWEventItem* iItem, TEveElementList* el, const FWViewContext* ctx)
53 {
54  m_towers=0;
55  if (iItem)
56  {
57  iItem->get(m_towers);
58  FWCaloDataProxyBuilderBase::build(iItem, el, ctx);
59  }
60 }
61 
62 
65 {
67 }
68 
69 void
71 {
72  m_hist->Reset();
73 
74  if (m_towers)
75  {
76  if(item()->defaultDisplayProperties().isVisible()) {
77  // assert(item()->size() >= m_towers->size());
78  unsigned int index=0;
79  for( reco::PFCandidateConstIterator tower = m_towers->begin(); tower != m_towers->end(); ++tower,++index) {
80  const FWEventItem::ModelInfo& info = item()->modelInfo(index);
81  if(info.displayProperties().isVisible()) {
82  addEntryToTEveCaloData(tower->eta(), tower->phi(), getEt(*tower), info.isSelected());
83  }
84  }
85  }
86  }
87 }
88 
static const TGPicture * info(bool iBackgroundIsBlack)
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:68
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:58
bool isSelected() const
Definition: FWEventItem.h:71
void get(const T *&oData) const
Definition: FWEventItem.h:85
const reco::PFCandidateCollection * m_towers
PFCandidateCollection::const_iterator PFCandidateConstIterator
iterator
const FWEventItem * item() const
virtual FWHistSliceSelector * instantiateSliceSelector()
void addEntryToTEveCaloData(float eta, float phi, float Et, bool isSelected)
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
static const int kAllLegoBits
Definition: FWViewType.h:60
virtual double getEt(const reco::PFCandidate &) const =0
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:537