CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
29  virtual void build( const FWEventItem* iItem, TEveElementList* product, const FWViewContext* ) override;
30 };
31 
32 void FWPCaloHitProxyBuilder::build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*)
33 {
35  iItem->get( collection );
36  if (! collection)
37  return;
38 
39 
40  TEveBoxSet* boxSet = addBoxSetToProduct(product);
41  int index = 0;
42  for (std::vector<PCaloHit>::const_iterator it = collection->begin() ; it != collection->end(); ++it)
43  {
44  const float* corners = item()->getGeom()->getCorners((*it).id());
45 
46  std::vector<float> scaledCorners(24);
47  if (corners)
48  fireworks::energyTower3DCorners(corners, (*it).energy() * 10, scaledCorners);
49 
50  addBox(boxSet, &scaledCorners[0], iItem->modelInfo(index++).displayProperties());
51  }
52 }
53 
54 // !AMT TEveBoxSet is not projectable. Can't be added to RPZ views empty.
std::vector< PCaloHit > PCaloHitContainer
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:67
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:58
void get(const T *&oData) const
Definition: FWEventItem.h:84
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:277
TEveBoxSet * addBoxSetToProduct(TEveElementList *product)
const FWPCaloHitProxyBuilder & operator=(const FWPCaloHitProxyBuilder &)
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