CMS 3D CMS Logo

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