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_towers(0)
27 {
28 }
29 
31 {
32 }
33 
34 //
35 // member functions
36 //
37 
38 
39 
40 void
41 FWCandidateTowerProxyBuilder::build(const FWEventItem* iItem, TEveElementList* el, const FWViewContext* ctx)
42 {
43  m_towers=0;
44  if (iItem)
45  {
46  iItem->get(m_towers);
47  FWCaloDataProxyBuilderBase::build(iItem, el, ctx);
48  }
49 }
50 
51 
54 {
56  return ss;
57 }
58 
59 void
61 {
62  m_hist->Reset();
63 
64  if (m_towers)
65  {
66  if(item()->defaultDisplayProperties().isVisible()) {
67  // assert(item()->size() >= m_towers->size());
68  unsigned int index=0;
69  for( pat::PackedCandidateCollection::const_iterator tower = m_towers->begin(); tower != m_towers->end(); ++tower,++index) {
70  const FWEventItem::ModelInfo& info = item()->modelInfo(index);
71  if(info.displayProperties().isVisible()) {
72  addEntryToTEveCaloData(tower->eta(), tower->phi(), getEt(*tower), info.isSelected());
73  }
74  }
75  }
76  }
77 }
78 
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
const pat::PackedCandidateCollection * m_towers
bool isSelected() const
Definition: FWEventItem.h:70
void get(const T *&oData) const
Definition: FWEventItem.h:84
std::vector< pat::PackedCandidate > PackedCandidateCollection
const FWEventItem * item() const
void addEntryToTEveCaloData(float eta, float phi, float Et, bool isSelected)
static const int kAllLegoBits
Definition: FWViewType.h:60
virtual double getEt(const reco::Candidate &cand) const
virtual FWHistSliceSelector * instantiateSliceSelector()
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:535