CMS 3D CMS Logo

Public Member Functions | Private Member Functions

FWCandidateLegoProxyBuilder Class Reference

Inheritance diagram for FWCandidateLegoProxyBuilder:
FWSimpleProxyBuilderTemplate< reco::Candidate > FWSimpleProxyBuilder FWProxyBuilderBase

List of all members.

Public Member Functions

 FWCandidateLegoProxyBuilder ()
virtual bool havePerViewProduct (FWViewType::EType) const
virtual void localModelChanges (const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *)
 REGISTER_PROXYBUILDER_METHODS ()
virtual void scaleProduct (TEveElementList *, FWViewType::EType, const FWViewContext *)
virtual ~FWCandidateLegoProxyBuilder ()

Private Member Functions

void build (const reco::Candidate &, unsigned int, TEveElement &, const FWViewContext *)
 FWCandidateLegoProxyBuilder (const FWCandidateLegoProxyBuilder &)
const FWCandidateLegoProxyBuilderoperator= (const FWCandidateLegoProxyBuilder &)

Detailed Description

Definition at line 27 of file FWCandidateLegoProxyBuilder.cc.


Constructor & Destructor Documentation

FWCandidateLegoProxyBuilder::FWCandidateLegoProxyBuilder ( ) [inline]

Definition at line 31 of file FWCandidateLegoProxyBuilder.cc.

{}
virtual FWCandidateLegoProxyBuilder::~FWCandidateLegoProxyBuilder ( ) [inline, virtual]

Definition at line 32 of file FWCandidateLegoProxyBuilder.cc.

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

Member Function Documentation

void FWCandidateLegoProxyBuilder::build ( const reco::Candidate 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::Candidate >.

Definition at line 88 of file FWCandidateLegoProxyBuilder.cc.

References FWProxyBuilderBase::context(), reco::Candidate::energy(), reco::Candidate::et(), reco::Candidate::eta(), FWProxyBuilderBase::item(), reco::Candidate::phi(), reco::Candidate::pt(), FWProxyBuilderBase::setupAddElement(), and fireworks::Context::voteMaxEtAndEnergy().

{
   FWLegoCandidate *candidate = new FWLegoCandidate( vc, context(), iData.energy(),
                                                         iData.et(), iData.pt(),
                                                         iData.eta(), iData.phi() );

   candidate->SetMarkerColor( item()->defaultDisplayProperties().color() );
   context().voteMaxEtAndEnergy( iData.et(), iData.energy() );

   setupAddElement( candidate, &oItemHolder );
}
virtual bool FWCandidateLegoProxyBuilder::havePerViewProduct ( FWViewType::EType  ) const [inline, virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 35 of file FWCandidateLegoProxyBuilder.cc.

{ return true; }
void FWCandidateLegoProxyBuilder::localModelChanges ( const FWModelId iId,
TEveElement *  parent,
FWViewType::EType  type,
const FWViewContext vc 
) [virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 72 of file FWCandidateLegoProxyBuilder.cc.

References FWDisplayProperties::color(), FWModelId::index(), FWProxyBuilderBase::item(), FWEventItem::modelInfo(), and dbtoconf::parent.

{
   // Line set marker is nto the same color as line, have to fix it here
   if( (parent)->HasChildren() )
   {
      TEveElement *el = (parent)->FirstChild();       // There is only one child
      FWLegoCandidate *candidate = dynamic_cast<FWLegoCandidate*> (el);
      const FWDisplayProperties &dp = item()->modelInfo( iId.index() ).displayProperties();
      candidate->SetMarkerColor( dp.color() );
      candidate->ElementChanged();
   }
}
const FWCandidateLegoProxyBuilder& FWCandidateLegoProxyBuilder::operator= ( const FWCandidateLegoProxyBuilder ) [private]
FWCandidateLegoProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )
void FWCandidateLegoProxyBuilder::scaleProduct ( TEveElementList *  parent,
FWViewType::EType  type,
const FWViewContext vc 
) [virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 56 of file FWCandidateLegoProxyBuilder.cc.

References FWProxyBuilderBase::context(), i, and FWLegoCandidate::updateScale().

{
   for( TEveElement::List_i i = parent->BeginChildren(); i != parent->EndChildren(); ++i )
   {
      if( (*i)->HasChildren() )
      {
         TEveElement *el = (*i)->FirstChild();  // There is only one child
         FWLegoCandidate *candidate = dynamic_cast<FWLegoCandidate*> (el);
         candidate->updateScale( vc, context() );
      }
   }
}