CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWTrackProxyBuilderFF Class Reference
Inheritance diagram for FWTrackProxyBuilderFF:
FWProxyBuilderBase

Public Member Functions

 FWTrackProxyBuilderFF ()
 
 REGISTER_PROXYBUILDER_METHODS ()
 
virtual void setItem (const FWEventItem *iItem)
 
virtual bool visibilityModelChanges (const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *)
 
virtual ~FWTrackProxyBuilderFF ()
 
- Public Member Functions inherited from FWProxyBuilderBase
void build ()
 
virtual bool canHandle (const FWEventItem &)
 
const fireworks::Contextcontext () const
 
TEveElementList * createProduct (FWViewType::EType, const FWViewContext *)
 
 FWProxyBuilderBase ()
 
bool getHaveWindow () const
 
virtual bool havePerViewProduct (FWViewType::EType) const
 
virtual bool haveSingleProduct () const
 
const FWEventItemitem () const
 
virtual void itemBeingDestroyed (const FWEventItem *)
 
void itemChanged (const FWEventItem *)
 
int layer () const
 
void modelChanges (const FWModelIds &)
 
void removePerViewProduct (FWViewType::EType, const FWViewContext *vc)
 
void scaleChanged (const FWViewContext *)
 
void setHaveWindow (bool iFlag)
 
virtual void setInteractionList (FWInteractionList *, const std::string &)
 
void setupAddElement (TEveElement *el, TEveElement *parent, bool set_color=true) const
 
void setupElement (TEveElement *el, bool color=true) const
 
virtual bool willHandleInteraction () const
 
virtual ~FWProxyBuilderBase ()
 

Private Member Functions

void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
void buildTrack (TrajTrackAssociationCollection::const_iterator it, TEveCompound *comp)
 
 FWTrackProxyBuilderFF (const FWTrackProxyBuilderFF &)
 
const FWTrackProxyBuilderFFoperator= (const FWTrackProxyBuilderFF &)
 

Private Attributes

TEveTrackPropagator * m_trackerPropagator
 
const
TrajTrackAssociationCollection
m_trajToTrackMap
 

Additional Inherited Members

- Static Public Member Functions inherited from FWProxyBuilderBase
static bool representsSubPart ()
 
static std::string typeOfBuilder ()
 Used by the plugin system to determine how the proxy uses the data from FWEventItem. More...
 
- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >
::iterator 
Product_it
 
- Protected Member Functions inherited from FWProxyBuilderBase
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
virtual void clean ()
 
virtual void cleanLocal ()
 
TEveCompound * createCompound (bool set_color=true, bool propagate_color_to_all_children=false) const
 
 FWProxyBuilderBase (const FWProxyBuilderBase &)
 
void increaseComponentTransparency (unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
 
virtual void localModelChanges (const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
 
virtual void modelChanges (const FWModelIds &, Product *)
 
const FWProxyBuilderBaseoperator= (const FWProxyBuilderBase &)
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Detailed Description

Definition at line 35 of file FWTrackProxyBuilderFF.cc.

Constructor & Destructor Documentation

FWTrackProxyBuilderFF::FWTrackProxyBuilderFF ( )

Definition at line 58 of file FWTrackProxyBuilderFF.cc.

References m_trackerPropagator.

58  :
61 {
62  m_trackerPropagator = new TEveTrackPropagator();
63  m_trackerPropagator->SetStepper( TEveTrackPropagator::kRungeKutta );
64  m_trackerPropagator->SetDelta(0.01);
65  m_trackerPropagator->SetMaxOrbs(0.7);
66  m_trackerPropagator->IncDenyDestroy();
67 }
const TrajTrackAssociationCollection * m_trajToTrackMap
TEveTrackPropagator * m_trackerPropagator
FWTrackProxyBuilderFF::~FWTrackProxyBuilderFF ( )
virtual

Definition at line 69 of file FWTrackProxyBuilderFF.cc.

References m_trackerPropagator.

70 {
71  m_trackerPropagator->DecDenyDestroy();
72 }
TEveTrackPropagator * m_trackerPropagator
FWTrackProxyBuilderFF::FWTrackProxyBuilderFF ( const FWTrackProxyBuilderFF )
private

Member Function Documentation

void FWTrackProxyBuilderFF::build ( const FWEventItem iItem,
TEveElementList *  product,
const FWViewContext vc 
)
privatevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 85 of file FWTrackProxyBuilderFF.cc.

References edm::AssociationMap< Tag >::begin(), buildTrack(), AlCaHLTBitMon_QueryRunRegistry::comp, gather_cfg::cout, FWProxyBuilderBase::createCompound(), edm::AssociationMap< Tag >::end(), cppFunctionSkipper::exception, FWEventItem::get(), FWEventItem::getConfig(), FWEventItem::getEvent(), FWProxyBuilderBase::item(), m_trackerPropagator, m_trajToTrackMap, FWProxyBuilderBase::setupAddElement(), GlobalPosition_Frontier_DevDB_cff::tag, testEve_cfg::tracks, FWProxyBuilderConfiguration::value(), and cms::Exception::what().

86 {
87  const reco::TrackCollection * tracks = 0;
88  iItem->get( tracks );
89  if( tracks == 0 ) return;
90 
91  try {
92  const edm::EventBase* event = item()->getEvent();
93  edm::InputTag tag(item()->moduleLabel(), item()->productInstanceLabel(), item()->processName());
94  edm::Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle;
95  event->getByLabel(tag, trajTrackAssociationHandle);
96  m_trajToTrackMap = &*trajTrackAssociationHandle;
97  }
98  catch (cms::Exception &exception)
99  {
100  m_trajToTrackMap =0;
101  std::cout << exception.what() << std::endl;
102  return;
103  }
104 
105 
106  bool rnrPathMarks = item()->getConfig()->value<bool>("Rnr TrajectoryMeasurement");
107  if (m_trackerPropagator->GetRnrReferences() != rnrPathMarks ) m_trackerPropagator->SetRnrReferences(rnrPathMarks);
108 
109  unsigned track_index = 0;
111  {
112  TEveCompound* comp = createCompound();
113  setupAddElement( comp, product );
114 
115  if (item()->modelInfo(track_index).displayProperties().isVisible())
116  buildTrack(it, comp);
117  }
118 
119  gEve->GetBrowser()->MapWindow();
120 }
virtual char const * what() const
Definition: Exception.cc:141
const TrajTrackAssociationCollection * m_trajToTrackMap
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:166
const_iterator end() const
last iterator over the map (read only)
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
TEveTrackPropagator * m_trackerPropagator
void get(const T *&oData) const
Definition: FWEventItem.h:85
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
const FWEventItem * item() const
void buildTrack(TrajTrackAssociationCollection::const_iterator it, TEveCompound *comp)
const edm::EventBase * getEvent() const
Definition: FWEventItem.h:147
tuple tracks
Definition: testEve_cfg.py:39
TEveCompound * createCompound(bool set_color=true, bool propagate_color_to_all_children=false) const
tuple cout
Definition: gather_cfg.py:121
const_iterator begin() const
first iterator over the map (read only)
void FWTrackProxyBuilderFF::buildTrack ( TrajTrackAssociationCollection::const_iterator  it,
TEveCompound *  comp 
)
private

Definition at line 122 of file FWTrackProxyBuilderFF.cc.

References alongMomentum, reco::TrackBase::charge(), Trajectory::direction(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), edm::helpers::KeyVal< K, V >::key, m_trackerPropagator, Trajectory::measurements(), reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), FWProxyBuilderBase::setupAddElement(), lumiQTWidget::t, edm::helpers::KeyVal< K, V >::val, reco::TrackBase::vx(), reco::TrackBase::vy(), reco::TrackBase::vz(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by build(), and visibilityModelChanges().

123 {
124  const reco::Track track = *it->val;
125  const Trajectory traj = *it->key;
126 
127  TEveRecTrack ts;
128  ts.fBeta = 1.;
129  ts.fSign = track.charge();
130  ts.fP.Set(track.px(), track.py(), track.pz());
131  ts.fV.Set(track.vx(), track.vy(), track.vz());
132  TEveTrack* eveTrack = new TEveTrack( &ts, m_trackerPropagator);
133 
134  // path-marks from a trajectory
135  std::vector<TrajectoryMeasurement> measurements = traj.measurements();
136  std::vector<TrajectoryMeasurement>::iterator measurements_it = measurements.begin();
137  std::vector<TrajectoryMeasurement>::reverse_iterator measurements_rit = measurements.rbegin();
138  for (size_t t=0; t != measurements.size(); ++t, ++measurements_it, ++measurements_rit)
139  {
140  TrajectoryStateOnSurface trajState = (traj.direction() == alongMomentum) ? measurements_it->updatedState() : measurements_rit->updatedState() ;
141 
142  if( !trajState.isValid() ) continue;
143 
144  eveTrack->AddPathMark( TEvePathMark( TEvePathMark::kReference,
145  TEveVector(trajState.globalPosition().x(),trajState.globalPosition().y(), trajState.globalPosition().z()),
146  TEveVector(trajState.globalMomentum().x(),trajState.globalMomentum().y(), trajState.globalMomentum().z())));
147  }
148 
149  eveTrack->MakeTrack();
150  setupAddElement(eveTrack, comp);
151 }
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
TEveTrackPropagator * m_trackerPropagator
T y() const
Definition: PV3DBase.h:63
GlobalPoint globalPosition() const
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:133
PropagationDirection const & direction() const
Definition: Trajectory.cc:196
DataContainer const & measurements() const
Definition: Trajectory.h:215
T z() const
Definition: PV3DBase.h:64
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:137
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:147
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:145
GlobalVector globalMomentum() const
int charge() const
track electric charge
Definition: TrackBase.h:113
T x() const
Definition: PV3DBase.h:62
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:135
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:143
const FWTrackProxyBuilderFF& FWTrackProxyBuilderFF::operator= ( const FWTrackProxyBuilderFF )
private
FWTrackProxyBuilderFF::REGISTER_PROXYBUILDER_METHODS ( )
void FWTrackProxyBuilderFF::setItem ( const FWEventItem iItem)
virtual

Reimplemented from FWProxyBuilderBase.

Definition at line 74 of file FWTrackProxyBuilderFF.cc.

References FWProxyBuilderConfiguration::assertParam(), FWProxyBuilderBase::context(), FWEventItem::getConfig(), m_trackerPropagator, and FWProxyBuilderBase::setItem().

Referenced by Vispa.Plugins.EdmBrowser.EventContentView.EventContentView::_addRow(), Vispa.Views.TableView.TableView::_createItem(), Vispa.Views.PropertyView.PropertyView::addCategory(), and Vispa.Views.PropertyView.PropertyView::append().

75 {
77  if (iItem)
78  {
79  m_trackerPropagator->SetMagFieldObj(context().getField(), false);
80  iItem->getConfig()->assertParam("Rnr TrajectoryMeasurement", false);
81  }
82 }
const fireworks::Context & context() const
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:166
TEveTrackPropagator * m_trackerPropagator
virtual void setItem(const FWEventItem *iItem)
FWGenericParameter< T > * assertParam(const std::string &name, T def)
bool FWTrackProxyBuilderFF::visibilityModelChanges ( const FWModelId iId,
TEveElement *  iCompound,
FWViewType::EType  viewType,
const FWViewContext vc 
)
virtual

Reimplemented from FWProxyBuilderBase.

Definition at line 153 of file FWTrackProxyBuilderFF.cc.

References edm::AssociationMap< Tag >::begin(), buildTrack(), FWEventItem::ModelInfo::displayProperties(), FWModelId::index(), info, FWDisplayProperties::isVisible(), FWModelId::item(), m_trajToTrackMap, and FWEventItem::modelInfo().

155 {
156  const FWEventItem::ModelInfo& info = iId.item()->modelInfo(iId.index());
157  bool returnValue = false;
158  if (info.displayProperties().isVisible() && iCompound->NumChildren()==0 && m_trajToTrackMap)
159  {
161  std::advance(it, iId.index());
162  buildTrack(it, (TEveCompound*)iCompound);
163  returnValue=true;
164  }
165  return returnValue;
166 }
const TrajTrackAssociationCollection * m_trajToTrackMap
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:68
int index() const
Definition: FWModelId.h:50
void buildTrack(TrajTrackAssociationCollection::const_iterator it, TEveCompound *comp)
const_iterator begin() const
first iterator over the map (read only)
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:536
const FWEventItem * item() const
Definition: FWModelId.h:45

Member Data Documentation

TEveTrackPropagator* FWTrackProxyBuilderFF::m_trackerPropagator
private
const TrajTrackAssociationCollection* FWTrackProxyBuilderFF::m_trajToTrackMap
private

Definition at line 55 of file FWTrackProxyBuilderFF.cc.

Referenced by build(), and visibilityModelChanges().