CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions
FWVertexProxyBuilder Class Reference
Inheritance diagram for FWVertexProxyBuilder:
FWSimpleProxyBuilderTemplate< reco::Vertex > FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

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

Private Member Functions

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

Additional Inherited Members

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >::iterator Product_it
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::Vertex >
void build ()
 
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
virtual void build (const void *, unsigned int iIndex, TEveElement &iItemHolder, const FWViewContext *)=0
 
void build (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context) override
 
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *) override
 
virtual void buildViewType (const reco::Vertex &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
 
virtual void buildViewType (const void *, unsigned int iIndex, TEveElement &iItemHolder, FWViewType::EType, const FWViewContext *)=0
 
void buildViewType (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context) override
 
const reco::VertexmodelData (int index)
 
- Protected Member Functions inherited from FWSimpleProxyBuilder
void build ()
 
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *) override
 
void clean () override
 
- 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 40 of file FWVertexProxyBuilder.cc.

Constructor & Destructor Documentation

◆ FWVertexProxyBuilder() [1/2]

FWVertexProxyBuilder::FWVertexProxyBuilder ( )
inline

Definition at line 42 of file FWVertexProxyBuilder.cc.

42 {}

◆ ~FWVertexProxyBuilder()

FWVertexProxyBuilder::~FWVertexProxyBuilder ( )
inlineoverride

Definition at line 43 of file FWVertexProxyBuilder.cc.

43 {}

◆ FWVertexProxyBuilder() [2/2]

FWVertexProxyBuilder::FWVertexProxyBuilder ( const FWVertexProxyBuilder )
privatedelete

Member Function Documentation

◆ build()

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 73 of file FWVertexProxyBuilder.cc.

76  {
77  const reco::Vertex& v = iData;
78 
79  // marker
80  TEveGeoManagerHolder gmgr(TEveGeoShape::GetGeoMangeur());
81  TEvePointSet* pointSet = new TEvePointSet();
82  pointSet->SetNextPoint(v.x(), v.y(), v.z());
83  setupAddElement(pointSet, &oItemHolder);
84 
85  // ellipse
86  if (item()->getConfig()->value<bool>("Draw Ellipse")) {
87  TEveEllipsoid* eveEllipsoid = new TEveEllipsoid("Ellipsoid", Form("Ellipsoid %d", iIndex));
88 
89  eveEllipsoid->RefPos().Set(v.x(), v.y(), v.z());
90 
91  reco::Vertex::Error e = v.error();
92  TMatrixDSym m(3);
93  for (int i = 0; i < 3; i++)
94  for (int j = 0; j < 3; j++) {
95  m(i, j) = e(i, j);
96  eveEllipsoid->RefEMtx()(i + 1, j + 1) = e(i, j);
97  }
98 
99  // external scaling
100  double ellipseScale = 1.;
101  if (item()->getConfig()->value<long>("Scale Ellipse"))
102  ellipseScale = item()->getConfig()->value<long>("Scale Ellipse");
103 
104  eveEllipsoid->SetScale(ellipseScale);
105 
106  // cache 3D extend used in eval bbox and render 3D
107  TMatrixDEigen eig(m);
108  TVectorD vv(eig.GetEigenValuesRe());
109  eveEllipsoid->RefExtent3D().Set(sqrt(vv(0)) * ellipseScale, sqrt(vv(1)) * ellipseScale, sqrt(vv(2)) * ellipseScale);
110 
111  eveEllipsoid->SetLineWidth(2);
112  setupAddElement(eveEllipsoid, &oItemHolder);
113  eveEllipsoid->SetMainTransparency(TMath::Min(100, 80 + item()->defaultDisplayProperties().transparency() / 5));
114 
115  Color_t color = item()->getConfig()->value<long>("Ellipse Color Index");
116  // eveEllipsoid->SetFillColor(item()->defaultDisplayProperties().color());
117  // eveEllipsoid->SetLineColor(item()->defaultDisplayProperties().color());
118  eveEllipsoid->SetMainColor(color + context().colorManager()->offsetOfLimitedColors());
119  }
120 
121  // tracks
122  if (item()->getConfig()->value<bool>("Draw Tracks")) {
123  for (reco::Vertex::trackRef_iterator it = v.tracks_begin(); it != v.tracks_end(); ++it) {
124  float w = v.trackWeight(*it);
125  if (w < 0.5)
126  continue;
127 
128  const reco::Track& track = *it->get();
129  TEveRecTrack t;
130  t.fBeta = 1.;
131  t.fV = TEveVector(track.vx(), track.vy(), track.vz());
132  t.fP = TEveVector(track.px(), track.py(), track.pz());
133  t.fSign = track.charge();
134  TEveTrack* trk = new TEveTrack(&t, context().getTrackPropagator());
135  trk->SetMainColor(item()->defaultDisplayProperties().color());
136  trk->MakeTrack();
137  setupAddElement(trk, &oItemHolder);
138  }
139  }
140  if (item()->getConfig()->value<bool>("Draw Pseudo Track")) {
141  TEveRecTrack t;
142  t.fBeta = 1.;
143  t.fV = TEveVector(v.x(), v.y(), v.z());
144  t.fP = TEveVector(-v.p4().px(), -v.p4().py(), -v.p4().pz());
145  t.fSign = 1;
146  TEveTrack* trk = new TEveTrack(&t, context().getTrackPropagator());
147  trk->SetLineStyle(7);
148  trk->MakeTrack();
149  setupAddElement(trk, &oItemHolder);
150  }
151 
153  int cIdx = item()->getConfig()->value<long>("Event Center Index");
154  if (cIdx == -1) {
156  }
157  if (cIdx >= 0 && int(iIndex) == int(cIdx)) {
158  fwLog(fwlog::kInfo) << "FWVertexProxyBuilder set event center "
159  << Form("idx [%d], (%f %f %f) \n", cIdx, v.x(), v.y(), v.z());
160  context->commonPrefs()->setEventCenter(v.x(), v.y(), v.z());
161  }
162 }

References fireworks::Context::commonPrefs(), FWProxyBuilderBase::context(), MillePedeFileConverter_cfg::e, fwLog, FWEventItem::getConfig(), fireworks::Context::getInstance(), mps_fire::i, FWProxyBuilderBase::item(), dqmiolumiharvest::j, fwlog::kInfo, visualization-live-secondInstance_cfg::m, Min(), TEveEllipsoid::RefEMtx(), TEveEllipsoid::RefExtent3D(), TEveEllipsoid::RefPos(), CmsShowCommon::resetEventCenter(), CmsShowCommon::setEventCenter(), TEveEllipsoid::SetScale(), FWProxyBuilderBase::setupAddElement(), mathSSE::sqrt(), OrderedSet::t, HLT_2018_cff::track, findQualityFiles::v, FWProxyBuilderConfiguration::value(), and w.

◆ classPurpose()

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

Definition at line 178 of file FWVertexProxyBuilder.cc.

◆ classRegisterTypeName()

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

Definition at line 178 of file FWVertexProxyBuilder.cc.

◆ classTypeName()

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

Definition at line 178 of file FWVertexProxyBuilder.cc.

◆ classView()

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

Definition at line 178 of file FWVertexProxyBuilder.cc.

◆ localModelChanges()

void FWVertexProxyBuilder::localModelChanges ( const FWModelId iId,
TEveElement *  iCompound,
FWViewType::EType  viewType,
const FWViewContext vc 
)
overrideprivatevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 164 of file FWVertexProxyBuilder.cc.

167  {
168  increaseComponentTransparency(iId.index(), iCompound, "Ellipsoid", 80);
169  TEveElement* el = iCompound->FindChild("Ellipsoid");
170  if (el)
171  el->SetMainColor(item()->getConfig()->value<long>("Ellipse Color Index") +
172  context().colorManager()->offsetOfLimitedColors());
173 }

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

◆ operator=()

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

◆ purpose()

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

Definition at line 58 of file FWVertexProxyBuilder.cc.

60 :
61  FWVertexProxyBuilder(const FWVertexProxyBuilder&) = delete; // stop default

◆ setItem()

void FWVertexProxyBuilder::setItem ( const FWEventItem iItem)
inlineoverridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 45 of file FWVertexProxyBuilder.cc.

45  {
47  if (iItem) {
48  iItem->getConfig()->assertParam("Draw Tracks", false);
49  iItem->getConfig()->assertParam("Draw Pseudo Track", false);
50  iItem->getConfig()->assertParam("Draw Ellipse", false);
51  iItem->getConfig()->assertParam("Scale Ellipse", 2l, 1l, 10l);
52  iItem->getConfig()->assertParam(
53  "Ellipse Color Index", 6l, 0l, (long)context().colorManager()->numberOfLimitedColors());
54  iItem->getConfig()->assertParam("Event Center Index", -1l, -1l, 500l);
55  }
56  }

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

◆ typeName()

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

Definition at line 58 of file FWVertexProxyBuilder.cc.

60 :
61  FWVertexProxyBuilder(const FWVertexProxyBuilder&) = delete; // stop default

◆ view()

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

Definition at line 58 of file FWVertexProxyBuilder.cc.

60 :
61  FWVertexProxyBuilder(const FWVertexProxyBuilder&) = delete; // stop default
reco::Vertex::trackRef_iterator
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition: Vertex.h:38
fwLog
#define fwLog(_level_)
Definition: fwLog.h:45
mps_fire.i
i
Definition: mps_fire.py:355
fireworks::Context
Definition: Context.h:41
TEveEllipsoid::RefPos
TEveVector & RefPos()
Definition: TEveEllipsoid.h:36
FWEventItem::getConfig
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:150
reco::Vertex::Error
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:44
TEveEllipsoid::RefEMtx
TEveTrans & RefEMtx()
Definition: TEveEllipsoid.h:38
TEveEllipsoid::SetScale
void SetScale(float x)
Definition: TEveEllipsoid.h:40
findQualityFiles.v
v
Definition: findQualityFiles.py:179
FWVertexProxyBuilder
Definition: FWVertexProxyBuilder.cc:40
CmsShowCommon::setEventCenter
void setEventCenter(float, float, float)
Definition: CmsShowCommon.cc:307
w
const double w
Definition: UKUtility.cc:23
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::Track
Definition: Track.h:27
CmsShowCommon::resetEventCenter
void resetEventCenter()
Definition: CmsShowCommon.cc:313
FWProxyBuilderBase::increaseComponentTransparency
void increaseComponentTransparency(unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
Definition: FWProxyBuilderBase.cc:393
OrderedSet.t
t
Definition: OrderedSet.py:90
FWModelId::index
int index() const
Definition: FWModelId.h:41
fireworks::Context::commonPrefs
CmsShowCommon * commonPrefs() const
Definition: Context.cc:160
FWProxyBuilderConfiguration::assertParam
FWGenericParameter< T > * assertParam(const std::string &name, T def)
Definition: FWProxyBuilderConfiguration.cc:83
TEveEllipsoid::RefExtent3D
TEveVector & RefExtent3D()
Definition: TEveEllipsoid.h:37
TEveEllipsoid
Definition: TEveEllipsoid.h:13
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition: FWProxyBuilderBase.cc:350
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
FWProxyBuilderBase::item
const FWEventItem * item() const
Definition: FWProxyBuilderBase.h:64
fwlog::kInfo
Definition: fwLog.h:35
FWVertexProxyBuilder::FWVertexProxyBuilder
FWVertexProxyBuilder()
Definition: FWVertexProxyBuilder.cc:42
FWProxyBuilderConfiguration::value
T value(const std::string &name)
Definition: FWProxyBuilderConfiguration.cc:123
fireworks::Context::getInstance
static Context * getInstance()
Definition: Context.cc:193
FWProxyBuilderBase::context
const fireworks::Context & context() const
Definition: FWProxyBuilderBase.cc:412
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
Min
T Min(T a, T b)
Definition: MathUtil.h:39
FWProxyBuilderBase::setItem
virtual void setItem(const FWEventItem *iItem)
Definition: FWProxyBuilderBase.cc:83
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
reco::Vertex
Definition: Vertex.h:35
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37