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
FWVertexProxyBuilder Class Reference
Inheritance diagram for FWVertexProxyBuilder:
FWSimpleProxyBuilderTemplate< reco::Vertex > FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWVertexProxyBuilder ()
 
 REGISTER_PROXYBUILDER_METHODS ()
 
virtual void setItem (const FWEventItem *iItem) override
 
virtual ~FWVertexProxyBuilder ()
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::Vertex >
 FWSimpleProxyBuilderTemplate ()
 
- Public Member Functions inherited from FWSimpleProxyBuilder
 FWSimpleProxyBuilder (const std::type_info &iType)
 
virtual ~FWSimpleProxyBuilder ()
 
- 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

virtual void build (const reco::Vertex &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *) override
 
 FWVertexProxyBuilder (const FWVertexProxyBuilder &)
 
virtual void localModelChanges (const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc) override
 
const FWVertexProxyBuilderoperator= (const FWVertexProxyBuilder &)
 

Additional Inherited Members

- Static Public Member Functions inherited from FWSimpleProxyBuilder
static std::string typeOfBuilder ()
 Used by the plugin system to determine how the proxy uses the data from FWEventItem. More...
 
- 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 FWSimpleProxyBuilderTemplate< reco::Vertex >
const reco::VertexmodelData (int index)
 
- Protected Member Functions inherited from FWSimpleProxyBuilder
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *)
 
virtual void clean ()
 
- Protected Member Functions inherited from FWProxyBuilderBase
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 modelChanges (const FWModelIds &, Product *)
 
const FWProxyBuilderBaseoperator= (const FWProxyBuilderBase &)
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
- Protected Attributes inherited from FWSimpleProxyBuilder
FWSimpleProxyHelper m_helper
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Detailed Description

Definition at line 38 of file FWVertexProxyBuilder.cc.

Constructor & Destructor Documentation

FWVertexProxyBuilder::FWVertexProxyBuilder ( )
inline

Definition at line 41 of file FWVertexProxyBuilder.cc.

41 {}
virtual FWVertexProxyBuilder::~FWVertexProxyBuilder ( )
inlinevirtual

Definition at line 42 of file FWVertexProxyBuilder.cc.

42 {}
FWVertexProxyBuilder::FWVertexProxyBuilder ( const FWVertexProxyBuilder )
private

Member Function Documentation

void FWVertexProxyBuilder::build ( const reco::Vertex iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
const FWViewContext  
)
overrideprivatevirtual

iIndex is the index where iData is found in the container from which it came iItemHolder is the object to which you add your own objects which inherit from TEveElement

Reimplemented from FWSimpleProxyBuilderTemplate< reco::Vertex >.

Definition at line 72 of file FWVertexProxyBuilder.cc.

References reco::TrackBase::charge(), create_public_lumi_plots::color, FWProxyBuilderBase::context(), alignCSCRings::e, reco::Vertex::error(), FWEventItem::getConfig(), i, FWProxyBuilderBase::item(), j, m, siStripFEDMonitor_P5_cff::Min, reco::Vertex::p4(), reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), TEveEllipsoid::RefEMtx(), TEveEllipsoid::RefExtent3D(), TEveEllipsoid::RefPos(), TEveEllipsoid::SetScale(), FWProxyBuilderBase::setupAddElement(), mathSSE::sqrt(), lumiQTWidget::t, reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), reco::Vertex::trackWeight(), findQualityFiles::v, FWProxyBuilderConfiguration::value(), reco::TrackBase::vx(), reco::TrackBase::vy(), reco::TrackBase::vz(), w(), reco::Vertex::x(), reco::Vertex::y(), and reco::Vertex::z().

73 {
74  const reco::Vertex & v = iData;
75 
76  // marker
77  TEveGeoManagerHolder gmgr(TEveGeoShape::GetGeoMangeur());
78  TEvePointSet* pointSet = new TEvePointSet();
79  pointSet->SetNextPoint( v.x(), v.y(), v.z() );
80  setupAddElement(pointSet, &oItemHolder);
81 
82 
83  // ellipse
84  if ( item()->getConfig()->value<bool>("Draw Ellipse"))
85  {
86 
87  TEveEllipsoid* eveEllipsoid = new TEveEllipsoid("Ellipsoid", Form("Ellipsoid %d", iIndex));
88 
89  eveEllipsoid->RefPos().Set(v.x(),v.y(),v.z());
90 
92  TMatrixDSym m(3);
93  for(int i=0;i<3;i++)
94  for(int j=0;j<3;j++)
95  {
96  m(i,j) = e(i,j);
97  eveEllipsoid->RefEMtx()(i+1, j+1) = e(i,j);
98  }
99 
100  // external scaling
101  double ellipseScale = 1.;
102  if ( item()->getConfig()->value<long>("Scale Ellipse"))
103  ellipseScale = item()->getConfig()->value<long>("Scale Ellipse");
104 
105  eveEllipsoid->SetScale(ellipseScale);
106 
107  // cache 3D extend used in eval bbox and render 3D
108  TMatrixDEigen eig(m);
109  TVectorD vv ( eig.GetEigenValuesRe());
110  eveEllipsoid->RefExtent3D().Set(sqrt(vv(0))*ellipseScale,sqrt(vv(1))*ellipseScale,sqrt(vv(2))*ellipseScale);
111 
112  eveEllipsoid->SetLineWidth(2);
113  setupAddElement(eveEllipsoid, &oItemHolder);
114  eveEllipsoid->SetMainTransparency(TMath::Min(100, 80 + item()->defaultDisplayProperties().transparency() / 5));
115 
116 
117 
118  Color_t color = item()->getConfig()->value<long>("Ellipse Color Index");
119  // eveEllipsoid->SetFillColor(item()->defaultDisplayProperties().color());
120  // eveEllipsoid->SetLineColor(item()->defaultDisplayProperties().color());
121  eveEllipsoid->SetMainColor(color + context().colorManager()->offsetOfLimitedColors());
122  }
123 
124  // tracks
125  if ( item()->getConfig()->value<bool>("Draw Tracks"))
126  {
128  it != v.tracks_end() ; ++it)
129  {
130  float w = v.trackWeight(*it);
131  if (w < 0.5) continue;
132 
133  const reco::Track & track = *it->get();
134  TEveRecTrack t;
135  t.fBeta = 1.;
136  t.fV = TEveVector(track.vx(), track.vy(), track.vz());
137  t.fP = TEveVector(track.px(), track.py(), track.pz());
138  t.fSign = track.charge();
139  TEveTrack* trk = new TEveTrack(&t, context().getTrackPropagator());
140  trk->SetMainColor(item()->defaultDisplayProperties().color());
141  trk->MakeTrack();
142  setupAddElement(trk, &oItemHolder);
143  }
144  }
145  if ( item()->getConfig()->value<bool>("Draw Pseudo Track"))
146  {
147  TEveRecTrack t;
148  t.fBeta = 1.;
149  t.fV = TEveVector(v.x(),v.y(),v.z());
150  t.fP = TEveVector(-v.p4().px(), -v.p4().py(), -v.p4().pz());
151  t.fSign = 1;
152  TEveTrack* trk = new TEveTrack(&t, context().getTrackPropagator());
153  trk->SetLineStyle(7);
154  trk->MakeTrack();
155  setupAddElement(trk, &oItemHolder);
156 
157  }
158 }
const fireworks::Context & context() const
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:165
int i
Definition: DBlmapReader.cc:9
TEveVector & RefPos()
Definition: TEveEllipsoid.h:38
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:44
double y() const
y coordinate
Definition: Vertex.h:96
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:43
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:131
const FWEventItem * item() const
void SetScale(float x)
Definition: TEveEllipsoid.h:42
float trackWeight(const TrackBaseRef &r) const
returns the weight with which a Track has contributed to the vertex-fit.
T sqrt(T t)
Definition: SSEVec.h:48
TEveTrans & RefEMtx()
Definition: TEveEllipsoid.h:40
int j
Definition: DBlmapReader.cc:9
double z() const
y coordinate
Definition: Vertex.h:98
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:135
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:145
double x() const
x coordinate
Definition: Vertex.h:94
TEveVector & RefExtent3D()
Definition: TEveEllipsoid.h:39
math::XYZTLorentzVectorD p4(float mass=0.13957018, float minWeight=0.5) const
Returns the four momentum of the sum of the tracks, assuming the given mass for the decay products...
Definition: Vertex.cc:112
Error error() const
return SMatrix
Definition: Vertex.h:115
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:143
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:37
int charge() const
track electric charge
Definition: TrackBase.h:111
T w() const
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:39
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:133
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:141
void FWVertexProxyBuilder::localModelChanges ( const FWModelId iId,
TEveElement *  iCompound,
FWViewType::EType  viewType,
const FWViewContext vc 
)
overrideprivatevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 161 of file FWVertexProxyBuilder.cc.

References FWProxyBuilderBase::context(), FWProxyBuilderBase::increaseComponentTransparency(), FWModelId::index(), and FWProxyBuilderBase::item().

163 {
164  increaseComponentTransparency(iId.index(), iCompound, "Ellipsoid", 80);
165  TEveElement* el = iCompound->FindChild("Ellipsoid");
166  if (el)
167  el->SetMainColor(item()->getConfig()->value<long>("Ellipse Color Index") + context().colorManager()->offsetOfLimitedColors());
168 }
const fireworks::Context & context() const
const FWEventItem * item() const
int index() const
Definition: FWModelId.h:49
void increaseComponentTransparency(unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
const FWVertexProxyBuilder& FWVertexProxyBuilder::operator= ( const FWVertexProxyBuilder )
private
FWVertexProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )
virtual void FWVertexProxyBuilder::setItem ( const FWEventItem iItem)
inlineoverridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 44 of file FWVertexProxyBuilder.cc.

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

45  {
47  if (iItem)
48  {
49  iItem->getConfig()->assertParam("Draw Tracks", false);
50  iItem->getConfig()->assertParam("Draw Pseudo Track", false);
51  iItem->getConfig()->assertParam("Draw Ellipse", false);
52  iItem->getConfig()->assertParam("Scale Ellipse",2l, 1l, 10l);
53  iItem->getConfig()->assertParam("Ellipse Color Index", 6l, 0l, (long)context().colorManager()->numberOfLimitedColors());
54  }
55  }
const fireworks::Context & context() const
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:165
virtual void setItem(const FWEventItem *iItem)
FWGenericParameter< T > * assertParam(const std::string &name, T def)