CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions
FWVertexCandidateProxyBuilder Class Reference
Inheritance diagram for FWVertexCandidateProxyBuilder:
FWSimpleProxyBuilderTemplate< reco::VertexCompositePtrCandidate > FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWVertexCandidateProxyBuilder ()
 
const std::string & purpose () const
 
virtual void setItem (const FWEventItem *iItem) override
 
const std::string & typeName () const
 
const std::string & view () const
 
virtual ~FWVertexCandidateProxyBuilder ()
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::VertexCompositePtrCandidate >
 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 ()
 

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

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

Additional Inherited Members

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >
::iterator 
Product_it
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::VertexCompositePtrCandidate >
virtual void build (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context)
 
virtual void buildViewType (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context)
 
virtual void buildViewType (const reco::VertexCompositePtrCandidate &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
 
const
reco::VertexCompositePtrCandidate
modelData (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 40 of file FWVertexCandidateProxyBuilder.cc.

Constructor & Destructor Documentation

FWVertexCandidateProxyBuilder::FWVertexCandidateProxyBuilder ( )
inline

Definition at line 43 of file FWVertexCandidateProxyBuilder.cc.

43 {}
virtual FWVertexCandidateProxyBuilder::~FWVertexCandidateProxyBuilder ( )
inlinevirtual

Definition at line 44 of file FWVertexCandidateProxyBuilder.cc.

44 {}
FWVertexCandidateProxyBuilder::FWVertexCandidateProxyBuilder ( const FWVertexCandidateProxyBuilder )
private

Member Function Documentation

void FWVertexCandidateProxyBuilder::build ( const reco::VertexCompositePtrCandidate 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::VertexCompositePtrCandidate >.

Definition at line 75 of file FWVertexCandidateProxyBuilder.cc.

References EnergyCorrector::c, create_public_lumi_plots::color, FWProxyBuilderBase::context(), gather_cfg::cout, reco::CompositePtrCandidate::daughter(), alignCSCRings::e, reco::VertexCompositePtrCandidate::error(), FWEventItem::getConfig(), i, FWProxyBuilderBase::item(), j, visualization-live-secondInstance_cfg::m, Min(), reco::CompositePtrCandidate::numberOfDaughters(), reco::LeafCandidate::p4(), fireworks::prepareCandidate(), TEveEllipsoid::RefEMtx(), TEveEllipsoid::RefExtent3D(), TEveEllipsoid::RefPos(), TEveEllipsoid::SetScale(), FWProxyBuilderBase::setupAddElement(), mathSSE::sqrt(), tree::t, findQualityFiles::v, FWProxyBuilderConfiguration::value(), reco::LeafCandidate::vx(), reco::LeafCandidate::vy(), and reco::LeafCandidate::vz().

76 {
77  const reco::VertexCompositePtrCandidate & v = iData;
78 
79  // marker
80  TEveGeoManagerHolder gmgr(TEveGeoShape::GetGeoMangeur());
81  TEvePointSet* pointSet = new TEvePointSet();
82  pointSet->SetNextPoint( v.vx(), v.vy(), v.vz() );
83  setupAddElement(pointSet, &oItemHolder);
84 
85 
86  // ellipse
87  if ( item()->getConfig()->value<bool>("Draw Ellipse"))
88  {
89 
90  TEveEllipsoid* eveEllipsoid = new TEveEllipsoid("Ellipsoid", Form("Ellipsoid %d", iIndex));
91 
92  eveEllipsoid->RefPos().Set(v.vx(),v.vy(),v.vz());
93 
95  TMatrixDSym m(3);
96  for(int i=0;i<3;i++)
97  for(int j=0;j<3;j++)
98  {
99  m(i,j) = e(i,j);
100  eveEllipsoid->RefEMtx()(i+1, j+1) = e(i,j);
101  }
102 
103  // external scaling
104  double ellipseScale = 1.;
105  if ( item()->getConfig()->value<long>("Scale Ellipse"))
106  ellipseScale = item()->getConfig()->value<long>("Scale Ellipse");
107 
108  eveEllipsoid->SetScale(ellipseScale);
109 
110  // cache 3D extend used in eval bbox and render 3D
111  TMatrixDEigen eig(m);
112  TVectorD vv ( eig.GetEigenValuesRe());
113  eveEllipsoid->RefExtent3D().Set(sqrt(vv(0))*ellipseScale,sqrt(vv(1))*ellipseScale,sqrt(vv(2))*ellipseScale);
114 
115  eveEllipsoid->SetLineWidth(2);
116  setupAddElement(eveEllipsoid, &oItemHolder);
117  eveEllipsoid->SetMainTransparency(TMath::Min(100, 80 + item()->defaultDisplayProperties().transparency() / 5));
118 
119 
120 
121  Color_t color = item()->getConfig()->value<long>("Ellipse Color Index");
122  // eveEllipsoid->SetFillColor(item()->defaultDisplayProperties().color());
123  // eveEllipsoid->SetLineColor(item()->defaultDisplayProperties().color());
124  eveEllipsoid->SetMainColor(color + context().colorManager()->offsetOfLimitedColors());
125  }
126 
127  // tracks
128  if ( item()->getConfig()->value<bool>("Draw Tracks"))
129  {
130  for(unsigned int j=0;j<v.numberOfDaughters();j++)
131  {
132  const reco::Candidate * c = v.daughter(j);
133  std::cout << c << std::endl;
134  TEveTrack* trk = fireworks::prepareCandidate( *c, context().getTrackPropagator() );
135 
136  trk->SetMainColor(item()->defaultDisplayProperties().color());
137  trk->MakeTrack();
138  setupAddElement(trk, &oItemHolder);
139  }
140  }
141  if ( item()->getConfig()->value<bool>("Draw Pseudo Track"))
142  {
143  TEveRecTrack t;
144  t.fBeta = 1.;
145  t.fV = TEveVector(v.vx(),v.vy(),v.vz());
146  t.fP = TEveVector(-v.p4().px(), -v.p4().py(), -v.p4().pz());
147  t.fSign = 1;
148  TEveTrack* trk = new TEveTrack(&t, context().getTrackPropagator());
149  trk->SetLineStyle(7);
150  trk->MakeTrack();
151  setupAddElement(trk, &oItemHolder);
152 
153  }
154 }
const fireworks::Context & context() const
tuple t
Definition: tree.py:139
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:165
int i
Definition: DBlmapReader.cc:9
TEveVector & RefPos()
Definition: TEveEllipsoid.h:38
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:43
T Min(T a, T b)
Definition: MathUtil.h:39
virtual double vy() const
y coordinate of vertex position
const FWEventItem * item() const
void SetScale(float x)
Definition: TEveEllipsoid.h:42
virtual size_t numberOfDaughters() const
number of daughters
T sqrt(T t)
Definition: SSEVec.h:48
TEveTrans & RefEMtx()
Definition: TEveEllipsoid.h:40
int j
Definition: DBlmapReader.cc:9
virtual double vz() const
z coordinate of vertex position
TEveVector & RefExtent3D()
Definition: TEveEllipsoid.h:39
TEveTrack * prepareCandidate(const reco::Candidate &track, TEveTrackPropagator *propagator)
virtual double vx() const
x coordinate of vertex position
tuple cout
Definition: gather_cfg.py:121
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
const std::string & FWVertexCandidateProxyBuilder::classPurpose ( )
static

Definition at line 169 of file FWVertexCandidateProxyBuilder.cc.

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

Definition at line 169 of file FWVertexCandidateProxyBuilder.cc.

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

Definition at line 169 of file FWVertexCandidateProxyBuilder.cc.

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

Definition at line 169 of file FWVertexCandidateProxyBuilder.cc.

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

Reimplemented from FWProxyBuilderBase.

Definition at line 157 of file FWVertexCandidateProxyBuilder.cc.

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

159 {
160  increaseComponentTransparency(iId.index(), iCompound, "Ellipsoid", 80);
161  TEveElement* el = iCompound->FindChild("Ellipsoid");
162  if (el)
163  el->SetMainColor(item()->getConfig()->value<long>("Ellipse Color Index") + context().colorManager()->offsetOfLimitedColors());
164 }
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 FWVertexCandidateProxyBuilder& FWVertexCandidateProxyBuilder::operator= ( const FWVertexCandidateProxyBuilder )
private
const std::string& FWVertexCandidateProxyBuilder::purpose ( ) const
inline
virtual void FWVertexCandidateProxyBuilder::setItem ( const FWEventItem iItem)
inlineoverridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 46 of file FWVertexCandidateProxyBuilder.cc.

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

47  {
49  if (iItem)
50  {
51  iItem->getConfig()->assertParam("Draw Tracks", false);
52  iItem->getConfig()->assertParam("Draw Pseudo Track", false);
53  iItem->getConfig()->assertParam("Draw Ellipse", false);
54  iItem->getConfig()->assertParam("Scale Ellipse",2l, 1l, 10l);
55  iItem->getConfig()->assertParam("Ellipse Color Index", 6l, 0l, (long)context().colorManager()->numberOfLimitedColors());
56  }
57  }
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)
const std::string& FWVertexCandidateProxyBuilder::typeName ( ) const
inline
const std::string& FWVertexCandidateProxyBuilder::view ( ) const
inline