Skip to content

Commit

Permalink
Merge pull request #26231 from ianna/dd4hep-merge-geometry-v0
Browse files Browse the repository at this point in the history
DD4hep: Merge Development to a Usual Geometry Structure
  • Loading branch information
cmsbuild committed Apr 8, 2019
2 parents 83bf6e2 + 265b2c5 commit 418ada8
Show file tree
Hide file tree
Showing 51 changed files with 808 additions and 322 deletions.
5 changes: 3 additions & 2 deletions DetectorDescription/DDCMS/data/cms-2015-muon-geometry.xml
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<DDDefinition>
<debug>
<!--debug_shapes/>
<!-- debug_shapes/>
<debug_includes/>
<debug_rotations/>
<debug_includes/>
Expand All @@ -13,7 +13,7 @@
<debug_algorithms/>
<debug_materials/>
<debug_visattr/>
<debug_specpars/-->
<debug_specpars/ -->
</debug>

<open_geometry/>
Expand Down Expand Up @@ -58,6 +58,7 @@
<Include ref='Geometry/MuonCommonData/data/mfshield/2015/v1/mfshield.xml'/>
<Include ref='Geometry/MuonCommonData/data/muonNumbering/2015/v2/muonNumbering.xml'/>
<Include ref='Geometry/DTGeometryBuilder/data/dtSpecsFilter/2019/v1/dtSpecsFilter.xml'/>
<Include ref='Geometry/MuonSimData/data/muonProdCuts.xml'/>
<Include ref='DetectorDescription/DDCMS/data/trackerParameters.xml'/>
</IncludeSection>

Expand Down
6 changes: 5 additions & 1 deletion DetectorDescription/DDCMS/interface/DDDetector.h
Expand Up @@ -6,13 +6,15 @@

namespace dd4hep {
class Detector;
class Volume;
}

namespace cms {
class DDDetector {
public:
using Detector = dd4hep::Detector;

using Volume = dd4hep::Volume;

explicit DDDetector(const std::string&, const std::string&);
DDDetector() = delete;

Expand All @@ -34,6 +36,8 @@ namespace cms {
DDSpecParRegistry const& specpars() const {
return m_specpars;
}

Volume worldVolume() const;

private:

Expand Down
23 changes: 0 additions & 23 deletions DetectorDescription/DDCMS/interface/MuonNumbering.h

This file was deleted.

24 changes: 0 additions & 24 deletions DetectorDescription/DDCMS/interface/MuonSubDetector.h

This file was deleted.

30 changes: 15 additions & 15 deletions DetectorDescription/DDCMS/plugins/BuildFile.xml
Expand Up @@ -4,28 +4,28 @@
<use name="dd4hep"/>
<use name="DetectorDescription/DDCMS"/>

<library name="DetectorDescriptionTestPlugins" file="DDTestVectors.cc,DDTestSpecPars.cc,DDTestSpecParsFilter.cc,DDTestDumpFile.cc,DDTestDumpGeometry.cc,DDTestNavigateGeometry.cc,DDTestMuonNumbering.cc" >
<library name="DetectorDescriptionTestPlugins" file="DDTestVectors.cc,DDTestSpecPars.cc,DDTestSpecParsFilter.cc,DDTestDumpFile.cc,DDTestDumpGeometry.cc,DDTestNavigateGeometry.cc" >
<use name="Geometry/Records"/>
<lib name="Geom"/>
<flags EDM_PLUGIN="1"/>
</library>
<library name="DetectorDescriptionPlugins" file="DDCMSDetector.cc,DDDetectorESProducer.cc,DDVectorRegistryESProducer.cc,DDSpecParRegistryESProducer.cc,MuonNumberingESProducer.cc" >
<library name="DetectorDescriptionPlugins" file="DDCMSDetector.cc,DDDetectorESProducer.cc,DDVectorRegistryESProducer.cc,DDSpecParRegistryESProducer.cc" >
<use name="Geometry/Records"/>
<lib name="Geom"/>
<flags EDM_PLUGIN="1"/>
</library>
<library name="DetectorDescriptionDD4HepPlugins" file="*.cc" >
<flags SKIP_FILE="DTGeometryESProducer.cc"/>
<flags SKIP_FILE="DDCMSDetector.cc"/>
<flags SKIP_FILE="DDTestVector.cc"/>
<flags SKIP_FILE="DDTestSpecPars.cc"/>
<flags SKIP_FILE="DDTestSpecParsFilter.cc"/>
<flags SKIP_FILE="DDTestDumpFile.cc"/>
<flags SKIP_FILE="DDTestDumpGeometry.cc"/>
<flags SKIP_FILE="DDTestNavigateGeometry.cc"/>
<flags SKIP_FILE="DDTestMuonNumbering.cc"/>
<flags SKIP_FILE="DDDetectorESProducer.cc"/>
<flags SKIP_FILE="DDVectorRegistryESProducer.cc"/>
<flags SKIP_FILE="DDSpecParRegistryESProducer.cc"/>
<flags SKIP_FILE="MuonNumberingESProducer.cc"/>
<flags SKIP_FILES="DTGeometryESProducer.cc"/>
<flags SKIP_FILES="DDCMSDetector.cc"/>
<flags SKIP_FILES="DDTestVectors.cc"/>
<flags SKIP_FILES="DDTestSpecPars.cc"/>
<flags SKIP_FILES="DDTestSpecParsFilter.cc"/>
<flags SKIP_FILES="DDTestDumpFile.cc"/>
<flags SKIP_FILES="DDTestDumpGeometry.cc"/>
<flags SKIP_FILES="DDTestNavigateGeometry.cc"/>
<flags SKIP_FILES="DDDetectorESProducer.cc"/>
<flags SKIP_FILES="DDVectorRegistryESProducer.cc"/>
<flags SKIP_FILES="DDSpecParRegistryESProducer.cc"/>
<use name="rootgeom"/>
<flags DD4HEP_PLUGIN="1"/>
</library>
4 changes: 2 additions & 2 deletions DetectorDescription/DDCMS/plugins/DDCMSDetector.cc
Expand Up @@ -5,9 +5,9 @@
#include "FWCore/Framework/interface/ESTransientHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DetectorDescription/DDCMS/interface/DetectorDescriptionRcd.h"
#include "Geometry/Records/interface/DetectorDescriptionRcd.h"
#include "DetectorDescription/DDCMS/interface/DDDetector.h"
#include "DetectorDescription/DDCMS/interface/DDVectorRegistryRcd.h"
#include "Geometry/Records/interface/DDVectorRegistryRcd.h"
#include "DetectorDescription/DDCMS/interface/DDVectorRegistry.h"
#include "DD4hep/Detector.h"

Expand Down
2 changes: 1 addition & 1 deletion DetectorDescription/DDCMS/plugins/DDDetectorESProducer.cc
Expand Up @@ -24,7 +24,7 @@
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include "DetectorDescription/DDCMS/interface/DetectorDescriptionRcd.h"
#include "Geometry/Records/interface/DetectorDescriptionRcd.h"
#include "DetectorDescription/DDCMS/interface/DDDetector.h"
#include "DD4hep/Detector.h"

Expand Down
Expand Up @@ -24,9 +24,9 @@

#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "DetectorDescription/DDCMS/interface/DDSpecParRegistryRcd.h"
#include "Geometry/Records/interface/DDSpecParRegistryRcd.h"
#include "DetectorDescription/DDCMS/interface/DDSpecParRegistry.h"
#include "DetectorDescription/DDCMS/interface/DetectorDescriptionRcd.h"
#include "Geometry/Records/interface/DetectorDescriptionRcd.h"
#include "DetectorDescription/DDCMS/interface/DDDetector.h"
#include "DD4hep/Detector.h"

Expand Down
2 changes: 1 addition & 1 deletion DetectorDescription/DDCMS/plugins/DDTestDumpFile.cc
Expand Up @@ -3,7 +3,7 @@
#include "FWCore/Framework/interface/ESTransientHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DetectorDescription/DDCMS/interface/DetectorDescriptionRcd.h"
#include "Geometry/Records/interface/DetectorDescriptionRcd.h"
#include "DetectorDescription/DDCMS/interface/DDDetector.h"
#include "DD4hep/Detector.h"
#include "DD4hep/DD4hepRootPersistency.h"
Expand Down
2 changes: 1 addition & 1 deletion DetectorDescription/DDCMS/plugins/DDTestDumpGeometry.cc
Expand Up @@ -3,7 +3,7 @@
#include "FWCore/Framework/interface/ESTransientHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DetectorDescription/DDCMS/interface/DetectorDescriptionRcd.h"
#include "Geometry/Records/interface/DetectorDescriptionRcd.h"
#include "DetectorDescription/DDCMS/interface/DDDetector.h"
#include "DD4hep/Detector.h"
#include "DD4hep/DD4hepRootPersistency.h"
Expand Down
4 changes: 2 additions & 2 deletions DetectorDescription/DDCMS/plugins/DDTestNavigateGeometry.cc
Expand Up @@ -3,9 +3,9 @@
#include "FWCore/Framework/interface/ESTransientHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DetectorDescription/DDCMS/interface/DetectorDescriptionRcd.h"
#include "Geometry/Records/interface/DetectorDescriptionRcd.h"
#include "DetectorDescription/DDCMS/interface/DDDetector.h"
#include "DetectorDescription/DDCMS/interface/DDVectorRegistryRcd.h"
#include "Geometry/Records/interface/DDVectorRegistryRcd.h"
#include "DetectorDescription/DDCMS/interface/DDVectorRegistry.h"
#include "DetectorDescription/DDCMS/interface/DDVolumeProcessor.h"
#include "DD4hep/Detector.h"
Expand Down
2 changes: 1 addition & 1 deletion DetectorDescription/DDCMS/plugins/DDTestSpecPars.cc
Expand Up @@ -3,7 +3,7 @@
#include "FWCore/Framework/interface/ESTransientHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DetectorDescription/DDCMS/interface/DDSpecParRegistryRcd.h"
#include "Geometry/Records/interface/DDSpecParRegistryRcd.h"
#include "DetectorDescription/DDCMS/interface/DDSpecParRegistry.h"

#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion DetectorDescription/DDCMS/plugins/DDTestSpecParsFilter.cc
Expand Up @@ -3,7 +3,7 @@
#include "FWCore/Framework/interface/ESTransientHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DetectorDescription/DDCMS/interface/DDSpecParRegistryRcd.h"
#include "Geometry/Records/interface/DDSpecParRegistryRcd.h"
#include "DetectorDescription/DDCMS/interface/DDSpecParRegistry.h"

#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion DetectorDescription/DDCMS/plugins/DDTestVectors.cc
Expand Up @@ -3,7 +3,7 @@
#include "FWCore/Framework/interface/ESTransientHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DetectorDescription/DDCMS/interface/DDVectorRegistryRcd.h"
#include "Geometry/Records/interface/DDVectorRegistryRcd.h"
#include "DetectorDescription/DDCMS/interface/DDVectorRegistry.h"

#include <iostream>
Expand Down
Expand Up @@ -25,9 +25,9 @@

#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "DetectorDescription/DDCMS/interface/DDVectorRegistryRcd.h"
#include "Geometry/Records/interface/DDVectorRegistryRcd.h"
#include "DetectorDescription/DDCMS/interface/DDVectorRegistry.h"
#include "DetectorDescription/DDCMS/interface/DetectorDescriptionRcd.h"
#include "Geometry/Records/interface/DetectorDescriptionRcd.h"
#include "DetectorDescription/DDCMS/interface/DDDetector.h"
#include "DD4hep/Detector.h"

Expand Down
9 changes: 8 additions & 1 deletion DetectorDescription/DDCMS/src/DDDetector.cc
@@ -1,5 +1,6 @@
#include "DetectorDescription/DDCMS/interface/DDDetector.h"
#include "DD4hep/Detector.h"
#include <DD4hep/Detector.h>
#include <DD4hep/Volumes.h>

#include <iostream>

Expand Down Expand Up @@ -28,3 +29,9 @@ DDDetector::process(const string& fileName)
const char* files[] = { fileName.c_str(), nullptr };
m_description->apply( name.c_str(), 2, (char**)files );
}

dd4hep::Volume
DDDetector::worldVolume() const {
assert(m_description);
return m_description->worldVolume();
}
12 changes: 1 addition & 11 deletions DetectorDescription/DDCMS/src/ES_DDDetector.cc
@@ -1,24 +1,14 @@
#include "FWCore/Utilities/interface/typelookup.h"
#include "DetectorDescription/DDCMS/interface/DDDetector.h"
#include "DetectorDescription/DDCMS/interface/DDSpecParRegistry.h"
#include "DetectorDescription/DDCMS/interface/DDSpecParRegistryRcd.h"
#include "DetectorDescription/DDCMS/interface/DDVectorRegistry.h"
#include "DetectorDescription/DDCMS/interface/DDVectorRegistryRcd.h"
#include "DetectorDescription/DDCMS/interface/DetectorDescriptionRcd.h"
#include "DetectorDescription/DDCMS/interface/MuonNumbering.h"
#include "DetectorDescription/DDCMS/interface/MuonNumberingRcd.h"
#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h"
#include "Geometry/Records/interface/DetectorDescriptionRcd.h"
#include "FWCore/Framework/interface/data_default_record_trait.h"

using namespace cms;

TYPELOOKUP_DATA_REG(DDDetector);
TYPELOOKUP_DATA_REG(DDSpecParRegistry);
TYPELOOKUP_DATA_REG(DDVectorRegistry);
TYPELOOKUP_DATA_REG(MuonNumbering);

EVENTSETUP_RECORD_REG(DetectorDescriptionRcd);
EVENTSETUP_DATA_DEFAULT_RECORD(DDDetector, DetectorDescriptionRcd);
EVENTSETUP_RECORD_REG(DDSpecParRegistryRcd);
EVENTSETUP_RECORD_REG(DDVectorRegistryRcd);
EVENTSETUP_RECORD_REG(MuonNumberingRcd);
2 changes: 1 addition & 1 deletion DetectorDescription/DDCMS/test/DDFilteredView.cppunit.cc
Expand Up @@ -39,6 +39,6 @@ void testDDFilteredView::setUp() {

void testDDFilteredView::checkFilteredView()
{
unique_ptr<DDDetector> det = make_unique<DDDetector>("DUMMY", fileName_);
unique_ptr<DDDetector> det = make_unique<DDDetector>("DUMMY", fileName_);
DDFilteredView fview(det.get(), det->description()->worldVolume());
}
@@ -0,0 +1,56 @@
import FWCore.ParameterSet.Config as cms

process = cms.Process("DDG4ProdCutsTest")

process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)

process.MessageLogger = cms.Service(
"MessageLogger",
statistics = cms.untracked.vstring('cout', 'g4prodcuts'),
categories = cms.untracked.vstring('Geometry'),
cout = cms.untracked.PSet(
threshold = cms.untracked.string('WARNING'),
noLineBreaks = cms.untracked.bool(True)
),
g4prodcuts = cms.untracked.PSet(
INFO = cms.untracked.PSet(
limit = cms.untracked.int32(0)
),
noLineBreaks = cms.untracked.bool(True),
DEBUG = cms.untracked.PSet(
limit = cms.untracked.int32(0)
),
WARNING = cms.untracked.PSet(
limit = cms.untracked.int32(0)
),
ERROR = cms.untracked.PSet(
limit = cms.untracked.int32(0)
),
threshold = cms.untracked.string('INFO'),
Geometry = cms.untracked.PSet(
limit = cms.untracked.int32(-1)
)
),
destinations = cms.untracked.vstring('cout',
'g4prodcuts')
)

process.DDDetectorESProducer = cms.ESSource("DDDetectorESProducer",
confGeomXMLFiles = cms.FileInPath('DetectorDescription/DDCMS/data/cms-2015-muon-geometry.xml'),
appendToDataLabel = cms.string('MUON')
)

process.DDSpecParRegistryESProducer = cms.ESProducer("DDSpecParRegistryESProducer",
appendToDataLabel = cms.string('MUON')
)

process.test = cms.EDAnalyzer("DDTestSpecParsFilter",
DDDetector = cms.ESInputTag('MUON'),
attribute = cms.untracked.string('CMSCutsRegion'),
value = cms.untracked.string('Muon')
)

process.p = cms.Path(process.test)

0 comments on commit 418ada8

Please sign in to comment.