CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWPSimHitProxyBuilder.cc
Go to the documentation of this file.
1 /*
2  * FWPSimHitProxyBuilder.cc
3  * FWorks
4  *
5  * Created by Ianna Osborne on 9/9/10.
6  *
7  */
8 
14 
15 #include "TEvePointSet.h"
16 
18 {
19 public:
21  virtual ~FWPSimHitProxyBuilder( void ) {}
22 
24 
25 private:
26  // Disable default copy constructor
28  // Disable default assignment operator
30 
31  void build( const PSimHit& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* );
32 };
33 
34 void
35 FWPSimHitProxyBuilder::build( const PSimHit& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* )
36 {
37  TEvePointSet* pointSet = new TEvePointSet;
38  setupAddElement( pointSet, &oItemHolder );
39  const FWGeometry *geom = item()->getGeom();
40  unsigned int rawid = iData.detUnitId();
41  if( ! geom->contains( rawid ))
42  {
44  << "failed to get geometry of detid: "
45  << rawid << std::endl;
46  return;
47  }
48 
49  float local[3] = { iData.localPosition().x(), iData.localPosition().y(), iData.localPosition().z() };
50  float global[3];
51  geom->localToGlobal( rawid, local, global );
52  pointSet->SetNextPoint( global[0], global[1], global[2] );
53 }
54 
virtual ~FWPSimHitProxyBuilder(void)
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:56
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
T y() const
Definition: PV3DBase.h:57
void localToGlobal(unsigned int id, const float *local, float *global) const
Definition: FWGeometry.cc:326
const FWEventItem * item() const
static const int kAll3DBits
Definition: FWViewType.h:57
Local3DPoint localPosition() const
Definition: PSimHit.h:44
const FWPSimHitProxyBuilder & operator=(const FWPSimHitProxyBuilder &)
T z() const
Definition: PV3DBase.h:58
bool contains(unsigned int id) const
Definition: FWGeometry.h:98
#define fwLog(_level_)
Definition: fwLog.h:51
T x() const
Definition: PV3DBase.h:56
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:688
unsigned int detUnitId() const
Definition: PSimHit.h:93