CMS 3D CMS Logo

FWPCaloHitProxyBuilder.cc
Go to the documentation of this file.
1 /*
2  * FWPCaloHitProxyBuilder.cc
3  * FWorks
4  *
5  * Created by Ianna Osborne on 9/9/10.
6  *
7  */
8 
16 
18 {
19 public:
21  virtual ~FWPCaloHitProxyBuilder( void ) {}
22 
24 
25 private:
28 
30  virtual void build( const FWEventItem* iItem, TEveElementList* product, const FWViewContext* ) override;
31 };
32 
33 void FWPCaloHitProxyBuilder::build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*)
34 {
36  iItem->get( collection );
37  if (! collection)
38  return;
39 
40 
41  TEveBoxSet* boxSet = addBoxSetToProduct(product);
42  int index = 0;
43  for (std::vector<PCaloHit>::const_iterator it = collection->begin() ; it != collection->end(); ++it)
44  {
45  const float* corners = item()->getGeom()->getCorners((*it).id());
46 
47  std::vector<float> scaledCorners(24);
48  if (corners)
49  fireworks::energyTower3DCorners(corners, (*it).energy() * 10, scaledCorners);
50 
51  addBox(boxSet, &scaledCorners[0], iItem->modelInfo(index++).displayProperties());
52  }
53 }
54 
55 // !AMT TEveBoxSet is not projectable. Can't be added to RPZ views empty.
#define REGISTER_PROXYBUILDER_METHODS()
std::vector< PCaloHit > PCaloHitContainer
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:68
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:58
void get(const T *&oData) const
Definition: FWEventItem.h:85
const FWEventItem * item() const
static const int kAll3DBits
Definition: FWViewType.h:59
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)
const FWPCaloHitProxyBuilder & operator=(const FWPCaloHitProxyBuilder &)
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