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 float
6 {
7  float et = 0.f;
8  TEveVector vec;
9 
10  vec.fX = cluster.x();
11  vec.fY = cluster.y();
12  vec.fZ = cluster.z();
13 
14  vec.Normalize();
15  vec *= e;
16  et = vec.Perp();
17 
18  return et;
19 }
20 
21 //______________________________________________________________________________
22 TEveScalableStraightLineSet *
24 {
25  float energy, et;
26 
27  energy = cluster.energy();
28  et = calculateEt( cluster, energy );
29 
30  return buildRhoPhiClusterLineSet( cluster, vc, energy, et, r );
31 }
32 
33 //______________________________________________________________________________
34 TEveScalableStraightLineSet *
36  float e, float et, float r )
37 {
38  TEveScalableStraightLineSet *ls = new TEveScalableStraightLineSet( "rhophiCluster" );
39  TEveVector vec;
40  float size = 1.f; // Stored in scale
41  double phi;
42 
43  vec = TEveVector( cluster.x(), cluster.y(), cluster.z() );
44  phi = vec.Phi();
45 
46  FWViewEnergyScale *energyScale = vc->getEnergyScale();
47  ls->SetLineWidth( 4 );
48 
49  ls->SetScaleCenter( r * cos( phi ), r * sin( phi ), 0 );
50  ls->AddLine( r * cos( phi ), r * sin( phi ), 0, ( r + size ) * cos( phi ), ( r + size ) * sin( phi ), 0 );
51  ls->SetScale( energyScale->getScaleFactor3D() * ( energyScale->getPlotEt() ? et : e ) );
52 
53  return ls;
54 }
55 
56 //______________________________________________________________________________
57 TEveScalableStraightLineSet *
59  float caloTransAngle, float r, float z )
60 {
61  float energy, et;
62 
63  energy = cluster.energy();
64  et = calculateEt( cluster, energy );
65 
66  return buildRhoZClusterLineSet( cluster, vc, caloTransAngle, energy, et, r, z );
67 }
68 
69 //______________________________________________________________________________
70 TEveScalableStraightLineSet *
72  float caloTransAngle, float e, float et, float r, float z )
73 {
74  float size = 1.f; // Stored in scale
75  float offr = 4;
76  float ecalZ = z + offr / tan( caloTransAngle );
77  double theta, phi;
78  double rad(0);
79  TEveVector vec;
80  TEveScalableStraightLineSet *ls = new TEveScalableStraightLineSet( "rhoZCluster" );
81 
82  vec = TEveVector( cluster.x(), cluster.y(), cluster.z() );
83  phi = vec.Phi();
84  theta = vec.Theta();
85 
86  FWViewEnergyScale *caloScale = vc->getEnergyScale();
87  ls->SetLineWidth( 4 );
88 
89  if ( theta < caloTransAngle || TMath::Pi() - theta < caloTransAngle )
90  rad = ecalZ / fabs( cos( theta ) );
91  else
92  rad = r / sin( theta );
93 
94  ls->SetScaleCenter( 0., ( phi > 0 ? rad * fabs( sin( theta ) ) : -rad * fabs( sin( theta ) ) ), rad * cos( theta ) );
95  ls->AddLine( 0., ( phi > 0 ? rad * fabs( sin( theta ) ) : -rad * fabs( sin( theta ) ) ), rad * cos( theta ),
96  0., ( phi > 0 ? ( rad + size ) * fabs( sin ( theta ) ) : -( rad + size ) * fabs( sin( theta) ) ),
97  ( rad + size ) * cos( theta ) );
98  ls->SetScale( caloScale->getScaleFactor3D() * ( caloScale->getPlotEt() ? et : e ) );
99 
100  return ls;
101 }
102 
const double Pi
float getScaleFactor3D() const
float calculateEt(const reco::PFCluster &, float e)
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:42
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:146
Definition: DDAxes.h:10
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:140
double energy() const
cluster energy
Definition: PFCluster.h:73
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:143
tuple size
Write out results.
bool getPlotEt() const
Definition: DDAxes.h:10