CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWTrackingParticleProxyBuilder.cc
Go to the documentation of this file.
1 /*
2  * FWTrackingParticleProxyBuilder.cc
3  * FWorks
4  *
5  * Created by Ianna Osborne on 9/9/10.
6  *
7  */
8 
14 
17 
18 #include "TEveTrack.h"
19 
21 {
22 public:
25 
26  virtual void setItem(const FWEventItem* iItem) override {
28  iItem->getConfig()->assertParam("Point Size", 1l, 3l, 1l);
29  }
30 
32 
33 private:
34  // Disable default copy constructor
36  // Disable default assignment operator
38 
39  void build( const TrackingParticle& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* ) override;
40 };
41 
42 void
43 FWTrackingParticleProxyBuilder::build( const TrackingParticle& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* )
44 {
45  TEveRecTrack t;
46  t.fBeta = 1.0;
47  t.fP = TEveVector( iData.px(), iData.py(), iData.pz() );
48  t.fV = TEveVector( iData.vx(), iData.vy(), iData.vz() );
49  t.fSign = iData.charge();
50 
51  TEveTrack* track = new TEveTrack(&t, context().getTrackPropagator());
52  if( t.fSign == 0 )
53  track->SetLineStyle( 7 );
54 
55  track->MakeTrack();
56  setupAddElement( track, &oItemHolder );
57 }
58 
const fireworks::Context & context() const
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:165
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:58
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
double py() const
y coordinate of momentum vector. Note this is taken from the first SimTrack only. ...
static const int kAll3DBits
Definition: FWViewType.h:59
double pz() const
z coordinate of momentum vector. Note this is taken from the first SimTrack only. ...
virtual void setItem(const FWEventItem *iItem) override
double vy() const
y coordinate of parent vertex position
virtual void setItem(const FWEventItem *iItem)
const FWTrackingParticleProxyBuilder & operator=(const FWTrackingParticleProxyBuilder &)
FWGenericParameter< T > * assertParam(const std::string &name, T def)
double vx() const
x coordinate of parent vertex position
Monte Carlo truth information used for tracking validation.
int charge() const
Electric charge. Note this is taken from the first SimTrack only.
double px() const
x coordinate of momentum vector. Note this is taken from the first SimTrack only. ...
double vz() const
z coordinate of parent vertex position