CMS 3D CMS Logo

FWHGCalMultiClusterLegoProxyBuilder.cc
Go to the documentation of this file.
1 // system includes
2 #include <cmath>
3 
4 // user includes
5 #include "TEveCaloData.h"
6 #include "TEveCalo.h"
7 #include "TH2F.h"
8 
13 
17 
19 
21 
22 #include "TEveCompound.h"
23 
25 {
26 }
27 
29 {
30 }
31 
32 void FWHGCalMultiClusterLegoProxyBuilder::build(const FWEventItem *iItem, TEveElementList *product, const FWViewContext *vc)
33 {
34  m_towers=nullptr;
35  if (iItem)
36  {
37  iItem->get(m_towers);
38  FWCaloDataProxyBuilderBase::build(iItem, product, vc);
39  }
40 }
41 
44 {
46 }
47 
48 void
50 {
51  m_hist->Reset();
52 
53  if (m_towers)
54  {
55  if(item()->defaultDisplayProperties().isVisible()) {
56  unsigned int index=0;
57  for(std::vector<reco::HGCalMultiCluster>::const_iterator tower = m_towers->begin(); tower != m_towers->end(); ++tower,++index) {
58  const FWEventItem::ModelInfo& info = item()->modelInfo(index);
59  if(info.displayProperties().isVisible()) {
60  addEntryToTEveCaloData(tower->eta(), tower->phi(), tower->pt(), info.isSelected());
61  }
62  }
63  }
64  }
65 }
66 
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
#define nullptr
const FWEventItem * item() const
FWHistSliceSelector * instantiateSliceSelector() override
const std::vector< reco::HGCalMultiCluster > * m_towers
void addEntryToTEveCaloData(float eta, float phi, float Et, bool isSelected)
static const int kAllLegoBits
Definition: FWViewType.h:60
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:540