Skip to content

Commit 506deee

Browse files
committed
making emulator chain working again.
1 parent b792903 commit 506deee

File tree

11 files changed

+26
-57
lines changed

11 files changed

+26
-57
lines changed

L1Trigger/TrackFindingTracklet/plugins/ProducerDR.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace trklet {
5555
// Setup token
5656
ESGetToken<Setup, SetupRcd> esGetTokenSetup_;
5757
// LayerEncoding token
58-
ESGetToken<LayerEncoding, ChannelAssignmentRcd> esGetTokenLayerEncoding_;
58+
ESGetToken<LayerEncoding, DataFormatsRcd> esGetTokenLayerEncoding_;
5959
// DataFormats token
6060
ESGetToken<DataFormats, ChannelAssignmentRcd> esGetTokenDataFormats_;
6161
// ChannelAssignment token

L1Trigger/TrackFindingTracklet/plugins/ProducerKF.cc

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ namespace trklet {
3838
~ProducerKF() override {}
3939

4040
private:
41-
void beginRun(const Run&, const EventSetup&) override;
4241
void produce(Event&, const EventSetup&) override;
4342
void endStream() override {
4443
if (printDebug_)
@@ -72,8 +71,6 @@ namespace trklet {
7271
KFParamsComb* tmtt_;
7372
// print end job internal unused MSB
7473
bool printDebug_;
75-
//
76-
bool use5ParameterFit_;
7774
};
7875

7976
ProducerKF::ProducerKF(const ParameterSet& iConfig)
@@ -123,9 +120,6 @@ namespace trklet {
123120
iConfig_.baseShiftC23_ = iConfig.getParameter<int>("BaseShiftC23");
124121
iConfig_.baseShiftC33_ = iConfig.getParameter<int>("BaseShiftC33");
125122
printDebug_ = iConfig.getParameter<bool>("PrintKFDebug");
126-
use5ParameterFit_ = iConfig.getParameter<bool>("Use5ParameterFit");
127-
if (use5ParameterFit_)
128-
tmtt_ = &tmtt5_;
129123
const string& label = iConfig.getParameter<string>("InputLabelKF");
130124
const string& branchStubs = iConfig.getParameter<string>("BranchStubs");
131125
const string& branchTracks = iConfig.getParameter<string>("BranchTracks");
@@ -143,21 +137,13 @@ namespace trklet {
143137
esGetTokenDataFormats_ = esConsumes();
144138
}
145139

146-
void ProducerKF::beginRun(const Run& iRun, const EventSetup& iSetup) {
140+
void ProducerKF::produce(Event& iEvent, const EventSetup& iSetup) {
147141
// helper class to store configurations
148142
const Setup* setup = &iSetup.getData(esGetTokenSetup_);
149143
settings_.setMagneticField(setup->bField());
150144
// helper class to extract structured data from tt::Frames
151145
const DataFormats* dataFormats = &iSetup.getData(esGetTokenDataFormats_);
152-
// provides dataformats of Kalman filter internals
153146
kalmanFilterFormats_.consume(dataFormats, iConfig_);
154-
}
155-
156-
void ProducerKF::produce(Event& iEvent, const EventSetup& iSetup) {
157-
// helper class to store configurations
158-
const Setup* setup = &iSetup.getData(esGetTokenSetup_);
159-
// helper class to extract structured data from tt::Frames
160-
const DataFormats* dataFormats = &iSetup.getData(esGetTokenDataFormats_);
161147
auto valid = [](int sum, const FrameTrack& f) { return sum + (f.first.isNull() ? 0 : 1); };
162148
// empty KF products
163149
StreamsStub streamsStub(setup->numRegions() * setup->numLayers());
@@ -170,7 +156,8 @@ namespace trklet {
170156
// prep TTTracks
171157
TTTracks ttTracks;
172158
vector<TTTrackRef> ttTrackRefs;
173-
if (use5ParameterFit_) {
159+
if (setup->kfUse5ParameterFit()) {
160+
tmtt_ = &tmtt5_;
174161
int nTracks(0);
175162
for (const StreamTrack& stream : tracks)
176163
nTracks += accumulate(stream.begin(), stream.end(), 0, valid);
@@ -189,7 +176,7 @@ namespace trklet {
189176
// fill output products
190177
kf.produce(streamsStub, streamsTrack, numStatesAccepted, numStatesTruncated);
191178
}
192-
if (use5ParameterFit_) {
179+
if (setup->kfUse5ParameterFit()) {
193180
// store ttTracks
194181
const OrphanHandle<TTTracks> oh = iEvent.emplace(edPutTokenTTTracks_, std::move(ttTracks));
195182
// replace ttTrackRefs in track streams

L1Trigger/TrackFindingTracklet/src/KalmanFilterFormats.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ namespace trklet {
172172
const double range = 4. * dPhi.range() * dPhi.range();
173173
const double base = S01.base();
174174
const int width = ceil(log2(range / base) - 1.e-11);
175-
return DataFormatKF(VariableKF::v0, true, iConfig.enableIntegerEmulation_, width, base, range);
175+
return DataFormatKF(VariableKF::v0, false, iConfig.enableIntegerEmulation_, width, base, range);
176176
}
177177

178178
template <>
@@ -182,7 +182,7 @@ namespace trklet {
182182
const double range = 4. * dZ.range() * dZ.range();
183183
const double base = S13.base();
184184
const int width = ceil(log2(range / base) - 1.e-11);
185-
return DataFormatKF(VariableKF::v1, true, iConfig.enableIntegerEmulation_, width, base, range);
185+
return DataFormatKF(VariableKF::v1, false, iConfig.enableIntegerEmulation_, width, base, range);
186186
}
187187

188188
template <>

L1Trigger/TrackFindingTracklet/test/AnalyzerDR.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#include "SimTracker/TrackTriggerAssociation/interface/StubAssociation.h"
1616
#include "L1Trigger/TrackTrigger/interface/Setup.h"
17-
#include "L1Trigger/TrackerTFP/interface/DataFormats.h"
17+
#include "L1Trigger/TrackFindingTracklet/interface/DataFormats.h"
1818
#include "L1Trigger/TrackFindingTracklet/interface/ChannelAssignment.h"
1919

2020
#include <TProfile.h>
@@ -30,7 +30,6 @@
3030

3131
using namespace std;
3232
using namespace edm;
33-
using namespace trackerTFP;
3433
using namespace tt;
3534

3635
namespace trklet {

L1Trigger/TrackFindingTracklet/test/AnalyzerTM.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#include "SimTracker/TrackTriggerAssociation/interface/StubAssociation.h"
1616
#include "L1Trigger/TrackTrigger/interface/Setup.h"
17-
#include "L1Trigger/TrackerTFP/interface/DataFormats.h"
17+
#include "L1Trigger/TrackFindingTracklet/interface/DataFormats.h"
1818
#include "L1Trigger/TrackFindingTracklet/interface/ChannelAssignment.h"
1919

2020
#include <TProfile.h>
@@ -30,7 +30,6 @@
3030

3131
using namespace std;
3232
using namespace edm;
33-
using namespace trackerTFP;
3433
using namespace tt;
3534

3635
namespace trklet {

L1Trigger/TrackFindingTracklet/test/AnalyzerTracklet.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#include "SimTracker/TrackTriggerAssociation/interface/StubAssociation.h"
1616
#include "L1Trigger/TrackTrigger/interface/Setup.h"
17-
#include "L1Trigger/TrackerTFP/interface/DataFormats.h"
17+
#include "L1Trigger/TrackFindingTracklet/interface/DataFormats.h"
1818
#include "L1Trigger/TrackFindingTracklet/interface/ChannelAssignment.h"
1919

2020
#include <TProfile.h>
@@ -30,7 +30,6 @@
3030

3131
using namespace std;
3232
using namespace edm;
33-
using namespace trackerTFP;
3433
using namespace tt;
3534

3635
namespace trklet {

L1Trigger/TrackTrigger/interface/Setup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ namespace tt {
222222
// returns bit accurate hybrid stub radius for given TTStubRef and h/w bit word
223223
double stubR(const TTBV& hw, const TTStubRef& ttStubRef) const;
224224
// returns bit accurate position of a stub from a given tfp region [0-8]
225-
GlobalPoint stubPos(bool hybrid, const tt::FrameStub& frame, int region) const;
225+
GlobalPoint stubPos(const tt::FrameStub& frame, int region) const;
226226
// empty trackerDTC EDProduct
227227
TTDTC ttDTC() const { return TTDTC(numRegions_, numOverlappingRegions_, numDTCsPerRegion_); }
228228
// stub layer id (barrel: 1 - 6, endcap: 11 - 15)

L1Trigger/TrackTrigger/src/Setup.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,12 +638,12 @@ namespace tt {
638638
}
639639

640640
// returns bit accurate position of a stub from a given tfp region [0-8]
641-
GlobalPoint Setup::stubPos(bool hybrid, const FrameStub& frame, int region) const {
641+
GlobalPoint Setup::stubPos(const FrameStub& frame, int region) const {
642642
GlobalPoint p;
643643
if (frame.first.isNull())
644644
return p;
645645
TTBV bv(frame.second);
646-
if (hybrid) {
646+
if (useHybrid_) {
647647
const bool barrel = this->barrel(frame.first);
648648
const int layerId = this->indexLayerId(frame.first);
649649
const GlobalPoint gp = this->stubPos(frame.first);

L1Trigger/TrackerDTC/test/Analyzer.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ namespace trackerDTC {
9494
const Setup* setup_;
9595
// enables analyze of TPs
9696
bool useMCTruth_;
97-
// specifies used TT algorithm
98-
bool hybrid_;
9997
//
10098
int nEvents_ = 0;
10199

@@ -118,8 +116,7 @@ namespace trackerDTC {
118116
stringstream log_;
119117
};
120118

121-
Analyzer::Analyzer(const ParameterSet& iConfig)
122-
: useMCTruth_(iConfig.getParameter<bool>("UseMCTruth")), hybrid_(iConfig.getParameter<bool>("UseHybrid")) {
119+
Analyzer::Analyzer(const ParameterSet& iConfig) : useMCTruth_(iConfig.getParameter<bool>("UseMCTruth")) {
123120
usesResource("TFileService");
124121
// book in- and output ED products
125122
const auto& inputTagAccepted = iConfig.getParameter<InputTag>("InputTagAccepted");
@@ -315,7 +312,7 @@ namespace trackerDTC {
315312
if (frame.first.isNull())
316313
continue;
317314
sum++;
318-
const GlobalPoint& pos = setup_->stubPos(hybrid_, frame, region);
315+
const GlobalPoint& pos = setup_->stubPos(frame, region);
319316
const GlobalPoint& ttPos = setup_->stubPos(frame.first);
320317
const vector<double> resolutions = {
321318
ttPos.perp() - pos.perp(), deltaPhi(ttPos.phi() - pos.phi()), ttPos.z() - pos.z()};

L1Trigger/TrackerTFP/plugins/ProducerLayerEncoding.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include "FWCore/ParameterSet/interface/ParameterSet.h"
44
#include "FWCore/Utilities/interface/ESGetToken.h"
55
#include "FWCore/Utilities/interface/ESInputTag.h"
6-
#include "DataFormats/Provenance/interface/ParameterSetID.h"
76
#include "L1Trigger/TrackerTFP/interface/LayerEncoding.h"
87

98
#include <memory>

0 commit comments

Comments
 (0)