CMS 3D CMS Logo

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

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 ()
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::MET >
 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 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 &)
 
virtual void setItem (const FWEventItem *iItem)
 
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 ()
 

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
 

Additional Inherited Members

- 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...
 
- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >
::iterator 
Product_it
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::MET >
const reco::METmodelData (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
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 localModelChanges (const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
 
virtual void modelChanges (const FWModelIds &, Product *)
 
const FWProxyBuilderBaseoperator= (const FWProxyBuilderBase &)
 
- Protected Attributes inherited from FWSimpleProxyBuilder
FWSimpleProxyHelper m_helper
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Detailed Description

Definition at line 35 of file FWMET3DProxyBuilder.cc.

Constructor & Destructor Documentation

FWMET3DProxyBuilder::FWMET3DProxyBuilder ( )

Definition at line 89 of file FWMET3DProxyBuilder.cc.

90 {
91 }
FWMET3DProxyBuilder::~FWMET3DProxyBuilder ( )
virtual

Definition at line 93 of file FWMET3DProxyBuilder.cc.

94 {
95 }
FWMET3DProxyBuilder::FWMET3DProxyBuilder ( const FWMET3DProxyBuilder )
private

Member Function Documentation

void FWMET3DProxyBuilder::build ( const reco::MET iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
const FWViewContext  
)
privatevirtual

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, phi, reco::LeafCandidate::phi(), FWMET3DProxyBuilder::Arrow::setScale(), FWProxyBuilderBase::setupAddElement(), funct::sin(), reco::LeafCandidate::theta(), theta(), and fireworks::Context::voteMaxEtAndEnergy().

117 {
118  float r0;
119  float phi = met.phi();
120  float theta = met.theta();
121 
122  if (TMath::Abs(met.eta()) < context().caloTransEta())
123  r0 = context().caloR1()/sin(theta);
124  else
125  r0 = context().caloZ1()/fabs(cos(theta));
126 
127  Arrow* arrow = new Arrow( sin(theta)*cos(phi), sin(theta)*sin(phi), cos(theta),
128  r0*sin(theta)*cos(phi), r0*sin(theta)*sin(phi), r0*cos(theta));
129  arrow->m_et = met.et();
130  arrow->m_energy = met.energy();
131  arrow->m_vc = vc;
132  arrow->SetConeL(0.15);
133  arrow->SetConeR(0.06);
134  setupAddElement(arrow, &oItemHolder );
135 
136  m_arrows.push_back(arrow);
137  arrow->setScale(vc->getEnergyScale());
138  arrow->setScale(vc->getEnergyScale());
139 
140  context().voteMaxEtAndEnergy(met.et(), met.energy());
141 
142 }
static float caloTransEta()
Definition: Context.cc:229
const fireworks::Context & context() const
tuple met
____________________________________________________________________________||
Definition: CaloMET_cfi.py:7
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:184
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
std::vector< Arrow * > m_arrows
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
static float caloR1(bool offset=true)
Definition: Context.cc:209
static float caloZ1(bool offset=true)
Definition: Context.cc:219
Definition: DDAxes.h:10
virtual void FWMET3DProxyBuilder::cleanLocal ( )
inlinevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 68 of file FWMET3DProxyBuilder.cc.

References m_arrows.

68 { m_arrows.clear(); }
std::vector< Arrow * > m_arrows
virtual bool FWMET3DProxyBuilder::havePerViewProduct ( FWViewType::EType  ) const
inlinevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 66 of file FWMET3DProxyBuilder.cc.

66 { 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.

102 {
103  // printf("scale prod \n");
104  FWViewEnergyScale* caloScale = vc->getEnergyScale();
105 
106  for (std::vector<Arrow*>::iterator i = m_arrows.begin(); i!= m_arrows.end(); ++ i)
107  {
108  if ( vc == (*i)->m_vc)
109  {
110  (*i)->setScale(caloScale);
111  }
112  }
113 }
int i
Definition: DBlmapReader.cc:9
FWViewEnergyScale * getEnergyScale() const
std::vector< Arrow * > m_arrows

Member Data Documentation

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

Definition at line 83 of file FWMET3DProxyBuilder.cc.

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