Skip to content

Commit

Permalink
re-work AlignmentStats and SiPhase2BadStripChannelBuilder in order to…
Browse files Browse the repository at this point in the history
… comply with deleted copy constructors
  • Loading branch information
mmusich committed Jun 8, 2023
1 parent 1914ab2 commit 6486f5e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Alignment/CommonAlignmentMonitor/plugins/AlignmentStats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void AlignmentStats::beginJob() { // const edm::EventSetup &iSetup
void AlignmentStats::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) {
//load list of detunits needed then in endJob
if (!trackerGeometry_) {
trackerGeometry_ = std::make_unique<TrackerGeometry>(iSetup.getData(esTokenTkGeo_));
trackerGeometry_ = &iSetup.getData(esTokenTkGeo_);
}

if (!trackerTopology_) {
Expand Down Expand Up @@ -308,7 +308,7 @@ void AlignmentStats::endJob() {
*/

std::unique_ptr<AlignableTracker> theAliTracker =
std::make_unique<AlignableTracker>(trackerGeometry_.get(), trackerTopology_.get());
std::make_unique<AlignableTracker>(trackerGeometry_, trackerTopology_.get());
const auto &Detunitslist = theAliTracker->deepComponents();
int ndetunits = Detunitslist.size();
edm::LogInfo("AlignmentStats") << "Number of DetUnits in the AlignableTracker: " << ndetunits;
Expand Down
2 changes: 1 addition & 1 deletion Alignment/CommonAlignmentMonitor/plugins/AlignmentStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class AlignmentStats : public edm::one::EDAnalyzer<> {
DetHitMap overlapmap_;

std::unique_ptr<TrackerTopology> trackerTopology_;
std::unique_ptr<TrackerGeometry> trackerGeometry_;
const TrackerGeometry *trackerGeometry_;
};

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class SiPhase2BadStripChannelBuilder : public ConditionDBWriter<SiStripBadStrip>
void algoBeginRun(const edm::Run& run, const edm::EventSetup& es) override {
if (!tTopo_) {
tTopo_ = std::make_unique<TrackerTopology>(es.getData(topoToken_));
tGeom_ = std::make_unique<TrackerGeometry>(es.getData(geomToken_));
tGeom_ = &es.getData(geomToken_);
}
};

Expand All @@ -63,7 +63,7 @@ class SiPhase2BadStripChannelBuilder : public ConditionDBWriter<SiStripBadStrip>

// ----------member data ---------------------------
std::unique_ptr<TrackerTopology> tTopo_;
std::unique_ptr<TrackerGeometry> tGeom_;
const TrackerGeometry* tGeom_;
CLHEP::HepRandomEngine* engine_;

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_;
Expand Down Expand Up @@ -220,8 +220,6 @@ std::unique_ptr<SiStripBadStrip> SiPhase2BadStripChannelBuilder::getNewObject()
} else {
edm::LogError("SiPhase2BadStripChannelBuilder") << "Service is unavailable" << std::endl;
}

tGeom_.release();
return obj;
}

Expand Down

0 comments on commit 6486f5e

Please sign in to comment.