CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
l1thgcfirmware::HGCalMulticluster Class Reference

#include <HGCalMulticluster_SA.h>

Public Member Functions

void addConstituent (const l1thgcfirmware::HGCalCluster &tc, bool updateCentre=true, float fraction=1.)
 
const std::vector< l1thgcfirmware::HGCalCluster > & constituents () const
 
 HGCalMulticluster ()
 
 HGCalMulticluster (const l1thgcfirmware::HGCalCluster &tc, float fraction=1.)
 
unsigned size () const
 
float sumPt () const
 
 ~HGCalMulticluster ()=default
 

Private Member Functions

void updateP4AndPosition (const l1thgcfirmware::HGCalCluster &tc, bool updateCentre=true, float fraction=1.)
 

Private Attributes

float centre_x_
 
float centre_y_
 
float centre_z_
 
float centreProj_x_
 
float centreProj_y_
 
float centreProj_z_
 
std::vector< l1thgcfirmware::HGCalClusterconstituents_
 
float mipPt_
 
float sumPt_
 

Detailed Description

Definition at line 10 of file HGCalMulticluster_SA.h.

Constructor & Destructor Documentation

◆ HGCalMulticluster() [1/2]

l1thgcfirmware::HGCalMulticluster::HGCalMulticluster ( )
inline

◆ HGCalMulticluster() [2/2]

HGCalMulticluster::HGCalMulticluster ( const l1thgcfirmware::HGCalCluster tc,
float  fraction = 1. 
)

Definition at line 7 of file HGCalMulticluster_SA.cc.

References addConstituent(), HLT_2022v14_cff::fraction, and HGCalMulticluster().

7  {
9  addConstituent(tc, true, fraction);
10 }
void addConstituent(const l1thgcfirmware::HGCalCluster &tc, bool updateCentre=true, float fraction=1.)

◆ ~HGCalMulticluster()

l1thgcfirmware::HGCalMulticluster::~HGCalMulticluster ( )
default

Member Function Documentation

◆ addConstituent()

void HGCalMulticluster::addConstituent ( const l1thgcfirmware::HGCalCluster tc,
bool  updateCentre = true,
float  fraction = 1. 
)

Definition at line 12 of file HGCalMulticluster_SA.cc.

References centre_x_, centre_y_, centre_z_, constituents_, HLT_2022v14_cff::fraction, updateP4AndPosition(), l1thgcfirmware::HGCalCluster::x(), l1thgcfirmware::HGCalCluster::y(), and l1thgcfirmware::HGCalCluster::z().

Referenced by HGCalMulticluster().

12  {
13  // If no constituents, set seedMiptPt to cluster mipPt
14  if (constituents_.empty()) {
15  // seedMipPt_ = cMipPt;
16  if (!updateCentre) {
17  centre_x_ = tc.x();
18  centre_y_ = tc.y();
19  centre_z_ = tc.z();
20  }
21  }
22  // UpdateP4AndPosition
23  updateP4AndPosition(tc, updateCentre, fraction);
24 
25  constituents_.emplace_back(tc);
26 }
void updateP4AndPosition(const l1thgcfirmware::HGCalCluster &tc, bool updateCentre=true, float fraction=1.)
std::vector< l1thgcfirmware::HGCalCluster > constituents_

◆ constituents()

const std::vector<l1thgcfirmware::HGCalCluster>& l1thgcfirmware::HGCalMulticluster::constituents ( ) const
inline

Definition at line 28 of file HGCalMulticluster_SA.h.

References constituents_.

28 { return constituents_; }
std::vector< l1thgcfirmware::HGCalCluster > constituents_

◆ size()

unsigned l1thgcfirmware::HGCalMulticluster::size ( void  ) const
inline

Definition at line 30 of file HGCalMulticluster_SA.h.

References constituents_.

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

30 { return constituents_.size(); }
std::vector< l1thgcfirmware::HGCalCluster > constituents_

◆ sumPt()

float l1thgcfirmware::HGCalMulticluster::sumPt ( ) const
inline

◆ updateP4AndPosition()

void HGCalMulticluster::updateP4AndPosition ( const l1thgcfirmware::HGCalCluster tc,
bool  updateCentre = true,
float  fraction = 1. 
)
private

Definition at line 28 of file HGCalMulticluster_SA.cc.

References funct::abs(), centre_x_, centre_y_, centre_z_, centreProj_x_, centreProj_y_, centreProj_z_, HLT_2022v14_cff::fraction, l1thgcfirmware::HGCalCluster::mipPt(), mipPt_, l1thgcfirmware::HGCalCluster::pt(), sumPt_, l1thgcfirmware::HGCalCluster::x(), l1thgcfirmware::HGCalCluster::y(), and l1thgcfirmware::HGCalCluster::z().

Referenced by addConstituent().

28  {
29  // Get cluster mipPt
30  double cMipt = tc.mipPt() * fraction;
31  double cPt = tc.pt() * fraction;
32  if (updateCentre) {
33  float clusterCentre_x = centre_x_ * mipPt_ + tc.x() * cMipt;
34  float clusterCentre_y = centre_y_ * mipPt_ + tc.y() * cMipt;
35  float clusterCentre_z = centre_z_ * mipPt_ + tc.z() * cMipt; // Check this!
36 
37  if ((mipPt_ + cMipt) > 0) {
38  clusterCentre_x /= (mipPt_ + cMipt);
39  clusterCentre_y /= (mipPt_ + cMipt);
40  clusterCentre_z /= (mipPt_ + cMipt);
41  }
42  centre_x_ = clusterCentre_x;
43  centre_y_ = clusterCentre_y;
44  centre_z_ = clusterCentre_z;
45 
46  if (centre_z_ != 0) {
50  }
51  }
52 
53  mipPt_ += cMipt;
54  sumPt_ += cPt;
55 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

◆ centre_x_

float l1thgcfirmware::HGCalMulticluster::centre_x_
private

Definition at line 37 of file HGCalMulticluster_SA.h.

Referenced by addConstituent(), and updateP4AndPosition().

◆ centre_y_

float l1thgcfirmware::HGCalMulticluster::centre_y_
private

Definition at line 38 of file HGCalMulticluster_SA.h.

Referenced by addConstituent(), and updateP4AndPosition().

◆ centre_z_

float l1thgcfirmware::HGCalMulticluster::centre_z_
private

Definition at line 39 of file HGCalMulticluster_SA.h.

Referenced by addConstituent(), and updateP4AndPosition().

◆ centreProj_x_

float l1thgcfirmware::HGCalMulticluster::centreProj_x_
private

Definition at line 41 of file HGCalMulticluster_SA.h.

Referenced by updateP4AndPosition().

◆ centreProj_y_

float l1thgcfirmware::HGCalMulticluster::centreProj_y_
private

Definition at line 42 of file HGCalMulticluster_SA.h.

Referenced by updateP4AndPosition().

◆ centreProj_z_

float l1thgcfirmware::HGCalMulticluster::centreProj_z_
private

Definition at line 43 of file HGCalMulticluster_SA.h.

Referenced by updateP4AndPosition().

◆ constituents_

std::vector<l1thgcfirmware::HGCalCluster> l1thgcfirmware::HGCalMulticluster::constituents_
private

Definition at line 48 of file HGCalMulticluster_SA.h.

Referenced by addConstituent(), constituents(), and size().

◆ mipPt_

float l1thgcfirmware::HGCalMulticluster::mipPt_
private

Definition at line 45 of file HGCalMulticluster_SA.h.

Referenced by updateP4AndPosition().

◆ sumPt_

float l1thgcfirmware::HGCalMulticluster::sumPt_
private

Definition at line 46 of file HGCalMulticluster_SA.h.

Referenced by sumPt(), and updateP4AndPosition().