Skip to content

Commit

Permalink
Declare production of Track collection after TrackExtra collection
Browse files Browse the repository at this point in the history
This change works around a rare scheduling bug in the framework when
these modules are run as scheduled, see
#39064
  • Loading branch information
makortel authored and missirol committed Aug 26, 2022
1 parent a1b3b18 commit 0dab1eb
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 11 deletions.
7 changes: 5 additions & 2 deletions RecoMuon/L2MuonProducer/plugins/L2MuonProducer.cc
Expand Up @@ -111,10 +111,13 @@ L2MuonProducer::L2MuonProducer(const edm::ParameterSet& parameterSet) {
std::make_unique<MuonTrajectoryCleaner>(true),
iC);

produces<reco::TrackCollection>();
produces<reco::TrackCollection>("UpdatedAtVtx");
produces<TrackingRecHitCollection>();
produces<reco::TrackExtraCollection>();
// TrackCollection refers to TrackingRechit and TrackExtra
// collections, need to declare its production after them to work
// around a rare race condition in framework scheduling
produces<reco::TrackCollection>();
produces<reco::TrackCollection>("UpdatedAtVtx");
produces<reco::TrackToTrackMap>();

produces<std::vector<Trajectory>>();
Expand Down
10 changes: 8 additions & 2 deletions RecoMuon/L3MuonProducer/src/L3MuonProducer.cc
Expand Up @@ -63,15 +63,21 @@ L3MuonProducer::L3MuonProducer(const ParameterSet& parameterSet) {
theL2SeededTkLabel =
trackLoaderParameters.getUntrackedParameter<std::string>("MuonSeededTracksInstance", std::string());

produces<reco::TrackCollection>(theL2SeededTkLabel);
produces<TrackingRecHitCollection>(theL2SeededTkLabel);
produces<reco::TrackExtraCollection>(theL2SeededTkLabel);
// TrackCollection refers to TrackingRechit and TrackExtra
// collections, need to declare its production after them to work
// around a rare race condition in framework scheduling
produces<reco::TrackCollection>(theL2SeededTkLabel);
produces<vector<Trajectory>>(theL2SeededTkLabel);
produces<TrajTrackAssociationCollection>(theL2SeededTkLabel);

produces<reco::TrackCollection>();
produces<TrackingRecHitCollection>();
produces<reco::TrackExtraCollection>();
// TrackCollection refers to TrackingRechit and TrackExtra
// collections, need to declare its production after them to work
// around a rare race condition in framework scheduling
produces<reco::TrackCollection>();
produces<vector<Trajectory>>();
produces<TrajTrackAssociationCollection>();

Expand Down
Expand Up @@ -38,9 +38,12 @@ class PixelTrackProducer : public edm::stream::EDProducer<> {
explicit PixelTrackProducer(const edm::ParameterSet& cfg)
: theReconstruction(cfg, consumesCollector()), htTopoToken_(esConsumes()) {
edm::LogInfo("PixelTrackProducer") << " construction...";
produces<reco::TrackCollection>();
produces<TrackingRecHitCollection>();
produces<reco::TrackExtraCollection>();
// TrackCollection refers to TrackingRechit and TrackExtra
// collections, need to declare its production after them to work
// around a rare race condition in framework scheduling
produces<reco::TrackCollection>();
}

~PixelTrackProducer() override = default;
Expand Down
Expand Up @@ -82,9 +82,12 @@ PixelTrackProducerFromSoA::PixelTrackProducerFromSoA(const edm::ParameterSet &iC
throw cms::Exception("PixelTrackConfiguration")
<< iConfig.getParameter<std::string>("minQuality") + " not supported";
}
produces<reco::TrackCollection>();
produces<TrackingRecHitCollection>();
produces<reco::TrackExtraCollection>();
// TrackCollection refers to TrackingRechit and TrackExtra
// collections, need to declare its production after them to work
// around a rare race condition in framework scheduling
produces<reco::TrackCollection>();
produces<IndToEdm>();
}

Expand Down
Expand Up @@ -217,7 +217,6 @@ AnalyticalTrackSelector::AnalyticalTrackSelector(const edm::ParameterSet& cfg) :
}

std::string alias(cfg.getParameter<std::string>("@module_label"));
produces<reco::TrackCollection>().setBranchAlias(alias + "Tracks");
if (copyExtras_) {
produces<reco::TrackExtraCollection>().setBranchAlias(alias + "TrackExtras");
produces<TrackingRecHitCollection>().setBranchAlias(alias + "RecHits");
Expand All @@ -226,6 +225,10 @@ AnalyticalTrackSelector::AnalyticalTrackSelector(const edm::ParameterSet& cfg) :
produces<std::vector<Trajectory>>().setBranchAlias(alias + "Trajectories");
produces<TrajTrackAssociationCollection>().setBranchAlias(alias + "TrajectoryTrackAssociations");
}
// TrackCollection refers to TrackingRechit and TrackExtra
// collections, need to declare its production after them to work
// around a rare race condition in framework scheduling
produces<reco::TrackCollection>().setBranchAlias(alias + "Tracks");
}

AnalyticalTrackSelector::~AnalyticalTrackSelector() {}
Expand Down
8 changes: 6 additions & 2 deletions RecoTracker/FinalTrackSelectors/plugins/TrackListMerger.cc
Expand Up @@ -276,8 +276,6 @@ TrackListMerger::TrackListMerger(edm::ParameterSet const& conf) {
produces<edm::ValueMap<int>>();
produces<QualityMaskCollection>("QualityMasks");
} else {
produces<reco::TrackCollection>();

makeReKeyedSeeds_ = conf.getUntrackedParameter<bool>("makeReKeyedSeeds", false);
if (makeReKeyedSeeds_) {
copyExtras_ = true;
Expand All @@ -288,6 +286,12 @@ TrackListMerger::TrackListMerger(edm::ParameterSet const& conf) {
produces<reco::TrackExtraCollection>();
produces<TrackingRecHitCollection>();
}

// TrackCollection refers to TrackingRechit and TrackExtra
// collections, need to declare its production after them to work
// around a rare race condition in framework scheduling
produces<reco::TrackCollection>();

produces<std::vector<Trajectory>>();
produces<TrajTrackAssociationCollection>();
}
Expand Down
5 changes: 4 additions & 1 deletion RecoTracker/TrackProducer/plugins/GsfTrackProducer.cc
Expand Up @@ -36,10 +36,13 @@ GsfTrackProducer::GsfTrackProducer(const edm::ParameterSet& iConfig)
// string a = alias_;
// a.erase(a.size()-6,a.size());
//register your products
produces<reco::GsfTrackCollection>().setBranchAlias(alias_ + "GsfTracks");
produces<reco::TrackExtraCollection>().setBranchAlias(alias_ + "TrackExtras");
produces<reco::GsfTrackExtraCollection>().setBranchAlias(alias_ + "GsfTrackExtras");
produces<TrackingRecHitCollection>().setBranchAlias(alias_ + "RecHits");
// GsfTrackCollection refers to TrackingRechit, TrackExtra, and
// GsfTrackExtra collections, need to declare its production after
// them to work around a rare race condition in framework scheduling
produces<reco::GsfTrackCollection>().setBranchAlias(alias_ + "GsfTracks");
produces<std::vector<Trajectory> >();
produces<TrajGsfTrackAssociationCollection>();
}
Expand Down
5 changes: 4 additions & 1 deletion RecoTracker/TrackProducer/plugins/TrackProducer.cc
Expand Up @@ -32,9 +32,12 @@ TrackProducer::TrackProducer(const edm::ParameterSet& iConfig)
}

//register your products
produces<reco::TrackCollection>().setBranchAlias(alias_ + "Tracks");
produces<reco::TrackExtraCollection>().setBranchAlias(alias_ + "TrackExtras");
produces<TrackingRecHitCollection>().setBranchAlias(alias_ + "RecHits");
// TrackCollection refers to TrackingRechit and TrackExtra
// collections, need to declare its production after them to work
// around a rare race condition in framework scheduling
produces<reco::TrackCollection>().setBranchAlias(alias_ + "Tracks");
produces<std::vector<Trajectory> >();
produces<std::vector<int> >();
produces<TrajTrackAssociationCollection>();
Expand Down

0 comments on commit 0dab1eb

Please sign in to comment.