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 {
7 }
8 
9 //______________________________________________________________________________
11 {
12  delete m_clusterUtils;
13 }
14 
15 //______________________________________________________________________________
16 void
18 {
19  typedef std::vector<ScalableLines> Lines_t;
20  FWViewEnergyScale *caloScale = vc->getEnergyScale();
21 
22  for( Lines_t::iterator i = m_clusters.begin(); i != m_clusters.end(); ++i )
23  {
24  if( vc == (*i).m_vc )
25  {
26  float value = caloScale->getPlotEt() ? (*i).m_et : (*i).m_energy;
27  (*i).m_ls->SetScale( caloScale->getScaleFactor3D() * value );
28  TEveProjected *proj = *(*i).m_ls->BeginProjecteds();
29  proj->UpdateProjection();
30  }
31  }
32 }
33 
34 //______________________________________________________________________________
35 void
36 FWPFClusterRPZProxyBuilder::sharedBuild( const reco::PFCluster &iData, unsigned int iIndex,
37  TEveElement &oItemHolder, const FWViewContext *vc, float r )
38 {
39  /* Handles RhoPhi view */
40  TEveScalableStraightLineSet *ls;
41  TEveVector centre = TEveVector( iData.x(), iData.y(), iData.z() );
43  float energy, et;
44 
45  energy = iData.energy();
46  et = FWPFMaths::calculateEt( centre, energy );
47  context().voteMaxEtAndEnergy( et, energy );
48 
49  ls = m_clusterUtils->buildRhoPhiClusterLineSet( iData, vc, energy, et, r );
50  ls->SetLineColor( dp.color() );
51  m_clusters.push_back( ScalableLines( ls, et, energy, vc ) );
52  setupAddElement( ls, &oItemHolder );
53 }
54 
55 //______________________________________________________________________________
56 void
57 FWPFClusterRPZProxyBuilder::build( const reco::PFCluster &iData, unsigned int iIndex,
58  TEveElement &oItemHolder, const FWViewContext *vc )
59 {
60  /* Handles RhoZ view */
61  float energy, et;
62  float ecalR = context().caloR1();
63  float ecalZ = context().caloZ1();
65  TEveScalableStraightLineSet *ls;
66  TEveVector centre = TEveVector( iData.x(), iData.y(), iData.z() );
67 
68  energy = iData.energy();
69  et = FWPFMaths::calculateEt( centre, 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, FWPFGeom::caloR1() );
89  else
90  sharedBuild( iData, iIndex, oItemHolder, vc, FWPFGeom::caloR2() );
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, FWPFGeom::caloR1() );
101 }
102 
103 //______________________________________________________________________________
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
Definition: PFCluster.cc:85
const fireworks::Context & context() const
float getScaleFactor3D() const
int i
Definition: DBlmapReader.cc:9
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:451
static const TGPicture * info(bool iBackgroundIsBlack)
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:67
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
list parent
Definition: dbtoconf.py:74
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:47
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:184
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
FWViewEnergyScale * getEnergyScale() const
TEveScalableStraightLineSet * buildRhoPhiClusterLineSet(const reco::PFCluster &, const FWViewContext *, float r)
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:158
const FWEventItem * item() const
Color_t color() const
virtual void scaleProduct(TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
float caloR1()
Definition: FWPFGeom.h:21
std::vector< ScalableLines > m_clusters
static float caloR1(bool offset=true)
Definition: Context.cc:209
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 x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:152
float caloR2()
Definition: FWPFGeom.h:25
float calculateEt(const TEveVector &centre, float e)
Definition: FWPFMaths.cc:115
double energy() const
cluster energy
Definition: PFCluster.h:79
Layer
layer definition
Definition: PFLayer.h:31
static float caloZ1(bool offset=true)
Definition: Context.cc:219
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:155
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:535
bool getPlotEt() const