Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "TEveTrack.h"
00016
00017
00018 #include "Fireworks/Core/interface/FWSimpleProxyBuilderTemplate.h"
00019 #include "Fireworks/Core/interface/FWEventItem.h"
00020 #include "Fireworks/Core/interface/FWMagField.h"
00021 #include "Fireworks/Tracks/interface/TrackUtils.h"
00022 #include "Fireworks/Tracks/interface/estimate_field.h"
00023
00024 #include "DataFormats/TrackReco/interface/Track.h"
00025
00026 class FWTrackProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::Track> {
00027
00028 public:
00029 FWTrackProxyBuilder();
00030 virtual ~FWTrackProxyBuilder();
00031
00032 REGISTER_PROXYBUILDER_METHODS();
00033
00034 private:
00035 FWTrackProxyBuilder(const FWTrackProxyBuilder&);
00036
00037 const FWTrackProxyBuilder& operator=(const FWTrackProxyBuilder&);
00038
00039 void build(const reco::Track& iData, unsigned int iIndex,TEveElement& oItemHolder, const FWViewContext*);
00040 };
00041
00042 FWTrackProxyBuilder::FWTrackProxyBuilder()
00043 {
00044 }
00045
00046 FWTrackProxyBuilder::~FWTrackProxyBuilder()
00047 {
00048 }
00049
00050 void
00051 FWTrackProxyBuilder::build( const reco::Track& iData, unsigned int iIndex,TEveElement& oItemHolder , const FWViewContext*)
00052 {
00053 if( context().getField()->getSource() == FWMagField::kNone ) {
00054 if( fabs( iData.eta() ) < 2.0 && iData.pt() > 0.5 && iData.pt() < 30 ) {
00055 double estimate = fw::estimate_field( iData, true );
00056 if( estimate >= 0 ) context().getField()->guessField( estimate );
00057 }
00058 }
00059
00060 TEveTrackPropagator* propagator = ( !iData.extra().isAvailable() ) ? context().getTrackerTrackPropagator() : context().getTrackPropagator();
00061
00062 TEveTrack* trk = fireworks::prepareTrack( iData, propagator );
00063 trk->MakeTrack();
00064 setupAddElement(trk, &oItemHolder);
00065 }
00066
00067
00068
00069
00070 REGISTER_FWPROXYBUILDER(FWTrackProxyBuilder, reco::Track, "Tracks", FWViewType::kAll3DBits | FWViewType::kAllRPZBits);