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

PPS: misaligned geometry built only optionally, off by default #35423

Merged
merged 1 commit into from
Sep 29, 2021
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 @@ -77,6 +77,7 @@ class CTPPSGeometryESModule : public edm::ESProducer {
const char* name);

const unsigned int verbosity_;
const bool buildMisalignedGeometry_;
const bool isRun2_;

edm::ESGetToken<DDCompactView, IdealGeometryRecord> ddToken_;
Expand All @@ -95,6 +96,7 @@ class CTPPSGeometryESModule : public edm::ESProducer {

CTPPSGeometryESModule::CTPPSGeometryESModule(const edm::ParameterSet& iConfig)
: verbosity_(iConfig.getUntrackedParameter<unsigned int>("verbosity")),
buildMisalignedGeometry_(iConfig.getParameter<bool>("buildMisalignedGeometry")),
isRun2_(iConfig.getParameter<bool>("isRun2")),
fromPreprocessedDB_(iConfig.getUntrackedParameter<bool>("fromPreprocessedDB", false)),
fromDD4hep_(iConfig.getUntrackedParameter<bool>("fromDD4hep", false)) {
Expand All @@ -106,9 +108,11 @@ CTPPSGeometryESModule::CTPPSGeometryESModule(const edm::ParameterSet& iConfig)
idealDBGDToken_ = c1.consumesFrom<DetGeomDesc, VeryForwardIdealGeometryRecord>(edm::ESInputTag());
realAlignmentToken_ = c1.consumesFrom<CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord>(edm::ESInputTag());

auto c2 = setWhatProduced(this, &CTPPSGeometryESModule::produceMisalignedGDFromPreprocessedDB);
misAlignmentToken_ =
c2.consumesFrom<CTPPSRPAlignmentCorrectionsData, RPMisalignedAlignmentRecord>(edm::ESInputTag());
if (buildMisalignedGeometry_) {
auto c2 = setWhatProduced(this, &CTPPSGeometryESModule::produceMisalignedGDFromPreprocessedDB);
misAlignmentToken_ =
c2.consumesFrom<CTPPSRPAlignmentCorrectionsData, RPMisalignedAlignmentRecord>(edm::ESInputTag());
}
} else if (!fromDD4hep_) {
auto c = setWhatProduced(this, &CTPPSGeometryESModule::produceIdealGD);
ddToken_ = c.consumes<DDCompactView>(edm::ESInputTag("", iConfig.getParameter<std::string>("compactViewTag")));
Expand All @@ -117,9 +121,11 @@ CTPPSGeometryESModule::CTPPSGeometryESModule(const edm::ParameterSet& iConfig)
idealGDToken_ = c1.consumesFrom<DetGeomDesc, IdealGeometryRecord>(edm::ESInputTag());
realAlignmentToken_ = c1.consumesFrom<CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord>(edm::ESInputTag());

auto c2 = setWhatProduced(this, &CTPPSGeometryESModule::produceMisalignedGD);
misAlignmentToken_ =
c2.consumesFrom<CTPPSRPAlignmentCorrectionsData, RPMisalignedAlignmentRecord>(edm::ESInputTag());
if (buildMisalignedGeometry_) {
auto c2 = setWhatProduced(this, &CTPPSGeometryESModule::produceMisalignedGD);
misAlignmentToken_ =
c2.consumesFrom<CTPPSRPAlignmentCorrectionsData, RPMisalignedAlignmentRecord>(edm::ESInputTag());
}
} else {
auto c = setWhatProduced(this, &CTPPSGeometryESModule::produceIdealGD);
dd4hepToken_ =
Expand All @@ -129,21 +135,26 @@ CTPPSGeometryESModule::CTPPSGeometryESModule(const edm::ParameterSet& iConfig)
idealGDToken_ = c1.consumesFrom<DetGeomDesc, IdealGeometryRecord>(edm::ESInputTag());
realAlignmentToken_ = c1.consumesFrom<CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord>(edm::ESInputTag());

auto c2 = setWhatProduced(this, &CTPPSGeometryESModule::produceMisalignedGD);
misAlignmentToken_ =
c2.consumesFrom<CTPPSRPAlignmentCorrectionsData, RPMisalignedAlignmentRecord>(edm::ESInputTag());
if (buildMisalignedGeometry_) {
auto c2 = setWhatProduced(this, &CTPPSGeometryESModule::produceMisalignedGD);
misAlignmentToken_ =
c2.consumesFrom<CTPPSRPAlignmentCorrectionsData, RPMisalignedAlignmentRecord>(edm::ESInputTag());
}
}

auto c_RTG = setWhatProduced(this, &CTPPSGeometryESModule::produceRealTG);
dgdRealToken_ = c_RTG.consumes<DetGeomDesc>(edm::ESInputTag());

auto c_MTG = setWhatProduced(this, &CTPPSGeometryESModule::produceMisalignedTG);
dgdMisToken_ = c_MTG.consumes<DetGeomDesc>(edm::ESInputTag());
if (buildMisalignedGeometry_) {
auto c_MTG = setWhatProduced(this, &CTPPSGeometryESModule::produceMisalignedTG);
dgdMisToken_ = c_MTG.consumes<DetGeomDesc>(edm::ESInputTag());
}
}

void CTPPSGeometryESModule::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.addUntracked<unsigned int>("verbosity", 1);
desc.add<bool>("buildMisalignedGeometry", false)->setComment("switch if misaligned geometry shall be built");
desc.add<bool>("isRun2", false)->setComment("Switch to legacy (2017-18) definition of diamond geometry");
desc.add<std::string>("dbTag", std::string());
desc.add<std::string>("compactViewTag", std::string());
Expand Down