CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 <cmath>
15 
16 // user includes
17 #include "TEveCaloData.h"
18 #include "TEveCalo.h"
19 #include "TH2F.h"
20 
24 
28 
30 
31 //
32 // constructors , dectructors
33 //
35 
37 
38 //
39 // member functions
40 //
41 
42 void FWPFCandidateTowerProxyBuilder::build(const FWEventItem* iItem, TEveElementList* el, const FWViewContext* ctx) {
43  m_towers = nullptr;
44  if (iItem) {
45  iItem->get(m_towers);
46  FWCaloDataProxyBuilderBase::build(iItem, el, ctx);
47  }
48 }
49 
52 }
53 
55  m_hist->Reset();
56 
57  if (m_towers) {
58  if (item()->defaultDisplayProperties().isVisible()) {
59  // assert(item()->size() >= m_towers->size());
60  unsigned int index = 0;
61  for (reco::PFCandidateConstIterator tower = m_towers->begin(); tower != m_towers->end(); ++tower, ++index) {
62  const FWEventItem::ModelInfo& info = item()->modelInfo(index);
63  if (info.displayProperties().isVisible()) {
64  addEntryToTEveCaloData(tower->eta(), tower->phi(), getEt(*tower), info.isSelected());
65  }
66  }
67  }
68  }
69 }
70 
73  "CaloTowerPfCandEcal",
77  "CaloTowerPfCandHcal",
static const TGPicture * info(bool iBackgroundIsBlack)
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:64
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:67
bool isSelected() const
Definition: FWEventItem.h:65
void get(const T *&oData) const
Definition: FWEventItem.h:78
const reco::PFCandidateCollection * m_towers
PFCandidateCollection::const_iterator PFCandidateConstIterator
iterator
const FWEventItem * item() const
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:69
virtual double getEt(const reco::PFCandidate &) const =0
FWHistSliceSelector * instantiateSliceSelector() override
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:446