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

◆ ClusterShapes() [1/3]

l1t::ClusterShapes::ClusterShapes ( )
inline

Definition at line 42 of file ClusterShapes.h.

Referenced by Add().

42 {}

◆ ClusterShapes() [2/3]

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

◆ ~ClusterShapes()

l1t::ClusterShapes::~ClusterShapes ( )
inline

Definition at line 44 of file ClusterShapes.h.

44 {}

◆ ClusterShapes() [3/3]

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

Member Function Documentation

◆ Add()

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

◆ eD()

float l1t::ClusterShapes::eD ( ) const
inline

Definition at line 65 of file ClusterShapes.h.

References mathSSE::sqrt(), sum_e2_, and sum_e_.

65 { return std::sqrt(sum_e2_) / sum_e_; }
T sqrt(T t)
Definition: SSEVec.h:19

◆ Eta()

float ClusterShapes::Eta ( ) const

Definition at line 75 of file ClusterShapes.cc.

References sum_eta_, and sum_w_.

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

75 { return sum_eta_ / sum_w_; }

◆ Init()

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

Definition at line 43 of file ClusterShapes.cc.

References MillePedeFileConverter_cfg::e, PVValHelper::eta, dqm-mbProfile::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().

43  {
44  if (e <= 0)
45  return;
46  sum_e_ = e;
47  sum_e2_ = e * e;
48  sum_logE_ = std::log(e);
49 
50  float w = e;
51 
52  n_ = 1;
53 
54  sum_w_ = w;
55 
56  sum_phi_0_ = w * (phi);
57  sum_phi_1_ = w * (phi + M_PI);
58  sum_r_ = w * r;
59  sum_eta_ = w * eta;
60 
61  //--
62  sum_r2_ += w * (r * r);
63  sum_eta2_ += w * (eta * eta);
64  sum_phi2_0_ += w * (phi * phi);
65  sum_phi2_1_ += w * (phi + M_PI) * (phi + M_PI);
66 
67  // -- off diagonal
68  sum_eta_r_ += w * (r * eta);
69  sum_r_phi_0_ += w * (r * phi);
70  sum_r_phi_1_ += w * r * (phi + M_PI);
71  sum_eta_phi_0_ += w * (eta * phi);
72  sum_eta_phi_1_ += w * eta * (phi + M_PI);
73 }
T w() const
#define M_PI

◆ LogEoverE()

float l1t::ClusterShapes::LogEoverE ( ) const
inline

Definition at line 64 of file ClusterShapes.h.

References sum_e_, and sum_logE_.

64 { return sum_logE_ / sum_e_; }

◆ N()

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

Definition at line 58 of file ClusterShapes.h.

References n_.

58 { return n_; }

◆ operator+()

ClusterShapes ClusterShapes::operator+ ( const ClusterShapes x)

Definition at line 6 of file ClusterShapes.cc.

References callgraph::cs, and x.

6  {
7  ClusterShapes cs(*this); // copy constructor
8  cs += x;
9  return cs;
10 }

◆ operator+=()

void ClusterShapes::operator+= ( const ClusterShapes x)

Definition at line 12 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_, sum_w_, and x.

12  {
13  sum_e_ += x.sum_e_;
14  sum_e2_ += x.sum_e2_;
15  sum_logE_ += x.sum_logE_;
16  n_ += x.n_;
17 
18  sum_w_ += x.sum_w_;
19 
20  emax_ = (emax_ > x.emax_) ? emax_ : x.emax_;
21 
22  // mid-point
23  sum_eta_ += x.sum_eta_;
24  sum_phi_0_ += x.sum_phi_0_; //
25  sum_phi_1_ += x.sum_phi_1_; //
26  sum_r_ += x.sum_r_;
27 
28  // square
29  sum_eta2_ += x.sum_eta2_;
30  sum_phi2_0_ += x.sum_phi2_0_;
31  sum_phi2_1_ += x.sum_phi2_1_;
32  sum_r2_ += x.sum_r2_;
33 
34  // off diagonal
35  sum_eta_r_ += x.sum_eta_r_;
36  sum_r_phi_0_ += x.sum_r_phi_0_;
37  sum_r_phi_1_ += x.sum_r_phi_1_;
38  sum_eta_phi_0_ += x.sum_eta_phi_0_;
39  sum_eta_phi_1_ += x.sum_eta_phi_1_;
40 }

◆ operator=()

ClusterShapes& l1t::ClusterShapes::operator= ( const ClusterShapes )
default

◆ Phi()

float ClusterShapes::Phi ( ) const

Definition at line 97 of file ClusterShapes.cc.

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

97  {
98  SigmaPhiPhi(); //update phi
99  if (isPhi0_)
100  return (sum_phi_0_ / sum_w_);
101  else
102  return (sum_phi_1_ / sum_w_);
103 }
float SigmaPhiPhi() const

◆ R()

float ClusterShapes::R ( ) const

Definition at line 76 of file ClusterShapes.cc.

References sum_r_, and sum_w_.

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

76 { return sum_r_ / sum_w_; }

◆ SigmaEtaEta()

float ClusterShapes::SigmaEtaEta ( ) const

Definition at line 78 of file ClusterShapes.cc.

References Eta(), sum_eta2_, and sum_w_.

78 { return sum_eta2_ / sum_w_ - Eta() * Eta(); }
float Eta() const

◆ SigmaEtaPhi()

float ClusterShapes::SigmaEtaPhi ( ) const

Definition at line 108 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_.

108  {
109  SigmaPhiPhi(); // decide which phi use, update phi
110 
111  if (isPhi0_)
112  return -(sum_eta_phi_0_ / sum_w_ - Eta() * (sum_phi_0_ / sum_w_));
113  else
114  return -(sum_eta_phi_1_ / sum_w_ - Eta() * (sum_phi_1_ / sum_w_));
115 }
float SigmaPhiPhi() const
float Eta() const

◆ SigmaEtaR()

float ClusterShapes::SigmaEtaR ( ) const

Definition at line 106 of file ClusterShapes.cc.

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

106 { return -(sum_eta_r_ / sum_w_ - Eta() * R()); }
float R() const
float Eta() const

◆ SigmaPhiPhi()

float ClusterShapes::SigmaPhiPhi ( ) const

Definition at line 82 of file ClusterShapes.cc.

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

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

82  {
83  float phi_0 = (sum_phi_0_ / sum_w_);
84  float phi_1 = (sum_phi_1_ / sum_w_);
85  float spp_0 = sum_phi2_0_ / sum_w_ - phi_0 * phi_0;
86  float spp_1 = sum_phi2_1_ / sum_w_ - phi_1 * phi_1;
87 
88  if (spp_0 < spp_1) {
89  isPhi0_ = true;
90  return spp_0;
91  } else {
92  isPhi0_ = false;
93  return spp_1;
94  }
95 }

◆ SigmaRPhi()

float ClusterShapes::SigmaRPhi ( ) const

Definition at line 117 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_.

117  {
118  SigmaPhiPhi(); // decide which phi use, update phi
119  if (isPhi0_)
120  return -(sum_r_phi_0_ / sum_w_ - R() * (sum_phi_0_ / sum_w_));
121  else
122  return -(sum_r_phi_1_ / sum_w_ - R() * (sum_phi_1_ / sum_w_));
123 }
float R() const
float SigmaPhiPhi() const

◆ SigmaRR()

float ClusterShapes::SigmaRR ( ) const

Definition at line 80 of file ClusterShapes.cc.

References R(), sum_r2_, and sum_w_.

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

Member Data Documentation

◆ emax_

float l1t::ClusterShapes::emax_ = 0.0
private

Definition at line 16 of file ClusterShapes.h.

Referenced by operator+=().

◆ isPhi0_

bool l1t::ClusterShapes::isPhi0_ = true
mutableprivate

Definition at line 38 of file ClusterShapes.h.

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

◆ modified_

bool l1t::ClusterShapes::modified_ = false
mutableprivate

Definition at line 39 of file ClusterShapes.h.

◆ n_

int l1t::ClusterShapes::n_ = 0.0
private

Definition at line 14 of file ClusterShapes.h.

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

◆ sum_e2_

float l1t::ClusterShapes::sum_e2_ = 0.0
private

Definition at line 12 of file ClusterShapes.h.

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

◆ sum_e_

float l1t::ClusterShapes::sum_e_ = 0.0
private

Definition at line 11 of file ClusterShapes.h.

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

◆ sum_eta2_

float l1t::ClusterShapes::sum_eta2_ = 0.0
private

Definition at line 25 of file ClusterShapes.h.

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

◆ sum_eta_

float l1t::ClusterShapes::sum_eta_ = 0.0
private

Definition at line 19 of file ClusterShapes.h.

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

◆ sum_eta_phi_0_

float l1t::ClusterShapes::sum_eta_phi_0_ = 0.0
private

Definition at line 34 of file ClusterShapes.h.

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

◆ sum_eta_phi_1_

float l1t::ClusterShapes::sum_eta_phi_1_ = 0.0
private

Definition at line 35 of file ClusterShapes.h.

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

◆ sum_eta_r_

float l1t::ClusterShapes::sum_eta_r_ = 0.0
private

Definition at line 31 of file ClusterShapes.h.

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

◆ sum_logE_

float l1t::ClusterShapes::sum_logE_ = 0.0
private

Definition at line 13 of file ClusterShapes.h.

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

◆ sum_phi2_0_

float l1t::ClusterShapes::sum_phi2_0_ = 0.0
private

Definition at line 27 of file ClusterShapes.h.

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

◆ sum_phi2_1_

float l1t::ClusterShapes::sum_phi2_1_ = 0.0
private

Definition at line 28 of file ClusterShapes.h.

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

◆ sum_phi_0_

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().

◆ sum_phi_1_

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().

◆ sum_r2_

float l1t::ClusterShapes::sum_r2_ = 0.0
private

Definition at line 26 of file ClusterShapes.h.

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

◆ sum_r_

float l1t::ClusterShapes::sum_r_ = 0.0
private

Definition at line 20 of file ClusterShapes.h.

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

◆ sum_r_phi_0_

float l1t::ClusterShapes::sum_r_phi_0_ = 0.0
private

Definition at line 32 of file ClusterShapes.h.

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

◆ sum_r_phi_1_

float l1t::ClusterShapes::sum_r_phi_1_ = 0.0
private

Definition at line 33 of file ClusterShapes.h.

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

◆ sum_w_

float l1t::ClusterShapes::sum_w_ = 0.0
private