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 //
12 
13 // system include files
14 #include "TEveTrack.h"
15 
16 // user include files
22 
24 
26 
27 public:
29  virtual ~FWTrackProxyBuilder();
30 
32 
33 private:
34  FWTrackProxyBuilder(const FWTrackProxyBuilder&); // stop default
35 
36  const FWTrackProxyBuilder& operator=(const FWTrackProxyBuilder&); // stop default
37 
39  void build(const reco::Track& iData, unsigned int iIndex,TEveElement& oItemHolder, const FWViewContext*) override;
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 //
bool isAvailable() const
Definition: Ref.h:614
const fireworks::Context & context() const
#define REGISTER_PROXYBUILDER_METHODS()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:58
const TrackExtraRef & extra() const
reference to &quot;extra&quot; object
Definition: Track.h:189
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:69
TEveTrackPropagator * getTrackerTrackPropagator() const
Definition: Context.h:74
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
TEveTrackPropagator * getTrackPropagator() const
Definition: Context.h:73
static const int kAll3DBits
Definition: FWViewType.h:59
double estimate_field(const reco::Track &track, bool highQuality=false)
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:699
FWMagField * getField() const
Definition: Context.h:77
void guessField(float estimate) const
Definition: FWMagField.cc:155
double pt() const
track transverse momentum
Definition: TrackBase.h:669
const FWTrackProxyBuilder & operator=(const FWTrackProxyBuilder &)