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:67
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:58
virtual void itemChangedImp(const FWEventItem *)
virtual float eta() const =0
momentum pseudorapidity
bool isSelected() const
Definition: FWEventItem.h:70
virtual float phi() const =0
momentum azimuthal angle
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:548
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:567
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:535
void itemChanged(const FWEventItem *)