CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FWPFClusterRPZProxyBuilder.cc
Go to the documentation of this file.
2 
3 //______________________________________________________________________________
5 
6 //______________________________________________________________________________
8 
9 //______________________________________________________________________________
11  FWViewType::EType viewType,
12  const FWViewContext *vc) {
13  typedef std::vector<ScalableLines> Lines_t;
14  FWViewEnergyScale *caloScale = vc->getEnergyScale();
15 
16  for (Lines_t::iterator i = m_clusters.begin(); i != m_clusters.end(); ++i) {
17  if (vc == (*i).m_vc) {
18  float value = caloScale->getPlotEt() ? (*i).m_et : (*i).m_energy;
19  (*i).m_ls->SetScale(caloScale->getScaleFactor3D() * value);
20  TEveProjected *proj = *(*i).m_ls->BeginProjecteds();
21  proj->UpdateProjection();
22  }
23  }
24 }
25 
26 //______________________________________________________________________________
28  const reco::PFCluster &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *vc, float r) {
29  /* Handles RhoPhi view */
30  TEveScalableStraightLineSet *ls;
31  TEveVector centre = TEveVector(iData.x(), iData.y(), iData.z());
33  float energy, et;
34 
35  energy = iData.energy();
36  et = FWPFMaths::calculateEt(centre, energy);
37  context().voteMaxEtAndEnergy(et, energy);
38 
39  ls = m_clusterUtils->buildRhoPhiClusterLineSet(iData, vc, energy, et, r);
40  ls->SetLineColor(dp.color());
41  m_clusters.push_back(ScalableLines(ls, et, energy, vc));
42  setupAddElement(ls, &oItemHolder);
43 }
44 
45 //______________________________________________________________________________
47  unsigned int iIndex,
48  TEveElement &oItemHolder,
49  const FWViewContext *vc) {
50  /* Handles RhoZ view */
51  float energy, et;
52  float ecalR = context().caloR1();
53  float ecalZ = context().caloZ1();
55  TEveScalableStraightLineSet *ls;
56  TEveVector centre = TEveVector(iData.x(), iData.y(), iData.z());
57 
58  energy = iData.energy();
59  et = FWPFMaths::calculateEt(centre, energy);
60  context().voteMaxEtAndEnergy(et, energy);
61 
62  ls = m_clusterUtils->buildRhoZClusterLineSet(iData, vc, context().caloTransAngle(), energy, et, ecalR, ecalZ);
63  ls->SetLineColor(dp.color());
64 
65  m_clusters.push_back(ScalableLines(ls, et, energy, vc));
66  setupAddElement(ls, &oItemHolder);
67 }
68 
69 //______________________________________________________________________________
71  unsigned int iIndex,
72  TEveElement &oItemHolder,
73  const FWViewContext *vc) {
74  PFLayer::Layer layer = iData.layer();
75  const FWEventItem::ModelInfo &info = item()->modelInfo(iIndex);
76  if (info.displayProperties().isVisible()) {
77  if (layer < 0)
78  sharedBuild(iData, iIndex, oItemHolder, vc, FWPFGeom::caloR1());
79  else
80  sharedBuild(iData, iIndex, oItemHolder, vc, FWPFGeom::caloR2());
81  }
82 }
83 
84 //______________________________________________________________________________
86  unsigned int iIndex,
87  TEveElement &oItemHolder,
88  const FWViewContext *vc) {
89  const FWEventItem::ModelInfo &info = item()->modelInfo(iIndex);
90  if (info.displayProperties().isVisible())
91  sharedBuild(iData, iIndex, oItemHolder, vc, FWPFGeom::caloR1());
92 }
93 
94 //______________________________________________________________________________
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
Definition: PFCluster.cc:56
const fireworks::Context & context() const
float getScaleFactor3D() const
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
static const TGPicture * info(bool iBackgroundIsBlack)
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:64
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:42
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:162
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
FWViewEnergyScale * getEnergyScale() const
def ls
Definition: eostools.py:349
TEveScalableStraightLineSet * buildRhoPhiClusterLineSet(const reco::PFCluster &, const FWViewContext *, float r)
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:178
const FWEventItem * item() const
Color_t color() const
float caloR1()
Definition: FWPFGeom.h:20
std::vector< ScalableLines > m_clusters
static float caloR1(bool offset=true)
Definition: Context.cc:180
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:172
float caloR2()
Definition: FWPFGeom.h:26
float calculateEt(const TEveVector &centre, float e)
Definition: FWPFMaths.cc:115
double energy() const
cluster energy
Definition: PFCluster.h:74
Layer
layer definition
Definition: PFLayer.h:29
static float caloZ1(bool offset=true)
Definition: Context.cc:183
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:175
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:446
void scaleProduct(TEveElementList *parent, FWViewType::EType, const FWViewContext *vc) override
bool getPlotEt() const