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 
19  virtual void build( const FWEventItem* iItem, TEveElementList* product, const FWViewContext* );
20 };
21 
22 
23 void FWPRCaloTowerProxyBuilder::build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*)
24 {
26  iItem->get( collection );
27  if (! collection)
28  return;
29 
30 
31  TEveBoxSet* boxSet = addBoxSetToProduct(product);
32  int index = 0;
33  for (std::vector<CaloTower>::const_iterator it = collection->begin() ; it != collection->end(); ++it)
34  {
35  const float* corners = item()->getGeom()->getCorners((*it).id().rawId());
36  if (corners == 0)
37  continue;
38 
39  std::vector<float> scaledCorners(24);
40  fireworks::energyTower3DCorners(corners, (*it).et(), scaledCorners);
41 
42  addBox(boxSet, &scaledCorners[0], iItem->modelInfo(index++).displayProperties());
43 
44  }
45 }
46 
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:277
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