CMS 3D CMS Logo

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  cluster->SetMarkerColor( FWProxyBuilderBase::item()->modelInfo( iId.index() ).displayProperties().color() );
15  cluster->ElementChanged();
16  }
17  }
18 }
19 
20 //______________________________________________________________________________
21 void
23 {
24  for (TEveElement::List_i i = parent->BeginChildren(); i!= parent->EndChildren(); ++i)
25  {
26  if ((*i)->HasChildren())
27  {
28  TEveElement* el = (*i)->FirstChild(); // there is only one child added in this proxy builder
29  FWLegoCandidate *cluster = dynamic_cast<FWLegoCandidate*>( el );
30  cluster->updateScale(vc, context());
31  }
32  }
33 }
34 
35 //______________________________________________________________________________
36 void
37 FWPFClusterLegoProxyBuilder::sharedBuild( const reco::PFCluster &iData, TEveElement &oItemHolder, const FWViewContext *vc )
38 {
39  TEveVector centre = TEveVector( iData.x(), iData.y(), iData.z() );
40  float energy = iData.energy();
41  float et = FWPFMaths::calculateEt( centre, energy );
42  float pt = et;
43  float eta = iData.eta();
44  float phi = iData.phi();
45 
46  context().voteMaxEtAndEnergy( et, energy );
47 
48  FWLegoCandidate *cluster = new FWLegoCandidate( vc, FWProxyBuilderBase::context(), energy, et, pt, eta, phi );
49  cluster->SetMarkerColor( FWProxyBuilderBase::item()->defaultDisplayProperties().color() );
50  setupAddElement( cluster, &oItemHolder );
51 }
52 
53 //______________________________ECAL____________________________________________
54 void
55 FWPFEcalClusterLegoProxyBuilder::build( const reco::PFCluster &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *vc )
56 {
57  PFLayer::Layer layer = iData.layer();
58  if( layer < 0 )
59  sharedBuild( iData, oItemHolder, vc );
60 }
61 
62 //______________________________HCAL____________________________________________
63 void
64 FWPFHcalClusterLegoProxyBuilder::build( const reco::PFCluster &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *vc )
65 {
66  PFLayer::Layer layer = iData.layer();
67  if( layer > 0 )
68  sharedBuild( iData, oItemHolder, vc );
69 }
70 
71 //______________________________________________________________________________
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
Definition: PFCluster.cc:120
type
Definition: HCALResponse.h:21
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:47
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:183
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:165
const FWEventItem * item() const
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:168
void scaleProduct(TEveElementList *parent, FWViewType::EType, const FWViewContext *vc) override
int index() const
Definition: FWModelId.h:49
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:159
float calculateEt(const TEveVector &centre, float e)
Definition: FWPFMaths.cc:115
double energy() const
cluster energy
Definition: PFCluster.h:82
Layer
layer definition
Definition: PFLayer.h:31
void sharedBuild(const reco::PFCluster &, TEveElement &, const FWViewContext *)
void updateScale(const FWViewContext *vc, const fireworks::Context &)
et
define resolution functions of each parameter
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:162
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:171