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  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:128
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:163
const FWEventItem * item() const
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:166
Color_t color() const
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:157
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 *)
auto dp
Definition: deltaR.h:22
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:160
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:537
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:169