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

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

Definition at line 10 of file RealisticCluster.h.

Constructor & Destructor Documentation

RealisticCluster::RealisticCluster ( )
inline

Definition at line 23 of file RealisticCluster.h.

23  :
24  totalEnergy(0.f),
25  exclusiveEnergy(0.f),
26  visible(true)
27  {
28 
29  }
double f[11][100]

Member Function Documentation

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

Definition at line 111 of file RealisticCluster.h.

References hitIdsAndFractions_.

112  {
113  hitIdsAndFractions_.emplace_back(hit,fraction);
114  }
std::vector< std::pair< unsigned int, float > > hitIdsAndFractions_
Hit3DPosition RealisticCluster::getCenterOfGravity ( unsigned int  layerId) const
inline

Definition at line 74 of file RealisticCluster.h.

References layerInfo_.

75  {
76  return layerInfo_[layerId].centerOfGravityAtLayer_ ;
77  }
std::vector< LayerInfo > layerInfo_
float RealisticCluster::getEnergy ( ) const
inline

Definition at line 49 of file RealisticCluster.h.

References totalEnergy.

50  {
51  return totalEnergy;
52  }
float RealisticCluster::getExclusiveEnergy ( ) const
inline

Definition at line 54 of file RealisticCluster.h.

References exclusiveEnergy.

55  {
56  return exclusiveEnergy;
57  }
float RealisticCluster::getExclusiveEnergyFraction ( ) const
inline

Definition at line 40 of file RealisticCluster.h.

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

41  {
42  float fraction = 0.f;
43  if(totalEnergy>0.f){
44  fraction = exclusiveEnergy/totalEnergy;
45  }
46  return fraction;
47  }
double f[11][100]
unsigned int RealisticCluster::getLayersNum ( ) const
inline

Definition at line 106 of file RealisticCluster.h.

References layerInfo_.

107  {
108  return layerInfo_.size();
109  }
std::vector< LayerInfo > layerInfo_
float RealisticCluster::getMaxEnergy ( unsigned int  layerId) const
inline

Definition at line 96 of file RealisticCluster.h.

References layerInfo_.

97  {
98  return layerInfo_[layerId].maxEnergyHitAtLayer_;
99  }
std::vector< LayerInfo > layerInfo_
Hit3DPosition RealisticCluster::getMaxEnergyPosition ( unsigned int  layerId) const
inline

Definition at line 91 of file RealisticCluster.h.

References layerInfo_.

92  {
93  return layerInfo_[layerId].maxHitPosAtLayer_;
94  }
std::vector< LayerInfo > layerInfo_
const std::vector< std::pair<unsigned int, float> >& RealisticCluster::hitsIdsAndFractions ( ) const
inline

Definition at line 129 of file RealisticCluster.h.

References hitIdsAndFractions_.

129 { return hitIdsAndFractions_; }
std::vector< std::pair< unsigned int, float > > hitIdsAndFractions_
void RealisticCluster::increaseEnergy ( float  value)
inline

Definition at line 31 of file RealisticCluster.h.

References totalEnergy, and relativeConstraints::value.

void RealisticCluster::increaseExclusiveEnergy ( float  value)
inline

Definition at line 35 of file RealisticCluster.h.

References exclusiveEnergy, and relativeConstraints::value.

bool RealisticCluster::isVisible ( ) const
inline

Definition at line 59 of file RealisticCluster.h.

References visible.

Referenced by Vispa.Gui.VispaWidget.VispaWidget::setBodyWidget().

60  {
61  return visible;
62  }
void RealisticCluster::modifyFractionByIndex ( float  fraction,
unsigned int  index 
)
inline

Definition at line 124 of file RealisticCluster.h.

References dedxEstimators_cff::fraction, and hitIdsAndFractions_.

125  {
127  }
std::vector< std::pair< unsigned int, float > > hitIdsAndFractions_
void RealisticCluster::modifyFractionForHitId ( float  fraction,
unsigned int  hitId 
)
inline

Definition at line 116 of file RealisticCluster.h.

References dedxEstimators_cff::fraction, and hitIdsAndFractions_.

117  {
118  auto it = std::find_if( hitIdsAndFractions_.begin(), hitIdsAndFractions_.end(),
119  [&hitId](const std::pair<unsigned int, float>& element){ return element.first == hitId;} );
120 
121  it->second = fraction;
122  }
std::vector< std::pair< unsigned int, float > > hitIdsAndFractions_
void RealisticCluster::setCenterOfGravity ( unsigned int  layerId,
const Hit3DPosition position 
)
inline

Definition at line 69 of file RealisticCluster.h.

References layerInfo_, and position.

70  {
71  layerInfo_[layerId].centerOfGravityAtLayer_ = position;
72  }
std::vector< LayerInfo > layerInfo_
static int position[264][3]
Definition: ReadPGInfo.cc:509
void RealisticCluster::setLayersNum ( unsigned int  numberOfLayers)
inline

Definition at line 101 of file RealisticCluster.h.

References layerInfo_.

102  {
103  layerInfo_.resize(numberOfLayers);
104  }
std::vector< LayerInfo > layerInfo_
bool RealisticCluster::setMaxEnergyHit ( unsigned int  layerId,
float  newEnergy,
const Hit3DPosition  position 
)
inline

Definition at line 79 of file RealisticCluster.h.

References layerInfo_, RealisticCluster::LayerInfo::maxEnergyHitAtLayer_, and position.

80  {
81  if (newEnergy > layerInfo_[layerId].maxEnergyHitAtLayer_)
82  {
83  layerInfo_[layerId].maxEnergyHitAtLayer_ = newEnergy;
84  layerInfo_[layerId].maxHitPosAtLayer_ = position;
85  return true;
86  }
87  else
88  return false;
89  }
std::vector< LayerInfo > layerInfo_
static int position[264][3]
Definition: ReadPGInfo.cc:509
void RealisticCluster::setVisible ( bool  vis)
inline

Definition at line 64 of file RealisticCluster.h.

References runTauDisplay::vis, and visible.

65  {
66  visible = vis;
67  }

Member Data Documentation

float RealisticCluster::exclusiveEnergy
private
std::vector<std::pair<unsigned int, float> > RealisticCluster::hitIdsAndFractions_
private
std::vector<LayerInfo> RealisticCluster::layerInfo_
private
float RealisticCluster::totalEnergy
private

Definition at line 135 of file RealisticCluster.h.

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

bool RealisticCluster::visible
private

Definition at line 137 of file RealisticCluster.h.

Referenced by isVisible(), and setVisible().