CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWTrackProxyBuilder.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Tracks
4 // Class : FWTrackProxyBuilder
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Tue Nov 25 14:42:13 EST 2008
11 // $Id: FWTrackProxyBuilder.cc,v 1.15 2012/06/27 20:26:29 amraktad Exp $
12 //
13 
14 // system include files
15 #include "TEveTrack.h"
16 
17 // user include files
23 
25 
27 
28 public:
30  virtual ~FWTrackProxyBuilder();
31 
33 
34 private:
35  FWTrackProxyBuilder(const FWTrackProxyBuilder&); // stop default
36 
37  const FWTrackProxyBuilder& operator=(const FWTrackProxyBuilder&); // stop default
38 
39  void build(const reco::Track& iData, unsigned int iIndex,TEveElement& oItemHolder, const FWViewContext*);
40 };
41 
43 {
44 }
45 
47 {
48 }
49 
50 void
51 FWTrackProxyBuilder::build( const reco::Track& iData, unsigned int iIndex,TEveElement& oItemHolder , const FWViewContext*)
52 {
53  if( context().getField()->getSource() == FWMagField::kNone ) {
54  if( fabs( iData.eta() ) < 2.0 && iData.pt() > 0.5 && iData.pt() < 30 ) {
55  double estimate = fw::estimate_field( iData, true );
56  if( estimate >= 0 ) context().getField()->guessField( estimate );
57  }
58  }
59 
60  TEveTrackPropagator* propagator = ( !iData.extra().isAvailable() ) ? context().getTrackerTrackPropagator() : context().getTrackPropagator();
61 
62  TEveTrack* trk = fireworks::prepareTrack( iData, propagator );
63  trk->MakeTrack();
64  setupAddElement(trk, &oItemHolder);
65 }
66 
67 //
68 // static member functions
69 //
const fireworks::Context & context() const
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:59
const TrackExtraRef & extra() const
reference to &quot;extra&quot; object
Definition: Track.h:97
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:70
TEveTrackPropagator * getTrackerTrackPropagator() const
Definition: Context.h:75
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
bool isAvailable() const
Definition: Ref.h:276
TEveTrackPropagator * getTrackPropagator() const
Definition: Context.h:74
static const int kAll3DBits
Definition: FWViewType.h:60
double estimate_field(const reco::Track &track, bool highQuality=false)
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:141
FWMagField * getField() const
Definition: Context.h:78
void guessField(float estimate) const
Definition: FWMagField.cc:155
double pt() const
track transverse momentum
Definition: TrackBase.h:131
const FWTrackProxyBuilder & operator=(const FWTrackProxyBuilder &)