CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWZDCRecHitProxyBuilder.cc
Go to the documentation of this file.
1 /*
2  * FWZDCRecHitProxyBuilder.cc
3  * cmsShow
4  *
5  * Created by Ianna Osborne on 7/8/10.
6  *
7  */
14 #include "TEveBoxSet.h"
15 
17 {
18 public:
20  virtual ~FWZDCRecHitProxyBuilder( void ) {}
21 
23 
24 private:
26 
28  virtual void build( const FWEventItem* iItem, TEveElementList* product, const FWViewContext* );
29 };
30 
31 void FWZDCRecHitProxyBuilder::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  boxSet->SetAntiFlick(kTRUE);
41  int index = 0;
42  for (std::vector<ZDCRecHit>::const_iterator it = collection->begin() ; it != collection->end(); ++it)
43  {
44  const float* corners = item()->getGeom()->getCorners((*it).detid());
45 
46  std::vector<float> scaledCorners(24);
47  if (corners != 0) {
48  fireworks::energyTower3DCorners(corners, (*it).energy(), scaledCorners);
49  // Invert the normals:
50  // for (int i = 0; i < 12; ++i)
51  // std::swap(scaledCorners[i], scaledCorners[i+12]);
52  }
53 
54  addBox(boxSet, &scaledCorners[0], iItem->modelInfo(index++).displayProperties());
55  }
56 }
57 
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 FWZDCRecHitProxyBuilder & operator=(const FWZDCRecHitProxyBuilder &)
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:535
void addBox(TEveBoxSet *set, const float *pnts, const FWDisplayProperties &dp)
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:687
const_iterator begin() const