CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FWPFClusterLegoProxyBuilder.cc
Go to the documentation of this file.
3 
4 //______________________________________________________________________________
6  TEveElement *parent,
7  FWViewType::EType viewType,
8  const FWViewContext *vc) {
9  // Line set marker is not the same colour as line, fixed here
10  if ((parent)->HasChildren()) {
11  for (TEveElement::List_i j = parent->BeginChildren(); j != parent->EndChildren(); j++) {
12  FWLegoCandidate *cluster = dynamic_cast<FWLegoCandidate *>(*j);
13  cluster->SetMarkerColor(FWProxyBuilderBase::item()->modelInfo(iId.index()).displayProperties().color());
14  cluster->ElementChanged();
15  }
16  }
17 }
18 
19 //______________________________________________________________________________
22  const FWViewContext *vc) {
23  for (TEveElement::List_i i = parent->BeginChildren(); i != parent->EndChildren(); ++i) {
24  if ((*i)->HasChildren()) {
25  TEveElement *el = (*i)->FirstChild(); // there is only one child added in this proxy builder
26  FWLegoCandidate *cluster = dynamic_cast<FWLegoCandidate *>(el);
27  cluster->updateScale(vc, context());
28  }
29  }
30 }
31 
32 //______________________________________________________________________________
34  TEveElement &oItemHolder,
35  const FWViewContext *vc) {
36  TEveVector centre = TEveVector(iData.x(), iData.y(), iData.z());
37  float energy = iData.energy();
38  float et = FWPFMaths::calculateEt(centre, energy);
39  float pt = et;
40  float eta = iData.eta();
41  float phi = iData.phi();
42 
43  context().voteMaxEtAndEnergy(et, energy);
44 
45  FWLegoCandidate *cluster = new FWLegoCandidate(vc, FWProxyBuilderBase::context(), energy, et, pt, eta, phi);
46  cluster->SetMarkerColor(FWProxyBuilderBase::item()->defaultDisplayProperties().color());
47  setupAddElement(cluster, &oItemHolder);
48 }
49 
50 //______________________________ECAL____________________________________________
52  unsigned int iIndex,
53  TEveElement &oItemHolder,
54  const FWViewContext *vc) {
55  PFLayer::Layer layer = iData.layer();
56  if (layer < 0)
57  sharedBuild(iData, oItemHolder, vc);
58 }
59 
60 //______________________________HCAL____________________________________________
62  unsigned int iIndex,
63  TEveElement &oItemHolder,
64  const FWViewContext *vc) {
65  PFLayer::Layer layer = iData.layer();
66  if (layer > 0)
67  sharedBuild(iData, oItemHolder, vc);
68 }
69 
70 //______________________________________________________________________________
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
Definition: PFCluster.cc:56
const fireworks::Context & context() const
void localModelChanges(const FWModelId &iId, TEveElement *el, FWViewType::EType viewType, const FWViewContext *vc) override
#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
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:178
const FWEventItem * item() const
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:181
void scaleProduct(TEveElementList *parent, FWViewType::EType, const FWViewContext *vc) override
int index() const
Definition: FWModelId.h:41
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:172
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
void sharedBuild(const reco::PFCluster &, TEveElement &, const FWViewContext *)
void updateScale(const FWViewContext *vc, const fireworks::Context &)
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:175
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:184