CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWPFClusterRPZUtils.cc
Go to the documentation of this file.
2 
3 //______________________________________________________________________________
4 TEveScalableStraightLineSet *
6 {
7  float energy, et;
8  TEveVector centre = TEveVector( cluster.x(), cluster.y(), cluster.z() );
9 
10  energy = cluster.energy();
11  et = FWPFMaths::calculateEt( centre, energy );
12 
13  return buildRhoPhiClusterLineSet( cluster, vc, energy, et, r );
14 }
15 
16 //______________________________________________________________________________
17 TEveScalableStraightLineSet *
19  float e, float et, float r )
20 {
21  TEveScalableStraightLineSet *ls = new TEveScalableStraightLineSet( "rhophiCluster" );
22  TEveVector vec;
23  float size = 1.f; // Stored in scale
24  double phi;
25 
26  vec = TEveVector( cluster.x(), cluster.y(), cluster.z() );
27  phi = vec.Phi();
28 
29  FWViewEnergyScale *energyScale = vc->getEnergyScale();
30  ls->SetLineWidth( 4 );
31 
32  ls->SetScaleCenter( r * cos( phi ), r * sin( phi ), 0 );
33  ls->AddLine( r * cos( phi ), r * sin( phi ), 0, ( r + size ) * cos( phi ), ( r + size ) * sin( phi ), 0 );
34  ls->SetScale( energyScale->getScaleFactor3D() * ( energyScale->getPlotEt() ? et : e ) );
35 
36  return ls;
37 }
38 
39 //______________________________________________________________________________
40 TEveScalableStraightLineSet *
42  float caloTransAngle, float r, float z )
43 {
44  float energy, et;
45  TEveVector centre = TEveVector( cluster.x(), cluster.y(), cluster.z() );
46 
47  energy = cluster.energy();
48  et = FWPFMaths::calculateEt( centre, energy );
49 
50  return buildRhoZClusterLineSet( cluster, vc, caloTransAngle, energy, et, r, z );
51 }
52 
53 //______________________________________________________________________________
54 TEveScalableStraightLineSet *
56  float caloTransAngle, float e, float et, float r, float z )
57 {
58  float size = 1.f; // Stored in scale
59  float offr = 4;
60  float ecalZ = z + offr / tan( caloTransAngle );
61  double theta, phi;
62  double rad(0);
63  TEveVector vec;
64  TEveScalableStraightLineSet *ls = new TEveScalableStraightLineSet( "rhoZCluster" );
65 
66  vec = TEveVector( cluster.x(), cluster.y(), cluster.z() );
67  phi = vec.Phi();
68  theta = vec.Theta();
69 
70  FWViewEnergyScale *caloScale = vc->getEnergyScale();
71  ls->SetLineWidth( 4 );
72 
73  if ( theta < caloTransAngle || TMath::Pi() - theta < caloTransAngle )
74  rad = ecalZ / fabs( cos( theta ) );
75  else
76  rad = r / sin( theta );
77 
78  ls->SetScaleCenter( 0., ( phi > 0 ? rad * fabs( sin( theta ) ) : -rad * fabs( sin( theta ) ) ), rad * cos( theta ) );
79  ls->AddLine( 0., ( phi > 0 ? rad * fabs( sin( theta ) ) : -rad * fabs( sin( theta ) ) ), rad * cos( theta ),
80  0., ( phi > 0 ? ( rad + size ) * fabs( sin ( theta ) ) : -( rad + size ) * fabs( sin( theta) ) ),
81  ( rad + size ) * cos( theta ) );
82  ls->SetScale( caloScale->getScaleFactor3D() * ( caloScale->getPlotEt() ? et : e ) );
83 
84  return ls;
85 }
86 
const double Pi
float getScaleFactor3D() const
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:47
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
FWViewEnergyScale * getEnergyScale() const
Geom::Theta< T > theta() const
TEveScalableStraightLineSet * buildRhoPhiClusterLineSet(const reco::PFCluster &, const FWViewContext *, float r)
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:160
float float float z
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
TEveScalableStraightLineSet * buildRhoZClusterLineSet(const reco::PFCluster &, const FWViewContext *, float caloTransAngle, float r, float z)
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:154
float calculateEt(const TEveVector &centre, float e)
Definition: FWPFMaths.cc:115
double energy() const
cluster energy
Definition: PFCluster.h:79
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:157
tuple size
Write out results.
bool getPlotEt() const
Definition: DDAxes.h:10