-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Condensed commit for mf geom builder migration to DD4hep
- Loading branch information
Showing
44 changed files
with
2,393 additions
and
891 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
DetectorDescription/DDCMS/plugins/DDCompactViewMFESProducer.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// -*- C++ -*- | ||
// | ||
// Package: DetectorDescription/Core | ||
// Class: DDCompactViewMFESProducer | ||
// | ||
/**\class DDCompactViewMFESProducer | ||
Description: Produce DDCompactView | ||
Implementation: | ||
Allow users view a DDDetector as a legacy compact view | ||
*/ | ||
// | ||
// Original Author: Ianna Osborne | ||
// | ||
// | ||
|
||
#include <memory> | ||
|
||
#include "FWCore/Framework/interface/ModuleFactory.h" | ||
#include "FWCore/Framework/interface/ESProducer.h" | ||
#include "FWCore/Framework/interface/ESHandle.h" | ||
|
||
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" | ||
#include "DetectorDescription/DDCMS/interface/DDCompactView.h" | ||
#include "Geometry/Records/interface/GeometryFileRcd.h" | ||
#include "DetectorDescription/DDCMS/interface/DDDetector.h" | ||
#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" | ||
#include "DD4hep/Detector.h" | ||
|
||
using namespace std; | ||
using namespace cms; | ||
|
||
class DDCompactViewMFESProducer : public edm::ESProducer { | ||
public: | ||
DDCompactViewMFESProducer(const edm::ParameterSet&); | ||
~DDCompactViewMFESProducer() override; | ||
|
||
using ReturnType = unique_ptr<DDCompactView>; | ||
|
||
static void fillDescriptions(edm::ConfigurationDescriptions&); | ||
|
||
ReturnType produce(const IdealMagneticFieldRecord&); | ||
|
||
private: | ||
const string m_label; | ||
}; | ||
|
||
DDCompactViewMFESProducer::DDCompactViewMFESProducer(const edm::ParameterSet& iConfig) | ||
: m_label(iConfig.getParameter<std::string>("appendToDataLabel")) { | ||
setWhatProduced(this); | ||
} | ||
|
||
DDCompactViewMFESProducer::~DDCompactViewMFESProducer() {} | ||
|
||
void DDCompactViewMFESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { | ||
edm::ParameterSetDescription desc; | ||
descriptions.addDefault(desc); | ||
} | ||
|
||
DDCompactViewMFESProducer::ReturnType DDCompactViewMFESProducer::produce(const IdealMagneticFieldRecord& iRecord) { | ||
edm::ESHandle<DDDetector> det; | ||
iRecord.getRecord<GeometryFileRcd>().get(m_label, det); | ||
|
||
auto product = std::make_unique<DDCompactView>(*det); | ||
return product; | ||
} | ||
|
||
DEFINE_FWK_EVENTSETUP_MODULE(DDCompactViewMFESProducer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.