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

Constructor & Destructor Documentation

◆ FWTrackProxyBuilderFullFramework() [1/2]

FWTrackProxyBuilderFullFramework::FWTrackProxyBuilderFullFramework ( )

Definition at line 54 of file FWTrackProxyBuilderFullFramework.cc.

55  : m_trackerPropagator(nullptr), m_trajToTrackMap(nullptr) {
56  m_trackerPropagator = new TEveTrackPropagator();
57  m_trackerPropagator->SetStepper(TEveTrackPropagator::kRungeKutta);
58  m_trackerPropagator->SetDelta(0.01);
59  m_trackerPropagator->SetMaxOrbs(0.7);
60  m_trackerPropagator->IncDenyDestroy();
61 }

References m_trackerPropagator.

◆ ~FWTrackProxyBuilderFullFramework()

FWTrackProxyBuilderFullFramework::~FWTrackProxyBuilderFullFramework ( )
override

Definition at line 63 of file FWTrackProxyBuilderFullFramework.cc.

63 { m_trackerPropagator->DecDenyDestroy(); }

References m_trackerPropagator.

◆ FWTrackProxyBuilderFullFramework() [2/2]

FWTrackProxyBuilderFullFramework::FWTrackProxyBuilderFullFramework ( const FWTrackProxyBuilderFullFramework )
privatedelete

Member Function Documentation

◆ build()

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

Reimplemented from FWProxyBuilderBase.

Definition at line 73 of file FWTrackProxyBuilderFullFramework.cc.

75  {
76  const reco::TrackCollection* tracks = nullptr;
77  iItem->get(tracks);
78  if (tracks == nullptr)
79  return;
80 
81  try {
82  const edm::EventBase* event = item()->getEvent();
83  edm::InputTag tag(item()->moduleLabel(), item()->productInstanceLabel(), item()->processName());
84  edm::Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle;
85  event->getByLabel(tag, trajTrackAssociationHandle);
86  m_trajToTrackMap = &*trajTrackAssociationHandle;
87  } catch (cms::Exception& exception) {
88  m_trajToTrackMap = nullptr;
89  std::cout << exception.what() << std::endl;
90  }
91 
92  if (m_trajToTrackMap) {
93  bool rnrPathMarks = item()->getConfig()->value<bool>("Rnr TrajectoryMeasurement");
94  if (m_trackerPropagator->GetRnrReferences() != rnrPathMarks)
95  m_trackerPropagator->SetRnrReferences(rnrPathMarks);
96 
97  unsigned track_index = 0;
99  ++it, ++track_index) {
100  TEveCompound* comp = createCompound();
101  setupAddElement(comp, product);
102 
103  if (item()->modelInfo(track_index).displayProperties().isVisible())
104  buildTrack(it, comp);
105  }
106  } else {
107  for (reco::TrackCollection::const_iterator i = tracks->begin(); i != tracks->end(); ++i) {
108  const reco::Track& track = *i;
109  TEveRecTrack ts;
110  ts.fBeta = 1.;
111  ts.fSign = track.charge();
112  ts.fP.Set(track.px(), track.py(), track.pz());
113  ts.fV.Set(track.vx(), track.vy(), track.vz());
114  TEveTrack* eveTrack = new TEveTrack(&ts, m_trackerPropagator);
115  eveTrack->MakeTrack();
116  TEveCompound* comp = createCompound();
117  setupAddElement(comp, product);
118  setupAddElement(eveTrack, comp);
119  }
120  }
121 
122  gEve->GetBrowser()->MapWindow();
123 }

References edm::AssociationMap< Tag >::begin(), buildTrack(), 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, HerwigMaxPtPartonFilter_cfi::moduleLabel, SimL1EmulatorRepack_CalouGT_cff::processName, FWProxyBuilderBase::setupAddElement(), GlobalPosition_Frontier_DevDB_cff::tag, HLT_FULL_cff::track, tracks, and FWProxyBuilderConfiguration::value().

◆ buildTrack()

void FWTrackProxyBuilderFullFramework::buildTrack ( TrajTrackAssociationCollection::const_iterator  it,
TEveCompound *  comp 
)
private

Definition at line 125 of file FWTrackProxyBuilderFullFramework.cc.

126  {
127  const reco::Track& track = *it->val;
128  const Trajectory& traj = *it->key;
129 
130  TEveRecTrack ts;
131  ts.fBeta = 1.;
132  ts.fSign = track.charge();
133  ts.fP.Set(track.px(), track.py(), track.pz());
134  ts.fV.Set(track.vx(), track.vy(), track.vz());
135  TEveTrack* eveTrack = new TEveTrack(&ts, m_trackerPropagator);
136 
137  // path-marks from a trajectory
138  std::vector<TrajectoryMeasurement> measurements = traj.measurements();
139  std::vector<TrajectoryMeasurement>::iterator measurements_it = measurements.begin();
140  std::vector<TrajectoryMeasurement>::reverse_iterator measurements_rit = measurements.rbegin();
141  for (size_t t = 0; t != measurements.size(); ++t, ++measurements_it, ++measurements_rit) {
142  TrajectoryStateOnSurface trajState =
143  (traj.direction() == alongMomentum) ? measurements_it->updatedState() : measurements_rit->updatedState();
144 
145  if (!trajState.isValid())
146  continue;
147 
148  eveTrack->AddPathMark(TEvePathMark(
149  TEvePathMark::kReference,
150  TEveVector(trajState.globalPosition().x(), trajState.globalPosition().y(), trajState.globalPosition().z()),
151  TEveVector(trajState.globalMomentum().x(), trajState.globalMomentum().y(), trajState.globalMomentum().z())));
152  }
153 
154  eveTrack->MakeTrack();
155  setupAddElement(eveTrack, comp);
156 }

References alongMomentum, AlCaHLTBitMon_QueryRunRegistry::comp, Trajectory::direction(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), m_trackerPropagator, Trajectory::measurements(), FWProxyBuilderBase::setupAddElement(), submitPVValidationJobs::t, HLT_FULL_cff::track, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by build(), and visibilityModelChanges().

◆ classPurpose()

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

Definition at line 176 of file FWTrackProxyBuilderFullFramework.cc.

◆ classRegisterTypeName()

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

Definition at line 176 of file FWTrackProxyBuilderFullFramework.cc.

◆ classTypeName()

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

Definition at line 176 of file FWTrackProxyBuilderFullFramework.cc.

◆ classView()

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

Definition at line 176 of file FWTrackProxyBuilderFullFramework.cc.

◆ operator=()

const FWTrackProxyBuilderFullFramework& FWTrackProxyBuilderFullFramework::operator= ( const FWTrackProxyBuilderFullFramework )
privatedelete

◆ purpose()

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

Definition at line 38 of file FWTrackProxyBuilderFullFramework.cc.

◆ setItem()

void FWTrackProxyBuilderFullFramework::setItem ( const FWEventItem iItem)
overridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 65 of file FWTrackProxyBuilderFullFramework.cc.

65  {
67  if (iItem) {
68  m_trackerPropagator->SetMagFieldObj(context().getField(), false);
69  iItem->getConfig()->assertParam("Rnr TrajectoryMeasurement", false);
70  }
71 }

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

◆ typeName()

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

Definition at line 38 of file FWTrackProxyBuilderFullFramework.cc.

◆ view()

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

Definition at line 38 of file FWTrackProxyBuilderFullFramework.cc.

◆ visibilityModelChanges()

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

Reimplemented from FWProxyBuilderBase.

Definition at line 158 of file FWTrackProxyBuilderFullFramework.cc.

161  {
162  const FWEventItem::ModelInfo& info = iId.item()->modelInfo(iId.index());
163  bool returnValue = false;
164  if (info.displayProperties().isVisible() && iCompound->NumChildren() == 0 && m_trajToTrackMap) {
166  std::advance(it, iId.index());
167  buildTrack(it, (TEveCompound*)iCompound);
168  returnValue = true;
169  }
170  return returnValue;
171 }

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

Member Data Documentation

◆ m_trackerPropagator

TEveTrackPropagator* FWTrackProxyBuilderFullFramework::m_trackerPropagator
private

◆ m_trajToTrackMap

const TrajTrackAssociationCollection* FWTrackProxyBuilderFullFramework::m_trajToTrackMap
private

Definition at line 51 of file FWTrackProxyBuilderFullFramework.cc.

Referenced by build(), and visibilityModelChanges().

FWEventItem::modelInfo
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:446
mps_fire.i
i
Definition: mps_fire.py:428
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
FWEventItem::getConfig
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:150
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
Trajectory::direction
PropagationDirection const & direction() const
Definition: Trajectory.cc:133
FWEventItem::get
void get(const T *&oData) const
Definition: FWEventItem.h:78
FWTrackProxyBuilderFullFramework::m_trackerPropagator
TEveTrackPropagator * m_trackerPropagator
Definition: FWTrackProxyBuilderFullFramework.cc:50
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
gather_cfg.cout
cout
Definition: gather_cfg.py:144
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
FWModelId::item
const FWEventItem * item() const
Definition: FWModelId.h:39
edm::Handle
Definition: AssociativeIterator.h:50
FWProxyBuilderBase::createCompound
TEveCompound * createCompound(bool set_color=true, bool propagate_color_to_all_children=false) const
Definition: FWProxyBuilderBase.cc:374
AlCaHLTBitMon_QueryRunRegistry.comp
comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
FWEventItem::ModelInfo
Definition: FWEventItem.h:58
edm::AssociationMap::end
const_iterator end() const
last iterator over the map (read only)
Definition: AssociationMap.h:171
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
FWTrackProxyBuilderFullFramework::buildTrack
void buildTrack(TrajTrackAssociationCollection::const_iterator it, TEveCompound *comp)
Definition: FWTrackProxyBuilderFullFramework.cc:125
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
reco::Track
Definition: Track.h:27
FWModelId::index
int index() const
Definition: FWModelId.h:41
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
FWEventItem::getEvent
const edm::EventBase * getEvent() const
Definition: FWEventItem.h:131
edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > >::const_iterator
friend struct const_iterator
Definition: AssociationMap.h:274
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:159
FWTrackProxyBuilderFullFramework::m_trajToTrackMap
const TrajTrackAssociationCollection * m_trajToTrackMap
Definition: FWTrackProxyBuilderFullFramework.cc:51
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition: FWProxyBuilderBase.cc:350
Trajectory::measurements
DataContainer const & measurements() const
Definition: Trajectory.h:178
SimL1EmulatorRepack_CalouGT_cff.processName
processName
Definition: SimL1EmulatorRepack_CalouGT_cff.py:17
FWProxyBuilderBase::item
const FWEventItem * item() const
Definition: FWProxyBuilderBase.h:64
TrajectoryStateOnSurface::globalMomentum
GlobalVector globalMomentum() const
Definition: TrajectoryStateOnSurface.h:66
FWProxyBuilderConfiguration::value
T value(const std::string &name)
Definition: FWProxyBuilderConfiguration.cc:123
Trajectory
Definition: Trajectory.h:38
edm::EventBase
Definition: EventBase.h:46
edm::AssociationMap::begin
const_iterator begin() const
first iterator over the map (read only)
Definition: AssociationMap.h:169
FWProxyBuilderBase::context
const fireworks::Context & context() const
Definition: FWProxyBuilderBase.cc:412
cms::Exception
Definition: Exception.h:70
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
FWProxyBuilderBase::setItem
virtual void setItem(const FWEventItem *iItem)
Definition: FWProxyBuilderBase.cc:83
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
alongMomentum
Definition: PropagationDirection.h:4
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54