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 (const ClusterShapes &x)=default
 
 ClusterShapes (float e, float eta, float phi, float r)
 
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.

42 {}

Referenced by Add().

◆ ClusterShapes() [2/3]

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

Definition at line 43 of file ClusterShapes.h.

43 { Init(e, eta, phi, r); }

References MillePedeFileConverter_cfg::e, PVValHelper::eta, Init(), and alignCSCRings::r.

◆ ~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

Definition at line 48 of file ClusterShapes.h.

48 { (*this) += ClusterShapes(e, eta, phi, r); }

References ClusterShapes(), MillePedeFileConverter_cfg::e, PVValHelper::eta, and alignCSCRings::r.

◆ eD()

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

Definition at line 65 of file ClusterShapes.h.

65 { return std::sqrt(sum_e2_) / sum_e_; }

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

◆ Eta()

float ClusterShapes::Eta ( ) const

Definition at line 75 of file ClusterShapes.cc.

75 { return sum_eta_ / sum_w_; }

References sum_eta_, and sum_w_.

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

◆ Init()

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

Definition at line 43 of file ClusterShapes.cc.

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 }

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

◆ LogEoverE()

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

Definition at line 64 of file ClusterShapes.h.

64 { return sum_logE_ / sum_e_; }

References sum_e_, and sum_logE_.

◆ N()

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

Definition at line 58 of file ClusterShapes.h.

58 { return n_; }

References n_.

◆ operator+()

ClusterShapes ClusterShapes::operator+ ( const ClusterShapes x)

Definition at line 6 of file ClusterShapes.cc.

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

References fwrapper::cs.

◆ operator+=()

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

Definition at line 12 of file ClusterShapes.cc.

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 }

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_.

◆ operator=()

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

◆ Phi()

float ClusterShapes::Phi ( ) const

Definition at line 97 of file ClusterShapes.cc.

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 }

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

◆ R()

float ClusterShapes::R ( ) const

Definition at line 76 of file ClusterShapes.cc.

76 { return sum_r_ / sum_w_; }

References sum_r_, and sum_w_.

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

◆ SigmaEtaEta()

float ClusterShapes::SigmaEtaEta ( ) const

Definition at line 78 of file ClusterShapes.cc.

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

References Eta(), sum_eta2_, and sum_w_.

◆ SigmaEtaPhi()

float ClusterShapes::SigmaEtaPhi ( ) const

Definition at line 108 of file ClusterShapes.cc.

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 }

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

◆ SigmaEtaR()

float ClusterShapes::SigmaEtaR ( ) const

Definition at line 106 of file ClusterShapes.cc.

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

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

◆ SigmaPhiPhi()

float ClusterShapes::SigmaPhiPhi ( ) const

Definition at line 82 of file ClusterShapes.cc.

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 }

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

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

◆ SigmaRPhi()

float ClusterShapes::SigmaRPhi ( ) const

Definition at line 117 of file ClusterShapes.cc.

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 }

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

◆ SigmaRR()

float ClusterShapes::SigmaRR ( ) const

Definition at line 80 of file ClusterShapes.cc.

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

References R(), sum_r2_, and sum_w_.

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
l1t::ClusterShapes::R
float R() const
Definition: ClusterShapes.cc:76
l1t::ClusterShapes::sum_eta_phi_0_
float sum_eta_phi_0_
Definition: ClusterShapes.h:34
l1t::ClusterShapes::n_
int n_
Definition: ClusterShapes.h:14
l1t::ClusterShapes::Eta
float Eta() const
Definition: ClusterShapes.cc:75
l1t::ClusterShapes::sum_r_phi_1_
float sum_r_phi_1_
Definition: ClusterShapes.h:33
l1t::ClusterShapes::sum_e2_
float sum_e2_
Definition: ClusterShapes.h:12
fwrapper::cs
unique_ptr< ClusterSequence > cs
Definition: fastjetfortran_madfks.cc:45
l1t::ClusterShapes::SigmaPhiPhi
float SigmaPhiPhi() const
Definition: ClusterShapes.cc:82
l1t::ClusterShapes::isPhi0_
bool isPhi0_
Definition: ClusterShapes.h:38
l1t::ClusterShapes::sum_eta2_
float sum_eta2_
Definition: ClusterShapes.h:25
DDAxes::x
l1t::ClusterShapes::sum_phi2_1_
float sum_phi2_1_
Definition: ClusterShapes.h:28
PVValHelper::eta
Definition: PVValidationHelpers.h:69
w
const double w
Definition: UKUtility.cc:23
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
l1t::ClusterShapes::sum_eta_phi_1_
float sum_eta_phi_1_
Definition: ClusterShapes.h:35
l1t::ClusterShapes::Init
void Init(float e, float eta, float phi, float r=0.)
Definition: ClusterShapes.cc:43
l1t::ClusterShapes::sum_phi2_0_
float sum_phi2_0_
Definition: ClusterShapes.h:27
l1t::ClusterShapes::ClusterShapes
ClusterShapes()
Definition: ClusterShapes.h:42
l1t::ClusterShapes::sum_r_phi_0_
float sum_r_phi_0_
Definition: ClusterShapes.h:32
l1t::ClusterShapes::sum_e_
float sum_e_
Definition: ClusterShapes.h:11
l1t::ClusterShapes::sum_eta_
float sum_eta_
Definition: ClusterShapes.h:19
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
l1t::ClusterShapes::sum_logE_
float sum_logE_
Definition: ClusterShapes.h:13
l1t::ClusterShapes::sum_eta_r_
float sum_eta_r_
Definition: ClusterShapes.h:31
l1t::ClusterShapes::sum_r2_
float sum_r2_
Definition: ClusterShapes.h:26
l1t::ClusterShapes::sum_phi_0_
float sum_phi_0_
Definition: ClusterShapes.h:22
alignCSCRings.r
r
Definition: alignCSCRings.py:93
l1t::ClusterShapes::sum_phi_1_
float sum_phi_1_
Definition: ClusterShapes.h:23
DDAxes::phi
l1t::ClusterShapes::sum_r_
float sum_r_
Definition: ClusterShapes.h:20
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
l1t::ClusterShapes::emax_
float emax_
Definition: ClusterShapes.h:16
l1t::ClusterShapes
Definition: ClusterShapes.h:9
l1t::ClusterShapes::sum_w_
float sum_w_
Definition: ClusterShapes.h:18
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37