diff --git a/Alignment/CommonAlignment/python/tools/trackselectionRefitting.py b/Alignment/CommonAlignment/python/tools/trackselectionRefitting.py index 0ecacf75e40d3..dff04b2a4b835 100644 --- a/Alignment/CommonAlignment/python/tools/trackselectionRefitting.py +++ b/Alignment/CommonAlignment/python/tools/trackselectionRefitting.py @@ -360,6 +360,10 @@ def getSequence(process, collection, ## put the sequence together ## ############################### + if "Fast" in TTRHBuilder: + print("PixelCPEFast has been chosen, here we must include CUDAService first") + process.load('HeterogeneousCore.CUDAServices.CUDAService_cfi') + modules = [] src = collection prevsrc = None diff --git a/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc b/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc index a570f5264bb9f..1f4f4f31cbb7e 100644 --- a/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc +++ b/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc @@ -36,6 +36,7 @@ class TkTransientTrackingRecHitBuilderESProducer : public edm::ESProducer { static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: + const std::string pname_; std::optional> spToken_; std::optional> ppToken_; std::optional> mpToken_; @@ -47,7 +48,8 @@ class TkTransientTrackingRecHitBuilderESProducer : public edm::ESProducer { using namespace edm; TkTransientTrackingRecHitBuilderESProducer::TkTransientTrackingRecHitBuilderESProducer(const edm::ParameterSet& p) - : computeCoarseLocalPositionFromDisk_(p.getParameter("ComputeCoarseLocalPositionFromDisk")) { + : pname_(p.getParameter("PixelCPE")), + computeCoarseLocalPositionFromDisk_(p.getParameter("ComputeCoarseLocalPositionFromDisk")) { std::string const myname = p.getParameter("ComponentName"); auto c = setWhatProduced(this, myname); geomToken_ = c.consumes(); @@ -57,15 +59,8 @@ TkTransientTrackingRecHitBuilderESProducer::TkTransientTrackingRecHitBuilderESPr spToken_ = c.consumes(edm::ESInputTag("", sname)); } - std::string const pname = p.getParameter("PixelCPE"); - if (pname != "Fake") { - ppToken_ = c.consumes(edm::ESInputTag("", pname)); - } - - if (pname == "PixelCPEFast") { - edm::LogWarning("TkTransientTrackingRecHitBuilderESProducer") - << "\n\t\t WARNING!\n 'PixelCPEFast' has been chosen as PixelCPE choice.\n" - << " Track angles will NOT be used in the CPE estimation!\n"; + if (pname_ != "Fake") { + ppToken_ = c.consumes(edm::ESInputTag("", pname_)); } auto const mname = p.getParameter("Matcher"); @@ -81,6 +76,12 @@ TkTransientTrackingRecHitBuilderESProducer::TkTransientTrackingRecHitBuilderESPr std::unique_ptr TkTransientTrackingRecHitBuilderESProducer::produce( const TransientRecHitRecord& iRecord) { + if (pname_ == "PixelCPEFast") { + edm::LogWarning("TkTransientTrackingRecHitBuilderESProducer") + << "\n\t\t WARNING!\n 'PixelCPEFast' has been chosen as PixelCPE choice.\n" + << " Track angles will NOT be used in the CPE estimation!\n"; + } + const StripClusterParameterEstimator* sp = nullptr; if (spToken_ && !p2OTToken_) { // no strips in Phase-2 sp = &iRecord.get(*spToken_);