CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWBeamSpotOnlineProxyBuilder.cc
Go to the documentation of this file.
1 /*
2  * FWBeamSpotProxyBuilder.cc
3  * FWorks
4  *
5  * Created by Ianna Osborne on 7/29/10.
6  *
7  */
8 
9 #include "TEvePointSet.h"
10 #include "TEveStraightLineSet.h"
11 
14 
16 
18 {
19 public:
21  virtual ~FWBeamSpotOnlineProxyBuilder( void ) {}
22 
24 
25 private:
26  // Disable default copy constructor
28  // Disable default assignment operator
30 
31  virtual void build( const BeamSpotOnline& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* );
32 };
33 
34 void
35 FWBeamSpotOnlineProxyBuilder::build( const BeamSpotOnline& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* )
36 {
37  TEvePointSet* pointSet = new TEvePointSet;
38  setupAddElement( pointSet, &oItemHolder );
39 
40  TEveStraightLineSet* lineSet = new TEveStraightLineSet;
41  setupAddElement( lineSet, &oItemHolder );
42 
43  double posx = iData.x();
44  double posy = iData.y();
45  double posz = iData.z();
46  double errx = iData.err_x();
47  double erry = iData.err_y();
48  double errz = iData.err_z();
49 
50  pointSet->SetNextPoint( posx, posy, posz );
51  pointSet->SetNextPoint( posx + errx, posy + erry, posz + errz );
52  pointSet->SetNextPoint( posx - errx, posy - erry, posz - errz );
53 
54  lineSet->AddLine( posx + errx, posy + erry, posz + errz,
55  posx - errx, posy - erry, posz - errz );
56 }
57 
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
float err_y() const
static const int kAllRPZBits
Definition: FWViewType.h:56
float err_x() const
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
float y() const
float x() const
float z() const
static const int kAll3DBits
Definition: FWViewType.h:57
float err_z() const
const FWBeamSpotOnlineProxyBuilder & operator=(const FWBeamSpotOnlineProxyBuilder &)