CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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()
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:64
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
void get(const T *&oData) const
Definition: FWEventItem.h:78
const FWEventItem * item() const
const FWPRCaloTowerProxyBuilder & operator=(const FWPRCaloTowerProxyBuilder &)=delete
const_iterator end() const
void energyTower3DCorners(const float *corners, float scale, std::vector< float > &, bool reflect=false)
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:461
TEveBoxSet * addBoxSetToProduct(TEveElementList *product)
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:446
void addBox(TEveBoxSet *set, const float *pnts, const FWDisplayProperties &dp)
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
const_iterator begin() const