Skip to content

Commit

Permalink
Merge pull request cms-sw#40170 from mmusich/CPEFastTrackRefitter_fol…
Browse files Browse the repository at this point in the history
…low-up_13_0_X

Fix warning message about `PixelCPEFast` in `TkTransientTrackingRecHitBuilderESProducer`
  • Loading branch information
cmsbuild authored Nov 30, 2022
2 parents f652000 + 6bcc614 commit bf75702
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class TkTransientTrackingRecHitBuilderESProducer : public edm::ESProducer {
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
const std::string pname_;
std::optional<edm::ESGetToken<StripClusterParameterEstimator, TkStripCPERecord>> spToken_;
std::optional<edm::ESGetToken<PixelClusterParameterEstimator, TkPixelCPERecord>> ppToken_;
std::optional<edm::ESGetToken<SiStripRecHitMatcher, TkStripCPERecord>> mpToken_;
Expand All @@ -47,7 +48,8 @@ class TkTransientTrackingRecHitBuilderESProducer : public edm::ESProducer {
using namespace edm;

TkTransientTrackingRecHitBuilderESProducer::TkTransientTrackingRecHitBuilderESProducer(const edm::ParameterSet& p)
: computeCoarseLocalPositionFromDisk_(p.getParameter<bool>("ComputeCoarseLocalPositionFromDisk")) {
: pname_(p.getParameter<std::string>("PixelCPE")),
computeCoarseLocalPositionFromDisk_(p.getParameter<bool>("ComputeCoarseLocalPositionFromDisk")) {
std::string const myname = p.getParameter<std::string>("ComponentName");
auto c = setWhatProduced(this, myname);
geomToken_ = c.consumes();
Expand All @@ -57,15 +59,8 @@ TkTransientTrackingRecHitBuilderESProducer::TkTransientTrackingRecHitBuilderESPr
spToken_ = c.consumes(edm::ESInputTag("", sname));
}

std::string const pname = p.getParameter<std::string>("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<std::string>("Matcher");
Expand All @@ -81,6 +76,12 @@ TkTransientTrackingRecHitBuilderESProducer::TkTransientTrackingRecHitBuilderESPr

std::unique_ptr<TransientTrackingRecHitBuilder> 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_);
Expand Down

0 comments on commit bf75702

Please sign in to comment.