1 #ifndef Fireworks_Core_FWHeatmapProxyBuilderTemplate_h 2 #define Fireworks_Core_FWHeatmapProxyBuilderTemplate_h 47 std::unordered_map<DetId, const HGCRecHit*>*
hitmap =
new std::unordered_map<DetId, const HGCRecHit*>;
51 static_cast<uint8_t>(0.0592 * 255),
52 static_cast<uint8_t
>(0.0780 * 255),
53 static_cast<uint8_t>(0.0232 * 255),
54 static_cast<uint8_t
>(0.1802 * 255),
55 static_cast<uint8_t>(0.5301 * 255),
56 static_cast<uint8_t
>(0.8186 * 255),
57 static_cast<uint8_t>(0.9956 * 255),
58 static_cast<uint8_t
>(0.9764 * 255)},
60 {
static_cast<uint8_t
>(0.1664 * 255),
61 static_cast<uint8_t>(0.3599 * 255),
62 static_cast<uint8_t
>(0.5041 * 255),
63 static_cast<uint8_t>(0.6419 * 255),
64 static_cast<uint8_t
>(0.7178 * 255),
65 static_cast<uint8_t>(0.7492 * 255),
66 static_cast<uint8_t
>(0.7328 * 255),
67 static_cast<uint8_t>(0.7862 * 255),
68 static_cast<uint8_t
>(0.9832 * 255)},
70 {
static_cast<uint8_t
>(0.5293 * 255),
71 static_cast<uint8_t>(0.8684 * 255),
72 static_cast<uint8_t
>(0.8385 * 255),
73 static_cast<uint8_t>(0.7914 * 255),
74 static_cast<uint8_t
>(0.6425 * 255),
75 static_cast<uint8_t>(0.4662 * 255),
76 static_cast<uint8_t
>(0.3499 * 255),
77 static_cast<uint8_t>(0.1968 * 255),
78 static_cast<uint8_t
>(0.0539 * 255)}};
95 if (
item()->getConfig()->
template value<bool>(
"Heatmap")) {
105 event->getByLabel(
edm::InputTag(
"HGCalRecHit",
"HGCHEFRecHits"), recHitHandleFH);
106 event->getByLabel(
edm::InputTag(
"HGCalRecHit",
"HGCHEBRecHits"), recHitHandleBH);
108 if (recHitHandleEE.
isValid()) {
109 const auto& rechitsEE = *recHitHandleEE;
111 for (
unsigned int i = 0;
i < rechitsEE.size(); ++
i) {
112 (*hitmap)[rechitsEE[
i].detid().rawId()] = &rechitsEE[
i];
116 if (recHitHandleFH.
isValid()) {
117 const auto& rechitsFH = *recHitHandleFH;
119 for (
unsigned int i = 0;
i < rechitsFH.size(); ++
i) {
120 (*hitmap)[rechitsFH[
i].detid().rawId()] = &rechitsFH[
i];
124 if (recHitHandleBH.
isValid()) {
125 const auto& rechitsBH = *recHitHandleBH;
127 for (
unsigned int i = 0;
i < rechitsBH.size(); ++
i) {
128 (*hitmap)[rechitsBH[
i].detid().rawId()] = &rechitsBH[
i];
138 if (
nullptr != iData) {
139 build(*reinterpret_cast<const T*>(iData), iIndex, oItemHolder,
context);
146 TEveElement& oItemHolder,
149 if (
nullptr != iData) {
157 throw std::runtime_error(
158 "virtual build(const T&, unsigned int, TEveElement&, const FWViewContext*) not implemented by inherited " 164 throw std::runtime_error(
165 "virtual buildViewType(const T&, unsigned int, TEveElement&, FWViewType::EType, const FWViewContext*) not " 166 "implemented by inherited class");
void setItem(const FWEventItem *iItem) override
FWProxyBuilderConfiguration * getConfig() const
static constexpr uint8_t gradient_steps
void build(const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context) override
bool getByLabel(InputTag const &, Handle< T > &) const
void build(const FWEventItem *iItem, TEveElementList *product, const FWViewContext *vc) override
virtual void buildViewType(const T &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
const fireworks::Context & context() const
const FWHeatmapProxyBuilderTemplate & operator=(const FWHeatmapProxyBuilderTemplate &)=delete
void buildViewType(const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context) override
virtual void setItem(const FWEventItem *iItem)
static constexpr uint8_t gradient[3][gradient_steps]
const edm::EventBase * getEvent() const
FWHeatmapProxyBuilderTemplate()
const void * offsetObject(const void *iObj) const
FWGenericParameter< T > * assertParam(const std::string &name, T def)
FWSimpleProxyHelper m_helper
void buildViewType(const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *) override
const T & modelData(int index)
virtual void build(const T &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *)
const FWEventItem * item() const
std::unordered_map< DetId, const HGCRecHit * > * hitmap