CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
l1t::ClusterShapes Class Reference

#include <ClusterShapes.h>

Public Member Functions

void Add (float e, float eta, float phi, float r=0.0)
 
 ClusterShapes ()
 
 ClusterShapes (float e, float eta, float phi, float r)
 
 ClusterShapes (const ClusterShapes &x)=default
 
float eD () const
 
float Eta () const
 
void Init (float e, float eta, float phi, float r=0.)
 
float LogEoverE () const
 
int N () const
 
ClusterShapes operator+ (const ClusterShapes &)
 
void operator+= (const ClusterShapes &)
 
ClusterShapesoperator= (const ClusterShapes &)=default
 
float Phi () const
 
float R () const
 
float SigmaEtaEta () const
 
float SigmaEtaPhi () const
 
float SigmaEtaR () const
 
float SigmaPhiPhi () const
 
float SigmaRPhi () const
 
float SigmaRR () const
 
 ~ClusterShapes ()
 

Private Attributes

float emax_ = 0.0
 
bool isPhi0_ = true
 
bool modified_ = false
 
int n_ =0.0
 
float sum_e2_ = 0.0
 
float sum_e_ = 0.0
 
float sum_eta2_ =0.0
 
float sum_eta_ = 0.0
 
float sum_eta_phi_0_ = 0.0
 
float sum_eta_phi_1_ = 0.0
 
float sum_eta_r_ =0.0
 
float sum_logE_ = 0.0
 
float sum_phi2_0_ =0.0
 
float sum_phi2_1_ =0.0
 
float sum_phi_0_ = 0.0
 
float sum_phi_1_ = 0.0
 
float sum_r2_ = 0.0
 
float sum_r_ = 0.0
 
float sum_r_phi_0_ = 0.0
 
float sum_r_phi_1_ = 0.0
 
float sum_w_ =0.0
 

Detailed Description

Definition at line 9 of file ClusterShapes.h.

Constructor & Destructor Documentation

l1t::ClusterShapes::ClusterShapes ( )
inline

Definition at line 42 of file ClusterShapes.h.

Referenced by Add(), and ~ClusterShapes().

42 {}
l1t::ClusterShapes::ClusterShapes ( float  e,
float  eta,
float  phi,
float  r 
)
inline

Definition at line 43 of file ClusterShapes.h.

References Init().

l1t::ClusterShapes::~ClusterShapes ( )
inline
l1t::ClusterShapes::ClusterShapes ( const ClusterShapes x)
default

Member Function Documentation

void l1t::ClusterShapes::Add ( float  e,
float  eta,
float  phi,
float  r = 0.0 
)
inline
float l1t::ClusterShapes::eD ( ) const
inline

Definition at line 67 of file ClusterShapes.h.

References operator+(), operator+=(), operator=(), mathSSE::sqrt(), and sum_e_.

67 { return std::sqrt(sum_e2_)/sum_e_;}
T sqrt(T t)
Definition: SSEVec.h:18
float ClusterShapes::Eta ( ) const

Definition at line 80 of file ClusterShapes.cc.

References sum_eta_, and sum_w_.

Referenced by Add(), SigmaEtaEta(), SigmaEtaPhi(), and SigmaEtaR().

void ClusterShapes::Init ( float  e,
float  eta,
float  phi,
float  r = 0. 
)

Definition at line 48 of file ClusterShapes.cc.

References MillePedeFileConverter_cfg::e, PVValHelper::eta, cmsBatch::log, M_PI, n_, alignCSCRings::r, sum_e2_, sum_e_, sum_eta2_, sum_eta_, sum_eta_phi_0_, sum_eta_phi_1_, sum_eta_r_, sum_logE_, sum_phi2_0_, sum_phi2_1_, sum_phi_0_, sum_phi_1_, sum_r2_, sum_r_, sum_r_phi_0_, sum_r_phi_1_, sum_w_, and w.

Referenced by ClusterShapes(), and ~ClusterShapes().

48  {
49  if (e<=0 ) return;
50  sum_e_ = e;
51  sum_e2_ = e*e;
52  sum_logE_ = std::log(e);
53 
54  float w = e;
55 
56  n_=1;
57 
58  sum_w_ = w;
59 
60  sum_phi_0_ = w *( phi );
61  sum_phi_1_ = w* (phi + M_PI);
62  sum_r_ = w * r;
63  sum_eta_ = w * eta;
64 
65  //--
66  sum_r2_ += w * (r*r);
67  sum_eta2_ += w * (eta*eta);
68  sum_phi2_0_ += w * (phi*phi);
69  sum_phi2_1_ += w * (phi+M_PI)*(phi+M_PI);
70 
71  // -- off diagonal
72  sum_eta_r_ += w * (r*eta);
73  sum_r_phi_0_ += w* (r *phi);
74  sum_r_phi_1_ += w* r *(phi + M_PI);
75  sum_eta_phi_0_ += w* (eta *phi);
76  sum_eta_phi_1_ += w* eta * (phi+M_PI);
77 
78 }
const double w
Definition: UKUtility.cc:23
#define M_PI
float l1t::ClusterShapes::LogEoverE ( ) const
inline

Definition at line 66 of file ClusterShapes.h.

References sum_e_.

int l1t::ClusterShapes::N ( ) const
inline

Definition at line 60 of file ClusterShapes.h.

References n_, SigmaEtaPhi(), SigmaEtaR(), and SigmaRPhi().

60 {return n_;}
ClusterShapes ClusterShapes::operator+ ( const ClusterShapes x)

Definition at line 6 of file ClusterShapes.cc.

References fwrapper::cs.

Referenced by eD().

7 {
8  ClusterShapes cs(*this); // copy constructor
9  cs += x;
10  return cs;
11 }
auto_ptr< ClusterSequence > cs
void ClusterShapes::operator+= ( const ClusterShapes x)

Definition at line 14 of file ClusterShapes.cc.

References emax_, n_, sum_e2_, sum_e_, sum_eta2_, sum_eta_, sum_eta_phi_0_, sum_eta_phi_1_, sum_eta_r_, sum_logE_, sum_phi2_0_, sum_phi2_1_, sum_phi_0_, sum_phi_1_, sum_r2_, sum_r_, sum_r_phi_0_, sum_r_phi_1_, and sum_w_.

Referenced by eD().

14  {
15 
16  sum_e_ += x.sum_e_;
17  sum_e2_ += x.sum_e2_;
18  sum_logE_ += x.sum_logE_;
19  n_ += x.n_;
20 
21  sum_w_ += x.sum_w_;
22 
23  emax_ = (emax_> x.emax_) ? emax_: x.emax_;
24 
25  // mid-point
26  sum_eta_ += x.sum_eta_;
27  sum_phi_0_ += x.sum_phi_0_; //
28  sum_phi_1_ += x.sum_phi_1_; //
29  sum_r_ += x.sum_r_;
30 
31  // square
32  sum_eta2_ += x.sum_eta2_;
35  sum_r2_ += x.sum_r2_;
36 
37  // off diagonal
38  sum_eta_r_ += x.sum_eta_r_ ;
43 
44 }
ClusterShapes& l1t::ClusterShapes::operator= ( const ClusterShapes )
default

Referenced by eD().

float ClusterShapes::Phi ( ) const

Definition at line 106 of file ClusterShapes.cc.

References isPhi0_, SigmaPhiPhi(), sum_phi_0_, sum_phi_1_, and sum_w_.

Referenced by Add().

106  {
107  SigmaPhiPhi(); //update phi
108  if (isPhi0_) return (sum_phi_0_ / sum_w_);
109  else return (sum_phi_1_ / sum_w_);
110 }
float SigmaPhiPhi() const
float ClusterShapes::R ( ) const

Definition at line 81 of file ClusterShapes.cc.

References sum_r_, and sum_w_.

Referenced by Add(), SigmaEtaR(), SigmaRPhi(), and SigmaRR().

81 { return sum_r_/sum_w_;}
float ClusterShapes::SigmaEtaEta ( ) const

Definition at line 83 of file ClusterShapes.cc.

References Eta(), sum_eta2_, and sum_w_.

Referenced by Add().

83 {return sum_eta2_/sum_w_ - Eta()*Eta();}
float Eta() const
float ClusterShapes::SigmaEtaPhi ( ) const

Definition at line 116 of file ClusterShapes.cc.

References Eta(), isPhi0_, SigmaPhiPhi(), sum_eta_phi_0_, sum_eta_phi_1_, sum_phi_0_, sum_phi_1_, and sum_w_.

Referenced by N().

116  {
117  SigmaPhiPhi() ; // decide which phi use, update phi
118 
119  if (isPhi0_)
120  return -(sum_eta_phi_0_ /sum_w_ - Eta()*(sum_phi_0_ / sum_w_));
121  else
122  return -(sum_eta_phi_1_ / sum_w_ - Eta()*(sum_phi_1_ / sum_w_));
123 }
float SigmaPhiPhi() const
float Eta() const
float ClusterShapes::SigmaEtaR ( ) const

Definition at line 114 of file ClusterShapes.cc.

References Eta(), R(), sum_eta_r_, and sum_w_.

Referenced by N().

114 { return -(sum_eta_r_ / sum_w_ - Eta() *R()) ;}
float Eta() const
float R() const
float ClusterShapes::SigmaPhiPhi ( ) const

Definition at line 88 of file ClusterShapes.cc.

References isPhi0_, sum_phi2_0_, sum_phi2_1_, sum_phi_0_, sum_phi_1_, and sum_w_.

Referenced by Add(), Phi(), SigmaEtaPhi(), and SigmaRPhi().

88  {
89  float phi_0 = (sum_phi_0_ / sum_w_);
90  float phi_1 = (sum_phi_1_ / sum_w_);
91  float spp_0 = sum_phi2_0_ / sum_w_ - phi_0*phi_0;
92  float spp_1 = sum_phi2_1_ / sum_w_ - phi_1*phi_1;
93 
94  if (spp_0 < spp_1 )
95  {
96  isPhi0_=true;
97  return spp_0;
98  }
99  else
100  {
101  isPhi0_=false;
102  return spp_1;
103  }
104 }
float ClusterShapes::SigmaRPhi ( ) const

Definition at line 125 of file ClusterShapes.cc.

References isPhi0_, R(), SigmaPhiPhi(), sum_phi_0_, sum_phi_1_, sum_r_phi_0_, sum_r_phi_1_, and sum_w_.

Referenced by N().

125  {
126  SigmaPhiPhi() ; // decide which phi use, update phi
127  if (isPhi0_)
128  return -(sum_r_phi_0_ / sum_w_ - R() *(sum_phi_0_ / sum_w_));
129  else
130  return -(sum_r_phi_1_ / sum_w_ - R() * (sum_phi_1_ / sum_w_));
131 }
float SigmaPhiPhi() const
float R() const
float ClusterShapes::SigmaRR ( ) const

Definition at line 85 of file ClusterShapes.cc.

References R(), sum_r2_, and sum_w_.

Referenced by Add().

85 { return sum_r2_/sum_w_ - R() *R();}
float R() const

Member Data Documentation

float l1t::ClusterShapes::emax_ = 0.0
private

Definition at line 16 of file ClusterShapes.h.

Referenced by operator+=().

bool l1t::ClusterShapes::isPhi0_ = true
mutableprivate

Definition at line 38 of file ClusterShapes.h.

Referenced by Phi(), SigmaEtaPhi(), SigmaPhiPhi(), and SigmaRPhi().

bool l1t::ClusterShapes::modified_ = false
mutableprivate

Definition at line 39 of file ClusterShapes.h.

int l1t::ClusterShapes::n_ =0.0
private

Definition at line 14 of file ClusterShapes.h.

Referenced by Init(), N(), and operator+=().

float l1t::ClusterShapes::sum_e2_ = 0.0
private

Definition at line 12 of file ClusterShapes.h.

Referenced by Init(), and operator+=().

float l1t::ClusterShapes::sum_e_ = 0.0
private

Definition at line 11 of file ClusterShapes.h.

Referenced by eD(), Init(), LogEoverE(), and operator+=().

float l1t::ClusterShapes::sum_eta2_ =0.0
private

Definition at line 25 of file ClusterShapes.h.

Referenced by Init(), operator+=(), and SigmaEtaEta().

float l1t::ClusterShapes::sum_eta_ = 0.0
private

Definition at line 19 of file ClusterShapes.h.

Referenced by Eta(), Init(), and operator+=().

float l1t::ClusterShapes::sum_eta_phi_0_ = 0.0
private

Definition at line 34 of file ClusterShapes.h.

Referenced by Init(), operator+=(), and SigmaEtaPhi().

float l1t::ClusterShapes::sum_eta_phi_1_ = 0.0
private

Definition at line 35 of file ClusterShapes.h.

Referenced by Init(), operator+=(), and SigmaEtaPhi().

float l1t::ClusterShapes::sum_eta_r_ =0.0
private

Definition at line 31 of file ClusterShapes.h.

Referenced by Init(), operator+=(), and SigmaEtaR().

float l1t::ClusterShapes::sum_logE_ = 0.0
private

Definition at line 13 of file ClusterShapes.h.

Referenced by Init(), and operator+=().

float l1t::ClusterShapes::sum_phi2_0_ =0.0
private

Definition at line 27 of file ClusterShapes.h.

Referenced by Init(), operator+=(), and SigmaPhiPhi().

float l1t::ClusterShapes::sum_phi2_1_ =0.0
private

Definition at line 28 of file ClusterShapes.h.

Referenced by Init(), operator+=(), and SigmaPhiPhi().

float l1t::ClusterShapes::sum_phi_0_ = 0.0
private

Definition at line 22 of file ClusterShapes.h.

Referenced by Init(), operator+=(), Phi(), SigmaEtaPhi(), SigmaPhiPhi(), and SigmaRPhi().

float l1t::ClusterShapes::sum_phi_1_ = 0.0
private

Definition at line 23 of file ClusterShapes.h.

Referenced by Init(), operator+=(), Phi(), SigmaEtaPhi(), SigmaPhiPhi(), and SigmaRPhi().

float l1t::ClusterShapes::sum_r2_ = 0.0
private

Definition at line 26 of file ClusterShapes.h.

Referenced by Init(), operator+=(), and SigmaRR().

float l1t::ClusterShapes::sum_r_ = 0.0
private

Definition at line 20 of file ClusterShapes.h.

Referenced by Init(), operator+=(), and R().

float l1t::ClusterShapes::sum_r_phi_0_ = 0.0
private

Definition at line 32 of file ClusterShapes.h.

Referenced by Init(), operator+=(), and SigmaRPhi().

float l1t::ClusterShapes::sum_r_phi_1_ = 0.0
private

Definition at line 33 of file ClusterShapes.h.

Referenced by Init(), operator+=(), and SigmaRPhi().

float l1t::ClusterShapes::sum_w_ =0.0
private