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

void cleanLocal () override
 
 FWMET3DProxyBuilder ()
 
bool havePerViewProduct (FWViewType::EType) const override
 
const std::string & purpose () const
 
void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc) override
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWMET3DProxyBuilder () override
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::MET >
 FWSimpleProxyBuilderTemplate ()
 
- Public Member Functions inherited from FWSimpleProxyBuilder
 FWSimpleProxyBuilder (const std::type_info &iType)
 
 ~FWSimpleProxyBuilder () override
 
- 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 *) override
 
 FWMET3DProxyBuilder (const FWMET3DProxyBuilder &)=delete
 
const FWMET3DProxyBuilderoperator= (const FWMET3DProxyBuilder &)=delete
 

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 >
void build ()
 
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
virtual void build (const void *, unsigned int iIndex, TEveElement &iItemHolder, const FWViewContext *)=0
 
void build (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context) override
 
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *) override
 
virtual void buildViewType (const reco::MET &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
 
virtual void buildViewType (const void *, unsigned int iIndex, TEveElement &iItemHolder, FWViewType::EType, const FWViewContext *)=0
 
void buildViewType (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context) override
 
const reco::METmodelData (int index)
 
- Protected Member Functions inherited from FWSimpleProxyBuilder
void build ()
 
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *) override
 
void clean () override
 
- 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() [1/2]

FWMET3DProxyBuilder::FWMET3DProxyBuilder ( )

Definition at line 85 of file FWMET3DProxyBuilder.cc.

85 {}

◆ ~FWMET3DProxyBuilder()

FWMET3DProxyBuilder::~FWMET3DProxyBuilder ( )
override

Definition at line 87 of file FWMET3DProxyBuilder.cc.

87 {}

◆ FWMET3DProxyBuilder() [2/2]

FWMET3DProxyBuilder::FWMET3DProxyBuilder ( const FWMET3DProxyBuilder )
privatedelete

Member Function Documentation

◆ build()

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

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 103 of file FWMET3DProxyBuilder.cc.

106  {
107  float r0;
108  float phi = met.phi();
109  float theta = met.theta();
110 
111  if (TMath::Abs(met.eta()) < context().caloTransEta())
112  r0 = context().caloR1() / sin(theta);
113  else
114  r0 = context().caloZ1() / fabs(cos(theta));
115 
116  Arrow* arrow = new Arrow(sin(theta) * cos(phi),
117  sin(theta) * sin(phi),
118  cos(theta),
119  r0 * sin(theta) * cos(phi),
120  r0 * sin(theta) * sin(phi),
121  r0 * cos(theta));
122  arrow->m_et = met.et();
123  arrow->m_energy = met.energy();
124  arrow->m_vc = vc;
125  arrow->SetConeL(0.15);
126  arrow->SetConeR(0.06);
127  setupAddElement(arrow, &oItemHolder);
128 
129  m_arrows.push_back(arrow);
130  arrow->setScale(vc->getEnergyScale());
131  arrow->setScale(vc->getEnergyScale());
132 
133  context().voteMaxEtAndEnergy(met.et(), met.energy());
134 }

References Abs(), fireworks::Context::caloR1(), fireworks::Context::caloTransEta(), fireworks::Context::caloZ1(), FWProxyBuilderBase::context(), funct::cos(), FWViewContext::getEnergyScale(), m_arrows, FWMET3DProxyBuilder::Arrow::m_energy, FWMET3DProxyBuilder::Arrow::m_et, FWMET3DProxyBuilder::Arrow::m_vc, BTaggingMonitor_cfi::met, phi, FWMET3DProxyBuilder::Arrow::setScale(), FWProxyBuilderBase::setupAddElement(), funct::sin(), theta(), and fireworks::Context::voteMaxEtAndEnergy().

◆ classPurpose()

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

Definition at line 144 of file FWMET3DProxyBuilder.cc.

◆ classRegisterTypeName()

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

Definition at line 144 of file FWMET3DProxyBuilder.cc.

◆ classTypeName()

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

Definition at line 144 of file FWMET3DProxyBuilder.cc.

◆ classView()

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

Definition at line 144 of file FWMET3DProxyBuilder.cc.

◆ cleanLocal()

void FWMET3DProxyBuilder::cleanLocal ( )
inlineoverridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 63 of file FWMET3DProxyBuilder.cc.

63 { m_arrows.clear(); }

References m_arrows.

◆ havePerViewProduct()

bool FWMET3DProxyBuilder::havePerViewProduct ( FWViewType::EType  ) const
inlineoverridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 61 of file FWMET3DProxyBuilder.cc.

61 { return true; } // used energy scaling

◆ operator=()

const FWMET3DProxyBuilder& FWMET3DProxyBuilder::operator= ( const FWMET3DProxyBuilder )
privatedelete

◆ purpose()

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

Definition at line 69 of file FWMET3DProxyBuilder.cc.

71 :
72  FWMET3DProxyBuilder(const FWMET3DProxyBuilder&) = delete; // stop default

◆ scaleProduct()

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

Reimplemented from FWProxyBuilderBase.

Definition at line 92 of file FWMET3DProxyBuilder.cc.

92  {
93  // printf("scale prod \n");
94  FWViewEnergyScale* caloScale = vc->getEnergyScale();
95 
96  for (std::vector<Arrow*>::iterator i = m_arrows.begin(); i != m_arrows.end(); ++i) {
97  if (vc == (*i)->m_vc) {
98  (*i)->setScale(caloScale);
99  }
100  }
101 }

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

◆ typeName()

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

Definition at line 69 of file FWMET3DProxyBuilder.cc.

71 :
72  FWMET3DProxyBuilder(const FWMET3DProxyBuilder&) = delete; // stop default

◆ view()

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

Definition at line 69 of file FWMET3DProxyBuilder.cc.

71 :
72  FWMET3DProxyBuilder(const FWMET3DProxyBuilder&) = delete; // stop default

Member Data Documentation

◆ m_arrows

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

Definition at line 79 of file FWMET3DProxyBuilder.cc.

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

mps_fire.i
i
Definition: mps_fire.py:355
FWMET3DProxyBuilder
Definition: FWMET3DProxyBuilder.cc:35
FWMET3DProxyBuilder::FWMET3DProxyBuilder
FWMET3DProxyBuilder()
Definition: FWMET3DProxyBuilder.cc:85
BTaggingMonitor_cfi.met
met
Definition: BTaggingMonitor_cfi.py:84
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs
T Abs(T a)
Definition: MathUtil.h:49
fireworks::Context::voteMaxEtAndEnergy
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:162
fireworks::Context::caloTransEta
static float caloTransEta()
Definition: Context.cc:187
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
FWMET3DProxyBuilder::m_arrows
std::vector< Arrow * > m_arrows
Definition: FWMET3DProxyBuilder.cc:79
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition: FWProxyBuilderBase.cc:350
DDAxes::phi
fireworks::Context::caloZ1
static float caloZ1(bool offset=true)
Definition: Context.cc:183
FWViewEnergyScale
Definition: FWViewEnergyScale.h:34
FWProxyBuilderBase::context
const fireworks::Context & context() const
Definition: FWProxyBuilderBase.cc:412
FWViewContext::getEnergyScale
FWViewEnergyScale * getEnergyScale() const
Definition: FWViewContext.cc:25
fireworks::Context::caloR1
static float caloR1(bool offset=true)
Definition: Context.cc:180