CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWCandidateTowerProxyBuilder.cc
Go to the documentation of this file.
2 
3 // system includes
4 #include <math.h>
5 
6 // user includes
7 #include "TEveCaloData.h"
8 #include "TEveCalo.h"
9 #include "TH2F.h"
10 
15 
17 
19 
20 
21 
22 //
23 // constructors , dectructors
24 //
26  m_helper(typeid(reco::Candidate))
27 {
28 }
29 
31 {
32 }
33 
34 //
35 // member functions
36 //
37 
38 
40 {
41  if (iItem)
42  {
43  m_helper.itemChanged(iItem);
44  }
45 }
46 
47 void
48 FWCandidateTowerProxyBuilder::build(const FWEventItem* iItem, TEveElementList* el, const FWViewContext* ctx)
49 {
50  // m_towers=0;
51  if (iItem )
52  {
53  // iItem->get(m_towers);
54  FWCaloDataProxyBuilderBase::build(iItem, el, ctx);
55  }
56 }
57 
58 
61 {
63  return ss;
64 }
65 
66 void
68 {
69  m_hist->Reset();
70 
71  // if (m_towers)
72  {
73  if(item()->defaultDisplayProperties().isVisible()) {
74  // assert(item()->size() >= m_towers->size());
75  for (size_t index = 0; index < item()->size(); ++index) {
77  if(info.displayProperties().isVisible()) {
78  const void* modelData = item()->modelData((int)index);
79 
80  const reco::Candidate* tower = reinterpret_cast<const reco::Candidate*>(m_helper.offsetObject(modelData));
81  addEntryToTEveCaloData(tower->eta(), tower->phi(), getEt(*tower), info.isSelected());
82  }
83  }
84  }
85  }
86 }
87 
88 
89 
90 
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
virtual void itemChangedImp(const FWEventItem *)
bool isSelected() const
Definition: FWEventItem.h:71
const void * offsetObject(const void *iObj) const
const FWEventItem * item() const
void addEntryToTEveCaloData(float eta, float phi, float Et, bool isSelected)
size_t size() const
Definition: FWEventItem.cc:550
static const int kAllLegoBits
Definition: FWViewType.h:60
virtual double getEt(const reco::Candidate &cand) const
virtual FWHistSliceSelector * instantiateSliceSelector()
const void * modelData(int iIndex) const
Definition: FWEventItem.cc:569
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:537
void itemChanged(const FWEventItem *)
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity