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

Removed inappropriate use of SerialTaskQueue from ClusterShapeLazyGetter #11562

Merged
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 @@ -3,7 +3,6 @@
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Utilities/interface/EDGetToken.h"
#include "FWCore/Concurrency/interface/SerialTaskQueue.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"
Expand Down Expand Up @@ -31,18 +30,15 @@ namespace {
~ClusterShapeLazyGetter() {}

void fill(const SiPixelClusterShapeCache::ClusterRef& cluster, const PixelGeomDetUnit *pixDet, const SiPixelClusterShapeCache& constCache) const override {
taskQueue_.pushAndWait([this, &cluster, pixDet, &constCache]{
if(constCache.isFilled(cluster))
return;
SiPixelClusterShapeCache& cache = const_cast<SiPixelClusterShapeCache&>(constCache);
this->data_.size.clear();
this->clusterShape_.determineShape(*pixDet, *cluster, this->data_);
cache.insert(cluster, this->data_);
});
if(constCache.isFilled(cluster))
return;
SiPixelClusterShapeCache& cache = const_cast<SiPixelClusterShapeCache&>(constCache);
this->data_.size.clear();
this->clusterShape_.determineShape(*pixDet, *cluster, this->data_);
cache.insert(cluster, this->data_);
}

private:
mutable edm::SerialTaskQueue taskQueue_; // not sure if this is the best synchronization mechanism
mutable ClusterData data_; // reused
mutable ClusterShape clusterShape_;
};
Expand Down