CMS 3D CMS Logo

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
23 
25 
27 public:
29  ~FWTrackProxyBuilder() override;
30 
32 
33  void setItem(const FWEventItem* iItem) override;
34 
35 private:
36  FWTrackProxyBuilder(const FWTrackProxyBuilder&) = delete; // stop default
37 
38  const FWTrackProxyBuilder& operator=(const FWTrackProxyBuilder&) = delete; // stop default
39 
41  void build(const reco::Track& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext*) override;
42 };
43 
45 
47 
50 
51  if (iItem) {
52  iItem->getConfig()->assertParam("LineWidth", long(1), long(1), long(4));
53  }
54 }
55 
57  unsigned int iIndex,
58  TEveElement& oItemHolder,
59  const FWViewContext*) {
60  if (context().getField()->getSource() == FWMagField::kNone) {
61  if (fabs(iData.eta()) < 2.0 && iData.pt() > 0.5 && iData.pt() < 30) {
62  double estimate = fw::estimate_field(iData, true);
63  if (estimate >= 0)
64  context().getField()->guessField(estimate);
65  }
66  }
67 
68  TEveTrackPropagator* propagator =
70 
71  TEveTrack* trk = fireworks::prepareTrack(iData, propagator);
72  trk->MakeTrack();
73 
74  // Line width can be cached as a member. Set in virtual builder::itemChanged()
75  int width = item()->getConfig()->value<long>("LineWidth");
76  trk->SetLineWidth(width);
77 
78  setupAddElement(trk, &oItemHolder);
79 }
80 
81 //
82 // static member functions
83 //
estimate_field.h
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
FWMagField::guessField
void guessField(float estimate) const
Definition: FWMagField.cc:129
FWSimpleProxyBuilderTemplate.h
FWMagField::kNone
Definition: FWMagField.h:18
FWEventItem::getConfig
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:150
FWViewType::kAllRPZBits
static const int kAllRPZBits
Definition: FWViewType.h:67
edm::Ref::isAvailable
bool isAvailable() const
Definition: Ref.h:537
REGISTER_FWPROXYBUILDER
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
Definition: FWProxyBuilderFactory.h:33
REGISTER_PROXYBUILDER_METHODS
#define REGISTER_PROXYBUILDER_METHODS()
Definition: register_dataproxybuilder_macro.h:28
reco::Track::extra
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139
TrackUtils.h
FWViewType::kAll3DBits
static const int kAll3DBits
Definition: FWViewType.h:68
reco::TrackBase::pt
double pt() const
track transverse momentum
Definition: TrackBase.h:637
Track.h
TrackCandidateProducer_cfi.propagator
propagator
Definition: TrackCandidateProducer_cfi.py:17
reco::Track
Definition: Track.h:27
FWTrackProxyBuilder::operator=
const FWTrackProxyBuilder & operator=(const FWTrackProxyBuilder &)=delete
CaloRecHitAuxSetter::getField
constexpr unsigned getField(const uint32_t u, const unsigned mask, const unsigned offset)
Definition: CaloRecHitAuxSetter.h:13
FWProxyBuilderConfiguration::assertParam
FWGenericParameter< T > * assertParam(const std::string &name, T def)
Definition: FWProxyBuilderConfiguration.cc:83
FWTrackProxyBuilder::~FWTrackProxyBuilder
~FWTrackProxyBuilder() override
Definition: FWTrackProxyBuilder.cc:46
fireworks::prepareTrack
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:62
reco::TrackBase::eta
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
FWProxyBuilderConfiguration.h
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition: FWProxyBuilderBase.cc:350
FWProxyBuilderBase::build
void build()
Definition: FWProxyBuilderBase.cc:110
FWEventItem.h
FWViewContext
Definition: FWViewContext.h:32
FWMagField.h
fireworks::Context::getField
FWMagField * getField() const
Definition: Context.h:66
FWProxyBuilderBase::item
const FWEventItem * item() const
Definition: FWProxyBuilderBase.h:64
FWEventItem
Definition: FWEventItem.h:56
FWTrackProxyBuilder::setItem
void setItem(const FWEventItem *iItem) override
Definition: FWTrackProxyBuilder.cc:48
FWProxyBuilderConfiguration::value
T value(const std::string &name)
Definition: FWProxyBuilderConfiguration.cc:123
FWTrackProxyBuilder
Definition: FWTrackProxyBuilder.cc:26
fireworks::Context::getTrackPropagator
TEveTrackPropagator * getTrackPropagator() const
Definition: Context.h:62
FWTrackProxyBuilder::FWTrackProxyBuilder
FWTrackProxyBuilder()
Definition: FWTrackProxyBuilder.cc:44
FWProxyBuilderBase::context
const fireworks::Context & context() const
Definition: FWProxyBuilderBase.cc:412
FWSimpleProxyBuilderTemplate
Definition: FWSimpleProxyBuilderTemplate.h:30
FWProxyBuilderBase::setItem
virtual void setItem(const FWEventItem *iItem)
Definition: FWProxyBuilderBase.cc:83
fireworks::Context::getTrackerTrackPropagator
TEveTrackPropagator * getTrackerTrackPropagator() const
Definition: Context.h:63
fw::estimate_field
double estimate_field(const reco::Track &track, bool highQuality=false)
Definition: estimate_field.cc:11