CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions
FWPFClusterLegoProxyBuilder Class Reference

#include <FWPFClusterLegoProxyBuilder.h>

Inheritance diagram for FWPFClusterLegoProxyBuilder:
FWSimpleProxyBuilderTemplate< reco::PFCluster > FWSimpleProxyBuilder FWProxyBuilderBase FWPFEcalClusterLegoProxyBuilder FWPFHcalClusterLegoProxyBuilder

Public Member Functions

 FWPFClusterLegoProxyBuilder ()
 
virtual bool havePerViewProduct (FWViewType::EType) const
 
virtual void localModelChanges (const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
 
 REGISTER_PROXYBUILDER_METHODS ()
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
virtual ~FWPFClusterLegoProxyBuilder ()
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::PFCluster >
 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 &)
 
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 std::string typeOfBuilder ()
 
- 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 Member Functions

float calculateEt (const reco::PFCluster &cluster, float E)
 
void sharedBuild (const reco::PFCluster &, TEveElement &, const FWViewContext *)
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::PFCluster >
const reco::PFClustermodelData (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
virtual void cleanLocal ()
 
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 modelChanges (const FWModelIds &, Product *)
 
const FWProxyBuilderBaseoperator= (const FWProxyBuilderBase &)
 

Private Member Functions

 FWPFClusterLegoProxyBuilder (const FWPFClusterLegoProxyBuilder &)
 
const FWPFClusterLegoProxyBuilderoperator= (const FWPFClusterLegoProxyBuilder &)
 

Additional Inherited Members

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >
::iterator 
Product_it
 
- Protected Attributes inherited from FWSimpleProxyBuilder
FWSimpleProxyHelper m_helper
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Detailed Description

Definition at line 32 of file FWPFClusterLegoProxyBuilder.h.

Constructor & Destructor Documentation

FWPFClusterLegoProxyBuilder::FWPFClusterLegoProxyBuilder ( )
inline

Definition at line 38 of file FWPFClusterLegoProxyBuilder.h.

38 {}
virtual FWPFClusterLegoProxyBuilder::~FWPFClusterLegoProxyBuilder ( )
inlinevirtual

Definition at line 39 of file FWPFClusterLegoProxyBuilder.h.

39 {}
FWPFClusterLegoProxyBuilder::FWPFClusterLegoProxyBuilder ( const FWPFClusterLegoProxyBuilder )
private

Member Function Documentation

float FWPFClusterLegoProxyBuilder::calculateEt ( const reco::PFCluster cluster,
float  E 
)
protected

Definition at line 5 of file FWPFClusterLegoProxyBuilder.cc.

References ExpressReco_HICollisions_FallBack::et, reco::CaloCluster::x(), reco::CaloCluster::y(), and reco::CaloCluster::z().

Referenced by sharedBuild().

6 {
7  float et = 0.f;
8  TEveVector vec;
9 
10  vec.fX = iData.x();
11  vec.fY = iData.y(); // Get the cluster centroid
12  vec.fZ = iData.z();
13 
14  vec.Normalize();
15  vec *= E;
16  et = vec.Perp(); // Get perpendicular vector
17 
18  return et;
19 }
virtual bool FWPFClusterLegoProxyBuilder::havePerViewProduct ( FWViewType::EType  ) const
inlinevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 43 of file FWPFClusterLegoProxyBuilder.h.

43 { return true; }
void FWPFClusterLegoProxyBuilder::localModelChanges ( const FWModelId iId,
TEveElement *  iCompound,
FWViewType::EType  viewType,
const FWViewContext vc 
)
virtual

Reimplemented from FWProxyBuilderBase.

Definition at line 23 of file FWPFClusterLegoProxyBuilder.cc.

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

24 {
25  // Line set marker is not the same colour as line, fixed here
26  if( ( parent )->HasChildren() )
27  {
28  for( TEveElement::List_i j = parent->BeginChildren(); j != parent->EndChildren(); j++ )
29  {
30  FWPFLegoCandidate *cluster = dynamic_cast<FWPFLegoCandidate*>( *j );
31  const FWDisplayProperties &dp = FWProxyBuilderBase::item()->modelInfo( iId.index() ).displayProperties();
32  cluster->SetMarkerColor( dp.color() );
33  cluster->ElementChanged();
34  }
35  }
36 }
list parent
Definition: dbtoconf.py:74
const FWEventItem * item() const
Color_t color() const
int index() const
Definition: FWModelId.h:50
int j
Definition: DBlmapReader.cc:9
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:536
const FWPFClusterLegoProxyBuilder& FWPFClusterLegoProxyBuilder::operator= ( const FWPFClusterLegoProxyBuilder )
private
FWPFClusterLegoProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )
void FWPFClusterLegoProxyBuilder::scaleProduct ( TEveElementList *  parent,
FWViewType::EType  type,
const FWViewContext vc 
)
virtual

Reimplemented from FWProxyBuilderBase.

Definition at line 40 of file FWPFClusterLegoProxyBuilder.cc.

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

41 {
42  for (TEveElement::List_i i = parent->BeginChildren(); i!= parent->EndChildren(); ++i)
43  {
44  if ((*i)->HasChildren())
45  {
46  TEveElement* el = (*i)->FirstChild(); // there is only one child added in this proxy builder
47  FWPFLegoCandidate *cluster = dynamic_cast<FWPFLegoCandidate*>( el );
48  cluster->updateScale(vc, context());
49  }
50  }
51 }
const fireworks::Context & context() const
int i
Definition: DBlmapReader.cc:9
list parent
Definition: dbtoconf.py:74
void updateScale(const FWViewContext *vc, const fireworks::Context &)
void FWPFClusterLegoProxyBuilder::sharedBuild ( const reco::PFCluster iData,
TEveElement &  oItemHolder,
const FWViewContext vc 
)
protected

Definition at line 55 of file FWPFClusterLegoProxyBuilder.cc.

References calculateEt(), FWProxyBuilderBase::context(), relval_parameters_module::energy, reco::PFCluster::energy(), ExpressReco_HICollisions_FallBack::et, eta(), reco::CaloCluster::eta(), FWProxyBuilderBase::item(), phi, reco::CaloCluster::phi(), ExpressReco_HICollisions_FallBack::pt, FWProxyBuilderBase::setupAddElement(), and fireworks::Context::voteMaxEtAndEnergy().

Referenced by FWPFEcalClusterLegoProxyBuilder::build(), and FWPFHcalClusterLegoProxyBuilder::build().

56 {
57  float energy = iData.energy();
58  float et = calculateEt( iData, energy );
59  float pt = et;
60  float eta = iData.eta();
61  float phi = iData.phi();
62 
63  context().voteMaxEtAndEnergy( et, energy );
64 
65  FWPFLegoCandidate *cluster = new FWPFLegoCandidate( vc, FWProxyBuilderBase::context(), energy, et, pt, eta, phi );
66  cluster->SetMarkerColor( FWProxyBuilderBase::item()->defaultDisplayProperties().color() );
67  setupAddElement( cluster, &oItemHolder );
68 }
const fireworks::Context & context() const
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:185
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
T eta() const
const FWEventItem * item() const
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:149
double energy() const
cluster energy
Definition: PFCluster.h:73
float calculateEt(const reco::PFCluster &cluster, float E)
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:152
Definition: DDAxes.h:10
static std::string FWPFClusterLegoProxyBuilder::typeOfBuilder ( )
inlinestatic

Definition at line 35 of file FWPFClusterLegoProxyBuilder.h.

35 { return "simple#"; }