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) {}

Member Function Documentation

◆ addHitAndFraction()

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

Definition at line 64 of file RealisticCluster.h.

64 { hitIdsAndFractions_.emplace_back(hit, fraction); }

References HLT_FULL_cff::fraction, and hitIdsAndFractions_.

◆ getCenterOfGravity()

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

Definition at line 45 of file RealisticCluster.h.

45 { return layerInfo_[layerId].centerOfGravityAtLayer_; }

References layerInfo_.

◆ getEnergy()

float RealisticCluster::getEnergy ( ) const
inline

Definition at line 33 of file RealisticCluster.h.

33 { return totalEnergy; }

References totalEnergy.

◆ getExclusiveEnergy()

float RealisticCluster::getExclusiveEnergy ( ) const
inline

Definition at line 35 of file RealisticCluster.h.

35 { return exclusiveEnergy; }

References exclusiveEnergy.

◆ getExclusiveEnergyFraction()

float RealisticCluster::getExclusiveEnergyFraction ( ) const
inline

Definition at line 25 of file RealisticCluster.h.

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

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

◆ getLayersNum()

unsigned int RealisticCluster::getLayersNum ( ) const
inline

Definition at line 62 of file RealisticCluster.h.

62 { return layerInfo_.size(); }

References layerInfo_.

◆ getMaxEnergy()

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

Definition at line 58 of file RealisticCluster.h.

58 { return layerInfo_[layerId].maxEnergyHitAtLayer_; }

References layerInfo_.

◆ getMaxEnergyPosition()

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

Definition at line 56 of file RealisticCluster.h.

56 { return layerInfo_[layerId].maxHitPosAtLayer_; }

References layerInfo_.

◆ hitsIdsAndFractions()

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

Definition at line 76 of file RealisticCluster.h.

76 { return hitIdsAndFractions_; }

References hitIdsAndFractions_.

◆ increaseEnergy()

void RealisticCluster::increaseEnergy ( float  value)
inline

Definition at line 22 of file RealisticCluster.h.

22 { totalEnergy += value; }

References totalEnergy, and relativeConstraints::value.

◆ increaseExclusiveEnergy()

void RealisticCluster::increaseExclusiveEnergy ( float  value)
inline

Definition at line 23 of file RealisticCluster.h.

23 { exclusiveEnergy += value; }

References exclusiveEnergy, and relativeConstraints::value.

◆ isVisible()

bool RealisticCluster::isVisible ( ) const
inline

Definition at line 37 of file RealisticCluster.h.

37 { return visible; }

References visible.

◆ modifyFractionByIndex()

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

Definition at line 74 of file RealisticCluster.h.

74 { hitIdsAndFractions_[index].second = fraction; }

References HLT_FULL_cff::fraction, and hitIdsAndFractions_.

◆ modifyFractionForHitId()

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

Definition at line 66 of file RealisticCluster.h.

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  }

References HLT_FULL_cff::fraction, and hitIdsAndFractions_.

◆ setCenterOfGravity()

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

Definition at line 41 of file RealisticCluster.h.

41  {
42  layerInfo_[layerId].centerOfGravityAtLayer_ = position;
43  }

References layerInfo_, and position.

◆ setLayersNum()

void RealisticCluster::setLayersNum ( unsigned int  numberOfLayers)
inline

Definition at line 60 of file RealisticCluster.h.

60 { layerInfo_.resize(numberOfLayers); }

References layerInfo_, and numberOfLayers().

◆ setMaxEnergyHit()

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

Definition at line 47 of file RealisticCluster.h.

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  }

References layerInfo_, and position.

◆ setVisible()

void RealisticCluster::setVisible ( bool  vis)
inline

Definition at line 39 of file RealisticCluster.h.

39 { visible = vis; }

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

f
double f[11][100]
Definition: MuScleFitUtils.cc:78
RealisticCluster::totalEnergy
float totalEnergy
Definition: RealisticCluster.h:82
RealisticCluster::layerInfo_
std::vector< LayerInfo > layerInfo_
Definition: RealisticCluster.h:80
HLT_FULL_cff.fraction
fraction
Definition: HLT_FULL_cff.py:52861
RealisticCluster::visible
bool visible
Definition: RealisticCluster.h:84
runTauDisplay.vis
vis
Definition: runTauDisplay.py:328
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
RealisticCluster::exclusiveEnergy
float exclusiveEnergy
Definition: RealisticCluster.h:83
relativeConstraints.value
value
Definition: relativeConstraints.py:53
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
numberOfLayers
const map< TString, int > numberOfLayers(TString Year="2018")
Definition: DMRtrends.cc:253
RealisticCluster::hitIdsAndFractions_
std::vector< std::pair< unsigned int, float > > hitIdsAndFractions_
Definition: RealisticCluster.h:79
hit
Definition: SiStripHitEffFromCalibTree.cc:88