Skip to content

Commit

Permalink
GE2/1 geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Dildick authored and ktf committed Jan 21, 2014
1 parent 1fb90cb commit 031ef2c
Show file tree
Hide file tree
Showing 25 changed files with 3,938 additions and 2,344 deletions.
21 changes: 3 additions & 18 deletions Configuration/Geometry/python/GeometryExtended2023Reco_cff.py
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms

# Ideal geometry, needed for transient ECAL alignement
from Geometry.CMSCommonData.cmsExtendedGeometry2023HGCalXML_cfi import *
from Configuration.Geometry.GeometryExtended2023_cff import *

# Reconstruction geometry services
# Tracking Geometry
Expand All @@ -15,6 +15,7 @@
#Muon
from Geometry.MuonNumbering.muonNumberingInitialization_cfi import *
from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import *
from Geometry.GEMGeometry.gemGeometry_cfi import *

# Alignment
from Geometry.TrackerGeometryBuilder.idealForDigiTrackerSLHCGeometry_cff import *
Expand All @@ -24,23 +25,7 @@

# Calorimeters
from Geometry.CaloEventSetup.CaloTopology_cfi import *

from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import *

CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder",
SelectedCalos = cms.vstring('HCAL' ,
'ZDC' ,
'CASTOR' ,
'EcalBarrel' ,
'TOWER' )
)

from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import *
from Geometry.HcalEventSetup.HcalGeometry_cfi import *
from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import *
from Geometry.HcalEventSetup.HcalTopology_cfi import *
from Geometry.ForwardGeometry.ForwardGeometry_cfi import *

from Geometry.CaloEventSetup.CaloGeometry_cff import *
from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import *
from Geometry.EcalMapping.EcalMapping_cfi import *
from Geometry.EcalMapping.EcalMappingRecord_cfi import *
Expand Down
6 changes: 5 additions & 1 deletion Configuration/Geometry/python/GeometryExtended2023_cff.py
@@ -1,4 +1,8 @@
import FWCore.ParameterSet.Config as cms

from Geometry.CMSCommonData.cmsExtendedGeometry2023HGCalXML_cfi import *
#
# Geometry master configuration
#
# Ideal geometry, needed for simulation
from Geometry.CMSCommonData.cmsExtendedGeometry2023XML_cfi import *
from Geometry.TrackerNumberingBuilder.trackerNumberingSLHCGeometry_cfi import *
3 changes: 3 additions & 0 deletions Geometry/CMSCommonData/data/materials.xml
Expand Up @@ -243,6 +243,9 @@
<MaterialFraction fraction="0.010549802">
<rMaterial name="materials:Hydrogen"/>
</MaterialFraction>
<MaterialFraction fraction="0.001119">
<rMaterial name="materials:Water"/>
</MaterialFraction>
</CompositeMaterial>
<CompositeMaterial name="Air" density="1.214*mg/cm3" symbol=" " method="mixture by weight">
<MaterialFraction fraction="0.7494">
Expand Down
283 changes: 283 additions & 0 deletions Geometry/CMSCommonData/python/cmsExtendedGeometry2023XML_cfi.py

Large diffs are not rendered by default.

43 changes: 22 additions & 21 deletions Geometry/GEMGeometry/test/GEMGeometryAnalyzer.cc
Expand Up @@ -77,7 +77,6 @@ GEMGeometryAnalyzer::analyze( const edm::Event& /*iEvent*/, const edm::EventSetu
ofos << " GeomDetUnit DetIds\t" <<pDD->detUnitIds().size() << endl;
ofos << " eta partitions \t" <<pDD->etaPartitions().size() << endl;
ofos << " chambers \t" <<pDD->chambers().size() << endl;
ofos << " no. eta partitions \t" <<pDD->etaPartitions().size()/pDD->chambers().size() << endl;
ofos << " super chambers \t" <<pDD->superChambers().size() << endl;
ofos << " rings \t\t" <<pDD->rings().size() << endl;
ofos << " stations \t\t" <<pDD->stations().size() << endl;
Expand All @@ -98,10 +97,11 @@ GEMGeometryAnalyzer::analyze( const edm::Event& /*iEvent*/, const edm::EventSetu
}
}
}
// checking the number of strips and pads
ofos << " total number of strips\t"<<nstrips << endl;
ofos << " total number of pads \t"<<npads << endl;
ofos << " flagNonUniqueRollID \t"<<flagNonUniqueRollID << endl;
ofos << " flagNonUniqueRollRawID\t"<<flagNonUniqueRollRawID << endl;
if (flagNonUniqueRollID or flagNonUniqueRollRawID)
ofos << " -- WARNING: non unique roll Ids!!!" << endl;

// checking uniqueness of chamber detIds
bool flagNonUniqueChID = false;
Expand All @@ -114,33 +114,31 @@ GEMGeometryAnalyzer::analyze( const edm::Event& /*iEvent*/, const edm::EventSetu
}
}
}
ofos << " flagNonUniqueChID \t"<<flagNonUniqueChID << endl;
ofos << " flagNonUniqueChRawID \t"<<flagNonUniqueChRawID << endl;

// checking the number of strips and pads
if (flagNonUniqueChID or flagNonUniqueChRawID)
ofos << " -- WARNING: non unique chamber Ids!!!" << endl;

ofos << myName() << ": Begin iteration over geometry..." << endl;
ofos << "iter " << dashedLine_ << endl;

//----------------------- Global GEMGeometry TEST -------------------------------------------------------
ofos << myName() << "Begin GEMGeometry structure TEST" << endl;

int j = 1;

for (auto region : pDD->regions()) {
ofos << " GEMRegion " << region->region() << " has " << region->nStations() << " stations." << endl;
for (auto station : region->stations()) {
ofos << " GEMStation " << station->getName() << " has " << station->nRings() << " rings." << endl;
ofos << " GEMStation " << station->getName() << " has " << station->nRings() << " rings." << endl;
for (auto ring : station->rings()) {
ofos << " GEMRing " << ring->region() << " " << ring->station() << " " << ring->ring() << " has " << ring->nSuperChambers() << " super chambers." << endl;
ofos << " GEMRing " << ring->region() << " " << ring->station() << " " << ring->ring() << " has " << ring->nSuperChambers() << " super chambers." << endl;
int i = 1;
for (auto sch : ring->superChambers()) {
GEMDetId schId(sch->id());
ofos << " GEMSuperChamber " << j << ", GEMDetId = " << schId.rawId() << ", " << schId << " has " << sch->nChambers() << " chambers." << endl;
ofos << " GEMSuperChamber " << i << ", GEMDetId = " << schId.rawId() << ", " << schId << " has " << sch->nChambers() << " chambers." << endl;
// checking the dimensions of each partition & chamber
int j = 1;
for (auto ch : sch->chambers()){
GEMDetId chId(ch->id());
int nRolls(ch->nEtaPartitions());
ofos << " GEMChamber " << j << ", GEMDetId = " << chId.rawId() << ", " << chId << " has " << nRolls << " eta partitions." << endl;
ofos << " GEMChamber " << j << ", GEMDetId = " << chId.rawId() << ", " << chId << " has " << nRolls << " eta partitions." << endl;

int k = 1;
auto& rolls(ch->etaPartitions());
Expand All @@ -159,7 +157,7 @@ GEMGeometryAnalyzer::analyze( const edm::Event& /*iEvent*/, const edm::EventSetu

for (auto roll : rolls){
GEMDetId rId(roll->id());
ofos<<" GEMEtaPartition " << k << ", GEMDetId = " << rId.rawId() << ", " << rId << endl;
ofos<<" GEMEtaPartition " << k << ", GEMDetId = " << rId.rawId() << ", " << rId << endl;

const BoundPlane& bSurface(roll->surface());
const StripTopology* topology(&(roll->specificTopology()));
Expand Down Expand Up @@ -220,18 +218,21 @@ GEMGeometryAnalyzer::analyze( const edm::Event& /*iEvent*/, const edm::EventSetu
double dphi(cstripN - cstrip1);
if (dphi < 0.) dphi += 360.;
double deta(abs(beta - teta));
ofos << " \tType: " << type << endl
<< " \tDimensions[cm]: b = " << bottomEdge << ", B = " << topEdge << ", h = " << height << endl
<< " \tnStrips = " << nStrips << ", nPads = " << nPads << endl
<< " \tcenter(x,y,z) = " << cx << " " << cy << " " << cz << ", center(eta,phi) = " << ceta << " " << cphi << endl
<< " \ttop(x,y,z) = " << tx << " " << ty << " " << tz << ", top(eta,phi) = " << teta << " " << tphi << endl
<< " \tbottom(x,y,z) = " << bx << " " << by << " " << bz << ", bottom(eta,phi) = " << beta << " " << bphi << endl
<< " \tpith (top,center,bottom) = " << topPitch << " " << pitch << " " << bottomPitch << ", dEta = " << deta << ", dPhi = " << dphi << endl;
const bool printDetails(false);
if (printDetails)
ofos << " \tType: " << type << endl
<< " \tDimensions[cm]: b = " << bottomEdge << ", B = " << topEdge << ", h = " << height << endl
<< " \tnStrips = " << nStrips << ", nPads = " << nPads << endl
<< " \tcenter(x,y,z) = " << cx << " " << cy << " " << cz << ", center(eta,phi) = " << ceta << " " << cphi << endl
<< " \ttop(x,y,z) = " << tx << " " << ty << " " << tz << ", top(eta,phi) = " << teta << " " << tphi << endl
<< " \tbottom(x,y,z) = " << bx << " " << by << " " << bz << ", bottom(eta,phi) = " << beta << " " << bphi << endl
<< " \tpith (top,center,bottom) = " << topPitch << " " << pitch << " " << bottomPitch << ", dEta = " << deta << ", dPhi = " << dphi << endl;

++k;
}
++j;
}
++i;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Geometry/GEMGeometryBuilder/data/GEMSpecs.xml
Expand Up @@ -2,11 +2,11 @@
<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">
<SpecParSection label="GEMSpecs.xml">
<SpecPar name="nStrips32" eval="true">
<PartSelector path="//GHA."/>
<PartSelector path="//GHA1.."/>
<Parameter name="nStrips" value="384"/>
</SpecPar>
<SpecPar name="nPads32" eval="true">
<PartSelector path="//GHA."/>
<PartSelector path="//GHA1.."/>
<Parameter name="nPads" value="96"/>
</SpecPar>
</SpecParSection>
Expand Down
6 changes: 2 additions & 4 deletions Geometry/GEMGeometryBuilder/data/v3/GEMSpecs.xml
Expand Up @@ -2,13 +2,11 @@
<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">
<SpecParSection label="GEMSpecs.xml">
<SpecPar name="nStrips32" eval="true">
<PartSelector path="//GHA."/>
<PartSelector path="//GHA10"/>
<PartSelector path="//GHA1.."/>
<Parameter name="nStrips" value="384"/>
</SpecPar>
<SpecPar name="nPads32" eval="true">
<PartSelector path="//GHA."/>
<PartSelector path="//GHA10"/>
<PartSelector path="//GHA1.."/>
<Parameter name="nPads" value="96"/>
</SpecPar>
</SpecParSection>
Expand Down
4 changes: 2 additions & 2 deletions Geometry/GEMGeometryBuilder/data/v4/GEMSpecs.xml
Expand Up @@ -2,11 +2,11 @@
<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">
<SpecParSection label="GEMSpecs.xml">
<SpecPar name="nStrips32" eval="true">
<PartSelector path="//GHA."/>
<PartSelector path="//GHA1.."/>
<Parameter name="nStrips" value="384"/>
</SpecPar>
<SpecPar name="nPads32" eval="true">
<PartSelector path="//GHA."/>
<PartSelector path="//GHA1.."/>
<Parameter name="nPads" value="96"/>
</SpecPar>
</SpecParSection>
Expand Down
15 changes: 15 additions & 0 deletions Geometry/GEMGeometryBuilder/data/v5/GEMSpecs.xml
@@ -0,0 +1,15 @@
<?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">
<SpecParSection label="GEMSpecs.xml">
<SpecPar name="nStrips32" eval="true">
<PartSelector path="//GHA1.."/>
<PartSelector path="//GHA2.."/>
<Parameter name="nStrips" value="384"/>
</SpecPar>
<SpecPar name="nPads32" eval="true">
<PartSelector path="//GHA1.."/>
<PartSelector path="//GHA2.."/>
<Parameter name="nPads" value="96"/>
</SpecPar>
</SpecParSection>
</DDDefinition>
55 changes: 33 additions & 22 deletions Geometry/GEMGeometryBuilder/src/GEMGeometryBuilderFromDDD.cc
Expand Up @@ -54,6 +54,7 @@ GEMGeometry* GEMGeometryBuilderFromDDD::build(const DDCompactView* cview, const

GEMGeometry* GEMGeometryBuilderFromDDD::buildGeometry(DDFilteredView& fview, const MuonDDDConstants& muonConstants)
{
std::cout << "Building the geometry service" << std::endl;
LogDebug("GEMGeometryBuilderFromDDD") <<"Building the geometry service";
GEMGeometry* geometry = new GEMGeometry();

Expand All @@ -65,6 +66,7 @@ GEMGeometry* GEMGeometryBuilderFromDDD::buildGeometry(DDFilteredView& fview, con

LogDebug("GEMGeometryBuilderFromDDD") <<"start the loop";
int nChambers(0);
int maxStation(1);
while (doSubDets)
{
// Get the Base Muon Number
Expand All @@ -81,6 +83,8 @@ GEMGeometry* GEMGeometryBuilderFromDDD::buildGeometry(DDFilteredView& fview, con
// chamber id for this partition. everything is the same; but partition number is 0.
GEMDetId chamberId(rollDetId.chamberId());
LogDebug("GEMGeometryBuilderFromDDD") << "GEM chamber rawId: " << chamberId.rawId() << ", detId: " << chamberId;
const int stationId(rollDetId.station());
if (stationId > maxStation) maxStation = stationId;

if (rollDetId.roll()==1) ++nChambers;

Expand Down Expand Up @@ -158,69 +162,77 @@ GEMGeometry* GEMGeometryBuilderFromDDD::buildGeometry(DDFilteredView& fview, con
}

auto& partitions(geometry->etaPartitions());
int nEtaPartitions((int)partitions.size()/nChambers);

// build the chambers and add them to the geometry
std::vector<GEMDetId> vDetId;
vDetId.clear();
int oldRollNumber = 1;
for (unsigned i=1; i<=partitions.size(); ++i){
GEMDetId detId(partitions.at(i-1)->id());
vDetId.push_back(detId);
if (i%nEtaPartitions==0){
const int rollNumber(detId.roll());
// new batch of eta partitions --> new chamber
if (rollNumber < oldRollNumber || i == partitions.size()) {
// don't forget the last partition for the last chamber
if (i == partitions.size()) vDetId.push_back(detId);

GEMDetId fId(vDetId.front());
GEMDetId chamberId(fId.chamberId());
//region(),fId.ring(),fId.station(),fId.layer(),fId.chamber(),0);

// compute the overall boundplane using the first eta partition
const GEMEtaPartition* p(geometry->etaPartition(fId));
const BoundPlane& bps = p->surface();
BoundPlane* bp = const_cast<BoundPlane*>(&bps);
ReferenceCountingPointer<BoundPlane> surf(bp);

GEMChamber* ch = new GEMChamber(chamberId, surf);
LogDebug("GEMGeometryBuilderFromDDD") << "Creating chamber " << chamberId << " with " << vDetId.size() << " eta partitions";

LogDebug("GEMGeometryBuilderFromDDD") << "Creating chamber " << chamberId << " with " << vDetId.size() << " eta partitions" << std::endl;
for(auto id : vDetId){
LogDebug("GEMGeometryBuilderFromDDD") << "Adding eta partition " << id << " to GEM chamber";
LogDebug("GEMGeometryBuilderFromDDD") << "Adding eta partition " << id << " to GEM chamber" << std::endl;
ch->add(const_cast<GEMEtaPartition*>(geometry->etaPartition(id)));
}

LogDebug("GEMGeometryBuilderFromDDD") << "Adding the chamber to the geometry";
LogDebug("GEMGeometryBuilderFromDDD") << "Adding the chamber to the geometry" << std::endl;
geometry->add(ch);
vDetId.clear();
}
vDetId.push_back(detId);
oldRollNumber = rollNumber;
}

auto& chambers(geometry->chambers());
// construct super chambers
for (unsigned i=0; i<chambers.size(); ++i){
const BoundPlane& bps = chambers.at(i)->surface();
BoundPlane* bp = const_cast<BoundPlane*>(&bps);
ReferenceCountingPointer<BoundPlane> surf(bp);
GEMDetId detIdL1(chambers.at(i)->id());
LogDebug("GEMGeometryBuilderFromDDD") << "First chamber for super chamber: " << detIdL1;

if (detIdL1.layer()==2) continue;
GEMDetId detIdL2(detIdL1.region(),detIdL1.ring(),detIdL1.station(),2,detIdL1.chamber(),0);
LogDebug("GEMGeometryBuilderFromDDD") << "Second chamber for super chamber: " << detIdL2;
auto ch2 = geometry->chamber(detIdL2);

LogDebug("GEMGeometryBuilderFromDDD") << "Creating new GEM super chamber out of chambers.";
LogDebug("GEMGeometryBuilderFromDDD") << "First chamber for super chamber: " << detIdL1 << std::endl;
LogDebug("GEMGeometryBuilderFromDDD") << "Second chamber for super chamber: " << detIdL2 << std::endl;

LogDebug("GEMGeometryBuilderFromDDD") << "Creating new GEM super chamber out of chambers." << std::endl;
GEMSuperChamber* sch = new GEMSuperChamber(detIdL1, surf);
sch->add(const_cast<GEMChamber*>(chambers.at(i)));
sch->add(const_cast<GEMChamber*>(ch2));

LogDebug("GEMGeometryBuilderFromDDD") << "Adding the super chamber to the geometry.";
LogDebug("GEMGeometryBuilderFromDDD") << "Adding the super chamber to the geometry." << std::endl;
geometry->add(sch);
}

auto& superChambers(geometry->superChambers());

// construct the regions, stations and rings.
std::cout << "maxStation " << maxStation << std::endl;
for (int re = -1; re <= 1; re = re+2) {
GEMRegion* region = new GEMRegion(re);
for (int st=1; st<=1; ++st) {
for (int st=1; st<=maxStation; ++st) {
GEMStation* station = new GEMStation(re, st);
station->setName("GE" + std::to_string(re) + "/" + std::to_string(st));
std::string name("GE" + std::to_string(re) + "/" + std::to_string(st));
// Closest (furthest) super chambers in GE2/1 are called GE2/1s (GE2/1l)
if (st==2) name = "GE" + std::to_string(re) + "/" + std::to_string(st) + "s";
if (st==3) name = "GE" + std::to_string(re) + "/" + std::to_string(st-1) + "l";
station->setName(name);
for (int ri=1; ri<=1; ++ri) {
GEMRing* ring = new GEMRing(re, st, ri);
for (unsigned sch=0; sch<superChambers.size(); ++sch){
Expand All @@ -241,6 +253,5 @@ GEMGeometry* GEMGeometryBuilderFromDDD::buildGeometry(DDFilteredView& fview, con
LogDebug("GEMGeometryBuilderFromDDD") << "Adding region " << re << " to the geometry " << std::endl;
geometry->add(region);
}

return geometry;
}

0 comments on commit 031ef2c

Please sign in to comment.