CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
trackerTFP::State Class Reference

#include <State.h>

Public Member Functions

double C00 () const
 
double C01 () const
 
double C11 () const
 
double C22 () const
 
double C23 () const
 
double C33 () const
 
double dPhi () const
 
double dZ () const
 
void fill (std::vector< StubKF > &stubs) const
 
void finish ()
 
tt::FrameTrack frame () const
 
double H00 () const
 
double H12 () const
 
const TTBVhitPattern () const
 
int layer () const
 
const std::vector< int > & layerMap () const
 
double m0 () const
 
double m1 () const
 
TTBV maybePattern () const
 
int numConsistentLayers () const
 
int numSkippedLayers () const
 
Stateparent () const
 
 State (State *state)
 
 State (const DataFormats *dataFormats, TrackKFin *track, int trackId)
 
 State (State *state, StubKFin *stub)
 
 State (State *state, const std::vector< double > &doubles)
 
StubKFinstub () const
 
TrackKFintrack () const
 
int trackId () const
 
double v0 () const
 
double v1 () const
 
double x0 () const
 
double x1 () const
 
double x2 () const
 
double x3 () const
 
 ~State ()
 

Private Attributes

double C00_
 
double C01_
 
double C11_
 
double C22_
 
double C23_
 
double C33_
 
const DataFormatsdataFormats_
 
TTBV hitPattern_
 
std::vector< int > layerMap_
 
int numConsistentLayers_
 
int numSkippedLayers_
 
Stateparent_
 
const tt::Setupsetup_
 
StubKFinstub_
 
TrackKFintrack_
 
int trackId_
 
double x0_
 
double x1_
 
double x2_
 
double x3_
 

Detailed Description

Definition at line 13 of file State.h.

Constructor & Destructor Documentation

◆ State() [1/4]

State::State ( State state)

Definition at line 9 of file State.cc.

10  : dataFormats_(state->dataFormats_),
11  setup_(state->setup_),
12  track_(state->track_),
13  trackId_(state->trackId_),
14  parent_(state->parent_),
15  stub_(state->stub_),
16  layerMap_(state->layerMap_),
17  hitPattern_(state->hitPattern_),
18  x0_(state->x0_),
19  x1_(state->x1_),
20  x2_(state->x2_),
21  x3_(state->x3_),
22  C00_(state->C00_),
23  C01_(state->C01_),
24  C11_(state->C11_),
25  C22_(state->C22_),
26  C23_(state->C23_),
27  C33_(state->C33_),
28  numSkippedLayers_(state->numSkippedLayers_),
29  numConsistentLayers_(state->numConsistentLayers_) {}
double C22_
Definition: State.h:119
StubKFin * stub_
Definition: State.h:100
double x3_
Definition: State.h:112
TrackKFin * track_
Definition: State.h:94
int numSkippedLayers_
Definition: State.h:124
double C33_
Definition: State.h:121
double x0_
Definition: State.h:106
double C23_
Definition: State.h:120
std::vector< int > layerMap_
Definition: State.h:102
TTBV hitPattern_
Definition: State.h:104
const DataFormats * dataFormats_
Definition: State.h:90
const tt::Setup * setup_
Definition: State.h:92
double C01_
Definition: State.h:117
double x2_
Definition: State.h:110
double C00_
Definition: State.h:116
int numConsistentLayers_
Definition: State.h:126
double x1_
Definition: State.h:108
double C11_
Definition: State.h:118
State * parent_
Definition: State.h:98

◆ State() [2/4]

State::State ( const DataFormats dataFormats,
TrackKFin track,
int  trackId 
)

Definition at line 32 of file State.cc.

References trackerTFP::DataFormats::base(), C00_, C01_, C11_, C22_, C23_, C33_, trackerTFP::cot, dataFormats_, trackerTFP::TrackKFin::hitPattern(), trackerTFP::inv2R, trackerTFP::kfin, tt::Setup::kfShiftInitialC00(), tt::Setup::kfShiftInitialC11(), tt::Setup::kfShiftInitialC22(), tt::Setup::kfShiftInitialC33(), trackerTFP::TrackKFin::layerStub(), trackerTFP::phiT, TTBV::plEncode(), funct::pow(), setup_, stub_, track(), x0_, x1_, x2_, x3_, and trackerTFP::zT.

33  : dataFormats_(dataFormats),
34  setup_(dataFormats->setup()),
35  track_(track),
37  parent_(nullptr),
38  stub_(nullptr),
43  // initial track parameter residuals w.r.t. found track
44  x0_ = 0.;
45  x1_ = 0.;
46  x2_ = 0.;
47  x3_ = 0.;
48  // initial uncertainties
53  C01_ = 0.;
54  C23_ = 0.;
55  // first stub from first layer on input track with stubs
57  }
StubKFin * layerStub(int layer) const
Definition: DataFormats.h:934
double base(Variable v, Process p) const
Definition: DataFormats.h:492
double C22_
Definition: State.h:119
int plEncode(bool b=true) const
Definition: TTBV.h:306
StubKFin * stub_
Definition: State.h:100
double x3_
Definition: State.h:112
TrackKFin * track_
Definition: State.h:94
int numSkippedLayers_
Definition: State.h:124
double C33_
Definition: State.h:121
double x0_
Definition: State.h:106
double C23_
Definition: State.h:120
std::vector< int > layerMap_
Definition: State.h:102
int kfShiftInitialC00() const
Definition: Setup.h:499
TTBV hitPattern() const
Definition: DataFormats.h:926
TTBV hitPattern_
Definition: State.h:104
const DataFormats * dataFormats_
Definition: State.h:90
const tt::Setup * setup_
Definition: State.h:92
double C01_
Definition: State.h:117
double x2_
Definition: State.h:110
int numLayers() const
Definition: Setup.h:215
TrackKFin * track() const
Definition: State.h:32
double C00_
Definition: State.h:116
int numConsistentLayers_
Definition: State.h:126
int kfShiftInitialC11() const
Definition: Setup.h:501
double x1_
Definition: State.h:108
double C11_
Definition: State.h:118
State * parent_
Definition: State.h:98
int kfShiftInitialC22() const
Definition: Setup.h:503
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
int kfShiftInitialC33() const
Definition: Setup.h:505
int trackId() const
Definition: State.h:40

◆ State() [3/4]

State::State ( State state,
StubKFin stub 
)

Definition at line 60 of file State.cc.

References parent_, stub(), and stub_.

60  : State(state) {
61  parent_ = state->parent();
62  stub_ = stub;
63  }
StubKFin * stub_
Definition: State.h:100
StubKFin * stub() const
Definition: State.h:36
State * parent_
Definition: State.h:98
State(State *state)
Definition: State.cc:9

◆ State() [4/4]

State::State ( State state,
const std::vector< double > &  doubles 
)

Definition at line 66 of file State.cc.

References C00_, C01_, C11_, C22_, C23_, C33_, TTBV::count(), HLT_2024v10_cff::distance, spr::find(), trackerTFP::TrackKFin::hitPattern(), hitPattern_, tt::Setup::kfMaxLayers(), layer(), trackerTFP::StubKFin::layer(), layerMap_, trackerTFP::TrackKFin::layerStub(), trackerTFP::TrackKFin::layerStubs(), tt::Setup::numLayers(), parent_, TTBV::set(), setup_, stub_, track_, x0_, x1_, x2_, and x3_.

66  : State(state) {
67  parent_ = state;
68  // updated track parameter and uncertainties
69  x0_ = doubles[0];
70  x1_ = doubles[1];
71  x2_ = doubles[2];
72  x3_ = doubles[3];
73  C00_ = doubles[4];
74  C11_ = doubles[5];
75  C22_ = doubles[6];
76  C33_ = doubles[7];
77  C01_ = doubles[8];
78  C23_ = doubles[9];
79  // update maps
80  const int layer = stub_->layer();
82  const vector<StubKFin*>& stubs = track_->layerStubs(layer);
83  layerMap_[layer] = distance(stubs.begin(), find(stubs.begin(), stubs.end(), stub_));
84  // pick next stub (first stub in next layer with stub)
85  stub_ = nullptr;
86  if (hitPattern_.count() == setup_->kfMaxLayers())
87  return;
88  for (int nextLayer = layer + 1; nextLayer < setup_->numLayers(); nextLayer++) {
89  if (track_->hitPattern(nextLayer)) {
90  stub_ = track_->layerStub(nextLayer);
91  break;
92  }
93  }
94  }
StubKFin * layerStub(int layer) const
Definition: DataFormats.h:934
double C22_
Definition: State.h:119
StubKFin * stub_
Definition: State.h:100
double x3_
Definition: State.h:112
TrackKFin * track_
Definition: State.h:94
double C33_
Definition: State.h:121
ROOT::VecOps::RVec< double > doubles
Definition: Resolutions.cc:7
double x0_
Definition: State.h:106
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
double C23_
Definition: State.h:120
std::vector< int > layerMap_
Definition: State.h:102
int kfMaxLayers() const
Definition: Setup.h:495
TTBV hitPattern() const
Definition: DataFormats.h:926
TTBV hitPattern_
Definition: State.h:104
int count() const
Definition: TTBV.h:88
const tt::Setup * setup_
Definition: State.h:92
double C01_
Definition: State.h:117
double x2_
Definition: State.h:110
TTBV & set()
Definition: TTBV.h:187
int numLayers() const
Definition: Setup.h:215
int layer() const
Definition: State.h:46
double C00_
Definition: State.h:116
std::vector< StubKFin * > layerStubs(int layer) const
Definition: DataFormats.h:932
double x1_
Definition: State.h:108
double C11_
Definition: State.h:118
State * parent_
Definition: State.h:98
State(State *state)
Definition: State.cc:9

◆ ~State()

trackerTFP::State::~State ( )
inline

Definition at line 23 of file State.h.

23 {}

Member Function Documentation

◆ C00()

double trackerTFP::State::C00 ( ) const
inline

Definition at line 56 of file State.h.

References C00_.

56 { return C00_; }
double C00_
Definition: State.h:116

◆ C01()

double trackerTFP::State::C01 ( ) const
inline

Definition at line 58 of file State.h.

References C01_.

58 { return C01_; }
double C01_
Definition: State.h:117

◆ C11()

double trackerTFP::State::C11 ( ) const
inline

Definition at line 60 of file State.h.

References C11_.

60 { return C11_; }
double C11_
Definition: State.h:118

◆ C22()

double trackerTFP::State::C22 ( ) const
inline

Definition at line 62 of file State.h.

References C22_.

62 { return C22_; }
double C22_
Definition: State.h:119

◆ C23()

double trackerTFP::State::C23 ( ) const
inline

Definition at line 64 of file State.h.

References C23_.

64 { return C23_; }
double C23_
Definition: State.h:120

◆ C33()

double trackerTFP::State::C33 ( ) const
inline

Definition at line 66 of file State.h.

References C33_.

66 { return C33_; }
double C33_
Definition: State.h:121

◆ dPhi()

double trackerTFP::State::dPhi ( ) const
inline

Definition at line 76 of file State.h.

References trackerTFP::StubKFin::dPhi(), and stub_.

76 { return stub_->dPhi(); }
double dPhi() const
Definition: DataFormats.h:808
StubKFin * stub_
Definition: State.h:100

◆ dZ()

double trackerTFP::State::dZ ( ) const
inline

Definition at line 78 of file State.h.

References trackerTFP::StubKFin::dZ(), and stub_.

78 { return stub_->dZ(); }
StubKFin * stub_
Definition: State.h:100
double dZ() const
Definition: DataFormats.h:810

◆ fill()

void State::fill ( std::vector< StubKF > &  stubs) const

Definition at line 97 of file State.cc.

References TTBV::count(), hitPattern_, parent_, alignCSCRings::s, x0_, x1_, x2_, and x3_.

Referenced by finish().

97  {
98  stubs.reserve(hitPattern_.count());
99  State* s = parent_;
100  while (s) {
101  stubs.emplace_back(*(s->stub()), x0_, x1_, x2_, x3_);
102  s = s->parent();
103  }
104  }
double x3_
Definition: State.h:112
double x0_
Definition: State.h:106
TTBV hitPattern_
Definition: State.h:104
int count() const
Definition: TTBV.h:88
double x2_
Definition: State.h:110
double x1_
Definition: State.h:108
State * parent_
Definition: State.h:98

◆ finish()

void State::finish ( )

Definition at line 107 of file State.cc.

References funct::abs(), dataFormats_, trackerTFP::StubKFin::dPhi(), trackerTFP::StubKFin::dZ(), fill(), trackerTFP::DataFormats::format(), hitPattern_, trackerTFP::kf, maybePattern(), numConsistentLayers_, numSkippedLayers_, topSingleLeptonDQM_PU_cfi::pattern, trackerTFP::phi, trackerTFP::StubKFin::phi(), TTBV::pmEncode(), stub(), trackerTFP::z, and trackerTFP::StubKFin::z().

Referenced by progressbar.ProgressBar::__next__().

107  {
108  auto consistent = [this](int sum, const StubKF& stub) {
111  // Check stub consistent with helix, allowing for stub uncertainty
112  const bool inRange0 = 2. * abs(stub.phi()) - stub.dPhi() < phi.base();
113  const bool inRange1 = 2. * abs(stub.z()) - stub.dZ() < z.base();
114  return sum + (inRange0 && inRange1 ? 1 : 0);
115  };
116  vector<StubKF> stubs;
117  fill(stubs);
118  numConsistentLayers_ = accumulate(stubs.begin(), stubs.end(), 0, consistent);
120  pattern |= maybePattern();
121  // Skipped layers before final stub on state
122  numSkippedLayers_ = pattern.count(0, hitPattern_.pmEncode(), false);
123  }
double dPhi() const
Definition: DataFormats.h:808
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
Definition: TTBV.h:20
double z() const
Definition: DataFormats.h:806
int numSkippedLayers_
Definition: State.h:124
TTBV hitPattern_
Definition: State.h:104
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const DataFormats * dataFormats_
Definition: State.h:90
void fill(std::vector< StubKF > &stubs) const
Definition: State.cc:97
StubKFin * stub() const
Definition: State.h:36
int numConsistentLayers_
Definition: State.h:126
TTBV maybePattern() const
Definition: State.h:42
double dZ() const
Definition: DataFormats.h:810
int pmEncode(bool b=true) const
Definition: TTBV.h:314
double phi() const
Definition: DataFormats.h:804
const DataFormat & format(Variable v, Process p) const
Definition: DataFormats.h:506

◆ frame()

tt::FrameTrack trackerTFP::State::frame ( ) const
inline

Definition at line 84 of file State.h.

References trackerTFP::Track< Ts >::frame(), track_, x0_, x1_, x2_, and x3_.

84 { return TrackKF(*track_, x1_, x0_, x3_, x2_).frame(); }
double x3_
Definition: State.h:112
TrackKFin * track_
Definition: State.h:94
double x0_
Definition: State.h:106
double x2_
Definition: State.h:110
double x1_
Definition: State.h:108

◆ H00()

double trackerTFP::State::H00 ( ) const
inline

Definition at line 68 of file State.h.

References trackerTFP::StubKFin::r(), and stub_.

68 { return stub_->r(); }
double r() const
Definition: DataFormats.h:802
StubKFin * stub_
Definition: State.h:100

◆ H12()

double trackerTFP::State::H12 ( ) const
inline

Definition at line 70 of file State.h.

References trackerTFP::DataFormats::chosenRofPhi(), tt::Setup::chosenRofZ(), dataFormats_, trackerTFP::StubKFin::r(), setup_, and stub_.

70 { return stub_->r() + dataFormats_->chosenRofPhi() - setup_->chosenRofZ(); }
double r() const
Definition: DataFormats.h:802
double chosenRofZ() const
Definition: Setup.h:417
StubKFin * stub_
Definition: State.h:100
double chosenRofPhi() const
Definition: DataFormats.h:508
const DataFormats * dataFormats_
Definition: State.h:90
const tt::Setup * setup_
Definition: State.h:92

◆ hitPattern()

const TTBV& trackerTFP::State::hitPattern ( ) const
inline

Definition at line 38 of file State.h.

References hitPattern_.

38 { return hitPattern_; }
TTBV hitPattern_
Definition: State.h:104

◆ layer()

int trackerTFP::State::layer ( ) const
inline

Definition at line 46 of file State.h.

References trackerTFP::StubKFin::layer(), and stub_.

Referenced by geometryXMLparser.DTAlignable::index(), geometryXMLparser.CSCAlignable::index(), and State().

46 { return stub_->layer(); }
StubKFin * stub_
Definition: State.h:100

◆ layerMap()

const std::vector<int>& trackerTFP::State::layerMap ( ) const
inline

Definition at line 44 of file State.h.

References layerMap_.

44 { return layerMap_; }
std::vector< int > layerMap_
Definition: State.h:102

◆ m0()

double trackerTFP::State::m0 ( ) const
inline

Definition at line 72 of file State.h.

References trackerTFP::StubKFin::phi(), and stub_.

72 { return stub_->phi(); }
StubKFin * stub_
Definition: State.h:100
double phi() const
Definition: DataFormats.h:804

◆ m1()

double trackerTFP::State::m1 ( ) const
inline

Definition at line 74 of file State.h.

References stub_, and trackerTFP::StubKFin::z().

74 { return stub_->z(); }
StubKFin * stub_
Definition: State.h:100
double z() const
Definition: DataFormats.h:806

◆ maybePattern()

TTBV trackerTFP::State::maybePattern ( ) const
inline

Definition at line 42 of file State.h.

References trackerTFP::TrackKFin::maybePattern(), and track_.

Referenced by finish().

42 { return track_->maybePattern(); }
const TTBV & maybePattern() const
Definition: DataFormats.h:912
TrackKFin * track_
Definition: State.h:94

◆ numConsistentLayers()

int trackerTFP::State::numConsistentLayers ( ) const
inline

Definition at line 30 of file State.h.

References numConsistentLayers_.

Referenced by trackerTFP::KalmanFilter::accumulator().

30 { return numConsistentLayers_; }
int numConsistentLayers_
Definition: State.h:126

◆ numSkippedLayers()

int trackerTFP::State::numSkippedLayers ( ) const
inline

Definition at line 28 of file State.h.

References numSkippedLayers_.

Referenced by trackerTFP::KalmanFilter::accumulator().

28 { return numSkippedLayers_; }
int numSkippedLayers_
Definition: State.h:124

◆ parent()

State* trackerTFP::State::parent ( void  ) const
inline

Definition at line 34 of file State.h.

References parent_.

34 { return parent_; }
State * parent_
Definition: State.h:98

◆ stub()

StubKFin* trackerTFP::State::stub ( ) const
inline

Definition at line 36 of file State.h.

References stub_.

Referenced by finish(), and State().

36 { return stub_; }
StubKFin * stub_
Definition: State.h:100

◆ track()

TrackKFin* trackerTFP::State::track ( ) const
inline

Definition at line 32 of file State.h.

References track_.

Referenced by trackerTFP::KalmanFilter::accumulator(), and State().

32 { return track_; }
TrackKFin * track_
Definition: State.h:94

◆ trackId()

int trackerTFP::State::trackId ( ) const
inline

Definition at line 40 of file State.h.

References trackId_.

Referenced by trackerTFP::KalmanFilter::accumulator().

40 { return trackId_; }

◆ v0()

double trackerTFP::State::v0 ( ) const
inline

Definition at line 80 of file State.h.

References trackerTFP::StubKFin::dPhi(), funct::pow(), and stub_.

80 { return pow(stub_->dPhi(), 2); }
double dPhi() const
Definition: DataFormats.h:808
StubKFin * stub_
Definition: State.h:100
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

◆ v1()

double trackerTFP::State::v1 ( ) const
inline

Definition at line 82 of file State.h.

References trackerTFP::StubKFin::dZ(), funct::pow(), and stub_.

82 { return pow(stub_->dZ(), 2); }
StubKFin * stub_
Definition: State.h:100
double dZ() const
Definition: DataFormats.h:810
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

◆ x0()

double trackerTFP::State::x0 ( ) const
inline

Definition at line 48 of file State.h.

References x0_.

48 { return x0_; }
double x0_
Definition: State.h:106

◆ x1()

double trackerTFP::State::x1 ( void  ) const
inline

◆ x2()

double trackerTFP::State::x2 ( void  ) const
inline

◆ x3()

double trackerTFP::State::x3 ( void  ) const
inline

Definition at line 54 of file State.h.

References x3_.

54 { return x3_; }
double x3_
Definition: State.h:112

Member Data Documentation

◆ C00_

double trackerTFP::State::C00_
private

Definition at line 116 of file State.h.

Referenced by C00(), and State().

◆ C01_

double trackerTFP::State::C01_
private

Definition at line 117 of file State.h.

Referenced by C01(), and State().

◆ C11_

double trackerTFP::State::C11_
private

Definition at line 118 of file State.h.

Referenced by C11(), and State().

◆ C22_

double trackerTFP::State::C22_
private

Definition at line 119 of file State.h.

Referenced by C22(), and State().

◆ C23_

double trackerTFP::State::C23_
private

Definition at line 120 of file State.h.

Referenced by C23(), and State().

◆ C33_

double trackerTFP::State::C33_
private

Definition at line 121 of file State.h.

Referenced by C33(), and State().

◆ dataFormats_

const DataFormats* trackerTFP::State::dataFormats_
private

Definition at line 90 of file State.h.

Referenced by finish(), H12(), and State().

◆ hitPattern_

TTBV trackerTFP::State::hitPattern_
private

Definition at line 104 of file State.h.

Referenced by fill(), finish(), hitPattern(), and State().

◆ layerMap_

std::vector<int> trackerTFP::State::layerMap_
private

Definition at line 102 of file State.h.

Referenced by layerMap(), and State().

◆ numConsistentLayers_

int trackerTFP::State::numConsistentLayers_
private

Definition at line 126 of file State.h.

Referenced by finish(), and numConsistentLayers().

◆ numSkippedLayers_

int trackerTFP::State::numSkippedLayers_
private

Definition at line 124 of file State.h.

Referenced by finish(), and numSkippedLayers().

◆ parent_

State* trackerTFP::State::parent_
private

Definition at line 98 of file State.h.

Referenced by fill(), parent(), and State().

◆ setup_

const tt::Setup* trackerTFP::State::setup_
private

Definition at line 92 of file State.h.

Referenced by H12(), upgradeWorkflowComponents.UpgradeWorkflow::setup(), and State().

◆ stub_

StubKFin* trackerTFP::State::stub_
private

Definition at line 100 of file State.h.

Referenced by dPhi(), dZ(), H00(), H12(), layer(), m0(), m1(), State(), stub(), v0(), and v1().

◆ track_

TrackKFin* trackerTFP::State::track_
private

Definition at line 94 of file State.h.

Referenced by frame(), maybePattern(), State(), and track().

◆ trackId_

int trackerTFP::State::trackId_
private

Definition at line 96 of file State.h.

Referenced by trackId().

◆ x0_

double trackerTFP::State::x0_
private

Definition at line 106 of file State.h.

Referenced by fill(), frame(), State(), and x0().

◆ x1_

double trackerTFP::State::x1_
private

Definition at line 108 of file State.h.

Referenced by fill(), frame(), State(), and x1().

◆ x2_

double trackerTFP::State::x2_
private

Definition at line 110 of file State.h.

Referenced by fill(), frame(), State(), and x2().

◆ x3_

double trackerTFP::State::x3_
private

Definition at line 112 of file State.h.

Referenced by fill(), frame(), State(), and x3().