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 65 of file ClusterShapes.h.

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

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

Definition at line 75 of file ClusterShapes.cc.

References sum_eta_, and sum_w_.

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

75 { return sum_eta_ / sum_w_; }
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, 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().

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 }
const double w
Definition: UKUtility.cc:23
#define M_PI
float l1t::ClusterShapes::LogEoverE ( ) const
inline

Definition at line 64 of file ClusterShapes.h.

References sum_e_.

64 { return sum_logE_ / sum_e_; }
int l1t::ClusterShapes::N ( ) const
inline

Definition at line 58 of file ClusterShapes.h.

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

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

Definition at line 6 of file ClusterShapes.cc.

References fwrapper::cs.

Referenced by eD().

6  {
7  ClusterShapes cs(*this); // copy constructor
8  cs += x;
9  return cs;
10 }
unique_ptr< ClusterSequence > cs
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_, and sum_w_.

Referenced by eD().

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_;
32  sum_r2_ += x.sum_r2_;
33 
34  // off diagonal
40 }
ClusterShapes& l1t::ClusterShapes::operator= ( const ClusterShapes )
default

Referenced by eD().

float ClusterShapes::Phi ( ) const

Definition at line 97 of file ClusterShapes.cc.

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

Referenced by Add().

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
float ClusterShapes::R ( ) const

Definition at line 76 of file ClusterShapes.cc.

References sum_r_, and sum_w_.

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

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

Definition at line 78 of file ClusterShapes.cc.

References Eta(), sum_eta2_, and sum_w_.

Referenced by Add().

78 { return sum_eta2_ / sum_w_ - Eta() * Eta(); }
float Eta() const
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_.

Referenced by N().

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
float ClusterShapes::SigmaEtaR ( ) const

Definition at line 106 of file ClusterShapes.cc.

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

Referenced by N().

106 { return -(sum_eta_r_ / sum_w_ - Eta() * R()); }
float Eta() const
float R() const
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 Add(), 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 }
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_.

Referenced by N().

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 SigmaPhiPhi() const
float R() const
float ClusterShapes::SigmaRR ( ) const

Definition at line 80 of file ClusterShapes.cc.

References R(), sum_r2_, and sum_w_.

Referenced by Add().

80 { 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