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

use faster variant of OmniClusterRef and RefCoreWithIndex initialization #47174

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions DataFormats/Common/interface/RefCoreWithIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ namespace edm {
bool transient,
unsigned int elementIndex);

RefCoreWithIndex(ProductID const& id, void const* prodPtr, unsigned int index)
: cachePtr_(prodPtr),
processIndex_(id.processIndex()),
productIndex_(id.productIndex()),
elementIndex_(index) {}

RefCoreWithIndex(RefCore const& iCore, unsigned int);

RefCoreWithIndex(RefCoreWithIndex const&);
Expand Down
1 change: 1 addition & 0 deletions DataFormats/TrackerRecHit2D/interface/OmniClusterRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class OmniClusterRef {
typedef edm::Ref<FTLClusterCollection, FTLCluster> ClusterMTDRef;

OmniClusterRef() : me(edm::RefCore(), kInvalid) {}
OmniClusterRef(edm::ProductID const& id, SiStripCluster const* clu, unsigned int key) : me(id, clu, key | kIsStrip) {}
explicit OmniClusterRef(ClusterPixelRef const& ref, unsigned int subClus = 0)
: me(ref.refCore(), (ref.isNonnull() ? ref.key() | (subClus << subClusShift) : kInvalid)) {}
explicit OmniClusterRef(ClusterStripRef const& ref, unsigned int subClus = 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ void SiStripRecHitConverterAlgorithm::run(edm::Handle<edmNew::DetSetVector<SiStr
void SiStripRecHitConverterAlgorithm::run(edm::Handle<edmNew::DetSetVector<SiStripCluster>> inputhandle,
products& output,
LocalVector trackdirection) {
auto const inputID = inputhandle.id();
for (auto const& DS : *inputhandle) {
auto id = DS.id();
if (!useModule(id))
Expand All @@ -75,8 +76,8 @@ void SiStripRecHitConverterAlgorithm::run(edm::Handle<edmNew::DetSetVector<SiStr
continue;

StripClusterParameterEstimator::LocalValues parameters = parameterestimator->localParameters(cluster, du);
collector.push_back(
SiStripRecHit2D(parameters.first, parameters.second, du, DS.makeRefTo(inputhandle, &cluster)));
collector.push_back(SiStripRecHit2D(
parameters.first, parameters.second, du, OmniClusterRef(inputID, &cluster, DS.makeKeyOf(&cluster))));
}

if (collector.empty())
Expand Down