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::XYZVectorF 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)
 
void setTrackIdx (int index)
 
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
 
int trackIdx () 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_
 
int track_idx_ = -1
 
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  : barycenter_({0.f, 0.f, 0.f}),
42  raw_energy_(0.f),
43  time_(0.f),
44  timeError_(-1.f),
45  raw_em_energy_(0.f),
47  raw_pt_(0.f),
48  raw_em_pt_(0.f),
49  seedIndex_(-1),
50  eigenvalues_{},
51  sigmas_{},
52  sigmasPCA_{},
53  iterationIndex_(0) {}
float timeError_
Definition: Trackster.h:157
uint8_t iterationIndex_
Definition: Trackster.h:196
float raw_em_pt_
Definition: Trackster.h:168
std::array< float, 3 > sigmas_
Definition: Trackster.h:185
Vector barycenter_
Definition: Trackster.h:152
double f[11][100]
float raw_energy_
Definition: Trackster.h:154
std::array< float, 8 > id_probabilities_
Definition: Trackster.h:161
float regressed_energy_
Definition: Trackster.h:153
std::array< float, 3 > sigmasPCA_
Definition: Trackster.h:186
std::array< float, 3 > eigenvalues_
Definition: Trackster.h:184
float raw_em_energy_
Definition: Trackster.h:158

Member Function Documentation

◆ addToRawEmEnergy()

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

Definition at line 71 of file Trackster.h.

References raw_em_energy_, and relativeConstraints::value.

◆ addToRawEnergy()

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

Definition at line 69 of file Trackster.h.

References raw_energy_, and relativeConstraints::value.

◆ barycenter()

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

Definition at line 136 of file Trackster.h.

References barycenter_.

Referenced by FWTracksterProxyBuilder::build().

136 { return barycenter_; }
Vector barycenter_
Definition: Trackster.h:152

◆ edges() [1/2]

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

Definition at line 58 of file Trackster.h.

References edges_.

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

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

◆ edges() [2/2]

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

Definition at line 126 of file Trackster.h.

References edges_.

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

◆ eigenvalues()

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

Definition at line 137 of file Trackster.h.

References eigenvalues_.

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

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

◆ eigenvectors() [1/2]

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

Definition at line 138 of file Trackster.h.

References eigenvectors_.

Referenced by fillPCAVariables().

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

◆ eigenvectors() [2/2]

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

Definition at line 139 of file Trackster.h.

References eigenvectors_.

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

◆ 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 78 of file Trackster.h.

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

83  {
84  int original_index = 0;
85  for (size_t i = 0; i < pcadimension; ++i) {
86  sigmas_[i] = std::sqrt(sigmas[i]);
87  // Reverse the order, since Eigen gives back the eigevalues in
88  // **increasing order** while we store them in **descreasing order**.
89  original_index = i;
91  original_index = pcadimension - i - 1;
92  eigenvalues_[i] = (float)eigenvalues[original_index];
94  eigenvectors(0, original_index), eigenvectors(1, original_index), eigenvectors(2, original_index));
95  sigmasPCA_[i] = std::sqrt(sigmasEigen[original_index]);
96  }
97  original_index = 0;
99  original_index = pcadimension - 1;
100  if (eigenvectors_[0].z() * barycenter_.z() < 0.0) {
102  eigenvectors(0, original_index), eigenvectors(1, original_index), eigenvectors(2, original_index));
103  }
104 
105  // Now also update the pt part of the Trackster, using the PCA as direction
106  raw_pt_ = std::sqrt((eigenvectors_[0].Unit() * raw_energy_).perp2());
108  }
math::XYZVectorF Vector
Definition: Trackster.h:21
std::array< Vector, 3 > eigenvectors_
Definition: Trackster.h:183
float raw_em_pt_
Definition: Trackster.h:168
std::array< float, 3 > sigmas_
Definition: Trackster.h:185
Vector barycenter_
Definition: Trackster.h:152
T perp2() const
Squared magnitude of transverse component.
const std::array< Vector, 3 > & eigenvectors() const
Definition: Trackster.h:138
T sqrt(T t)
Definition: SSEVec.h:19
float raw_energy_
Definition: Trackster.h:154
const std::array< float, 3 > & sigmas() const
Definition: Trackster.h:140
std::array< float, 3 > sigmasPCA_
Definition: Trackster.h:186
std::array< float, 3 > eigenvalues_
Definition: Trackster.h:184
const std::array< float, 3 > & eigenvalues() const
Definition: Trackster.h:137
float raw_em_energy_
Definition: Trackster.h:158

◆ id_probabilities() [1/2]

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

Definition at line 142 of file Trackster.h.

References id_probabilities_.

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

◆ id_probabilities() [2/2]

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

Definition at line 143 of file Trackster.h.

References id_probabilities_.

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

◆ id_probability()

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

Definition at line 146 of file Trackster.h.

References id_probabilities_, and createfilelist::int.

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

◆ raw_em_energy()

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

Definition at line 133 of file Trackster.h.

References raw_em_energy_.

133 { return raw_em_energy_; }
float raw_em_energy_
Definition: Trackster.h:158

◆ raw_em_pt()

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

Definition at line 135 of file Trackster.h.

References raw_em_pt_.

135 { return raw_em_pt_; }
float raw_em_pt_
Definition: Trackster.h:168

◆ raw_energy()

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

Definition at line 132 of file Trackster.h.

References raw_energy_.

Referenced by ticl::LinkingAlgoByDirectionGeometric::timeAndEnergyCompatible().

132 { return raw_energy_; }
float raw_energy_
Definition: Trackster.h:154

◆ raw_pt()

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

Definition at line 134 of file Trackster.h.

References raw_pt_.

134 { return raw_pt_; }

◆ regressed_energy()

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

Definition at line 131 of file Trackster.h.

References regressed_energy_.

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

131 { return regressed_energy_; }
float regressed_energy_
Definition: Trackster.h:153

◆ seedID()

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

Definition at line 127 of file Trackster.h.

References seedID_.

Referenced by HGVHistoProducerAlgo::tracksters_to_SimTracksters().

127 { return seedID_; }
edm::ProductID seedID_
Definition: Trackster.h:174

◆ seedIndex()

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

Definition at line 128 of file Trackster.h.

References seedIndex_.

Referenced by HGVHistoProducerAlgo::tracksters_to_SimTracksters().

128 { return seedIndex_; }

◆ setBarycenter()

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

Definition at line 74 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 55 of file Trackster.h.

References mps_fire::i, and iterationIndex_.

Referenced by SimTrackstersProducer::addTrackster().

55 { iterationIndex_ = i; }
uint8_t iterationIndex_
Definition: Trackster.h:196

◆ setProbabilities()

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

Definition at line 114 of file Trackster.h.

References id_probabilities_, and AlCaHLTBitMon_ParallelJobs::p.

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

◆ setRawEmEnergy()

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

Definition at line 70 of file Trackster.h.

References raw_em_energy_, and relativeConstraints::value.

◆ setRawEmPt()

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

Definition at line 73 of file Trackster.h.

References raw_em_pt_, and relativeConstraints::value.

◆ setRawEnergy()

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

Definition at line 68 of file Trackster.h.

References raw_energy_, and relativeConstraints::value.

◆ setRawPt()

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

Definition at line 72 of file Trackster.h.

References raw_pt_, and relativeConstraints::value.

◆ setRegressedEnergy()

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

◆ setSeed()

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

Definition at line 59 of file Trackster.h.

References seedID_, and seedIndex_.

Referenced by SimTrackstersProducer::addTrackster(), and SimTrackstersProducer::makePUTrackster().

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

◆ setTimeAndError()

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

Definition at line 63 of file Trackster.h.

References submitPVValidationJobs::t, time_, and timeError_.

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

◆ setTrackIdx()

void ticl::Trackster::setTrackIdx ( int  index)
inline

Definition at line 75 of file Trackster.h.

References track_idx_.

Referenced by TrackstersMergeProducer::produce().

◆ sigmas()

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

Definition at line 140 of file Trackster.h.

References sigmas_.

Referenced by fillPCAVariables().

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

◆ sigmasPCA()

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

Definition at line 141 of file Trackster.h.

References sigmasPCA_.

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

◆ ticlIteration()

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

Definition at line 121 of file Trackster.h.

References iterationIndex_.

121 { return (IterationIndex)iterationIndex_; }
uint8_t iterationIndex_
Definition: Trackster.h:196

◆ time()

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

Definition at line 129 of file Trackster.h.

References time_.

Referenced by TICLCandidate::addTrackster(), and ticl::LinkingAlgoByDirectionGeometric::timeAndEnergyCompatible().

129 { return time_; }

◆ timeError()

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

◆ trackIdx()

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

Definition at line 76 of file Trackster.h.

References track_idx_.

76 { return track_idx_; }

◆ 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 124 of file Trackster.h.

References vertex_multiplicity_.

124 { return vertex_multiplicity_; }
std::vector< float > vertex_multiplicity_
Definition: Trackster.h:166

◆ vertex_multiplicity() [3/3]

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

Definition at line 125 of file Trackster.h.

References vertex_multiplicity_.

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

◆ 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 122 of file Trackster.h.

References vertices_.

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

◆ vertices() [3/3]

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

Definition at line 123 of file Trackster.h.

References vertices_.

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

◆ zeroProbabilities()

void ticl::Trackster::zeroProbabilities ( )
inline

Definition at line 109 of file Trackster.h.

References id_probabilities_, and AlCaHLTBitMon_ParallelJobs::p.

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

Member Data Documentation

◆ barycenter_

Vector ticl::Trackster::barycenter_
private

Definition at line 152 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 193 of file Trackster.h.

Referenced by edges().

◆ eigenvalues_

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

Definition at line 184 of file Trackster.h.

Referenced by eigenvalues(), and fillPCAVariables().

◆ eigenvectors_

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

Definition at line 183 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 196 of file Trackster.h.

Referenced by setIteration(), and ticlIteration().

◆ raw_em_energy_

float ticl::Trackster::raw_em_energy_
private

Definition at line 158 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 168 of file Trackster.h.

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

◆ raw_energy_

float ticl::Trackster::raw_energy_
private

Definition at line 154 of file Trackster.h.

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

◆ raw_pt_

float ticl::Trackster::raw_pt_
private

Definition at line 167 of file Trackster.h.

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

◆ regressed_energy_

float ticl::Trackster::regressed_energy_
private

Definition at line 153 of file Trackster.h.

Referenced by regressed_energy(), and setRegressedEnergy().

◆ seedID_

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

Definition at line 174 of file Trackster.h.

Referenced by seedID(), and setSeed().

◆ seedIndex_

int ticl::Trackster::seedIndex_
private

Definition at line 180 of file Trackster.h.

Referenced by seedIndex(), and setSeed().

◆ sigmas_

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

Definition at line 185 of file Trackster.h.

Referenced by fillPCAVariables(), and sigmas().

◆ sigmasPCA_

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

Definition at line 186 of file Trackster.h.

Referenced by fillPCAVariables(), and sigmasPCA().

◆ time_

float ticl::Trackster::time_
private

Definition at line 156 of file Trackster.h.

Referenced by setTimeAndError(), and time().

◆ timeError_

float ticl::Trackster::timeError_
private

Definition at line 157 of file Trackster.h.

Referenced by setTimeAndError(), and timeError().

◆ track_idx_

int ticl::Trackster::track_idx_ = -1
private

Definition at line 181 of file Trackster.h.

Referenced by setTrackIdx(), and trackIdx().

◆ vertex_multiplicity_

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

Definition at line 166 of file Trackster.h.

Referenced by vertex_multiplicity().

◆ vertices_

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

Definition at line 165 of file Trackster.h.

Referenced by vertices().