CMS 3D CMS Logo

Public Member Functions | Private Member Functions

FWBeamSpotProxyBuilder Class Reference

Inheritance diagram for FWBeamSpotProxyBuilder:
FWSimpleProxyBuilderTemplate< reco::BeamSpot > FWSimpleProxyBuilder FWProxyBuilderBase

List of all members.

Public Member Functions

 FWBeamSpotProxyBuilder (void)
 REGISTER_PROXYBUILDER_METHODS ()
virtual ~FWBeamSpotProxyBuilder (void)

Private Member Functions

virtual void build (const reco::BeamSpot &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *)
 FWBeamSpotProxyBuilder (const FWBeamSpotProxyBuilder &)
virtual void localModelChanges (const FWModelId &iId, TEveElement *parent, FWViewType::EType viewType, const FWViewContext *vc)
const FWBeamSpotProxyBuilderoperator= (const FWBeamSpotProxyBuilder &)

Detailed Description

Definition at line 15 of file FWBeamSpotProxyBuilder.cc.


Constructor & Destructor Documentation

FWBeamSpotProxyBuilder::FWBeamSpotProxyBuilder ( void  ) [inline]

Definition at line 18 of file FWBeamSpotProxyBuilder.cc.

{}
virtual FWBeamSpotProxyBuilder::~FWBeamSpotProxyBuilder ( void  ) [inline, virtual]

Definition at line 19 of file FWBeamSpotProxyBuilder.cc.

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

Member Function Documentation

void FWBeamSpotProxyBuilder::build ( const reco::BeamSpot 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::BeamSpot >.

Definition at line 53 of file FWBeamSpotProxyBuilder.cc.

References a, b, FWDisplayProperties::color(), FWEventItem::defaultDisplayProperties(), i, FWProxyBuilderBase::item(), python::rootplot::utilities::ls(), MultiGaussianStateTransform::N, Pi, pos, FWProxyBuilderBase::setupAddElement(), reco::BeamSpot::x0(), reco::BeamSpot::x0Error(), reco::BeamSpot::y0(), reco::BeamSpot::y0Error(), reco::BeamSpot::z0(), and reco::BeamSpot::z0Error().

{  
   TEveStraightLineSet* ls = new TEveStraightLineSet();

   double pos[3] = { bs.x0(), bs.y0(), bs.z0() };
   double e[3] = { bs.x0Error(), bs.y0Error(), bs.z0Error() };

   const Int_t   N = 32;
   const Float_t S = 2*TMath::Pi()/N;

   Float_t a = e[0], b = e[1];
   for (Int_t i = 0; i<N; i++)
      ls->AddLine(a*TMath::Cos(i*S)  , b*TMath::Sin(i*S)  , 0,
                  a*TMath::Cos(i*S+S), b*TMath::Sin(i*S+S), 0);

   a = e[0]; b = e[2];
   for (Int_t i = 0; i<N; i++)
      ls->AddLine(a*TMath::Cos(i*S)  , 0, b*TMath::Sin(i*S),
                  a*TMath::Cos(i*S+S), 0, b*TMath::Sin(i*S+S));

   a = e[1]; b = e[2];
   for (Int_t i = 0; i<N; i++)
      ls->AddLine(0, a*TMath::Cos(i*S)  ,  b*TMath::Sin(i*S),
                  0, a*TMath::Cos(i*S+S),  b*TMath::Sin(i*S+S));

   ls->AddLine(0,0,0,0,0,0);
   ls->AddMarker(0,0,0);
   ls->SetMarkerStyle(21);
   const FWDisplayProperties &dp = 
      FWProxyBuilderBase::item()->defaultDisplayProperties();
   ls->SetMarkerColor( dp.color() );

   ls->RefMainTrans().SetPos(pos);
   setupAddElement(ls, &oItemHolder);
}
void FWBeamSpotProxyBuilder::localModelChanges ( const FWModelId iId,
TEveElement *  parent,
FWViewType::EType  viewType,
const FWViewContext vc 
) [private, virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 33 of file FWBeamSpotProxyBuilder.cc.

References trackerHits::c, FWModelId::index(), FWProxyBuilderBase::item(), j, python::rootplot::utilities::ls(), and FWEventItem::modelInfo().

{
  if( TEveStraightLineSet *ls = dynamic_cast<TEveStraightLineSet*> ( *parent->BeginChildren() ))
  { 
    Color_t c = FWProxyBuilderBase::item()->modelInfo( iId.index() ).displayProperties().color();
    for (TEveProjectable::ProjList_i j = ls->BeginProjecteds(); j != ls->EndProjecteds(); ++j)
    {
      if( TEveStraightLineSet *pls = dynamic_cast<TEveStraightLineSet*> (*j))
      {
        pls->SetMarkerColor(c);
        pls->ElementChanged();
      }
    }

    ls->SetMarkerColor(c);
    ls->ElementChanged();
  }
}
const FWBeamSpotProxyBuilder& FWBeamSpotProxyBuilder::operator= ( const FWBeamSpotProxyBuilder ) [private]
FWBeamSpotProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )