CMS 3D CMS Logo

FWPRCaloTowerProxyBuilder.cc
Go to the documentation of this file.
6 
8 {
9 public:
11  ~FWPRCaloTowerProxyBuilder( void ) override {}
12 
14 
15 private:
16  FWPRCaloTowerProxyBuilder( const FWPRCaloTowerProxyBuilder& ) = delete; // stop default
17  const FWPRCaloTowerProxyBuilder& operator=( const FWPRCaloTowerProxyBuilder& ) = delete; // stop default
18 
20  void build( const FWEventItem* iItem, TEveElementList* product, const FWViewContext* ) override;
21 };
22 
23 
24 void FWPRCaloTowerProxyBuilder::build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*)
25 {
26  const CaloTowerCollection* collection = nullptr;
27  iItem->get( collection );
28  if (! collection)
29  return;
30 
31 
32  TEveBoxSet* boxSet = addBoxSetToProduct(product);
33  int index = 0;
34  for (std::vector<CaloTower>::const_iterator it = collection->begin() ; it != collection->end(); ++it)
35  {
36  const float* corners = item()->getGeom()->getCorners((*it).id().rawId());
37  if (corners == nullptr)
38  continue;
39 
40  std::vector<float> scaledCorners(24);
41  fireworks::energyTower3DCorners(corners, (*it).et(), scaledCorners);
42 
43  addBox(boxSet, &scaledCorners[0], iItem->modelInfo(index++).displayProperties());
44 
45  }
46 }
47 
#define REGISTER_PROXYBUILDER_METHODS()
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:68
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
void get(const T *&oData) const
Definition: FWEventItem.h:85
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:286
TEveBoxSet * addBoxSetToProduct(TEveElementList *product)
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:537
void addBox(TEveBoxSet *set, const float *pnts, const FWDisplayProperties &dp)
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:683
const_iterator begin() const