CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static 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
 
const std::string & purpose () const
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
const std::string & typeName () const
 
const std::string & view () const
 
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 ()
 

Static Public Member Functions

static const std::string & classPurpose ()
 
static const std::string & classRegisterTypeName ()
 
static const std::string & classTypeName ()
 
static const std::string & classView ()
 
- 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...
 

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

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >::iterator Product_it
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::MET >
virtual void build (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context)
 
virtual void buildViewType (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context)
 
virtual void buildViewType (const reco::MET &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
 
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 90 of file FWMET3DProxyBuilder.cc.

Referenced by FWMET3DProxyBuilder::Arrow::setScale().

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

Definition at line 94 of file FWMET3DProxyBuilder.cc.

Referenced by FWMET3DProxyBuilder::Arrow::setScale().

95 {
96 }
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 117 of file FWMET3DProxyBuilder.cc.

References Abs(), FWMET3DProxyBuilder::Arrow::Arrow(), 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().

118 {
119  float r0;
120  float phi = met.phi();
121  float theta = met.theta();
122 
123  if (TMath::Abs(met.eta()) < context().caloTransEta())
124  r0 = context().caloR1()/sin(theta);
125  else
126  r0 = context().caloZ1()/fabs(cos(theta));
127 
128  Arrow* arrow = new Arrow( sin(theta)*cos(phi), sin(theta)*sin(phi), cos(theta),
129  r0*sin(theta)*cos(phi), r0*sin(theta)*sin(phi), r0*cos(theta));
130  arrow->m_et = met.et();
131  arrow->m_energy = met.energy();
132  arrow->m_vc = vc;
133  arrow->SetConeL(0.15);
134  arrow->SetConeR(0.06);
135  setupAddElement(arrow, &oItemHolder );
136 
137  m_arrows.push_back(arrow);
138  arrow->setScale(vc->getEnergyScale());
139  arrow->setScale(vc->getEnergyScale());
140 
141  context().voteMaxEtAndEnergy(met.et(), met.energy());
142 
143 }
static float caloTransEta()
Definition: Context.cc:228
const fireworks::Context & context() const
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:183
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
T Abs(T a)
Definition: MathUtil.h:49
static float caloR1(bool offset=true)
Definition: Context.cc:208
met
===> hadronic RAZOR
static float caloZ1(bool offset=true)
Definition: Context.cc:218
const std::string & FWMET3DProxyBuilder::classPurpose ( )
static

Definition at line 153 of file FWMET3DProxyBuilder.cc.

const std::string & FWMET3DProxyBuilder::classRegisterTypeName ( )
static

Definition at line 153 of file FWMET3DProxyBuilder.cc.

const std::string & FWMET3DProxyBuilder::classTypeName ( )
static

Definition at line 153 of file FWMET3DProxyBuilder.cc.

const std::string & FWMET3DProxyBuilder::classView ( )
static

Definition at line 153 of file FWMET3DProxyBuilder.cc.

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.

References class-composition::parent, and scaleProduct().

66 { return true; } // used energy scaling
const FWMET3DProxyBuilder& FWMET3DProxyBuilder::operator= ( const FWMET3DProxyBuilder )
private
const std::string& FWMET3DProxyBuilder::purpose ( ) const
inline

Definition at line 74 of file FWMET3DProxyBuilder.cc.

void FWMET3DProxyBuilder::scaleProduct ( TEveElementList *  parent,
FWViewType::EType  type,
const FWViewContext vc 
)
virtual

Reimplemented from FWProxyBuilderBase.

Definition at line 102 of file FWMET3DProxyBuilder.cc.

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

Referenced by havePerViewProduct().

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

Definition at line 74 of file FWMET3DProxyBuilder.cc.

const std::string& FWMET3DProxyBuilder::view ( ) const
inline

Definition at line 74 of file FWMET3DProxyBuilder.cc.

Member Data Documentation

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

Definition at line 84 of file FWMET3DProxyBuilder.cc.

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