CMS 3D CMS Logo

Public Member Functions | Private Member Functions

FWVertexWithTracksProxyBuilder Class Reference

Inheritance diagram for FWVertexWithTracksProxyBuilder:
FWSimpleProxyBuilderTemplate< reco::Vertex > FWSimpleProxyBuilder FWProxyBuilderBase

List of all members.

Public Member Functions

 FWVertexWithTracksProxyBuilder ()
 REGISTER_PROXYBUILDER_METHODS ()

Private Member Functions

virtual void build (const reco::Vertex &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *)
 FWVertexWithTracksProxyBuilder (const FWVertexWithTracksProxyBuilder &)
const
FWVertexWithTracksProxyBuilder
operator= (const FWVertexWithTracksProxyBuilder &)

Detailed Description

Definition at line 45 of file FWVertexWithTracksProxyBuilder.cc.


Constructor & Destructor Documentation

FWVertexWithTracksProxyBuilder::FWVertexWithTracksProxyBuilder ( )

Definition at line 79 of file FWVertexWithTracksProxyBuilder.cc.

{
}
FWVertexWithTracksProxyBuilder::FWVertexWithTracksProxyBuilder ( const FWVertexWithTracksProxyBuilder ) [private]

Member Function Documentation

void FWVertexWithTracksProxyBuilder::build ( const reco::Vertex iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
const FWViewContext  
) [private, virtual]

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 88 of file FWVertexWithTracksProxyBuilder.cc.

References reco::TrackBase::charge(), FWProxyBuilderBase::context(), ExpressReco_HICollisions_FallBack::e, reco::Vertex::error(), i, FWProxyBuilderBase::item(), j, m, position, reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), mathSSE::sqrt(), matplotRender::t, ExpressReco_HICollisions_FallBack::track, reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), reco::Vertex::trackWeight(), v, reco::TrackBase::vx(), reco::TrackBase::vy(), reco::TrackBase::vz(), reco::Vertex::x(), reco::Vertex::y(), and reco::Vertex::z().

{

  TEveGeoManagerHolder gmgr(TEveGeoShape::GetGeoMangeur());
   TEvePointSet* pointSet = new TEvePointSet();
   pointSet->SetMainColor(item()->defaultDisplayProperties().color());
//   for(unsigned int i=0;i<iData.nVertices();i++)
//   {
      const reco::Vertex & v = iData;
      // do we need this stuff?
      TGeoSphere * sphere = new TGeoSphere(0, 0.002); //would that leak?
      TGeoTranslation position(v.x(), v.y(), v.z() );
      TEveGeoShape * shape = new TEveGeoShape();
      sphere->SetBoxDimensions(2.5,2.5,2.5);
      shape->SetShape(sphere);
      shape->SetMainColor(item()->defaultDisplayProperties().color());
      shape->SetMainTransparency(10);

      TEveTrans & t =   shape->RefMainTrans();
      reco::Vertex::Error e= v.error();
      TMatrixDSym m(3);
      for(int i=0;i<3;i++)
         for(int j=0;j<3;j++)
         {
            m(i,j) = e(i,j);
         }
      TMatrixDEigen eig(m);
      TDecompSVD svd(m);
      TMatrixD mm = svd.GetU();
      //   TMatrixD mm =  eig.GetEigenVectors().Print();
      for(int i=0;i<3;i++)
         for(int j=0;j<3;j++)
         {
            t(i+1,j+1) = mm(i,j);
         }
      TVectorD vv ( eig.GetEigenValuesRe())   ;
      t.Scale(sqrt(vv(0))*1000.,sqrt(vv(1))*1000.,sqrt(vv(2))*1000.);
      t.SetPos(v.x(),v.y(),v.z());
      oItemHolder.AddElement(shape);
      pointSet->SetNextPoint( v.x(), v.y(), v.z() );
      for(reco::Vertex::trackRef_iterator it = v.tracks_begin() ;
          it != v.tracks_end()  ; ++it)
     {
               float w = v.trackWeight(*it);
               if (w < 0.5) continue;

         const reco::Track & track = *it->get();
         TEveRecTrack t;
         t.fBeta = 1.;
         t.fV = TEveVector(track.vx(), track.vy(), track.vz());
         t.fP = TEveVector(track.px(), track.py(), track.pz());
         t.fSign = track.charge();
         TEveTrack* trk = new TEveTrack(&t, context().getTrackPropagator());
         trk->SetMainColor(item()->defaultDisplayProperties().color());
         trk->MakeTrack();
         oItemHolder.AddElement( trk );
      }

//   }
   oItemHolder.AddElement( pointSet );




}
const FWVertexWithTracksProxyBuilder& FWVertexWithTracksProxyBuilder::operator= ( const FWVertexWithTracksProxyBuilder ) [private]
FWVertexWithTracksProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )