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 
38  void build(const reco::Track& iData, unsigned int iIndex,TEveElement& oItemHolder, const FWViewContext*) override;
39 };
40 
42 {
43 }
44 
46 {
47 }
48 
49 void
50 FWTrackProxyBuilder::build( const reco::Track& iData, unsigned int iIndex,TEveElement& oItemHolder , const FWViewContext*)
51 {
52  if( context().getField()->getSource() == FWMagField::kNone ) {
53  if( fabs( iData.eta() ) < 2.0 && iData.pt() > 0.5 && iData.pt() < 30 ) {
54  double estimate = fw::estimate_field( iData, true );
55  if( estimate >= 0 ) context().getField()->guessField( estimate );
56  }
57  }
58 
59  TEveTrackPropagator* propagator = ( !iData.extra().isAvailable() ) ? context().getTrackerTrackPropagator() : context().getTrackPropagator();
60 
61  TEveTrack* trk = fireworks::prepareTrack( iData, propagator );
62  trk->MakeTrack();
63  setupAddElement(trk, &oItemHolder);
64 }
65 
66 //
67 // static member functions
68 //
const fireworks::Context & context() const
#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:96
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
bool isAvailable() const
Definition: Ref.h:276
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:139
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:129
const FWTrackProxyBuilder & operator=(const FWTrackProxyBuilder &)