CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
FWHeatmapProxyBuilderTemplate< T > Class Template Reference

#include <Fireworks/Calo/interface/FWHeatmapProxyBuilderTemplate.h>

Inheritance diagram for FWHeatmapProxyBuilderTemplate< T >:
FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWHeatmapProxyBuilderTemplate ()
 
- Public Member Functions inherited from FWSimpleProxyBuilder
 FWSimpleProxyBuilder (const std::type_info &iType)
 
 ~FWSimpleProxyBuilder () override
 
- Public Member Functions inherited from FWProxyBuilderBase
void build ()
 
virtual bool canHandle (const FWEventItem &)
 
const fireworks::Contextcontext () const
 
TEveElementList * createProduct (FWViewType::EType, const FWViewContext *)
 
 FWProxyBuilderBase ()
 
bool getHaveWindow () const
 
virtual bool havePerViewProduct (FWViewType::EType) const
 
virtual bool haveSingleProduct () const
 
const FWEventItemitem () const
 
virtual void itemBeingDestroyed (const FWEventItem *)
 
void itemChanged (const FWEventItem *)
 
int layer () const
 
void modelChanges (const FWModelIds &)
 
void removePerViewProduct (FWViewType::EType, const FWViewContext *vc)
 
void scaleChanged (const FWViewContext *)
 
void setHaveWindow (bool iFlag)
 
virtual void setInteractionList (FWInteractionList *, const std::string &)
 
void setupAddElement (TEveElement *el, TEveElement *parent, bool set_color=true) const
 
void setupElement (TEveElement *el, bool color=true) const
 
virtual bool willHandleInteraction () const
 
virtual ~FWProxyBuilderBase ()
 

Protected Member Functions

void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *vc) override
 
void build (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context) override
 
virtual void build (const T &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *)
 
void buildViewType (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context) override
 
virtual void buildViewType (const T &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
 
const TmodelData (int index)
 
void setItem (const FWEventItem *iItem) override
 
- Protected Member Functions inherited from FWSimpleProxyBuilder
void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *) override
 
void clean () override
 
- Protected Member Functions inherited from FWProxyBuilderBase
virtual void cleanLocal ()
 
TEveCompound * createCompound (bool set_color=true, bool propagate_color_to_all_children=false) const
 
 FWProxyBuilderBase (const FWProxyBuilderBase &)
 
void increaseComponentTransparency (unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
 
virtual void localModelChanges (const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
 
virtual void modelChanges (const FWModelIds &, Product *)
 
const FWProxyBuilderBaseoperator= (const FWProxyBuilderBase &)
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 

Protected Attributes

std::map< DetId, const HGCRecHit * > hitmap
 
- Protected Attributes inherited from FWSimpleProxyBuilder
FWSimpleProxyHelper m_helper
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Static Protected Attributes

static uint8_t gradient [3][gradient_steps]
 
static uint8_t gradient_steps = 9
 

Private Member Functions

 FWHeatmapProxyBuilderTemplate (const FWHeatmapProxyBuilderTemplate &)=delete
 
const FWHeatmapProxyBuilderTemplateoperator= (const FWHeatmapProxyBuilderTemplate &)=delete
 

Additional Inherited Members

- Static Public Member Functions inherited from FWSimpleProxyBuilder
static std::string typeOfBuilder ()
 Used by the plugin system to determine how the proxy uses the data from FWEventItem. More...
 
- Static Public Member Functions inherited from FWProxyBuilderBase
static bool representsSubPart ()
 
static std::string typeOfBuilder ()
 Used by the plugin system to determine how the proxy uses the data from FWEventItem. More...
 
- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >::iterator Product_it
 

Detailed Description

template<typename T>
class FWHeatmapProxyBuilderTemplate< T >

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 34 of file FWHeatmapProxyBuilderTemplate.h.

Constructor & Destructor Documentation

template<typename T>
FWHeatmapProxyBuilderTemplate< T >::FWHeatmapProxyBuilderTemplate ( )
inline

Definition at line 36 of file FWHeatmapProxyBuilderTemplate.h.

Referenced by FWHeatmapProxyBuilderTemplate< reco::CaloCluster >::buildViewType().

36 : FWSimpleProxyBuilder(typeid(T)) {}
FWSimpleProxyBuilder(const std::type_info &iType)
long double T
template<typename T>
FWHeatmapProxyBuilderTemplate< T >::FWHeatmapProxyBuilderTemplate ( const FWHeatmapProxyBuilderTemplate< T > &  )
privatedelete

Member Function Documentation

template<typename T>
void FWHeatmapProxyBuilderTemplate< T >::build ( const FWEventItem iItem,
TEveElementList *  product,
const FWViewContext vc 
)
inlineoverrideprotectedvirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 94 of file FWHeatmapProxyBuilderTemplate.h.

94  {
95  if (item()->getConfig()->template value<bool>("Heatmap")) {
96  hitmap.clear();
97 
98  edm::Handle<HGCRecHitCollection> recHitHandleEE;
99  edm::Handle<HGCRecHitCollection> recHitHandleFH;
100  edm::Handle<HGCRecHitCollection> recHitHandleBH;
101 
102  const edm::EventBase* event = iItem->getEvent();
103  event->getByLabel(edm::InputTag("HGCalRecHit", "HGCEERecHits"), recHitHandleEE);
104  event->getByLabel(edm::InputTag("HGCalRecHit", "HGCHEFRecHits"), recHitHandleFH);
105  event->getByLabel(edm::InputTag("HGCalRecHit", "HGCHEBRecHits"), recHitHandleBH);
106 
107  if (recHitHandleEE.isValid()) {
108  const auto& rechitsEE = *recHitHandleEE;
109 
110  for (unsigned int i = 0; i < rechitsEE.size(); ++i) {
111  hitmap[rechitsEE[i].detid().rawId()] = &rechitsEE[i];
112  }
113  }
114 
115  if (recHitHandleFH.isValid()) {
116  const auto& rechitsFH = *recHitHandleFH;
117 
118  for (unsigned int i = 0; i < rechitsFH.size(); ++i) {
119  hitmap[rechitsFH[i].detid().rawId()] = &rechitsFH[i];
120  }
121  }
122 
123  if (recHitHandleBH.isValid()) {
124  const auto& rechitsBH = *recHitHandleBH;
125 
126  for (unsigned int i = 0; i < rechitsBH.size(); ++i) {
127  hitmap[rechitsBH[i].detid().rawId()] = &rechitsBH[i];
128  }
129  }
130  }
131 
132  FWSimpleProxyBuilder::build(iItem, product, vc);
133  }
std::map< DetId, const HGCRecHit * > hitmap
const FWEventItem * item() const
bool isValid() const
Definition: HandleBase.h:70
const edm::EventBase * getEvent() const
Definition: FWEventItem.h:131
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:92
template<typename T>
void FWHeatmapProxyBuilderTemplate< T >::build ( const void *  iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
const FWViewContext context 
)
inlineoverrideprotectedvirtual

Implements FWSimpleProxyBuilder.

Definition at line 136 of file FWHeatmapProxyBuilderTemplate.h.

136  {
137  if (nullptr != iData) {
138  build(*reinterpret_cast<const T*>(iData), iIndex, oItemHolder, context);
139  }
140  }
template<typename T>
virtual void FWHeatmapProxyBuilderTemplate< T >::build ( const T iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
const FWViewContext  
)
inlineprotectedvirtual

iIndex is the index where iData is found in the container from which it came iItemHolder is the object to which you add your own objects which inherit from TEveElement

Reimplemented in FWCaloClusterProxyBuilder, FWCaloParticleProxyBuilder, and FWHGCalMultiClusterProxyBuilder.

Definition at line 155 of file FWHeatmapProxyBuilderTemplate.h.

155  {
156  throw std::runtime_error(
157  "virtual build(const T&, unsigned int, TEveElement&, const FWViewContext*) not implemented by inherited "
158  "class.");
159  }
template<typename T>
void FWHeatmapProxyBuilderTemplate< T >::buildViewType ( const void *  iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
FWViewType::EType  viewType,
const FWViewContext context 
)
inlineoverrideprotectedvirtual

Implements FWSimpleProxyBuilder.

Definition at line 143 of file FWHeatmapProxyBuilderTemplate.h.

Referenced by FWHeatmapProxyBuilderTemplate< reco::CaloCluster >::buildViewType().

147  {
148  if (nullptr != iData) {
149  buildViewType(*reinterpret_cast<const T*>(iData), iIndex, oItemHolder, viewType, context);
150  }
151  }
void buildViewType(const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context) override
template<typename T>
virtual void FWHeatmapProxyBuilderTemplate< T >::buildViewType ( const T iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
FWViewType::EType  viewType,
const FWViewContext  
)
inlineprotectedvirtual

Definition at line 161 of file FWHeatmapProxyBuilderTemplate.h.

162  {
163  throw std::runtime_error(
164  "virtual buildViewType(const T&, unsigned int, TEveElement&, FWViewType::EType, const FWViewContext*) not "
165  "implemented by inherited class");
166  };
template<typename T>
const T& FWHeatmapProxyBuilderTemplate< T >::modelData ( int  index)
inlineprotected

Definition at line 80 of file FWHeatmapProxyBuilderTemplate.h.

Referenced by FWHeatmapProxyBuilderTemplate< reco::CaloCluster >::modelData().

80 { return *reinterpret_cast<const T*>(m_helper.offsetObject(item()->modelData(index))); }
const void * offsetObject(const void *iObj) const
const FWEventItem * item() const
FWSimpleProxyHelper m_helper
long double T
template<typename T>
const FWHeatmapProxyBuilderTemplate& FWHeatmapProxyBuilderTemplate< T >::operator= ( const FWHeatmapProxyBuilderTemplate< T > &  )
privatedelete
template<typename T>
void FWHeatmapProxyBuilderTemplate< T >::setItem ( const FWEventItem iItem)
inlineoverrideprotectedvirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 82 of file FWHeatmapProxyBuilderTemplate.h.

Referenced by Vispa.Plugins.EdmBrowser.EventContentView.EventContentView::_addRow(), Vispa.Views.TableView.TableView::_createItem(), Vispa.Views.PropertyView.PropertyView::addCategory(), Vispa.Views.PropertyView.PropertyView::append(), and FWCaloClusterProxyBuilder::setItem().

82  {
84  if (iItem) {
85  iItem->getConfig()->keepEntries(true);
86  iItem->getConfig()->assertParam("Layer", 0L, 0L, 52L);
87  iItem->getConfig()->assertParam("EnergyCutOff", 0.5, 0.2, 5.0);
88  iItem->getConfig()->assertParam("Heatmap", true);
89  iItem->getConfig()->assertParam("Z+", true);
90  iItem->getConfig()->assertParam("Z-", true);
91  }
92  }
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:150
virtual void setItem(const FWEventItem *iItem)
FWGenericParameter< T > * assertParam(const std::string &name, T def)

Member Data Documentation

template<typename T>
uint8_t FWHeatmapProxyBuilderTemplate< T >::gradient[3][gradient_steps]
staticprotected
Initial value:
= {{static_cast<uint8_t>(0.2082 * 255),
static_cast<uint8_t>(0.0592 * 255),
static_cast<uint8_t>(0.0780 * 255),
static_cast<uint8_t>(0.0232 * 255),
static_cast<uint8_t>(0.1802 * 255),
static_cast<uint8_t>(0.5301 * 255),
static_cast<uint8_t>(0.8186 * 255),
static_cast<uint8_t>(0.9956 * 255),
static_cast<uint8_t>(0.9764 * 255)},
{static_cast<uint8_t>(0.1664 * 255),
static_cast<uint8_t>(0.3599 * 255),
static_cast<uint8_t>(0.5041 * 255),
static_cast<uint8_t>(0.6419 * 255),
static_cast<uint8_t>(0.7178 * 255),
static_cast<uint8_t>(0.7492 * 255),
static_cast<uint8_t>(0.7328 * 255),
static_cast<uint8_t>(0.7862 * 255),
static_cast<uint8_t>(0.9832 * 255)},
{static_cast<uint8_t>(0.5293 * 255),
static_cast<uint8_t>(0.8684 * 255),
static_cast<uint8_t>(0.8385 * 255),
static_cast<uint8_t>(0.7914 * 255),
static_cast<uint8_t>(0.6425 * 255),
static_cast<uint8_t>(0.4662 * 255),
static_cast<uint8_t>(0.3499 * 255),
static_cast<uint8_t>(0.1968 * 255),
static_cast<uint8_t>(0.0539 * 255)}}

Definition at line 50 of file FWHeatmapProxyBuilderTemplate.h.

template<typename T>
uint8_t FWHeatmapProxyBuilderTemplate< T >::gradient_steps = 9
staticprotected

Definition at line 49 of file FWHeatmapProxyBuilderTemplate.h.

template<typename T>
std::map<DetId, const HGCRecHit*> FWHeatmapProxyBuilderTemplate< T >::hitmap
protected

Definition at line 47 of file FWHeatmapProxyBuilderTemplate.h.