CMS 3D CMS Logo

Classes | Public Member Functions | Private Member Functions | Private Attributes

FWMET3DProxyBuilder Class Reference

Inheritance diagram for FWMET3DProxyBuilder:
FWSimpleProxyBuilderTemplate< reco::MET > FWSimpleProxyBuilder FWProxyBuilderBase

List of all members.

Classes

class  Arrow

Public Member Functions

virtual void cleanLocal ()
 FWMET3DProxyBuilder ()
virtual bool havePerViewProduct (FWViewType::EType) const
 REGISTER_PROXYBUILDER_METHODS ()
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
virtual ~FWMET3DProxyBuilder ()

Private Member Functions

void build (const reco::MET &, unsigned int, TEveElement &, const FWViewContext *)
 FWMET3DProxyBuilder (const FWMET3DProxyBuilder &)
const FWMET3DProxyBuilderoperator= (const FWMET3DProxyBuilder &)

Private Attributes

std::vector< Arrow * > m_arrows

Detailed Description

Definition at line 35 of file FWMET3DProxyBuilder.cc.


Constructor & Destructor Documentation

FWMET3DProxyBuilder::FWMET3DProxyBuilder ( )

Definition at line 89 of file FWMET3DProxyBuilder.cc.

{
}
FWMET3DProxyBuilder::~FWMET3DProxyBuilder ( ) [virtual]

Definition at line 93 of file FWMET3DProxyBuilder.cc.

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

Member Function Documentation

void FWMET3DProxyBuilder::build ( const reco::MET 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::MET >.

Definition at line 116 of file FWMET3DProxyBuilder.cc.

References fireworks::Context::caloR1(), fireworks::Context::caloTransEta(), fireworks::Context::caloZ1(), FWProxyBuilderBase::context(), funct::cos(), reco::LeafCandidate::energy(), reco::LeafCandidate::et(), reco::LeafCandidate::eta(), FWViewContext::getEnergyScale(), m_arrows, FWMET3DProxyBuilder::Arrow::m_energy, FWMET3DProxyBuilder::Arrow::m_et, FWMET3DProxyBuilder::Arrow::m_vc, reco::LeafCandidate::phi(), phi, FWMET3DProxyBuilder::Arrow::setScale(), FWProxyBuilderBase::setupAddElement(), funct::sin(), theta(), reco::LeafCandidate::theta(), and fireworks::Context::voteMaxEtAndEnergy().

{
   float r0;
   float phi   = met.phi();
   float theta = met.theta();

   if (TMath::Abs(met.eta()) < context().caloTransEta())
      r0  = context().caloR1()/sin(theta);
   else
      r0  = context().caloZ1()/fabs(cos(theta));

   Arrow* arrow = new Arrow( sin(theta)*cos(phi), sin(theta)*sin(phi), cos(theta),
                             r0*sin(theta)*cos(phi), r0*sin(theta)*sin(phi), r0*cos(theta));
   arrow->m_et = met.et();
   arrow->m_energy = met.energy();
   arrow->m_vc = vc;
   arrow->SetConeL(0.15);
   arrow->SetConeR(0.06);
   setupAddElement(arrow, &oItemHolder );  

   m_arrows.push_back(arrow);
   arrow->setScale(vc->getEnergyScale()); 
   arrow->setScale(vc->getEnergyScale());

   context().voteMaxEtAndEnergy(met.et(), met.energy());

}
virtual void FWMET3DProxyBuilder::cleanLocal ( ) [inline, virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 68 of file FWMET3DProxyBuilder.cc.

References m_arrows.

{ m_arrows.clear(); }
virtual bool FWMET3DProxyBuilder::havePerViewProduct ( FWViewType::EType  ) const [inline, virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 66 of file FWMET3DProxyBuilder.cc.

{ return true; } // used energy scaling
const FWMET3DProxyBuilder& FWMET3DProxyBuilder::operator= ( const FWMET3DProxyBuilder ) [private]
FWMET3DProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )
void FWMET3DProxyBuilder::scaleProduct ( TEveElementList *  parent,
FWViewType::EType  type,
const FWViewContext vc 
) [virtual]

Reimplemented from FWProxyBuilderBase.

Definition at line 101 of file FWMET3DProxyBuilder.cc.

References FWViewContext::getEnergyScale(), i, and m_arrows.

{
   // printf("scale prod \n");
   FWViewEnergyScale* caloScale = vc->getEnergyScale();  

   for (std::vector<Arrow*>::iterator i = m_arrows.begin(); i!= m_arrows.end(); ++ i)
   {
      if ( vc == (*i)->m_vc)
      {
         (*i)->setScale(caloScale);  
      }
   }
}

Member Data Documentation

std::vector<Arrow*> FWMET3DProxyBuilder::m_arrows [private]

Definition at line 83 of file FWMET3DProxyBuilder.cc.

Referenced by build(), cleanLocal(), and scaleProduct().