CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWPRCaloTowerProxyBuilder.cc
Go to the documentation of this file.
6 
8 {
9 public:
11  virtual ~FWPRCaloTowerProxyBuilder( void ) {}
12 
14 
15 private:
16  FWPRCaloTowerProxyBuilder( const FWPRCaloTowerProxyBuilder& ); // stop default
17  const FWPRCaloTowerProxyBuilder& operator=( const FWPRCaloTowerProxyBuilder& ); // stop default
18 
20  virtual void build( const FWEventItem* iItem, TEveElementList* product, const FWViewContext* );
21 };
22 
23 
24 void FWPRCaloTowerProxyBuilder::build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*)
25 {
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 == 0)
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 
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:67
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
void get(const T *&oData) const
Definition: FWEventItem.h:84
const FWPRCaloTowerProxyBuilder & operator=(const FWPRCaloTowerProxyBuilder &)
const FWEventItem * item() const
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:261
TEveBoxSet * addBoxSetToProduct(TEveElementList *product)
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:535
void addBox(TEveBoxSet *set, const float *pnts, const FWDisplayProperties &dp)
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:681
const_iterator begin() const