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
}
 
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 setEigenValuesVectors ()
 
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< uint8_t > & vertex_multiplicity ()
 
const std::vector< uint8_t > & vertex_multiplicity () const
 
const uint8_t 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< uint8_t > 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 

Definition at line 23 of file Trackster.h.

23 { TRKEM = 0, EM, TRKHAD, HAD, MIP };

◆ 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  : seedIndex_(0),
41  time_(0.f),
42  timeError_(-1.f),
44  raw_energy_(0.f),
45  raw_em_energy_(0.f),
46  raw_pt_(0.f),
47  raw_em_pt_(0.f),
48  barycenter_({0., 0., 0.}),
49  eigenvalues_{{0.f, 0.f, 0.f}},
50  sigmas_{{0.f, 0.f, 0.f}},
51  sigmasPCA_{{0.f, 0.f, 0.f}} {
53  }

Member Function Documentation

◆ addToRawEmEnergy()

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

Definition at line 71 of file Trackster.h.

71 { raw_em_energy_ += value; }

References raw_em_energy_, and relativeConstraints::value.

◆ addToRawEnergy()

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

Definition at line 69 of file Trackster.h.

69 { raw_energy_ += value; }

References raw_energy_, and relativeConstraints::value.

◆ barycenter()

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

Definition at line 134 of file Trackster.h.

134 { return barycenter_; }

References barycenter_.

Referenced by FWTracksterProxyBuilder::build().

◆ edges() [1/2]

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

Definition at line 58 of file Trackster.h.

58 { return edges_; }

References edges_.

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

◆ edges() [2/2]

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

Definition at line 124 of file Trackster.h.

124 { return edges_; }

References edges_.

◆ eigenvalues()

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

Definition at line 135 of file Trackster.h.

135 { return eigenvalues_; }

References eigenvalues_.

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

◆ eigenvectors() [1/2]

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

Definition at line 136 of file Trackster.h.

136 { return eigenvectors_; }

References eigenvectors_.

Referenced by fillPCAVariables().

◆ eigenvectors() [2/2]

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

Definition at line 137 of file Trackster.h.

137 { return eigenvectors_[index]; }

References eigenvectors_.

◆ 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.

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  }

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

◆ id_probabilities() [1/2]

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

Definition at line 140 of file Trackster.h.

140 { return id_probabilities_; }

References id_probabilities_.

◆ id_probabilities() [2/2]

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

Definition at line 141 of file Trackster.h.

141 { return id_probabilities_[index]; }

References id_probabilities_.

◆ id_probability()

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

Definition at line 144 of file Trackster.h.

144  {
145  // probabilities are stored in the same order as defined in the ParticleType enum
146  return id_probabilities_[(int)type];
147  }

References id_probabilities_, and createfilelist::int.

◆ raw_em_energy()

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

Definition at line 131 of file Trackster.h.

131 { return raw_em_energy_; }

References raw_em_energy_.

◆ raw_em_pt()

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

Definition at line 133 of file Trackster.h.

133 { return raw_em_pt_; }

References raw_em_pt_.

◆ raw_energy()

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

Definition at line 130 of file Trackster.h.

130 { return raw_energy_; }

References raw_energy_.

◆ raw_pt()

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

Definition at line 132 of file Trackster.h.

132 { return raw_pt_; }

References raw_pt_.

◆ regressed_energy()

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

Definition at line 129 of file Trackster.h.

129 { return regressed_energy_; }

References regressed_energy_.

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

◆ seedID()

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

Definition at line 125 of file Trackster.h.

125 { return seedID_; }

References seedID_.

◆ seedIndex()

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

Definition at line 126 of file Trackster.h.

126 { return seedIndex_; }

References seedIndex_.

◆ setBarycenter()

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

Definition at line 74 of file Trackster.h.

74 { barycenter_ = value; }

References barycenter_, and relativeConstraints::value.

◆ setEigenValuesVectors()

void ticl::Trackster::setEigenValuesVectors ( )
inline

◆ 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.

55 { iterationIndex_ = i; }

References mps_fire::i, and iterationIndex_.

◆ setProbabilities()

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

Definition at line 112 of file Trackster.h.

112  {
113  for (float &p : id_probabilities_) {
114  p = *(probs++);
115  }
116  }

References id_probabilities_, and AlCaHLTBitMon_ParallelJobs::p.

◆ setRawEmEnergy()

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

Definition at line 70 of file Trackster.h.

70 { raw_em_energy_ = value; }

References raw_em_energy_, and relativeConstraints::value.

◆ setRawEmPt()

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

Definition at line 73 of file Trackster.h.

73 { raw_em_pt_ = value; }

References raw_em_pt_, and relativeConstraints::value.

◆ setRawEnergy()

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

Definition at line 68 of file Trackster.h.

68 { raw_energy_ = value; }

References raw_energy_, and relativeConstraints::value.

◆ setRawPt()

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

Definition at line 72 of file Trackster.h.

72 { raw_pt_ = value; }

References raw_pt_, and relativeConstraints::value.

◆ setRegressedEnergy()

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

Definition at line 67 of file Trackster.h.

References regressed_energy_, and relativeConstraints::value.

◆ setSeed()

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

Definition at line 59 of file Trackster.h.

59  {
60  seedID_ = pid;
61  seedIndex_ = index;
62  }

References seedID_, and seedIndex_.

Referenced by TrackstersFromSimClustersProducer::produce().

◆ setTimeAndError()

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

Definition at line 63 of file Trackster.h.

63  {
64  time_ = t;
65  timeError_ = tError;
66  }

References submitPVValidationJobs::t, time_, and timeError_.

◆ sigmas()

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

Definition at line 138 of file Trackster.h.

138 { return sigmas_; }

References sigmas_.

Referenced by fillPCAVariables().

◆ sigmasPCA()

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

Definition at line 139 of file Trackster.h.

139 { return sigmasPCA_; }

References sigmasPCA_.

◆ ticlIteration()

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

Definition at line 119 of file Trackster.h.

119 { return (IterationIndex)iterationIndex_; }

References iterationIndex_.

◆ time()

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

Definition at line 127 of file Trackster.h.

127 { return time_; }

References time_.

Referenced by TICLCandidate::addTrackster().

◆ timeError()

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

Definition at line 128 of file Trackster.h.

128 { return timeError_; }

References timeError_.

Referenced by TICLCandidate::addTrackster().

◆ vertex_multiplicity() [1/3]

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

◆ vertex_multiplicity() [2/3]

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

Definition at line 122 of file Trackster.h.

122 { return vertex_multiplicity_; }

References vertex_multiplicity_.

◆ vertex_multiplicity() [3/3]

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

Definition at line 123 of file Trackster.h.

123 { return vertex_multiplicity_[index]; }

References vertex_multiplicity_.

◆ 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.

120 { return vertices_; }

References vertices_.

◆ vertices() [3/3]

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

Definition at line 121 of file Trackster.h.

121 { return vertices_[index]; }

References vertices_.

◆ zeroProbabilities()

void ticl::Trackster::zeroProbabilities ( )
inline

Definition at line 107 of file Trackster.h.

107  {
108  for (auto &p : id_probabilities_) {
109  p = 0.f;
110  }
111  }

References id_probabilities_, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by TrackstersFromSimClustersProducer::produce().

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

ticl::Trackster::Vector
math::XYZVector Vector
Definition: Trackster.h:21
muons2muons_cfi.photon
photon
Definition: muons2muons_cfi.py:28
ticl::Trackster::raw_em_energy_
float raw_em_energy_
Definition: Trackster.h:188
mps_fire.i
i
Definition: mps_fire.py:428
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
ticl::Trackster::eigenvalues_
std::array< float, 3 > eigenvalues_
Definition: Trackster.h:194
ticl::Trackster::raw_pt_
float raw_pt_
Definition: Trackster.h:189
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
detailsBasic3DVector::z
float float float z
Definition: extBasic3DVector.h:14
muon
Definition: MuonCocktails.h:17
ticl::Trackster::TRKEM
Definition: Trackster.h:23
ticl::Trackster::seedID_
edm::ProductID seedID_
Definition: Trackster.h:169
ticl::Trackster::vertices_
std::vector< unsigned int > vertices_
Definition: Trackster.h:155
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
ticl::Trackster::PCAOrdering::ascending
ticl::Trackster::EM
Definition: Trackster.h:23
ticl::Trackster::eigenvectors
const std::array< Vector, 3 > & eigenvectors() const
Definition: Trackster.h:136
ticl::Trackster::barycenter_
Vector barycenter_
Definition: Trackster.h:193
ticl::Trackster::iterationIndex_
uint8_t iterationIndex_
Definition: Trackster.h:151
ticl::Trackster::time_
float time_
Definition: Trackster.h:182
ticl::Trackster::HAD
Definition: Trackster.h:23
ticl::Trackster::edges_
std::vector< std::array< unsigned int, 2 > > edges_
Definition: Trackster.h:163
ticl::Trackster::zeroProbabilities
void zeroProbabilities()
Definition: Trackster.h:107
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
metsig::electron
Definition: SignAlgoResolutions.h:48
ticl::Trackster::raw_energy_
float raw_energy_
Definition: Trackster.h:187
ticl::Trackster::eigenvectors_
std::array< Vector, 3 > eigenvectors_
Definition: Trackster.h:195
ticl::Trackster::sigmas_
std::array< float, 3 > sigmas_
Definition: Trackster.h:196
ticl::Trackster::raw_em_pt_
float raw_em_pt_
Definition: Trackster.h:190
ticl::Trackster::IterationIndex
IterationIndex
Definition: Trackster.h:23
ticl::Trackster::MIP
Definition: Trackster.h:23
ticl::Trackster::vertex_multiplicity_
std::vector< uint8_t > vertex_multiplicity_
Definition: Trackster.h:156
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
eventshapeDQM_cfi.order
order
Definition: eventshapeDQM_cfi.py:8
createfilelist.int
int
Definition: createfilelist.py:10
ticl::Trackster::TRKHAD
Definition: Trackster.h:23
ticl::Trackster::seedIndex_
int seedIndex_
Definition: Trackster.h:175
perp2
T perp2() const
Squared magnitude of transverse component.
Definition: Basic3DVectorLD.h:130
ticl::Trackster::sigmas
const std::array< float, 3 > & sigmas() const
Definition: Trackster.h:138
relativeConstraints.value
value
Definition: relativeConstraints.py:53
ticl::Trackster::eigenvalues
const std::array< float, 3 > & eigenvalues() const
Definition: Trackster.h:135
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
ticl::Trackster::timeError_
float timeError_
Definition: Trackster.h:183
ticl::Trackster::id_probabilities_
std::array< float, 8 > id_probabilities_
Definition: Trackster.h:200
ticl::Trackster::sigmasPCA_
std::array< float, 3 > sigmasPCA_
Definition: Trackster.h:197
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
ticl::Trackster::regressed_energy_
float regressed_energy_
Definition: Trackster.h:186
susybsm::HSCParticleType::unknown
Definition: HSCParticle.h:20