Skip to content

Commit

Permalink
Initial PPS Simulation Geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
mundim committed Apr 25, 2019
1 parent 1d77d13 commit 5b61fe1
Show file tree
Hide file tree
Showing 34 changed files with 4,950 additions and 283 deletions.
10 changes: 10 additions & 0 deletions Configuration/Geometry/python/GeometryExtended2016_CTPPS_cff.py
@@ -0,0 +1,10 @@
import FWCore.ParameterSet.Config as cms

#
# Geometry master configuration
#
# Ideal geometry, needed for simulation
from Geometry.CMSCommonData.cmsExtendedGeometry2016aXML_CTPPS_cfi import *
from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import *
from Geometry.HcalCommonData.hcalParameters_cfi import *
from Geometry.HcalCommonData.hcalDDDSimConstants_cfi import *
11 changes: 11 additions & 0 deletions Configuration/Geometry/python/GeometryExtended2017_CTPPS_cff.py
@@ -0,0 +1,11 @@
import FWCore.ParameterSet.Config as cms

#
# Geometry master configuration
#
# Ideal geometry, needed for simulation
from Geometry.CMSCommonData.cmsExtendedGeometry2017XML_CTPPS_cfi import *
from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import *
from Geometry.HcalCommonData.hcalParameters_cfi import *
from Geometry.HcalCommonData.hcalDDDSimConstants_cfi import *

11 changes: 11 additions & 0 deletions Configuration/Geometry/python/GeometryExtended2018_CTPPS_cff.py
@@ -0,0 +1,11 @@
import FWCore.ParameterSet.Config as cms

#
# Geometry master configuration
#
# Ideal geometry, needed for simulation
from Geometry.CMSCommonData.cmsExtendedGeometry2018XML_CTPPS_cfi import *
from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import *
from Geometry.HcalCommonData.hcalParameters_cfi import *
from Geometry.HcalCommonData.hcalDDDSimConstants_cfi import *

76 changes: 76 additions & 0 deletions Geometry/CMSCommonData/data/cmsextent/2018/v1/cmsextent.xml
@@ -0,0 +1,76 @@
<?xml version="1.0"?>
<DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../../../DetectorDescription/Schema/DDLSchema.xsd">
<ConstantsSection label="cmsextent.xml" eval="true">
<Constant name="Rmin" value="0*fm"/>
<Constant name="Zmin" value="0*fm"/>
<Constant name="HallZ" value="27.0*m"/>
<Constant name="HallR" value="14.3*m"/>
<Constant name="HallRMax" value="17.5*m"/>
<Constant name="CMSR1" value="8.30*m"/>
<Constant name="CMSR2" value="1.00*m"/>
<Constant name="CMSZ1" value="450.0*m"/>
<Constant name="CMSZ2" value="26.0*m"/>
</ConstantsSection>
<SolidSection label="cmsextent.xml">
<Tubs name="CMStoZDC" rMin="[Rmin]" rMax="[CMSR2]" dz="56*m" startPhi="0*deg" deltaPhi="360*deg"/>
<Tubs name="ZDCtoVF200" rMin="[Rmin]" rMax="[CMSR2]" dz="26*m" startPhi="0*deg" deltaPhi="360*deg"/>
<Tubs name="VF200toFP420" rMin="[Rmin]" rMax="[CMSR2]" dz="89.392*m" startPhi="0*deg" deltaPhi="360*deg"/>
</SolidSection>
<LogicalPartSection label="cmsextent.xml">
<LogicalPart name="CMStoZDC" category="unspecified">
<rSolid name="CMStoZDC"/>
<rMaterial name="materials:Air"/>
</LogicalPart>
<LogicalPart name="ZDCtoVF200" category="unspecified">
<rSolid name="ZDCtoVF200"/>
<rMaterial name="materials:Air"/>
</LogicalPart>
<LogicalPart name="VF200toFP420" category="unspecified">
<rSolid name="VF200toFP420"/>
<rMaterial name="materials:Air"/>
</LogicalPart>
</LogicalPartSection>
<PosPartSection label="cmsextent.xml">
<PosPart copyNumber="1">
<rParent name="cms:CMSE"/>
<rChild name="cmsextent:CMStoZDC"/>
<Translation x="0*fm" y="0*fm" z="83*m"/>
</PosPart>
<PosPart copyNumber="2">
<rParent name="cms:CMSE"/>
<rChild name="cmsextent:CMStoZDC"/>
<Translation x="0*fm" y="0*fm" z="-83*m"/>
</PosPart>
<PosPart copyNumber="1">
<rParent name="cms:CMSE"/>
<rChild name="cmsextent:ZDCtoVF200"/>
<Translation x="0*fm" y="0*fm" z="176.769*m"/>
</PosPart>
<PosPart copyNumber="2">
<rParent name="cms:CMSE"/>
<rChild name="cmsextent:ZDCtoVF200"/>
<Translation x="0*fm" y="0*fm" z="-176.769*m"/>
</PosPart>
<PosPart copyNumber="1">
<rParent name="cms:CMSE"/>
<rChild name="cmsextent:VF200toFP420"/>
<Translation x="0*fm" y="0*fm" z="310.*m"/>
</PosPart>
<PosPart copyNumber="2">
<rParent name="cms:CMSE"/>
<rChild name="cmsextent:VF200toFP420"/>
<Translation x="0*fm" y="0*fm" z="-310.*m"/>
</PosPart>
</PosPartSection>
<SpecParSection label="cmsextent.xml" eval="true">
<SpecPar name="cmsextent">
<PartSelector path="//CMStoZDC"/>
<PartSelector path="//ZDCtoVF200"/>
<PartSelector path="//VF200toFP420"/>
<Parameter name="CMSCutsRegion" value="InterimRegion" eval="false"/>
<Parameter name="ProdCutsForElectrons" value="1*mm"/>
<Parameter name="ProdCutsForPositrons" value="1*mm"/>
<Parameter name="ProdCutsForGamma" value="1*mm"/>
</SpecPar>
</SpecParSection>
</DDDefinition>
374 changes: 374 additions & 0 deletions Geometry/CMSCommonData/python/cmsExtendedGeometry2016aXML_CTPPS_cfi.py

Large diffs are not rendered by default.

385 changes: 385 additions & 0 deletions Geometry/CMSCommonData/python/cmsExtendedGeometry2017XML_CTPPS_cfi.py

Large diffs are not rendered by default.

380 changes: 380 additions & 0 deletions Geometry/CMSCommonData/python/cmsExtendedGeometry2018XML_CTPPS_cfi.py

Large diffs are not rendered by default.

47 changes: 21 additions & 26 deletions Geometry/CMSCommonData/test/DDFilteredViewAnalyzer.cc
Expand Up @@ -9,9 +9,8 @@

class DDFilteredViewAnalyzer : public edm::one::EDAnalyzer<> {
public:

explicit DDFilteredViewAnalyzer( const edm::ParameterSet& );
~DDFilteredViewAnalyzer( void ) override {}
explicit DDFilteredViewAnalyzer(const edm::ParameterSet&);
~DDFilteredViewAnalyzer(void) override {}

void beginJob() override {}
void analyze(edm::Event const& iEvent, edm::EventSetup const&) override;
Expand All @@ -24,43 +23,39 @@ class DDFilteredViewAnalyzer : public edm::one::EDAnalyzer<> {
DDCompOp m_comp;
};

DDFilteredViewAnalyzer::DDFilteredViewAnalyzer( const edm::ParameterSet& pset ) {
m_attribute = pset.getParameter< std::string >( "attribute" );
m_value = pset.getParameter< std::string >( "value" );
m_shouldPrint = pset.getUntrackedParameter<bool>("shouldPrint",true);
if(pset.getUntrackedParameter<bool>("compareNotEquals",true) ) {
DDFilteredViewAnalyzer::DDFilteredViewAnalyzer(const edm::ParameterSet& pset) {
m_attribute = pset.getParameter<std::string>("attribute");
m_value = pset.getParameter<std::string>("value");

m_shouldPrint = pset.getUntrackedParameter<bool>("shouldPrint", true);
if (pset.getUntrackedParameter<bool>("compareNotEquals", true)) {
m_comp = DDCompOp::not_equals;
} else {
m_comp= DDCompOp::equals;
m_comp = DDCompOp::equals;
}
}

void
DDFilteredViewAnalyzer::analyze( const edm::Event& ,
const edm::EventSetup& iSetup ) {
void DDFilteredViewAnalyzer::analyze(const edm::Event&, const edm::EventSetup& iSetup) {
edm::ESTransientHandle<DDCompactView> cpv;
iSetup.get<IdealGeometryRecord>().get( cpv );
DDValue val( m_attribute, m_value, 0.0 );
iSetup.get<IdealGeometryRecord>().get(cpv);

DDValue val(m_attribute, m_value, 0.0);
DDSpecificsFilter filter;
filter.setCriteria( val, // name & value of a variable
m_comp
);
DDFilteredView fv( *cpv,filter );
if( fv.firstChild()) {
filter.setCriteria(val, // name & value of a variable
m_comp);
DDFilteredView fv(*cpv, filter);
if (fv.firstChild()) {
std::cout << "Found attribute " << m_attribute.c_str() << " with value " << m_value.c_str() << std::endl;
bool dodet = true;
int i = 0;
while( dodet ) {
while (dodet) {
dodet = fv.next();
if(m_shouldPrint) {
if (m_shouldPrint) {
std::cout << i++ << ": " << fv.logicalPart().name() << std::endl;
}
}
}
else
} else
std::cout << "No luck..." << std::endl;
}

DEFINE_FWK_MODULE( DDFilteredViewAnalyzer );
DEFINE_FWK_MODULE(DDFilteredViewAnalyzer);

0 comments on commit 5b61fe1

Please sign in to comment.