Skip to content

Commit e51e86a

Browse files
committed
quinnanm 1
1 parent 737ebdb commit e51e86a

File tree

83 files changed

+3089
-3234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+3089
-3234
lines changed

DataFormats/L1TrackTrigger/src/TTDTC.cc

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33

44
#include <numeric>
55

6-
using namespace std;
7-
using namespace edm;
8-
using namespace tt;
9-
106
TTDTC::TTDTC(int numRegions, int numOverlappingRegions, int numDTCsPerRegion)
117
: numRegions_(numRegions),
128
numOverlappingRegions_(numOverlappingRegions),
@@ -15,13 +11,13 @@ TTDTC::TTDTC(int numRegions, int numOverlappingRegions, int numDTCsPerRegion)
1511
regions_(numRegions_),
1612
channels_(numDTCsPerTFP_),
1713
streams_(numRegions_ * numDTCsPerTFP_) {
18-
iota(regions_.begin(), regions_.end(), 0);
19-
iota(channels_.begin(), channels_.end(), 0);
14+
std::iota(regions_.begin(), regions_.end(), 0);
15+
std::iota(channels_.begin(), channels_.end(), 0);
2016
}
2117

2218
// write one specific stream of TTStubRefs using DTC identifier (region[0-8], board[0-23], channel[0-1])
2319
// dtcRegions aka detector regions are defined by tk layout
24-
void TTDTC::setStream(int dtcRegion, int dtcBoard, int dtcChannel, const StreamStub& stream) {
20+
void TTDTC::setStream(int dtcRegion, int dtcBoard, int dtcChannel, const tt::StreamStub& stream) {
2521
// check arguments
2622
const bool oorRegion = dtcRegion >= numRegions_ || dtcRegion < 0;
2723
const bool oorBoard = dtcBoard >= numDTCsPerRegion_ || dtcBoard < 0;
@@ -45,7 +41,7 @@ void TTDTC::setStream(int dtcRegion, int dtcBoard, int dtcChannel, const StreamS
4541

4642
// read one specific stream of TTStubRefs using TFP identifier (region[0-8], channel[0-47])
4743
// tfpRegions aka processing regions are rotated by -0.5 region width w.r.t detector regions
48-
const StreamStub& TTDTC::stream(int tfpRegion, int tfpChannel) const {
44+
const tt::StreamStub& TTDTC::stream(int tfpRegion, int tfpChannel) const {
4945
// check arguments
5046
const bool oorRegion = tfpRegion >= numRegions_ || tfpRegion < 0;
5147
const bool oorChannel = tfpChannel >= numDTCsPerTFP_ || tfpChannel < 0;
@@ -65,25 +61,25 @@ const StreamStub& TTDTC::stream(int tfpRegion, int tfpChannel) const {
6561

6662
// total number of frames
6763
int TTDTC::size() const {
68-
auto all = [](int sum, const StreamStub& stream) { return sum + stream.size(); };
69-
return accumulate(streams_.begin(), streams_.end(), 0, all);
64+
auto all = [](int sum, const tt::StreamStub& stream) { return sum + stream.size(); };
65+
return std::accumulate(streams_.begin(), streams_.end(), 0, all);
7066
}
7167

7268
// total number of stubs
7369
int TTDTC::nStubs() const {
74-
auto stubs = [](int sum, const FrameStub& frame) { return sum + frame.first.isNonnull(); };
70+
auto stubs = [](int sum, const tt::FrameStub& frame) { return sum + frame.first.isNonnull(); };
7571
int n(0);
76-
for (const StreamStub& stream : streams_)
77-
n += accumulate(stream.begin(), stream.end(), 0, stubs);
72+
for (const tt::StreamStub& stream : streams_)
73+
n += std::accumulate(stream.begin(), stream.end(), 0, stubs);
7874
return n;
7975
}
8076

8177
// total number of gaps
8278
int TTDTC::nGaps() const {
83-
auto gaps = [](int sum, const FrameStub& frame) { return sum + frame.first.isNull(); };
79+
auto gaps = [](int sum, const tt::FrameStub& frame) { return sum + frame.first.isNull(); };
8480
int n(0);
85-
for (const StreamStub& stream : streams_)
86-
n += accumulate(stream.begin(), stream.end(), 0, gaps);
81+
for (const tt::StreamStub& stream : streams_)
82+
n += std::accumulate(stream.begin(), stream.end(), 0, gaps);
8783
return n;
8884
}
8985

L1Trigger/TrackFindingTracklet/interface/KalmanFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,4 @@ namespace trklet {
154154

155155
} // namespace trklet
156156

157-
#endif
157+
#endif

L1Trigger/TrackFindingTracklet/interface/KalmanFilterFormats.h

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,28 @@ enabling tuning of bit widths
1919

2020
namespace trklet {
2121

22+
/*
23+
* All variable names & equations come from Fruhwirth KF paper
24+
* http://dx.doi.org/10.1016/0168-9002%2887%2990887-4
25+
* Summary of variables:
26+
* m = hit position (phi,z)
27+
* V = hit position 2x2 covariance matrix in (phi,z).
28+
* x = helix params
29+
* C = helix params 4x4 covariance matrix
30+
* r = residuals
31+
* H = 2x4 derivative matrix (expected stub position w.r.t. helix params)
32+
* K = KF gain 2x2 matrix
33+
* x' & C': Updated values of x & C after KF iteration
34+
* Boring: F = unit matrix; pxcov = C
35+
* Summary of equations:
36+
* S = H*C (2x4 matrix); St = Transpose S
37+
* R = V + H*C*Ht (KF paper) = V + H*St (used here at simpler): 2x2 matrix
38+
* Rinv = Inverse R
39+
* K = St * Rinv : 2x2 Kalman gain matrix * det(R)
40+
* r = m - H*x
41+
* x' = x + K*r
42+
* C' = C - K*H*C (KF paper) = C - K*S (used here as simpler)
43+
*/
2244
enum class VariableKF {
2345
begin,
2446
x0 = begin,
@@ -160,7 +182,7 @@ namespace trklet {
160182
const tt::Setup* setup() const { return dataFormats_->setup(); }
161183
const DataFormats* dataFormats() const { return dataFormats_; }
162184
void consume(const DataFormats* dataFormats, const ConfigKF& iConfig);
163-
void endJob();
185+
void endJob(std::stringstream& ss);
164186

165187
private:
166188
template <VariableKF it = VariableKF::begin>

L1Trigger/TrackFindingTracklet/interface/State.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,4 @@ namespace trklet {
140140

141141
} // namespace trklet
142142

143-
#endif
143+
#endif

L1Trigger/TrackFindingTracklet/interface/TrackFindingProcessor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ namespace trklet {
8888

8989
} // namespace trklet
9090

91-
#endif
91+
#endif

0 commit comments

Comments
 (0)