CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWCastorRecHitProxyBuilder.cc
Go to the documentation of this file.
1 /*
2  * FWCastorRecHitProxyBuilder.cc
3  * cmsShow
4  *
5  * Created by Ianna Osborne on 7/8/10.
6  *
7  */
8 
15 
17 {
18 public:
20  virtual ~FWCastorRecHitProxyBuilder( void ) {}
21 
23 
24 private:
27 
28  virtual void build( const FWEventItem* iItem, TEveElementList* product, const FWViewContext* );
29 };
30 
31 void FWCastorRecHitProxyBuilder::build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*)
32 {
34  iItem->get( collection );
35  if (! collection)
36  return;
37 
38 
39  TEveBoxSet* boxSet = addBoxSetToProduct(product);
40  int index = 0;
41  for (std::vector<CastorRecHit>::const_iterator it = collection->begin() ; it != collection->end(); ++it)
42  {
43  const float* corners = item()->getGeom()->getCorners((*it).detid());
44  if (corners == 0)
45  continue;
46 
47  std::vector<float> scaledCorners(24);
48  fireworks::energyTower3DCorners(corners, (*it).energy() * 10, scaledCorners);
49 
50  addBox(boxSet, &scaledCorners[0], iItem->modelInfo(index++).displayProperties());
51  }
52 }
53 
const FWCastorRecHitProxyBuilder & operator=(const FWCastorRecHitProxyBuilder &)
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 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:278
TEveBoxSet * addBoxSetToProduct(TEveElementList *product)
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:536
void addBox(TEveBoxSet *set, const float *pnts, const FWDisplayProperties &dp)
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:688
const_iterator begin() const