CMS 3D CMS Logo

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

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

Inheritance diagram for FWHeatmapProxyBuilderTemplate< T >:
FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWHeatmapProxyBuilderTemplate ()
 
 FWHeatmapProxyBuilderTemplate (const FWHeatmapProxyBuilderTemplate &)=delete
 
const FWHeatmapProxyBuilderTemplateoperator= (const FWHeatmapProxyBuilderTemplate &)=delete
 
- Public Member Functions inherited from FWSimpleProxyBuilder
 FWSimpleProxyBuilder (const std::type_info &iType)
 
 FWSimpleProxyBuilder (const FWSimpleProxyBuilder &)=delete
 
const FWSimpleProxyBuilderoperator= (const FWSimpleProxyBuilder &)=delete
 
 ~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 FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
virtual void build (const void *, unsigned int iIndex, TEveElement &iItemHolder, const FWViewContext *)=0
 
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 *)
 
virtual void buildViewType (const void *, unsigned int iIndex, TEveElement &iItemHolder, FWViewType::EType, const FWViewContext *)=0
 
void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *) override
 
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 ()
 
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
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::unordered_map< DetId, const HGCRecHit * > * hitmap = new std::unordered_map<DetId, const HGCRecHit*>
 
- Protected Attributes inherited from FWSimpleProxyBuilder
FWSimpleProxyHelper m_helper
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Static Protected Attributes

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

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

◆ FWHeatmapProxyBuilderTemplate() [1/2]

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

Definition at line 36 of file FWHeatmapProxyBuilderTemplate.h.

36 : FWSimpleProxyBuilder(typeid(T)) {}
FWSimpleProxyBuilder(const std::type_info &iType)
long double T

◆ FWHeatmapProxyBuilderTemplate() [2/2]

Member Function Documentation

◆ build() [1/5]

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 
104  event->getByLabel(edm::InputTag("HGCalRecHit", "HGCEERecHits"), recHitHandleEE);
105  event->getByLabel(edm::InputTag("HGCalRecHit", "HGCHEFRecHits"), recHitHandleFH);
106  event->getByLabel(edm::InputTag("HGCalRecHit", "HGCHEBRecHits"), recHitHandleBH);
107 
108  if (recHitHandleEE.isValid()) {
109  const auto& rechitsEE = *recHitHandleEE;
110 
111  for (unsigned int i = 0; i < rechitsEE.size(); ++i) {
112  (*hitmap)[rechitsEE[i].detid().rawId()] = &rechitsEE[i];
113  }
114  }
115 
116  if (recHitHandleFH.isValid()) {
117  const auto& rechitsFH = *recHitHandleFH;
118 
119  for (unsigned int i = 0; i < rechitsFH.size(); ++i) {
120  (*hitmap)[rechitsFH[i].detid().rawId()] = &rechitsFH[i];
121  }
122  }
123 
124  if (recHitHandleBH.isValid()) {
125  const auto& rechitsBH = *recHitHandleBH;
126 
127  for (unsigned int i = 0; i < rechitsBH.size(); ++i) {
128  (*hitmap)[rechitsBH[i].detid().rawId()] = &rechitsBH[i];
129  }
130  }
131  }
132 
133  FWSimpleProxyBuilder::build(iItem, product, vc);
134  }
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:97
const edm::EventBase * getEvent() const
Definition: FWEventItem.h:131
bool isValid() const
Definition: HandleBase.h:70
const FWEventItem * item() const
std::unordered_map< DetId, const HGCRecHit * > * hitmap

◆ build() [2/5]

template<typename T>
void FWSimpleProxyBuilder::build
overrideprotected

Definition at line 75 of file FWSimpleProxyBuilder.cc.

75  {
76  size_t size = iItem->size();
77  TEveElement::List_i pIdx = product->BeginChildren();
78  for (int index = 0; index < static_cast<int>(size); ++index) {
79  TEveElement* itemHolder = nullptr;
80  if (index < product->NumChildren()) {
81  itemHolder = *pIdx;
82  itemHolder->SetRnrSelfChildren(true, true);
83  ++pIdx;
84  } else {
85  itemHolder = createCompound();
86  product->AddElement(itemHolder);
87  }
88  if (iItem->modelInfo(index).displayProperties().isVisible()) {
89  const void* modelData = iItem->modelData(index);
90  build(m_helper.offsetObject(modelData), index, *itemHolder, vc);
91  }
92  }
93 }
size
Write out results.
const void * offsetObject(const void *iObj) const
FWSimpleProxyHelper m_helper
TEveCompound * createCompound(bool set_color=true, bool propagate_color_to_all_children=false) const

◆ build() [3/5]

template<typename T>
virtual void FWSimpleProxyBuilder::build
protected

◆ build() [4/5]

template<typename T>
void FWHeatmapProxyBuilderTemplate< T >::build ( const void *  iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
const FWViewContext context 
)
inlineoverrideprotectedvirtual

Implements FWSimpleProxyBuilder.

Definition at line 137 of file FWHeatmapProxyBuilderTemplate.h.

137  {
138  if (nullptr != iData) {
139  build(*reinterpret_cast<const T*>(iData), iIndex, oItemHolder, context);
140  }
141  }
const fireworks::Context & context() const

◆ build() [5/5]

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 FWTracksterLayersProxyBuilder, FWTracksterHitsProxyBuilder, FWCaloClusterProxyBuilder, FWCaloParticleProxyBuilder, and FWHGCalMultiClusterProxyBuilder.

Definition at line 156 of file FWHeatmapProxyBuilderTemplate.h.

156  {
157  throw std::runtime_error(
158  "virtual build(const T&, unsigned int, TEveElement&, const FWViewContext*) not implemented by inherited "
159  "class.");
160  }

◆ buildViewType() [1/4]

template<typename T>
void FWSimpleProxyBuilder::buildViewType
overrideprotected

Definition at line 95 of file FWSimpleProxyBuilder.cc.

98  {
99  size_t size = iItem->size();
100  TEveElement::List_i pIdx = product->BeginChildren();
101  for (int index = 0; index < static_cast<int>(size); ++index) {
102  TEveElement* itemHolder = nullptr;
103  if (index < product->NumChildren()) {
104  itemHolder = *pIdx;
105  itemHolder->SetRnrSelfChildren(true, true);
106  ++pIdx;
107  } else {
108  itemHolder = createCompound();
109  product->AddElement(itemHolder);
110  }
111  if (iItem->modelInfo(index).displayProperties().isVisible()) {
112  const void* modelData = iItem->modelData(index);
113  buildViewType(m_helper.offsetObject(modelData), index, *itemHolder, viewType, vc);
114  }
115  }
116 }
size
Write out results.
void buildViewType(const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context) override
const void * offsetObject(const void *iObj) const
FWSimpleProxyHelper m_helper
TEveCompound * createCompound(bool set_color=true, bool propagate_color_to_all_children=false) const

◆ buildViewType() [2/4]

template<typename T>
virtual void FWSimpleProxyBuilder::buildViewType
protected

◆ buildViewType() [3/4]

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 144 of file FWHeatmapProxyBuilderTemplate.h.

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

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

◆ buildViewType() [4/4]

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 162 of file FWHeatmapProxyBuilderTemplate.h.

163  {
164  throw std::runtime_error(
165  "virtual buildViewType(const T&, unsigned int, TEveElement&, FWViewType::EType, const FWViewContext*) not "
166  "implemented by inherited class");
167  };

◆ modelData()

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
FWSimpleProxyHelper m_helper
long double T
const FWEventItem * item() const

◆ operator=()

template<typename T>
const FWHeatmapProxyBuilderTemplate& FWHeatmapProxyBuilderTemplate< T >::operator= ( const FWHeatmapProxyBuilderTemplate< T > &  )
delete

◆ setItem()

template<typename T>
void FWHeatmapProxyBuilderTemplate< T >::setItem ( const FWEventItem iItem)
inlineoverrideprotectedvirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 82 of file FWHeatmapProxyBuilderTemplate.h.

Referenced by FWCaloClusterProxyBuilder::setItem(), FWTracksterHitsProxyBuilder::setItem(), and FWTracksterLayersProxyBuilder::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

◆ gradient

template<typename T>
constexpr 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.

◆ gradient_steps

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

Definition at line 49 of file FWHeatmapProxyBuilderTemplate.h.

◆ hitmap

template<typename T>
std::unordered_map<DetId, const HGCRecHit*>* FWHeatmapProxyBuilderTemplate< T >::hitmap = new std::unordered_map<DetId, const HGCRecHit*>
protected