CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
FWTrackProxyBuilderFullFramework Class Reference
Inheritance diagram for FWTrackProxyBuilderFullFramework:
FWProxyBuilderBase

Public Member Functions

 FWTrackProxyBuilderFullFramework ()
 
const std::string & purpose () const
 
void setItem (const FWEventItem *iItem) override
 
const std::string & typeName () const
 
const std::string & view () const
 
bool visibilityModelChanges (const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *) override
 
 ~FWTrackProxyBuilderFullFramework () override
 
- 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 ()
 

Static Public Member Functions

static const std::string & classPurpose ()
 
static const std::string & classRegisterTypeName ()
 
static const std::string & classTypeName ()
 
static const std::string & classView ()
 
- 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...
 

Private Member Functions

void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
void buildTrack (TrajTrackAssociationCollection::const_iterator it, TEveCompound *comp)
 
 FWTrackProxyBuilderFullFramework (const FWTrackProxyBuilderFullFramework &)=delete
 
const FWTrackProxyBuilderFullFrameworkoperator= (const FWTrackProxyBuilderFullFramework &)=delete
 

Private Attributes

TEveTrackPropagator * m_trackerPropagator
 
const TrajTrackAssociationCollectionm_trajToTrackMap
 

Additional Inherited Members

- 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 34 of file FWTrackProxyBuilderFullFramework.cc.

Constructor & Destructor Documentation

FWTrackProxyBuilderFullFramework::FWTrackProxyBuilderFullFramework ( )

Definition at line 57 of file FWTrackProxyBuilderFullFramework.cc.

References m_trackerPropagator.

57  :
58 m_trackerPropagator(nullptr),
59 m_trajToTrackMap(nullptr)
60 {
61  m_trackerPropagator = new TEveTrackPropagator();
62  m_trackerPropagator->SetStepper( TEveTrackPropagator::kRungeKutta );
63  m_trackerPropagator->SetDelta(0.01);
64  m_trackerPropagator->SetMaxOrbs(0.7);
65  m_trackerPropagator->IncDenyDestroy();
66 }
const TrajTrackAssociationCollection * m_trajToTrackMap
FWTrackProxyBuilderFullFramework::~FWTrackProxyBuilderFullFramework ( )
override

Definition at line 68 of file FWTrackProxyBuilderFullFramework.cc.

References m_trackerPropagator.

69 {
70  m_trackerPropagator->DecDenyDestroy();
71 }
FWTrackProxyBuilderFullFramework::FWTrackProxyBuilderFullFramework ( const FWTrackProxyBuilderFullFramework )
privatedelete

Member Function Documentation

void FWTrackProxyBuilderFullFramework::build ( const FWEventItem iItem,
TEveElementList *  product,
const FWViewContext vc 
)
overrideprivatevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 84 of file FWTrackProxyBuilderFullFramework.cc.

References edm::AssociationMap< Tag >::begin(), buildTrack(), reco::TrackBase::charge(), AlCaHLTBitMon_QueryRunRegistry::comp, edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > >::const_iterator, gather_cfg::cout, FWProxyBuilderBase::createCompound(), edm::AssociationMap< Tag >::end(), cppFunctionSkipper::exception, FWEventItem::get(), FWEventItem::getConfig(), FWEventItem::getEvent(), mps_fire::i, FWProxyBuilderBase::item(), m_trackerPropagator, m_trajToTrackMap, modifiedElectrons_cfi::processName, reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), FWProxyBuilderBase::setupAddElement(), GlobalPosition_Frontier_DevDB_cff::tag, HiIsolationCommonParameters_cff::track, l1t::tracks, FWProxyBuilderConfiguration::value(), reco::TrackBase::vx(), reco::TrackBase::vy(), reco::TrackBase::vz(), and cms::Exception::what().

85 {
86  const reco::TrackCollection * tracks = nullptr;
87  iItem->get( tracks );
88  if( tracks == nullptr ) return;
89 
90  try {
91  const edm::EventBase* event = item()->getEvent();
92  edm::InputTag tag(item()->moduleLabel(), item()->productInstanceLabel(), item()->processName());
93  edm::Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle;
94  event->getByLabel(tag, trajTrackAssociationHandle);
95  m_trajToTrackMap = &*trajTrackAssociationHandle;
96  }
97  catch (cms::Exception &exception)
98  {
99  m_trajToTrackMap =nullptr;
100  std::cout << exception.what() << std::endl;
101  }
102 
103  if (m_trajToTrackMap) {
104  bool rnrPathMarks = item()->getConfig()->value<bool>("Rnr TrajectoryMeasurement");
105  if (m_trackerPropagator->GetRnrReferences() != rnrPathMarks ) m_trackerPropagator->SetRnrReferences(rnrPathMarks);
106 
107  unsigned track_index = 0;
109  {
110  TEveCompound* comp = createCompound();
111  setupAddElement( comp, product );
112 
113  if (item()->modelInfo(track_index).displayProperties().isVisible())
114  buildTrack(it, comp);
115  }
116  }
117  else {
118  for (reco::TrackCollection::const_iterator i = tracks->begin(); i != tracks->end(); ++i)
119  {
120  const reco::Track& track = *i;
121  TEveRecTrack ts;
122  ts.fBeta = 1.;
123  ts.fSign = track.charge();
124  ts.fP.Set(track.px(), track.py(), track.pz());
125  ts.fV.Set(track.vx(), track.vy(), track.vz());
126  TEveTrack* eveTrack = new TEveTrack( &ts, m_trackerPropagator);
127  eveTrack->MakeTrack();
128  TEveCompound* comp = createCompound();
129  setupAddElement(comp, product );
130  setupAddElement(eveTrack, comp);
131  }
132  }
133 
134 
135 
136  gEve->GetBrowser()->MapWindow();
137 }
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:169
const_iterator end() const
last iterator over the map (read only)
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
void get(const T *&oData) const
Definition: FWEventItem.h:85
void buildTrack(TrajTrackAssociationCollection::const_iterator it, TEveCompound *comp)
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:15
char const * what() const override
Definition: Exception.cc:103
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:660
const FWEventItem * item() const
const TrajTrackAssociationCollection * m_trajToTrackMap
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:672
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:702
const edm::EventBase * getEvent() const
Definition: FWEventItem.h:148
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:696
TEveCompound * createCompound(bool set_color=true, bool propagate_color_to_all_children=false) const
int charge() const
track electric charge
Definition: TrackBase.h:600
const_iterator begin() const
first iterator over the map (read only)
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:666
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:690
void FWTrackProxyBuilderFullFramework::buildTrack ( TrajTrackAssociationCollection::const_iterator  it,
TEveCompound *  comp 
)
private

Definition at line 139 of file FWTrackProxyBuilderFullFramework.cc.

References alongMomentum, reco::TrackBase::charge(), Trajectory::direction(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), m_trackerPropagator, Trajectory::measurements(), reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), FWProxyBuilderBase::setupAddElement(), lumiQTWidget::t, HiIsolationCommonParameters_cff::track, 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().

140 {
141  const reco::Track& track = *it->val;
142  const Trajectory& traj = *it->key;
143 
144  TEveRecTrack ts;
145  ts.fBeta = 1.;
146  ts.fSign = track.charge();
147  ts.fP.Set(track.px(), track.py(), track.pz());
148  ts.fV.Set(track.vx(), track.vy(), track.vz());
149  TEveTrack* eveTrack = new TEveTrack( &ts, m_trackerPropagator);
150 
151  // path-marks from a trajectory
152  std::vector<TrajectoryMeasurement> measurements = traj.measurements();
153  std::vector<TrajectoryMeasurement>::iterator measurements_it = measurements.begin();
154  std::vector<TrajectoryMeasurement>::reverse_iterator measurements_rit = measurements.rbegin();
155  for (size_t t=0; t != measurements.size(); ++t, ++measurements_it, ++measurements_rit)
156  {
157  TrajectoryStateOnSurface trajState = (traj.direction() == alongMomentum) ? measurements_it->updatedState() : measurements_rit->updatedState() ;
158 
159  if( !trajState.isValid() ) continue;
160 
161  eveTrack->AddPathMark( TEvePathMark( TEvePathMark::kReference,
162  TEveVector(trajState.globalPosition().x(),trajState.globalPosition().y(), trajState.globalPosition().z()),
163  TEveVector(trajState.globalMomentum().x(),trajState.globalMomentum().y(), trajState.globalMomentum().z())));
164  }
165 
166  eveTrack->MakeTrack();
167  setupAddElement(eveTrack, comp);
168 }
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
T y() const
Definition: PV3DBase.h:63
GlobalPoint globalPosition() const
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:660
PropagationDirection const & direction() const
Definition: Trajectory.cc:140
DataContainer const & measurements() const
Definition: Trajectory.h:196
T z() const
Definition: PV3DBase.h:64
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:672
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:702
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:696
GlobalVector globalMomentum() const
int charge() const
track electric charge
Definition: TrackBase.h:600
T x() const
Definition: PV3DBase.h:62
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:666
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:690
const std::string & FWTrackProxyBuilderFullFramework::classPurpose ( )
static

Definition at line 185 of file FWTrackProxyBuilderFullFramework.cc.

const std::string & FWTrackProxyBuilderFullFramework::classRegisterTypeName ( )
static

Definition at line 185 of file FWTrackProxyBuilderFullFramework.cc.

const std::string & FWTrackProxyBuilderFullFramework::classTypeName ( )
static

Definition at line 185 of file FWTrackProxyBuilderFullFramework.cc.

const std::string & FWTrackProxyBuilderFullFramework::classView ( )
static

Definition at line 185 of file FWTrackProxyBuilderFullFramework.cc.

const FWTrackProxyBuilderFullFramework& FWTrackProxyBuilderFullFramework::operator= ( const FWTrackProxyBuilderFullFramework )
privatedelete
const std::string& FWTrackProxyBuilderFullFramework::purpose ( ) const
inline

Definition at line 40 of file FWTrackProxyBuilderFullFramework.cc.

void FWTrackProxyBuilderFullFramework::setItem ( const FWEventItem iItem)
overridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 73 of file FWTrackProxyBuilderFullFramework.cc.

References FWProxyBuilderConfiguration::assertParam(), FWProxyBuilderBase::context(), FWEventItem::getConfig(), CaloRecHitAuxSetter::getField(), 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().

74 {
76  if (iItem)
77  {
78  m_trackerPropagator->SetMagFieldObj(context().getField(), false);
79  iItem->getConfig()->assertParam("Rnr TrajectoryMeasurement", false);
80  }
81 }
const fireworks::Context & context() const
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:169
virtual void setItem(const FWEventItem *iItem)
constexpr unsigned getField(const uint32_t u, const unsigned mask, const unsigned offset)
FWGenericParameter< T > * assertParam(const std::string &name, T def)
const std::string& FWTrackProxyBuilderFullFramework::typeName ( ) const
inline

Definition at line 40 of file FWTrackProxyBuilderFullFramework.cc.

const std::string& FWTrackProxyBuilderFullFramework::view ( ) const
inline

Definition at line 40 of file FWTrackProxyBuilderFullFramework.cc.

bool FWTrackProxyBuilderFullFramework::visibilityModelChanges ( const FWModelId iId,
TEveElement *  iCompound,
FWViewType::EType  viewType,
const FWViewContext vc 
)
overridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 170 of file FWTrackProxyBuilderFullFramework.cc.

References edm::AssociationMap< Tag >::begin(), buildTrack(), edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > >::const_iterator, FWEventItem::ModelInfo::displayProperties(), FWModelId::index(), info(), FWDisplayProperties::isVisible(), FWModelId::item(), m_trajToTrackMap, and FWEventItem::modelInfo().

172 {
173  const FWEventItem::ModelInfo& info = iId.item()->modelInfo(iId.index());
174  bool returnValue = false;
175  if (info.displayProperties().isVisible() && iCompound->NumChildren()==0 && m_trajToTrackMap)
176  {
178  std::advance(it, iId.index());
179  buildTrack(it, (TEveCompound*)iCompound);
180  returnValue=true;
181  }
182  return returnValue;
183 }
static const TGPicture * info(bool iBackgroundIsBlack)
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:68
void buildTrack(TrajTrackAssociationCollection::const_iterator it, TEveCompound *comp)
const TrajTrackAssociationCollection * m_trajToTrackMap
int index() const
Definition: FWModelId.h:49
const_iterator begin() const
first iterator over the map (read only)
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:540
const FWEventItem * item() const
Definition: FWModelId.h:44

Member Data Documentation

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

Definition at line 54 of file FWTrackProxyBuilderFullFramework.cc.

Referenced by build(), and visibilityModelChanges().