Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track classifier using TensorFlow - continuation #32128

Merged
merged 32 commits into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0fa14ea
Add a record and a producer for holding tensorflow graphDef
Sep 22, 2020
4e13557
Add track classifier that uses tensorflow.
Sep 22, 2020
7267832
Move TFGraphDefWrapper and TfGraphDefProducer out of DataFormats into…
Oct 9, 2020
98e7321
Improved naming scheme for TrackTfClassifier weights
Oct 9, 2020
5af40b9
test
Oct 23, 2020
92585cc
change header for new path
Nov 2, 2020
3212d2f
take care of all comments except tensorflow section
Nov 9, 2020
c591c92
revert the changes for TfGraphDefWrapper module
Nov 9, 2020
46fafc4
updated
Nov 12, 2020
bd640f2
fix code format issue
Nov 16, 2020
529444b
update for PR 32182
Nov 25, 2020
c328f8d
update for the PR 32128 (runTheMatrix, TfDnnCache)
Dec 3, 2020
9157510
update for workflow and remove TfDnnCache
Dec 3, 2020
4a4bc10
fix the code format issue
Dec 3, 2020
51415cd
fix a mistake in TrackTfClassifier.cc
Dec 3, 2020
cc7be66
remove the files produced by the performance test
Dec 3, 2020
054af00
update runTheMatrix workflow
Dec 5, 2020
3298b2b
fix the issue of code format
Dec 5, 2020
a90da53
fix python error
Dec 8, 2020
e2e192b
update workflow
Dec 8, 2020
8d9efec
keep only one workflow
Dec 9, 2020
7928542
fix merge
Jan 18, 2021
1ab0b82
fix path for .pb file
Jan 20, 2021
106ff9d
fix mlpf workflow
Jan 21, 2021
e371301
add trackdnn workflow 11634.91
Jan 21, 2021
0db6299
fix the tensorflow session to be one
minxiyang Jan 28, 2021
ba03448
fix code format issue
minxiyang Jan 28, 2021
0b6f9d0
remove custom function
Feb 4, 2021
235b281
rm comments
Feb 4, 2021
a762ac2
fix the quote and whitespace
Feb 5, 2021
1db5432
fix issues
minxiyang Feb 7, 2021
26625ca
Change TfGraphDefWrapper non-moveable and non-copyable
minxiyang Feb 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Configuration/PyReleaseValidation/python/relval_2017.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# 2021 (DD4HEP: TTbar, ZMM)
# (ele guns 10, 35, 1000; pho guns 10, 35; mu guns 1, 10, 100, 1000, QCD 3TeV, QCD Flat)
# (ZMM, TTbar, ZEE, MinBias, TTbar PU, TTbar PU premix, ZEE PU, TTbar design)
# (TTbar trackingOnly, pixelTrackingOnly, trackingMkFit)
# (TTbar trackingOnly, pixelTrackingOnly, trackingMkFit, trackdnn)
# (Patatrack pixel-only: ZMM - on CPU)
# (Patatrack pixel-only: TTbar - on CPU)
# (Patatrack ECAL-only: TTbar - on CPU)
Expand All @@ -58,7 +58,7 @@
11624.911, 11642.911,
11601.0,11602.0,11603.0,11604.0,11605.0,11606.0,11607.0,11608.0,11609.0,11630.0,11643.0,
11650.0,11634.0,11646.0,11640.0,11834.0,11834.99,11846.0,12024.0,
11634.1,11634.5,11634.7,
11634.1,11634.5,11634.7,11634.91,
11650.501,
11634.501,
11634.511,
Expand All @@ -67,7 +67,7 @@
11834.13,
11723.17,
12434.0,12634.0,12634.99,
12834.0,13034.0,13034.99]
12834.0,13034.0,13034.99,]
for numWF in numWFIB:
if not numWF in _upgrade_workflows: continue
workflows[numWF] = _upgrade_workflows[numWF]
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,26 @@ def condition(self, fragment, stepList, key, hasHarvest):
offset = 0.9,
)


# Track DNN workflows
class UpgradeWorkflow_trackdnn(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
stepDict[stepName][k] = merge([{'--procModifiers': 'trackdnn'}, stepDict[step][k]])

def condition(self, fragment, stepList, key, hasHarvest):
return fragment=="TTbar_14TeV" and '2021' in key
upgradeWFs['trackdnn'] = UpgradeWorkflow_trackdnn(
steps = [
'Reco',
],
PU = [
'Reco',
],
suffix = '_trackdnn',
offset = 0.91,
)


# MLPF workflows
class UpgradeWorkflow_mlpf(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
Expand Down
2 changes: 2 additions & 0 deletions RecoTracker/FinalTrackSelectors/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<use name="CondFormats/GBRForest"/>
<use name="roottmva"/>
<use name="lwtnn"/>
<use name="TrackingTools/Records"/>
<use name="PhysicsTools/TensorFlow"/>
<export>
<lib name="1"/>
</export>
20 changes: 20 additions & 0 deletions RecoTracker/FinalTrackSelectors/interface/TfGraphDefWrapper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef RecoTracker_FinalTrackSelectors_TfGraphDefWrapper_h
#define RecoTracker_FinalTrackSelectors_TfGraphDefWrapper_h

#include "PhysicsTools/TensorFlow/interface/TensorFlow.h"

class TfGraphDefWrapper {
public:
TfGraphDefWrapper(tensorflow::Session*);
~TfGraphDefWrapper() { tensorflow::closeSession(session_); };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the destructor, it would be safer to make this class non-copyable and non-movable. In principle movability could be achieved, but that would require changes in the destructor. (currently an accidental copy of TfGraphDefWrapper could lead to premature closing of the Session)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we have some suggestions to implement it? Maybe try something like ‘TfGraphDefWrapper & operator=(TfGraphDefWrapper&) = delete’ ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Matti for catching this!

@minxiyang per the rule of five https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-five, if you define a custom destructor, you should explicitly state what happens to the move and copy constructors&operators. In this case, they should be deleted:

  ~TfGraphDefWrapper() { tensorflow::closeSession(session_); };
  TfGraphDefWrapper(const TfGraphDefWrapper&) = delete;
  TfGraphDefWrapper& operator=(const TfGraphDefWrapper&) = delete;
  TfGraphDefWrapper(TfGraphDefWrapper&&) = delete;
  TfGraphDefWrapper& operator=(TfGraphDefWrapper&&) = delete;

TfGraphDefWrapper(const TfGraphDefWrapper&) = delete;
TfGraphDefWrapper& operator=(const TfGraphDefWrapper&) = delete;
TfGraphDefWrapper(TfGraphDefWrapper&&) = delete;
TfGraphDefWrapper& operator=(TfGraphDefWrapper&&) = delete;
const tensorflow::Session* getSession() const;

private:
tensorflow::Session* session_;
};

#endif
63 changes: 63 additions & 0 deletions RecoTracker/FinalTrackSelectors/plugins/TfGraphDefProducer.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// -*- C++ -*-
//
// Package: RecoTracker/FinalTrackSelectors
// Class: TFGraphDefProducer
//
/**\class TFGraphDefProducer
Description: Produces TfGraphRecord into the event containing a tensorflow GraphDef object that can be used for running inference on a pretrained network
*/
//
// Original Author: Joona Havukainen
// Created: Fri, 24 Jul 2020 08:04:00 GMT
//
//

// system include files
#include <memory>

// user include files
#include "FWCore/Framework/interface/ModuleFactory.h"
#include "FWCore/Framework/interface/ESProducer.h"

#include "FWCore/Framework/interface/ESHandle.h"
#include "TrackingTools/Records/interface/TfGraphRecord.h"
#include "RecoTracker/FinalTrackSelectors/interface/TfGraphDefWrapper.h"

// class declaration

class TfGraphDefProducer : public edm::ESProducer {
public:
TfGraphDefProducer(const edm::ParameterSet&);
using ReturnType = std::unique_ptr<TfGraphDefWrapper>;

ReturnType produce(const TfGraphRecord&);

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
const std::string filename_;
// ----------member data ---------------------------
};

TfGraphDefProducer::TfGraphDefProducer(const edm::ParameterSet& iConfig)
: filename_(iConfig.getParameter<edm::FileInPath>("FileName").fullPath()) {
auto componentName = iConfig.getParameter<std::string>("ComponentName");
setWhatProduced(this, componentName);
}

// ------------ method called to produce the data ------------
std::unique_ptr<TfGraphDefWrapper> TfGraphDefProducer::produce(const TfGraphRecord& iRecord) {
return std::make_unique<TfGraphDefWrapper>(tensorflow::createSession(tensorflow::loadGraphDef(filename_), 1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this actually leak the GraphDef?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking into it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing it out! Per the recent CMSSW ML documentation, we need to indeed delete the graphDef by hand after closeSession (for some reason I was under the impression closeSession deletes the associated graphs). I will open a PR to fix this. I don't seem to observe any detectable effect on the memory, though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix merged in #32945

}

void TfGraphDefProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<std::string>("ComponentName", "tfGraphDef");
desc.add<edm::FileInPath>("FileName");
descriptions.add("tfGraphDefProducer", desc);
}

//define this as a plug-in
#include "FWCore/PluginManager/interface/ModuleDef.h"
#include "FWCore/Framework/interface/MakerMacros.h"
DEFINE_FWK_EVENTSETUP_MODULE(TfGraphDefProducer);
107 changes: 107 additions & 0 deletions RecoTracker/FinalTrackSelectors/plugins/TrackTfClassifier.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#include "RecoTracker/FinalTrackSelectors/interface/TrackMVAClassifier.h"

#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/global/EDProducer.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "getBestVertex.h"

#include "TrackingTools/Records/interface/TfGraphRecord.h"
#include "PhysicsTools/TensorFlow/interface/TensorFlow.h"
#include "RecoTracker/FinalTrackSelectors/interface/TfGraphDefWrapper.h"

namespace {
class TfDnn {
public:
TfDnn(const edm::ParameterSet& cfg)
: tfDnnLabel_(cfg.getParameter<std::string>("tfDnnLabel")),
session_(nullptr)

{}

static const char* name() { return "TrackTfClassifier"; }

static void fillDescriptions(edm::ParameterSetDescription& desc) {
desc.add<std::string>("tfDnnLabel", "trackSelectionTf");
}

void beginStream() {}

void initEvent(const edm::EventSetup& es) {
if (session_ == nullptr) {
edm::ESHandle<TfGraphDefWrapper> tfDnnHandle;
es.get<TfGraphRecord>().get(tfDnnLabel_, tfDnnHandle);
Comment on lines +33 to +34
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESHandle::get() is deprecated, use ESGetToken to get data from the EventSetup: https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideHowToGetDataFromES#Getting_data_from_a_Record

you can see this PR for an example: https://github.com/cms-sw/cmssw/pull/32246/files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, it seems like I need to include the new header file for esConsumes(), but I am not sure which header is supposed to used in here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

esConsumes needs to come from the EDProducer, or passed via ConsumesCollector. This will require a few changes to the other Track MVA classes. So that this PR here doesn't get stuck or expand in scope too much, let's defer the ESGetToken update for a follow-up.

session_ = tfDnnHandle.product()->getSession();
}
}

float operator()(reco::Track const& trk,
reco::BeamSpot const& beamSpot,
reco::VertexCollection const& vertices) const {
const auto& bestVertex = getBestVertex(trk, vertices);

tensorflow::Tensor input1(tensorflow::DT_FLOAT, {1, 29});
tensorflow::Tensor input2(tensorflow::DT_FLOAT, {1, 1});

input1.matrix<float>()(0, 0) = trk.pt();
input1.matrix<float>()(0, 1) = trk.innerMomentum().x();
input1.matrix<float>()(0, 2) = trk.innerMomentum().y();
input1.matrix<float>()(0, 3) = trk.innerMomentum().z();
input1.matrix<float>()(0, 4) = trk.innerMomentum().rho();
input1.matrix<float>()(0, 5) = trk.outerMomentum().x();
input1.matrix<float>()(0, 6) = trk.outerMomentum().y();
input1.matrix<float>()(0, 7) = trk.outerMomentum().z();
input1.matrix<float>()(0, 8) = trk.outerMomentum().rho();
input1.matrix<float>()(0, 9) = trk.ptError();
input1.matrix<float>()(0, 10) = trk.dxy(bestVertex);
input1.matrix<float>()(0, 11) = trk.dz(bestVertex);
input1.matrix<float>()(0, 12) = trk.dxy(beamSpot.position());
input1.matrix<float>()(0, 13) = trk.dz(beamSpot.position());
input1.matrix<float>()(0, 14) = trk.dxyError();
input1.matrix<float>()(0, 15) = trk.dzError();
input1.matrix<float>()(0, 16) = trk.normalizedChi2();
input1.matrix<float>()(0, 17) = trk.eta();
input1.matrix<float>()(0, 18) = trk.phi();
input1.matrix<float>()(0, 19) = trk.etaError();
input1.matrix<float>()(0, 20) = trk.phiError();
input1.matrix<float>()(0, 21) = trk.hitPattern().numberOfValidPixelHits();
input1.matrix<float>()(0, 22) = trk.hitPattern().numberOfValidStripHits();
input1.matrix<float>()(0, 23) = trk.ndof();
input1.matrix<float>()(0, 24) = trk.hitPattern().numberOfLostTrackerHits(reco::HitPattern::MISSING_INNER_HITS);
input1.matrix<float>()(0, 25) = trk.hitPattern().numberOfLostTrackerHits(reco::HitPattern::MISSING_OUTER_HITS);
input1.matrix<float>()(0, 26) =
trk.hitPattern().trackerLayersTotallyOffOrBad(reco::HitPattern::MISSING_INNER_HITS);
input1.matrix<float>()(0, 27) =
trk.hitPattern().trackerLayersTotallyOffOrBad(reco::HitPattern::MISSING_OUTER_HITS);
input1.matrix<float>()(0, 28) = trk.hitPattern().trackerLayersWithoutMeasurement(reco::HitPattern::TRACK_HITS);

//Original algo as its own input, it will enter the graph so that it gets one-hot encoded, as is the preferred
//format for categorical inputs, where the labels do not have any metric amongst them
input2.matrix<float>()(0, 0) = trk.originalAlgo();

//The names for the input tensors get locked when freezing the trained tensorflow model. The NamedTensors must
//match those names
tensorflow::NamedTensorList inputs;
inputs.resize(2);
inputs[0] = tensorflow::NamedTensor("x", input1);
inputs[1] = tensorflow::NamedTensor("y", input2);
std::vector<tensorflow::Tensor> outputs;

//evaluate the input
tensorflow::run(const_cast<tensorflow::Session*>(session_), inputs, {"Identity"}, &outputs);
//scale output to be [-1, 1] due to convention
float output = 2.0 * outputs[0].matrix<float>()(0, 0) - 1.0;
return output;
}

const std::string tfDnnLabel_;
const tensorflow::Session* session_;
};

using TrackTfClassifier = TrackMVAClassifier<TfDnn>;
} // namespace
#include "FWCore/PluginManager/interface/ModuleDef.h"
#include "FWCore/Framework/interface/MakerMacros.h"

DEFINE_FWK_MODULE(TrackTfClassifier);
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from RecoTracker.FinalTrackSelectors.tfGraphDefProducer_cfi import tfGraphDefProducer as _tfGraphDefProducer
trackSelectionTf = _tfGraphDefProducer.clone(
ComponentName = "trackSelectionTf",
FileName = "RecoTracker/FinalTrackSelectors/data/TrackTfClassifier/QCDFlatPU_QCDHighPt_ZEE_DisplacedSUSY_2020.pb"
)
4 changes: 4 additions & 0 deletions RecoTracker/FinalTrackSelectors/src/ES_TfGraphDefWrapper.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "RecoTracker/FinalTrackSelectors/interface/TfGraphDefWrapper.h"
#include "FWCore/Utilities/interface/typelookup.h"

TYPELOOKUP_DATA_REG(TfGraphDefWrapper);
6 changes: 6 additions & 0 deletions RecoTracker/FinalTrackSelectors/src/TfGraphDefWrapper.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "RecoTracker/FinalTrackSelectors/interface/TfGraphDefWrapper.h"

TfGraphDefWrapper::TfGraphDefWrapper(tensorflow::Session* session) : session_(session) {}
const tensorflow::Session* TfGraphDefWrapper::getSession() const {
return const_cast<const tensorflow::Session*>(session_);
}
11 changes: 6 additions & 5 deletions RecoTracker/IterativeTracking/python/DetachedQuadStep_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#for dnn classifier
from Configuration.ProcessModifiers.trackdnn_cff import trackdnn
from RecoTracker.IterativeTracking.dnnQualityCuts import qualityCutDictionary

###############################################
# Low pT and detached tracks from pixel quadruplets
Expand Down Expand Up @@ -211,11 +212,11 @@
qualityCuts = [-0.5,0.0,0.5]
)

from RecoTracker.FinalTrackSelectors.TrackLwtnnClassifier_cfi import *
from RecoTracker.FinalTrackSelectors.trackSelectionLwtnn_cfi import *
trackdnn.toReplaceWith(detachedQuadStep, TrackLwtnnClassifier.clone(
src = 'detachedQuadStepTracks',
qualityCuts = [-0.6, 0.05, 0.7]
from RecoTracker.FinalTrackSelectors.TrackTfClassifier_cfi import *
from RecoTracker.FinalTrackSelectors.trackSelectionTf_cfi import *
trackdnn.toReplaceWith(detachedQuadStep, TrackTfClassifier.clone(
src = 'detachedQuadStepTracks',
qualityCuts = qualityCutDictionary['DetachedQuadStep']
))

highBetaStar_2018.toModify(detachedQuadStep,qualityCuts = [-0.7,0.0,0.5])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#for dnn classifier
from Configuration.ProcessModifiers.trackdnn_cff import trackdnn
from RecoTracker.IterativeTracking.dnnQualityCuts import qualityCutDictionary

###############################################
# Low pT and detached tracks from pixel triplets
Expand Down Expand Up @@ -259,11 +260,11 @@
qualityCuts = [-0.2,0.3,0.8]
))

from RecoTracker.FinalTrackSelectors.TrackLwtnnClassifier_cfi import *
from RecoTracker.FinalTrackSelectors.trackSelectionLwtnn_cfi import *
trackdnn.toReplaceWith(detachedTripletStep, TrackLwtnnClassifier.clone(
from RecoTracker.FinalTrackSelectors.TrackTfClassifier_cfi import *
from RecoTracker.FinalTrackSelectors.trackSelectionTf_cfi import *
trackdnn.toReplaceWith(detachedTripletStep, TrackTfClassifier.clone(
src = 'detachedTripletStepTracks',
qualityCuts = [0.0, 0.4, 0.8],
qualityCuts = qualityCutDictionary['DetachedTripletStep'],
))
(trackdnn & fastSim).toModify(detachedTripletStep,vertices = 'firstStepPrimaryVerticesBeforeMixing')

Expand Down
11 changes: 6 additions & 5 deletions RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#for dnn classifier
from Configuration.ProcessModifiers.trackdnn_cff import trackdnn
from RecoTracker.IterativeTracking.dnnQualityCuts import qualityCutDictionary

### high-pT triplets ###

Expand Down Expand Up @@ -253,11 +254,11 @@
qualityCuts = [0.2,0.3,0.4]
)

from RecoTracker.FinalTrackSelectors.TrackLwtnnClassifier_cfi import *
from RecoTracker.FinalTrackSelectors.trackSelectionLwtnn_cfi import *
trackdnn.toReplaceWith(highPtTripletStep, TrackLwtnnClassifier.clone(
src = 'highPtTripletStepTracks',
qualityCuts = [0.75, 0.775, 0.8],
from RecoTracker.FinalTrackSelectors.TrackTfClassifier_cfi import *
from RecoTracker.FinalTrackSelectors.trackSelectionTf_cfi import *
trackdnn.toReplaceWith(highPtTripletStep, TrackTfClassifier.clone(
src = 'highPtTripletStepTracks',
qualityCuts = qualityCutDictionary['HighPtTripletStep'],
))

highBetaStar_2018.toModify(highPtTripletStep,qualityCuts = [-0.2,0.3,0.4])
Expand Down
9 changes: 5 additions & 4 deletions RecoTracker/IterativeTracking/python/InitialStep_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#for dnn classifier
from Configuration.ProcessModifiers.trackdnn_cff import trackdnn
from RecoTracker.IterativeTracking.dnnQualityCuts import qualityCutDictionary

### STEP 0 ###

Expand Down Expand Up @@ -315,11 +316,11 @@
qualityCuts = [-0.95,-0.85,-0.75]
))

from RecoTracker.FinalTrackSelectors.TrackLwtnnClassifier_cfi import *
from RecoTracker.FinalTrackSelectors.trackSelectionLwtnn_cfi import *
trackdnn.toReplaceWith(initialStep, TrackLwtnnClassifier.clone(
from RecoTracker.FinalTrackSelectors.TrackTfClassifier_cfi import *
from RecoTracker.FinalTrackSelectors.trackSelectionTf_cfi import *
trackdnn.toReplaceWith(initialStep, TrackTfClassifier.clone(
src = 'initialStepTracks',
qualityCuts = [0.0, 0.3, 0.6]
qualityCuts = qualityCutDictionary["InitialStep"]
))
(trackdnn & fastSim).toModify(initialStep,vertices = 'firstStepPrimaryVerticesBeforeMixing')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change with the whitespace and quotes is not strictly needed, please revert

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be addressed for the final version


Expand Down
11 changes: 6 additions & 5 deletions RecoTracker/IterativeTracking/python/JetCoreRegionalStep_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#for dnn classifier
from Configuration.ProcessModifiers.trackdnn_cff import trackdnn
from RecoTracker.IterativeTracking.dnnQualityCuts import qualityCutDictionary

# This step runs over all clusters

Expand Down Expand Up @@ -231,11 +232,11 @@
qualityCuts = [-0.2,0.0,0.4]
))

from RecoTracker.FinalTrackSelectors.TrackLwtnnClassifier_cfi import *
from RecoTracker.FinalTrackSelectors.trackSelectionLwtnn_cfi import *
trackdnn.toReplaceWith(jetCoreRegionalStep, TrackLwtnnClassifier.clone(
src = 'jetCoreRegionalStepTracks',
qualityCuts = [0.6, 0.7, 0.8],
from RecoTracker.FinalTrackSelectors.TrackTfClassifier_cfi import *
from RecoTracker.FinalTrackSelectors.trackSelectionTf_cfi import *
trackdnn.toReplaceWith(jetCoreRegionalStep, TrackTfClassifier.clone(
src = 'jetCoreRegionalStepTracks',
qualityCuts = qualityCutDictionary["JetCoreRegionalStep"],
))

fastSim.toModify(jetCoreRegionalStep,vertices = 'firstStepPrimaryVerticesBeforeMixing')
Expand Down
Loading