CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
ticl::Trackster Class Reference

#include <Trackster.h>

Public Types

enum  IterationIndex {
  TRKEM = 0, EM, TRKHAD, HAD,
  MIP, SIM, SIM_CP
}
 
enum  ParticleType {
  ParticleType::photon = 0, ParticleType::electron, ParticleType::muon, ParticleType::neutral_pion,
  ParticleType::charged_hadron, ParticleType::neutral_hadron, ParticleType::ambiguous, ParticleType::unknown
}
 
enum  PCAOrdering { PCAOrdering::ascending = 0, PCAOrdering::descending }
 
typedef math::XYZVector Vector
 

Public Member Functions

void addToRawEmEnergy (float value)
 
void addToRawEnergy (float value)
 
const Vectorbarycenter () const
 
std::vector< std::array< unsigned int, 2 > > & edges ()
 
const std::vector< std::array< unsigned int, 2 > > & edges () const
 
const std::array< float, 3 > & eigenvalues () const
 
const std::array< Vector, 3 > & eigenvectors () const
 
const Vectoreigenvectors (int index) const
 
void fillPCAVariables (Eigen::Vector3d &eigenvalues, Eigen::Matrix3d &eigenvectors, Eigen::Vector3d &sigmas, Eigen::Vector3d &sigmasEigen, size_t pcadimension, PCAOrdering order)
 
const std::array< float, 8 > & id_probabilities () const
 
const float id_probabilities (int index) const
 
float id_probability (ParticleType type) const
 
const float raw_em_energy () const
 
const float raw_em_pt () const
 
const float raw_energy () const
 
const float raw_pt () const
 
const float regressed_energy () const
 
const edm::ProductIDseedID () const
 
const int seedIndex () const
 
void setBarycenter (Vector value)
 
void setIdProbability (ParticleType type, float value)
 
void setIteration (const Trackster::IterationIndex i)
 
void setProbabilities (float *probs)
 
void setRawEmEnergy (float value)
 
void setRawEmPt (float value)
 
void setRawEnergy (float value)
 
void setRawPt (float value)
 
void setRegressedEnergy (float value)
 
void setSeed (edm::ProductID pid, int index)
 
void setTimeAndError (float t, float tError)
 
const std::array< float, 3 > & sigmas () const
 
const std::array< float, 3 > & sigmasPCA () const
 
const Trackster::IterationIndex ticlIteration () const
 
const float time () const
 
const float timeError () const
 
 Trackster ()
 
std::vector< float > & vertex_multiplicity ()
 
const std::vector< float > & vertex_multiplicity () const
 
const float vertex_multiplicity (int index) const
 
std::vector< unsigned int > & vertices ()
 
const std::vector< unsigned int > & vertices () const
 
const unsigned int vertices (int index) const
 
void zeroProbabilities ()
 

Private Attributes

Vector barycenter_
 
std::vector< std::array< unsigned int, 2 > > edges_
 
std::array< float, 3 > eigenvalues_
 
std::array< Vector, 3 > eigenvectors_
 
std::array< float, 8 > id_probabilities_
 
uint8_t iterationIndex_
 
float raw_em_energy_
 
float raw_em_pt_
 
float raw_energy_
 
float raw_pt_
 
float regressed_energy_
 
edm::ProductID seedID_
 
int seedIndex_
 
std::array< float, 3 > sigmas_
 
std::array< float, 3 > sigmasPCA_
 
float time_
 
float timeError_
 
std::vector< float > vertex_multiplicity_
 
std::vector< unsigned int > vertices_
 

Detailed Description

Definition at line 19 of file Trackster.h.

Member Typedef Documentation

◆ Vector

Definition at line 21 of file Trackster.h.

Member Enumeration Documentation

◆ IterationIndex

Enumerator
TRKEM 
EM 
TRKHAD 
HAD 
MIP 
SIM 
SIM_CP 

Definition at line 23 of file Trackster.h.

◆ ParticleType

Enumerator
photon 
electron 
muon 
neutral_pion 
charged_hadron 
neutral_hadron 
ambiguous 
unknown 

Definition at line 26 of file Trackster.h.

26  {
27  photon = 0,
28  electron,
29  muon,
30  neutral_pion,
31  charged_hadron,
32  neutral_hadron,
33  ambiguous,
34  unknown,
35  };

◆ PCAOrdering

Enumerator
ascending 
descending 

Definition at line 37 of file Trackster.h.

37 { ascending = 0, descending };

Constructor & Destructor Documentation

◆ Trackster()

ticl::Trackster::Trackster ( )
inline

Definition at line 39 of file Trackster.h.

40  : iterationIndex_(0),
41  seedIndex_(0),
42  time_(0.f),
43  timeError_(-1.f),
45  raw_energy_(0.f),
46  raw_em_energy_(0.f),
47  raw_pt_(0.f),
48  raw_em_pt_(0.f),
49  barycenter_({0., 0., 0.}),
50  eigenvalues_{{0.f, 0.f, 0.f}},
51  sigmas_{{0.f, 0.f, 0.f}},
52  sigmasPCA_{{0.f, 0.f, 0.f}} {
54  }
float timeError_
Definition: Trackster.h:183
uint8_t iterationIndex_
Definition: Trackster.h:151
float raw_em_pt_
Definition: Trackster.h:190
std::array< float, 3 > sigmas_
Definition: Trackster.h:196
Vector barycenter_
Definition: Trackster.h:193
double f[11][100]
void zeroProbabilities()
Definition: Trackster.h:107
float raw_energy_
Definition: Trackster.h:187
float regressed_energy_
Definition: Trackster.h:186
std::array< float, 3 > sigmasPCA_
Definition: Trackster.h:197
std::array< float, 3 > eigenvalues_
Definition: Trackster.h:194
float raw_em_energy_
Definition: Trackster.h:188

Member Function Documentation

◆ addToRawEmEnergy()

void ticl::Trackster::addToRawEmEnergy ( float  value)
inline

Definition at line 72 of file Trackster.h.

References raw_em_energy_, and relativeConstraints::value.

◆ addToRawEnergy()

void ticl::Trackster::addToRawEnergy ( float  value)
inline

Definition at line 70 of file Trackster.h.

References raw_energy_, and relativeConstraints::value.

◆ barycenter()

const Vector& ticl::Trackster::barycenter ( ) const
inline

Definition at line 134 of file Trackster.h.

References barycenter_.

Referenced by FWTracksterProxyBuilder::build().

134 { return barycenter_; }
Vector barycenter_
Definition: Trackster.h:193

◆ edges() [1/2]

std::vector<std::array<unsigned int, 2> >& ticl::Trackster::edges ( )
inline

Definition at line 59 of file Trackster.h.

References edges_.

Referenced by FWTracksterHitsProxyBuilder::build(), and FWTracksterLayersProxyBuilder::build().

59 { return edges_; }
std::vector< std::array< unsigned int, 2 > > edges_
Definition: Trackster.h:163

◆ edges() [2/2]

const std::vector<std::array<unsigned int, 2> >& ticl::Trackster::edges ( ) const
inline

Definition at line 124 of file Trackster.h.

References edges_.

124 { return edges_; }
std::vector< std::array< unsigned int, 2 > > edges_
Definition: Trackster.h:163

◆ eigenvalues()

const std::array<float, 3>& ticl::Trackster::eigenvalues ( ) const
inline

Definition at line 135 of file Trackster.h.

References eigenvalues_.

Referenced by FWTracksterProxyBuilder::build(), and fillPCAVariables().

135 { return eigenvalues_; }
std::array< float, 3 > eigenvalues_
Definition: Trackster.h:194

◆ eigenvectors() [1/2]

const std::array<Vector, 3>& ticl::Trackster::eigenvectors ( ) const
inline

Definition at line 136 of file Trackster.h.

References eigenvectors_.

Referenced by fillPCAVariables().

136 { return eigenvectors_; }
std::array< Vector, 3 > eigenvectors_
Definition: Trackster.h:195

◆ eigenvectors() [2/2]

const Vector& ticl::Trackster::eigenvectors ( int  index) const
inline

Definition at line 137 of file Trackster.h.

References eigenvectors_.

137 { return eigenvectors_[index]; }
std::array< Vector, 3 > eigenvectors_
Definition: Trackster.h:195

◆ fillPCAVariables()

void ticl::Trackster::fillPCAVariables ( Eigen::Vector3d &  eigenvalues,
Eigen::Matrix3d &  eigenvectors,
Eigen::Vector3d &  sigmas,
Eigen::Vector3d &  sigmasEigen,
size_t  pcadimension,
PCAOrdering  order 
)
inline

Definition at line 76 of file Trackster.h.

References ascending, barycenter_, eigenvalues(), eigenvalues_, eigenvectors(), eigenvectors_, dqmMemoryStats::float, mps_fire::i, eventshapeDQM_cfi::order, perp2(), raw_em_energy_, raw_em_pt_, raw_energy_, raw_pt_, sigmas(), sigmas_, sigmasPCA_, and mathSSE::sqrt().

81  {
82  int original_index = 0;
83  for (size_t i = 0; i < pcadimension; ++i) {
84  sigmas_[i] = std::sqrt(sigmas[i]);
85  // Reverse the order, since Eigen gives back the eigevalues in
86  // **increasing order** while we store them in **descreasing order**.
87  original_index = i;
89  original_index = pcadimension - i - 1;
90  eigenvalues_[i] = (float)eigenvalues[original_index];
92  eigenvectors(0, original_index), eigenvectors(1, original_index), eigenvectors(2, original_index));
93  sigmasPCA_[i] = std::sqrt(sigmasEigen[original_index]);
94  }
95  original_index = 0;
97  original_index = pcadimension - 1;
98  if (eigenvectors_[0].z() * barycenter_.z() < 0.0) {
100  eigenvectors(0, original_index), eigenvectors(1, original_index), eigenvectors(2, original_index));
101  }
102 
103  // Now also update the pt part of the Trackster, using the PCA as direction
104  raw_pt_ = std::sqrt((eigenvectors_[0].Unit() * raw_energy_).perp2());
106  }
math::XYZVector Vector
Definition: Trackster.h:21
std::array< Vector, 3 > eigenvectors_
Definition: Trackster.h:195
float raw_em_pt_
Definition: Trackster.h:190
std::array< float, 3 > sigmas_
Definition: Trackster.h:196
Vector barycenter_
Definition: Trackster.h:193
T perp2() const
Squared magnitude of transverse component.
const std::array< Vector, 3 > & eigenvectors() const
Definition: Trackster.h:136
T sqrt(T t)
Definition: SSEVec.h:19
float raw_energy_
Definition: Trackster.h:187
const std::array< float, 3 > & sigmas() const
Definition: Trackster.h:138
std::array< float, 3 > sigmasPCA_
Definition: Trackster.h:197
std::array< float, 3 > eigenvalues_
Definition: Trackster.h:194
const std::array< float, 3 > & eigenvalues() const
Definition: Trackster.h:135
float raw_em_energy_
Definition: Trackster.h:188

◆ id_probabilities() [1/2]

const std::array<float, 8>& ticl::Trackster::id_probabilities ( ) const
inline

Definition at line 140 of file Trackster.h.

References id_probabilities_.

140 { return id_probabilities_; }
std::array< float, 8 > id_probabilities_
Definition: Trackster.h:200

◆ id_probabilities() [2/2]

const float ticl::Trackster::id_probabilities ( int  index) const
inline

Definition at line 141 of file Trackster.h.

References id_probabilities_.

141 { return id_probabilities_[index]; }
std::array< float, 8 > id_probabilities_
Definition: Trackster.h:200

◆ id_probability()

float ticl::Trackster::id_probability ( ParticleType  type) const
inline

Definition at line 144 of file Trackster.h.

References id_probabilities_, and createfilelist::int.

144  {
145  // probabilities are stored in the same order as defined in the ParticleType enum
146  return id_probabilities_[(int)type];
147  }
std::array< float, 8 > id_probabilities_
Definition: Trackster.h:200

◆ raw_em_energy()

const float ticl::Trackster::raw_em_energy ( ) const
inline

Definition at line 131 of file Trackster.h.

References raw_em_energy_.

131 { return raw_em_energy_; }
float raw_em_energy_
Definition: Trackster.h:188

◆ raw_em_pt()

const float ticl::Trackster::raw_em_pt ( ) const
inline

Definition at line 133 of file Trackster.h.

References raw_em_pt_.

133 { return raw_em_pt_; }
float raw_em_pt_
Definition: Trackster.h:190

◆ raw_energy()

const float ticl::Trackster::raw_energy ( ) const
inline

Definition at line 130 of file Trackster.h.

References raw_energy_.

130 { return raw_energy_; }
float raw_energy_
Definition: Trackster.h:187

◆ raw_pt()

const float ticl::Trackster::raw_pt ( ) const
inline

Definition at line 132 of file Trackster.h.

References raw_pt_.

132 { return raw_pt_; }

◆ regressed_energy()

const float ticl::Trackster::regressed_energy ( ) const
inline

Definition at line 129 of file Trackster.h.

References regressed_energy_.

Referenced by ticl::TracksterP4FromEnergySum::calcP4().

129 { return regressed_energy_; }
float regressed_energy_
Definition: Trackster.h:186

◆ seedID()

const edm::ProductID& ticl::Trackster::seedID ( ) const
inline

Definition at line 125 of file Trackster.h.

References seedID_.

Referenced by HGVHistoProducerAlgo::tracksters_to_SimTracksters().

125 { return seedID_; }
edm::ProductID seedID_
Definition: Trackster.h:169

◆ seedIndex()

const int ticl::Trackster::seedIndex ( ) const
inline

Definition at line 126 of file Trackster.h.

References seedIndex_.

Referenced by HGVHistoProducerAlgo::tracksters_to_SimTracksters().

126 { return seedIndex_; }

◆ setBarycenter()

void ticl::Trackster::setBarycenter ( Vector  value)
inline

Definition at line 75 of file Trackster.h.

References barycenter_, and relativeConstraints::value.

◆ setIdProbability()

void ticl::Trackster::setIdProbability ( ParticleType  type,
float  value 
)
inline

◆ setIteration()

void ticl::Trackster::setIteration ( const Trackster::IterationIndex  i)
inline

Definition at line 56 of file Trackster.h.

References mps_fire::i, and iterationIndex_.

Referenced by ticl::addTrackster().

56 { iterationIndex_ = i; }
uint8_t iterationIndex_
Definition: Trackster.h:151

◆ setProbabilities()

void ticl::Trackster::setProbabilities ( float *  probs)
inline

Definition at line 112 of file Trackster.h.

References id_probabilities_, and AlCaHLTBitMon_ParallelJobs::p.

112  {
113  for (float &p : id_probabilities_) {
114  p = *(probs++);
115  }
116  }
std::array< float, 8 > id_probabilities_
Definition: Trackster.h:200

◆ setRawEmEnergy()

void ticl::Trackster::setRawEmEnergy ( float  value)
inline

Definition at line 71 of file Trackster.h.

References raw_em_energy_, and relativeConstraints::value.

◆ setRawEmPt()

void ticl::Trackster::setRawEmPt ( float  value)
inline

Definition at line 74 of file Trackster.h.

References raw_em_pt_, and relativeConstraints::value.

◆ setRawEnergy()

void ticl::Trackster::setRawEnergy ( float  value)
inline

Definition at line 69 of file Trackster.h.

References raw_energy_, and relativeConstraints::value.

◆ setRawPt()

void ticl::Trackster::setRawPt ( float  value)
inline

Definition at line 73 of file Trackster.h.

References raw_pt_, and relativeConstraints::value.

◆ setRegressedEnergy()

void ticl::Trackster::setRegressedEnergy ( float  value)
inline

Definition at line 68 of file Trackster.h.

References regressed_energy_, and relativeConstraints::value.

Referenced by ticl::addTrackster().

◆ setSeed()

void ticl::Trackster::setSeed ( edm::ProductID  pid,
int  index 
)
inline

Definition at line 60 of file Trackster.h.

References seedID_, and seedIndex_.

Referenced by ticl::addTrackster().

60  {
61  seedID_ = pid;
62  seedIndex_ = index;
63  }
edm::ProductID seedID_
Definition: Trackster.h:169

◆ setTimeAndError()

void ticl::Trackster::setTimeAndError ( float  t,
float  tError 
)
inline

Definition at line 64 of file Trackster.h.

References submitPVValidationJobs::t, time_, and timeError_.

64  {
65  time_ = t;
66  timeError_ = tError;
67  }
float timeError_
Definition: Trackster.h:183

◆ sigmas()

const std::array<float, 3>& ticl::Trackster::sigmas ( ) const
inline

Definition at line 138 of file Trackster.h.

References sigmas_.

Referenced by fillPCAVariables().

138 { return sigmas_; }
std::array< float, 3 > sigmas_
Definition: Trackster.h:196

◆ sigmasPCA()

const std::array<float, 3>& ticl::Trackster::sigmasPCA ( ) const
inline

Definition at line 139 of file Trackster.h.

References sigmasPCA_.

139 { return sigmasPCA_; }
std::array< float, 3 > sigmasPCA_
Definition: Trackster.h:197

◆ ticlIteration()

const Trackster::IterationIndex ticl::Trackster::ticlIteration ( ) const
inline

Definition at line 119 of file Trackster.h.

References iterationIndex_.

119 { return (IterationIndex)iterationIndex_; }
uint8_t iterationIndex_
Definition: Trackster.h:151

◆ time()

const float ticl::Trackster::time ( ) const
inline

Definition at line 127 of file Trackster.h.

References time_.

Referenced by TICLCandidate::addTrackster().

127 { return time_; }

◆ timeError()

const float ticl::Trackster::timeError ( ) const
inline

Definition at line 128 of file Trackster.h.

References timeError_.

Referenced by TICLCandidate::addTrackster().

128 { return timeError_; }
float timeError_
Definition: Trackster.h:183

◆ vertex_multiplicity() [1/3]

std::vector<float>& ticl::Trackster::vertex_multiplicity ( )
inline

◆ vertex_multiplicity() [2/3]

const std::vector<float>& ticl::Trackster::vertex_multiplicity ( ) const
inline

Definition at line 122 of file Trackster.h.

References vertex_multiplicity_.

122 { return vertex_multiplicity_; }
std::vector< float > vertex_multiplicity_
Definition: Trackster.h:156

◆ vertex_multiplicity() [3/3]

const float ticl::Trackster::vertex_multiplicity ( int  index) const
inline

Definition at line 123 of file Trackster.h.

References vertex_multiplicity_.

123 { return vertex_multiplicity_[index]; }
std::vector< float > vertex_multiplicity_
Definition: Trackster.h:156

◆ vertices() [1/3]

std::vector<unsigned int>& ticl::Trackster::vertices ( )
inline

◆ vertices() [2/3]

const std::vector<unsigned int>& ticl::Trackster::vertices ( ) const
inline

Definition at line 120 of file Trackster.h.

References vertices_.

120 { return vertices_; }
std::vector< unsigned int > vertices_
Definition: Trackster.h:155

◆ vertices() [3/3]

const unsigned int ticl::Trackster::vertices ( int  index) const
inline

Definition at line 121 of file Trackster.h.

References vertices_.

121 { return vertices_[index]; }
std::vector< unsigned int > vertices_
Definition: Trackster.h:155

◆ zeroProbabilities()

void ticl::Trackster::zeroProbabilities ( )
inline

Definition at line 107 of file Trackster.h.

References id_probabilities_, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by ticl::addTrackster().

107  {
108  for (auto &p : id_probabilities_) {
109  p = 0.f;
110  }
111  }
std::array< float, 8 > id_probabilities_
Definition: Trackster.h:200

Member Data Documentation

◆ barycenter_

Vector ticl::Trackster::barycenter_
private

Definition at line 193 of file Trackster.h.

Referenced by barycenter(), fillPCAVariables(), and setBarycenter().

◆ edges_

std::vector<std::array<unsigned int, 2> > ticl::Trackster::edges_
private

Definition at line 163 of file Trackster.h.

Referenced by edges().

◆ eigenvalues_

std::array<float, 3> ticl::Trackster::eigenvalues_
private

Definition at line 194 of file Trackster.h.

Referenced by eigenvalues(), and fillPCAVariables().

◆ eigenvectors_

std::array<Vector, 3> ticl::Trackster::eigenvectors_
private

Definition at line 195 of file Trackster.h.

Referenced by eigenvectors(), and fillPCAVariables().

◆ id_probabilities_

std::array<float, 8> ticl::Trackster::id_probabilities_
private

◆ iterationIndex_

uint8_t ticl::Trackster::iterationIndex_
private

Definition at line 151 of file Trackster.h.

Referenced by setIteration(), and ticlIteration().

◆ raw_em_energy_

float ticl::Trackster::raw_em_energy_
private

Definition at line 188 of file Trackster.h.

Referenced by addToRawEmEnergy(), fillPCAVariables(), raw_em_energy(), and setRawEmEnergy().

◆ raw_em_pt_

float ticl::Trackster::raw_em_pt_
private

Definition at line 190 of file Trackster.h.

Referenced by fillPCAVariables(), raw_em_pt(), and setRawEmPt().

◆ raw_energy_

float ticl::Trackster::raw_energy_
private

Definition at line 187 of file Trackster.h.

Referenced by addToRawEnergy(), fillPCAVariables(), raw_energy(), and setRawEnergy().

◆ raw_pt_

float ticl::Trackster::raw_pt_
private

Definition at line 189 of file Trackster.h.

Referenced by fillPCAVariables(), raw_pt(), and setRawPt().

◆ regressed_energy_

float ticl::Trackster::regressed_energy_
private

Definition at line 186 of file Trackster.h.

Referenced by regressed_energy(), and setRegressedEnergy().

◆ seedID_

edm::ProductID ticl::Trackster::seedID_
private

Definition at line 169 of file Trackster.h.

Referenced by seedID(), and setSeed().

◆ seedIndex_

int ticl::Trackster::seedIndex_
private

Definition at line 175 of file Trackster.h.

Referenced by seedIndex(), and setSeed().

◆ sigmas_

std::array<float, 3> ticl::Trackster::sigmas_
private

Definition at line 196 of file Trackster.h.

Referenced by fillPCAVariables(), and sigmas().

◆ sigmasPCA_

std::array<float, 3> ticl::Trackster::sigmasPCA_
private

Definition at line 197 of file Trackster.h.

Referenced by fillPCAVariables(), and sigmasPCA().

◆ time_

float ticl::Trackster::time_
private

Definition at line 182 of file Trackster.h.

Referenced by setTimeAndError(), and time().

◆ timeError_

float ticl::Trackster::timeError_
private

Definition at line 183 of file Trackster.h.

Referenced by setTimeAndError(), and timeError().

◆ vertex_multiplicity_

std::vector<float> ticl::Trackster::vertex_multiplicity_
private

Definition at line 156 of file Trackster.h.

Referenced by vertex_multiplicity().

◆ vertices_

std::vector<unsigned int> ticl::Trackster::vertices_
private

Definition at line 155 of file Trackster.h.

Referenced by vertices().