CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWPFClusterRPZProxyBuilder.cc
Go to the documentation of this file.
2 
3 //______________________________________________________________________________
5 {
6  m_pfUtils = new FWPFUtils();
8 }
9 
10 //______________________________________________________________________________
12 {
13  delete m_pfUtils;
14  delete m_clusterUtils;
15 }
16 
17 //______________________________________________________________________________
18 void
20 {
21  typedef std::vector<ScalableLines> Lines_t;
22  FWViewEnergyScale *caloScale = vc->getEnergyScale();
23 
24  for( Lines_t::iterator i = m_clusters.begin(); i != m_clusters.end(); ++i )
25  {
26  if( vc == (*i).m_vc )
27  {
28  float value = caloScale->getPlotEt() ? (*i).m_et : (*i).m_energy;
29  (*i).m_ls->SetScale( caloScale->getScaleFactor3D() * value );
30  TEveProjected *proj = *(*i).m_ls->BeginProjecteds();
31  proj->UpdateProjection();
32  }
33  }
34 }
35 
36 //______________________________________________________________________________
37 void
38 FWPFClusterRPZProxyBuilder::sharedBuild( const reco::PFCluster &iData, unsigned int iIndex,
39  TEveElement &oItemHolder, const FWViewContext *vc, float r )
40 {
41  /* Handles RhoPhi view */
42  TEveScalableStraightLineSet *ls;
44  float energy, et;
45 
46  energy = iData.energy();
47  et = m_clusterUtils->calculateEt( iData, energy );
48  context().voteMaxEtAndEnergy( et, energy );
49 
50  ls = m_clusterUtils->buildRhoPhiClusterLineSet( iData, vc, energy, et, r );
51  ls->SetLineColor( dp.color() );
52  m_clusters.push_back( ScalableLines( ls, et, energy, vc ) );
53  setupAddElement( ls, &oItemHolder );
54 }
55 
56 //______________________________________________________________________________
57 void
58 FWPFClusterRPZProxyBuilder::build( const reco::PFCluster &iData, unsigned int iIndex,
59  TEveElement &oItemHolder, const FWViewContext *vc )
60 {
61  /* Handles RhoZ view */
62  float energy, et;
63  float ecalR = context().caloR1();
64  float ecalZ = context().caloZ1();
66  TEveScalableStraightLineSet *ls;
67 
68  energy = iData.energy();
69  et = m_clusterUtils->calculateEt( iData, energy );
70  context().voteMaxEtAndEnergy( et, energy );
71 
72  ls = m_clusterUtils->buildRhoZClusterLineSet( iData, vc, context().caloTransAngle(), energy, et, ecalR, ecalZ );
73  ls->SetLineColor( dp.color() );
74 
75  m_clusters.push_back( ScalableLines( ls, et, energy, vc ) );
76  setupAddElement( ls, &oItemHolder );
77 }
78 
79 //______________________________________________________________________________
80 void
81 FWPFEcalClusterRPZProxyBuilder::build( const reco::PFCluster &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *vc )
82 {
83  PFLayer::Layer layer = iData.layer();
84  const FWEventItem::ModelInfo &info = item()->modelInfo( iIndex );
85  if( info.displayProperties().isVisible() )
86  {
87  if( layer < 0 )
88  sharedBuild( iData, iIndex, oItemHolder, vc, m_pfUtils->getCaloR1() );
89  else
90  sharedBuild( iData, iIndex, oItemHolder, vc, m_pfUtils->getCaloR2() );
91  }
92 }
93 
94 //______________________________________________________________________________
95 void
96 FWPFHcalClusterRPZProxyBuilder::build( const reco::PFCluster &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *vc )
97 {
98  const FWEventItem::ModelInfo &info = item()->modelInfo( iIndex );
99  if( info.displayProperties().isVisible() )
100  sharedBuild( iData, iIndex, oItemHolder, vc, m_pfUtils->getCaloR1() );
101 }
102 
103 //______________________________________________________________________________
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
Definition: PFCluster.cc:81
const fireworks::Context & context() const
float getScaleFactor3D() const
int i
Definition: DBlmapReader.cc:9
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:452
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:67
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
float calculateEt(const reco::PFCluster &, float e)
list parent
Definition: dbtoconf.py:74
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:42
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:185
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
float getCaloR1()
Definition: FWPFUtils.h:46
FWViewEnergyScale * getEnergyScale() const
TEveScalableStraightLineSet * buildRhoPhiClusterLineSet(const reco::PFCluster &, const FWViewContext *, float r)
const FWEventItem * item() const
Color_t color() const
virtual void scaleProduct(TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
std::vector< ScalableLines > m_clusters
float getCaloR2()
Definition: FWPFUtils.h:47
static float caloR1(bool offset=true)
Definition: Context.cc:210
TEveScalableStraightLineSet * buildRhoZClusterLineSet(const reco::PFCluster &, const FWViewContext *, float caloTransAngle, float r, float z)
virtual void sharedBuild(const reco::PFCluster &cluster, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *vc, float radius)
double energy() const
cluster energy
Definition: PFCluster.h:73
Layer
layer definition
Definition: PFLayer.h:31
static float caloZ1(bool offset=true)
Definition: Context.cc:220
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:536
bool getPlotEt() const