CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Types | Private Attributes
RealisticCluster Class Reference

#include <RealisticCluster.h>

Classes

struct  LayerInfo
 

Public Member Functions

void addHitAndFraction (unsigned int hit, float fraction)
 
Hit3DPosition getCenterOfGravity (unsigned int layerId) const
 
float getEnergy () const
 
float getExclusiveEnergy () const
 
float getExclusiveEnergyFraction () const
 
unsigned int getLayersNum () const
 
float getMaxEnergy (unsigned int layerId) const
 
Hit3DPosition getMaxEnergyPosition (unsigned int layerId) const
 
const std::vector< std::pair< unsigned int, float > > & hitsIdsAndFractions () const
 
void increaseEnergy (float value)
 
void increaseExclusiveEnergy (float value)
 
bool isVisible () const
 
void modifyFractionByIndex (float fraction, unsigned int index)
 
void modifyFractionForHitId (float fraction, unsigned int hitId)
 
 RealisticCluster ()
 
void setCenterOfGravity (unsigned int layerId, const Hit3DPosition &position)
 
void setLayersNum (unsigned int numberOfLayers)
 
bool setMaxEnergyHit (unsigned int layerId, float newEnergy, const Hit3DPosition position)
 
void setVisible (bool vis)
 

Private Types

using Hit3DPosition = std::array< float, 3 >
 

Private Attributes

float exclusiveEnergy
 
std::vector< std::pair< unsigned int, float > > hitIdsAndFractions_
 
std::vector< LayerInfolayerInfo_
 
float totalEnergy
 
bool visible
 

Detailed Description

Definition at line 8 of file RealisticCluster.h.

Member Typedef Documentation

◆ Hit3DPosition

using RealisticCluster::Hit3DPosition = std::array<float, 3>
private

Definition at line 9 of file RealisticCluster.h.

Constructor & Destructor Documentation

◆ RealisticCluster()

RealisticCluster::RealisticCluster ( )
inline

Definition at line 20 of file RealisticCluster.h.

20 : totalEnergy(0.f), exclusiveEnergy(0.f), visible(true) {}
double f[11][100]

Member Function Documentation

◆ addHitAndFraction()

void RealisticCluster::addHitAndFraction ( unsigned int  hit,
float  fraction 
)
inline

Definition at line 64 of file RealisticCluster.h.

References HLT_2022v12_cff::fraction, and hitIdsAndFractions_.

64 { hitIdsAndFractions_.emplace_back(hit, fraction); }
std::vector< std::pair< unsigned int, float > > hitIdsAndFractions_

◆ getCenterOfGravity()

Hit3DPosition RealisticCluster::getCenterOfGravity ( unsigned int  layerId) const
inline

Definition at line 45 of file RealisticCluster.h.

References layerInfo_.

45 { return layerInfo_[layerId].centerOfGravityAtLayer_; }
std::vector< LayerInfo > layerInfo_

◆ getEnergy()

float RealisticCluster::getEnergy ( ) const
inline

Definition at line 33 of file RealisticCluster.h.

References totalEnergy.

33 { return totalEnergy; }

◆ getExclusiveEnergy()

float RealisticCluster::getExclusiveEnergy ( ) const
inline

Definition at line 35 of file RealisticCluster.h.

References exclusiveEnergy.

35 { return exclusiveEnergy; }

◆ getExclusiveEnergyFraction()

float RealisticCluster::getExclusiveEnergyFraction ( ) const
inline

Definition at line 25 of file RealisticCluster.h.

References exclusiveEnergy, f, HLT_2022v12_cff::fraction, and totalEnergy.

25  {
26  float fraction = 0.f;
27  if (totalEnergy > 0.f) {
29  }
30  return fraction;
31  }
double f[11][100]

◆ getLayersNum()

unsigned int RealisticCluster::getLayersNum ( ) const
inline

Definition at line 62 of file RealisticCluster.h.

References layerInfo_.

62 { return layerInfo_.size(); }
std::vector< LayerInfo > layerInfo_

◆ getMaxEnergy()

float RealisticCluster::getMaxEnergy ( unsigned int  layerId) const
inline

Definition at line 58 of file RealisticCluster.h.

References layerInfo_.

58 { return layerInfo_[layerId].maxEnergyHitAtLayer_; }
std::vector< LayerInfo > layerInfo_

◆ getMaxEnergyPosition()

Hit3DPosition RealisticCluster::getMaxEnergyPosition ( unsigned int  layerId) const
inline

Definition at line 56 of file RealisticCluster.h.

References layerInfo_.

56 { return layerInfo_[layerId].maxHitPosAtLayer_; }
std::vector< LayerInfo > layerInfo_

◆ hitsIdsAndFractions()

const std::vector<std::pair<unsigned int, float> >& RealisticCluster::hitsIdsAndFractions ( ) const
inline

Definition at line 76 of file RealisticCluster.h.

References hitIdsAndFractions_.

76 { return hitIdsAndFractions_; }
std::vector< std::pair< unsigned int, float > > hitIdsAndFractions_

◆ increaseEnergy()

void RealisticCluster::increaseEnergy ( float  value)
inline

◆ increaseExclusiveEnergy()

void RealisticCluster::increaseExclusiveEnergy ( float  value)
inline

◆ isVisible()

bool RealisticCluster::isVisible ( ) const
inline

Definition at line 37 of file RealisticCluster.h.

References visible.

37 { return visible; }

◆ modifyFractionByIndex()

void RealisticCluster::modifyFractionByIndex ( float  fraction,
unsigned int  index 
)
inline

Definition at line 74 of file RealisticCluster.h.

References HLT_2022v12_cff::fraction, and hitIdsAndFractions_.

74 { hitIdsAndFractions_[index].second = fraction; }
std::vector< std::pair< unsigned int, float > > hitIdsAndFractions_

◆ modifyFractionForHitId()

void RealisticCluster::modifyFractionForHitId ( float  fraction,
unsigned int  hitId 
)
inline

Definition at line 66 of file RealisticCluster.h.

References HLT_2022v12_cff::fraction, and hitIdsAndFractions_.

66  {
67  auto it = std::find_if(hitIdsAndFractions_.begin(),
68  hitIdsAndFractions_.end(),
69  [&hitId](const std::pair<unsigned int, float>& element) { return element.first == hitId; });
70 
71  it->second = fraction;
72  }
std::vector< std::pair< unsigned int, float > > hitIdsAndFractions_

◆ setCenterOfGravity()

void RealisticCluster::setCenterOfGravity ( unsigned int  layerId,
const Hit3DPosition position 
)
inline

Definition at line 41 of file RealisticCluster.h.

References layerInfo_, and position.

41  {
42  layerInfo_[layerId].centerOfGravityAtLayer_ = position;
43  }
std::vector< LayerInfo > layerInfo_
static int position[264][3]
Definition: ReadPGInfo.cc:289

◆ setLayersNum()

void RealisticCluster::setLayersNum ( unsigned int  numberOfLayers)
inline

Definition at line 60 of file RealisticCluster.h.

References layerInfo_, and numberOfLayers().

60 { layerInfo_.resize(numberOfLayers); }
const map< TString, int > numberOfLayers(TString Year="2018")
Definition: DMRtrends.cc:254
std::vector< LayerInfo > layerInfo_

◆ setMaxEnergyHit()

bool RealisticCluster::setMaxEnergyHit ( unsigned int  layerId,
float  newEnergy,
const Hit3DPosition  position 
)
inline

Definition at line 47 of file RealisticCluster.h.

References layerInfo_, and position.

47  {
48  if (newEnergy > layerInfo_[layerId].maxEnergyHitAtLayer_) {
49  layerInfo_[layerId].maxEnergyHitAtLayer_ = newEnergy;
50  layerInfo_[layerId].maxHitPosAtLayer_ = position;
51  return true;
52  } else
53  return false;
54  }
std::vector< LayerInfo > layerInfo_
static int position[264][3]
Definition: ReadPGInfo.cc:289

◆ setVisible()

void RealisticCluster::setVisible ( bool  vis)
inline

Definition at line 39 of file RealisticCluster.h.

References runTauDisplay::vis, and visible.

Member Data Documentation

◆ exclusiveEnergy

float RealisticCluster::exclusiveEnergy
private

◆ hitIdsAndFractions_

std::vector<std::pair<unsigned int, float> > RealisticCluster::hitIdsAndFractions_
private

◆ layerInfo_

std::vector<LayerInfo> RealisticCluster::layerInfo_
private

◆ totalEnergy

float RealisticCluster::totalEnergy
private

Definition at line 82 of file RealisticCluster.h.

Referenced by getEnergy(), getExclusiveEnergyFraction(), and increaseEnergy().

◆ visible

bool RealisticCluster::visible
private

Definition at line 84 of file RealisticCluster.h.

Referenced by isVisible(), and setVisible().