CMS 3D CMS Logo

FWPRCaloTowerProxyBuilder.cc
Go to the documentation of this file.
6 
8 public:
10  ~FWPRCaloTowerProxyBuilder(void) override {}
11 
13 
14  FWPRCaloTowerProxyBuilder(const FWPRCaloTowerProxyBuilder&) = delete; // stop default
15  const FWPRCaloTowerProxyBuilder& operator=(const FWPRCaloTowerProxyBuilder&) = delete; // stop default
16 
17 private:
19  void build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*) override;
20 };
21 
22 void FWPRCaloTowerProxyBuilder::build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*) {
23  const CaloTowerCollection* collection = nullptr;
24  iItem->get(collection);
25  if (!collection)
26  return;
27 
28  TEveBoxSet* boxSet = addBoxSetToProduct(product);
29  int index = 0;
30  for (std::vector<CaloTower>::const_iterator it = collection->begin(); it != collection->end(); ++it) {
31  const float* corners = item()->getGeom()->getCorners((*it).id().rawId());
32  if (corners == nullptr)
33  continue;
34 
35  std::vector<float> scaledCorners(24);
36  fireworks::energyTower3DCorners(corners, (*it).et(), scaledCorners);
37 
38  addBox(boxSet, &scaledCorners[0], iItem->modelInfo(index++).displayProperties());
39  }
40 }
41 
#define REGISTER_PROXYBUILDER_METHODS()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
void get(const T *&oData) const
Definition: FWEventItem.h:78
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:64
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:439
const FWPRCaloTowerProxyBuilder & operator=(const FWPRCaloTowerProxyBuilder &)=delete
void energyTower3DCorners(const float *corners, float scale, std::vector< float > &, bool reflect=false)
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
TEveBoxSet * addBoxSetToProduct(TEveElementList *product)
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:446
void addBox(TEveBoxSet *set, const float *pnts, const FWDisplayProperties &dp)
const FWEventItem * item() const
static constexpr unsigned int kISpyBit
Definition: FWViewType.h:50