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.
2 
3 //______________________________________________________________________________
4 float
6 {
7  float et = 0.f;
8  TEveVector vec;
9 
10  vec.fX = iData.x();
11  vec.fY = iData.y(); // Get the cluster centroid
12  vec.fZ = iData.z();
13 
14  vec.Normalize();
15  vec *= E;
16  et = vec.Perp(); // Get perpendicular vector
17 
18  return et;
19 }
20 
21 //______________________________________________________________________________
22 void
24 {
25  // Line set marker is not the same colour as line, fixed here
26  if( ( parent )->HasChildren() )
27  {
28  for( TEveElement::List_i j = parent->BeginChildren(); j != parent->EndChildren(); j++ )
29  {
30  FWPFLegoCandidate *cluster = dynamic_cast<FWPFLegoCandidate*>( *j );
31  const FWDisplayProperties &dp = FWProxyBuilderBase::item()->modelInfo( iId.index() ).displayProperties();
32  cluster->SetMarkerColor( dp.color() );
33  cluster->ElementChanged();
34  }
35  }
36 }
37 
38 //______________________________________________________________________________
39 void
41 {
42  for (TEveElement::List_i i = parent->BeginChildren(); i!= parent->EndChildren(); ++i)
43  {
44  if ((*i)->HasChildren())
45  {
46  TEveElement* el = (*i)->FirstChild(); // there is only one child added in this proxy builder
47  FWPFLegoCandidate *cluster = dynamic_cast<FWPFLegoCandidate*>( el );
48  cluster->updateScale(vc, context());
49  }
50  }
51 }
52 
53 //______________________________________________________________________________
54 void
55 FWPFClusterLegoProxyBuilder::sharedBuild( const reco::PFCluster &iData, TEveElement &oItemHolder, const FWViewContext *vc )
56 {
57  float energy = iData.energy();
58  float et = calculateEt( iData, energy );
59  float pt = et;
60  float eta = iData.eta();
61  float phi = iData.phi();
62 
63  context().voteMaxEtAndEnergy( et, energy );
64 
65  FWPFLegoCandidate *cluster = new FWPFLegoCandidate( vc, FWProxyBuilderBase::context(), energy, et, pt, eta, phi );
66  cluster->SetMarkerColor( FWProxyBuilderBase::item()->defaultDisplayProperties().color() );
67  setupAddElement( cluster, &oItemHolder );
68 }
69 
70 //______________________________ECAL____________________________________________
71 void
72 FWPFEcalClusterLegoProxyBuilder::build( const reco::PFCluster &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *vc )
73 {
74  PFLayer::Layer layer = iData.layer();
75  if( layer < 0 )
76  sharedBuild( iData, oItemHolder, vc );
77 }
78 
79 //______________________________HCAL____________________________________________
80 void
81 FWPFHcalClusterLegoProxyBuilder::build( const reco::PFCluster &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *vc )
82 {
83  PFLayer::Layer layer = iData.layer();
84  if( layer > 0 )
85  sharedBuild( iData, oItemHolder, vc );
86 }
87 
88 //______________________________________________________________________________
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
Definition: PFCluster.cc:81
type
Definition: HCALResponse.h:22
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:42
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:185
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:146
const FWEventItem * item() const
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:149
Color_t color() const
virtual void scaleProduct(TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
int index() const
Definition: FWModelId.h:50
int j
Definition: DBlmapReader.cc:9
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:140
void updateScale(const FWViewContext *vc, const fireworks::Context &)
double energy() const
cluster energy
Definition: PFCluster.h:73
Layer
layer definition
Definition: PFLayer.h:31
void sharedBuild(const reco::PFCluster &, TEveElement &, const FWViewContext *)
virtual void localModelChanges(const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
float calculateEt(const reco::PFCluster &cluster, float E)
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:143
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:536
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:152
Definition: DDAxes.h:10