CMS 3D CMS Logo

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);
38 
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);
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 //______________________________________________________________________________
static const TGPicture * info(bool iBackgroundIsBlack)
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:42
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
Definition: PFCluster.cc:56
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:172
TEveScalableStraightLineSet * buildRhoPhiClusterLineSet(const reco::PFCluster &, const FWViewContext *, float r)
const fireworks::Context & context() const
bool getPlotEt() const
FWViewEnergyScale * getEnergyScale() const
float caloR1()
Definition: FWPFGeom.h:20
std::vector< ScalableLines > m_clusters
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:403
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:169
double energy() const
cluster energy
Definition: PFCluster.h:74
static float caloR1(bool offset=true)
Definition: Context.cc:187
TEveScalableStraightLineSet * buildRhoZClusterLineSet(const reco::PFCluster &, const FWViewContext *, float caloTransAngle, float r, float z)
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:178
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:175
virtual void sharedBuild(const reco::PFCluster &cluster, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *vc, float radius)
float caloR2()
Definition: FWPFGeom.h:26
Definition: value.py:1
float calculateEt(const TEveVector &centre, float e)
Definition: FWPFMaths.cc:115
Layer
layer definition
Definition: PFLayer.h:29
float getScaleFactor3D() const
def ls(path, rec=False)
Definition: eostools.py:349
static float caloZ1(bool offset=true)
Definition: Context.cc:190
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:446
const FWEventItem * item() const
void scaleProduct(TEveElementList *parent, FWViewType::EType, const FWViewContext *vc) override