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

[12.6.X] Fix warning message about PixelCPEFast in TkTransientTrackingRecHitBuilderESProducer #40171

Merged
merged 2 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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