Skip to content

Commit 00b95db

Browse files
committed
Changing model location input from string to relative file path
1 parent b14318c commit 00b95db

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

L1Trigger/L1TTrackMatch/interface/DisplacedVertexProducer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class DisplacedVertexProducer : public edm::global::EDProducer<> {
167167
const edm::EDGetTokenT<std::vector<TTTrack<Ref_Phase2TrackerDigi_>>> trackToken_;
168168
const edm::EDGetTokenT<std::vector<TTTrack<Ref_Phase2TrackerDigi_>>> trackGTTToken_;
169169
const std::string outputVertexCollectionName_;
170-
const std::string model_;
170+
const edm::FileInPath model_;
171171
const bool runEmulation_;
172172
const edm::ParameterSet cutSet_;
173173
const double chi2rzMax_, promptMVAMin_, ptMin_, etaMax_, dispD0Min_, promptMVADispTrackMin_, overlapEtaMin_,

L1Trigger/L1TTrackMatch/plugins/DisplacedVertexProducer.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ DisplacedVertexProducer::DisplacedVertexProducer(const edm::ParameterSet& iConfi
170170
trackGTTToken_(consumes<std::vector<TTTrack<Ref_Phase2TrackerDigi_>>>(
171171
iConfig.getParameter<edm::InputTag>("l1TracksGTTInputTag"))),
172172
outputVertexCollectionName_(iConfig.getParameter<std::string>("l1TrackVertexCollectionName")),
173-
model_(iConfig.getParameter<std::string>("model")),
173+
model_(iConfig.getParameter<edm::FileInPath>("model")),
174174
runEmulation_(iConfig.getParameter<bool>("runEmulation")),
175175
cutSet_(iConfig.getParameter<edm::ParameterSet>("cutSet")),
176176
chi2rzMax_(cutSet_.getParameter<double>("chi2rzMax")),
@@ -341,7 +341,8 @@ void DisplacedVertexProducer::produce(edm::StreamID, edm::Event& iEvent, const e
341341
vertex.R_T,
342342
vertex.cos_T,
343343
vertex.delta_z * 0.125};
344-
conifer::BDT<ap_fixed<13, 8, AP_RND_CONV, AP_SAT>, ap_fixed<13, 8, AP_RND_CONV, AP_SAT>> bdt(this->model_);
344+
conifer::BDT<ap_fixed<13, 8, AP_RND_CONV, AP_SAT>, ap_fixed<13, 8, AP_RND_CONV, AP_SAT>> bdt(
345+
this->model_.fullPath());
345346
std::vector<ap_fixed<13, 8, AP_RND_CONV, AP_SAT>> output = bdt.decision_function(Transformed_features);
346347
outputVertex.setScore(output.at(0).to_float());
347348
} else {
@@ -365,7 +366,7 @@ void DisplacedVertexProducer::produce(edm::StreamID, edm::Event& iEvent, const e
365366
vertex.R_T,
366367
vertex.cos_T,
367368
float(vertex.delta_z * 0.125)};
368-
conifer::BDT<float, float> bdt(this->model_);
369+
conifer::BDT<float, float> bdt(this->model_.fullPath());
369370
std::vector<float> output = bdt.decision_function(Transformed_features);
370371
outputVertex.setScore(output.at(0));
371372
}

L1Trigger/L1TTrackMatch/python/DisplacedVertexProducer_cfi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
l1TracksGTTInputTag = cms.InputTag("l1tGTTInputProducerExtended","Level1TTTracksExtendedConverted"),
66
l1TrackVertexCollectionName = cms.string("dispVertices"),
77
mcTruthTrackInputTag = cms.InputTag("TTTrackAssociatorFromPixelDigisExtended", "Level1TTTracks"),
8-
model = cms.string("/afs/cern.ch/user/r/rmccarth/private/dispVert/l1tOfflinePR/CMSSW_14_0_0_pre3/src/L1Trigger/L1TTrackMatch/data/dispVertTaggerEmulationConiferShifted13p8.json"),
9-
runEmulation = cms.bool(False),
8+
model = cms.FileInPath("L1Trigger/L1TTrackMatch/data/dispVertTaggerEmulationConiferShifted13p8.json"),
9+
runEmulation = cms.bool(True),
1010
cutSet = cms.PSet(
1111
chi2rzMax = cms.double(3.0), # chi2rz value for all tracks must be less than this
1212
promptMVAMin = cms.double(0.2), # prompt track quality MVA score for all tracks must be greater than this

0 commit comments

Comments
 (0)