Skip to content

Commit

Permalink
Merged fireworks-gem-75x from repository jshlee
Browse files Browse the repository at this point in the history
Conflicts:
	Fireworks/Geometry/python/dumpSimGeometry_cfg.py
  • Loading branch information
jshlee committed May 5, 2015
2 parents 789dd23 + e783683 commit fe7d957
Show file tree
Hide file tree
Showing 17 changed files with 649 additions and 150 deletions.
25 changes: 2 additions & 23 deletions Configuration/Geometry/python/GeometryExtended2023MuonReco_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Reconstruction geometry services
# Tracking Geometry
#bah - well, this is not a cfi!
from Geometry.CommonDetUnit.globalTracking2023Geometry_cfi import *
from Geometry.CommonDetUnit.globalTrackingGeometry_cfi import *

#Tracker
from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import *
Expand All @@ -22,32 +22,11 @@
from Geometry.TrackerGeometryBuilder.idealForDigiTrackerSLHCGeometry_cff import *
from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import *
from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import *
trackerSLHCGeometry.applyAlignment = cms.bool(False)
trackerGeometry.applyAlignment = cms.bool(False)

# 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 *

## Include EE and ES back temporarily
from Geometry.CaloEventSetup.CaloGeometry_cff 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.EcalTrigTowerConstituents_cfi import *
from Geometry.EcalMapping.EcalMapping_cfi import *
from Geometry.EcalMapping.EcalMappingRecord_cfi import *
from Geometry.HcalCommonData.hcalRecNumberingInitialization_cfi import *

8 changes: 8 additions & 0 deletions Configuration/Geometry/python/GeometryExtended2023Muon_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import FWCore.ParameterSet.Config as cms
#
# Geometry master configuration
#
# Ideal geometry, needed for simulation
from Geometry.CMSCommonData.cmsExtendedGeometry2023MuonXML_cfi import *
from Geometry.TrackerNumberingBuilder.trackerTopology2023Constants_cfi import *
#from Geometry.HcalCommonData.hcalSimNumberingInitialization_cfi import *
1 change: 1 addition & 0 deletions Fireworks/Core/interface/FWRPZView.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class FWRPZView : public FWEveView
FWBoolParameter m_showTrackerEndcap;
FWBoolParameter m_showRpcEndcap;
FWBoolParameter m_showGEM;
FWBoolParameter m_showME0;

FWBoolParameter m_shiftOrigin;
FWDoubleParameter m_fishEyeDistortion;
Expand Down
2 changes: 2 additions & 0 deletions Fireworks/Core/interface/FWRPZViewGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class FWRPZViewGeometry : public FWViewGeometryList
void showTrackerEndcap( bool );
void showRpcEndcap( bool );
void showGEM( bool );
void showME0( bool );

private:
FWRPZViewGeometry(const FWRPZViewGeometry&); // stop default
Expand Down Expand Up @@ -77,6 +78,7 @@ class FWRPZViewGeometry : public FWViewGeometryList
TEveElementList* m_trackerEndcapElements;
TEveElementList* m_rpcEndcapElements;
TEveElementList* m_GEMElements;
TEveElementList* m_ME0Elements;

};

Expand Down
132 changes: 84 additions & 48 deletions Fireworks/Core/src/FW3DViewGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "DataFormats/MuonDetId/interface/DTChamberId.h"
#include "DataFormats/MuonDetId/interface/CSCDetId.h"
#include "DataFormats/MuonDetId/interface/GEMDetId.h"
#include "DataFormats/MuonDetId/interface/ME0DetId.h"

#include "DataFormats/SiPixelDetId/interface/PXBDetId.h"
#include "DataFormats/SiPixelDetId/interface/PXFDetId.h"
Expand Down Expand Up @@ -168,79 +169,114 @@ FW3DViewGeometry::showMuonEndcap( bool showMuonEndcap )
else
cEndcap = new TEveElementList( "CSC Backward" );
m_muonEndcapElements->AddElement( cEndcap );
// Actual CSC geometry:
// Station 1 has 4 rings with 36 chambers in each
// Station 2: ring 1 has 18 chambers, ring 2 has 36 chambers
// Station 3: ring 1 has 18 chambers, ring 2 has 36 chambers
// Station 4: ring 1 has 18 chambers
Int_t maxChambers = 36;
// Actual CSC geometry:
// Station 1 has 4 rings with 36 chambers in each
// Station 2: ring 1 has 18 chambers, ring 2 has 36 chambers
// Station 3: ring 1 has 18 chambers, ring 2 has 36 chambers
// Station 4: ring 1 has 18 chambers
Int_t maxChambers = 36;
for( Int_t iStation = 1; iStation <= 4; ++iStation )
{
std::ostringstream s; s << "Station" << iStation;
TEveElementList* cStation = new TEveElementList( s.str().c_str() );
cEndcap->AddElement( cStation );
for( Int_t iRing = 1; iRing <= 4; ++iRing )
{
{
if( iStation > 1 && iRing > 2 ) continue;
if( iStation > 3 && iRing > 1 ) continue;
std::ostringstream s; s << "Ring" << iRing;
TEveElementList* cRing = new TEveElementList( s.str().c_str() );
cStation->AddElement( cRing );
( iRing == 1 && iStation > 1 ) ? ( maxChambers = 18 ) : ( maxChambers = 36 );
( iRing == 1 && iStation > 1 ) ? ( maxChambers = 18 ) : ( maxChambers = 36 );
for( Int_t iChamber = 1; iChamber <= maxChambers; ++iChamber )
{
Int_t iLayer = 0; // chamber
CSCDetId id( iEndcap, iStation, iRing, iChamber, iLayer );
TEveGeoShape* shape = m_geom->getEveShape( id.rawId() );
CSCDetId id( iEndcap, iStation, iRing, iChamber, iLayer );
TEveGeoShape* shape = m_geom->getEveShape( id.rawId() );
shape->SetTitle(TString::Format("CSC: %s, S=%d, R=%d, C=%d\ndet-id=%u",
cEndcap->GetName(), iStation, iRing, iChamber, id.rawId()));

addToCompound(shape, kFWMuonEndcapLineColorIndex);
cRing->AddElement( shape );
cRing->AddElement( shape );
}
}
}
}
}

// m_muonEndcapElements->AddElement(CSClist);


TEveElementList* GEMlist = new TEveCompound( "GEM" );
for( Int_t iRegion = GEMDetId::minRegionId; iRegion <= GEMDetId::maxRegionId; ++iRegion )
{
for( Int_t iStation = GEMDetId::minStationId; iStation <= GEMDetId::maxStationId; ++iStation )
{
TEveElementList* cStation = new TEveCompound(Form("Station_%d Region_%d", iStation, iRegion) );
GEMlist->AddElement( cStation );
for( Int_t iRing = GEMDetId::minRingId; iRing <= GEMDetId::maxRingId; ++iRing )
{
TEveCompound* cRing = new TEveCompound( Form("Ring_%d", iRing) );
cStation->AddElement( cRing );
for( Int_t iChamber = GEMDetId::minChamberId; iChamber <= GEMDetId::maxChamberId; ++iChamber )
{
for( Int_t iLayer = GEMDetId::minLayerId; iLayer <= GEMDetId::maxLayerId ; ++iLayer )
{
for (Int_t iRoll = GEMDetId::minRollId; iRoll <= GEMDetId::maxRollId ; ++iRoll )
{
GEMDetId id( iRegion, iRing, iStation, iLayer, iChamber, iRoll );
TEveGeoShape* shape = m_geom->getEveShape( id.rawId() );
shape->SetTitle(TString::Format("GEM: , Rng=%d, St=%d, Ch=%d Rl=%d\ndet-id=%u",
iRing, iStation, iChamber, iRoll, id.rawId()));
// hardcoded gem and me0; need to find better way for different gem geometries
for( Int_t iRegion = GEMDetId::minRegionId; iRegion <= GEMDetId::maxRegionId; iRegion= iRegion+2){
TEveElementList* teEndcap = 0;
if( iRegion == 1 )
teEndcap = new TEveElementList( "GEM Forward" );
else
teEndcap = new TEveElementList( "GEM Backward" );
m_muonEndcapElements->AddElement( teEndcap );

int mxSt = m_geom->versionInfo().haveExtraDet("GE2") ? 3:1;

for( Int_t iStation = GEMDetId::minStationId; iStation <= mxSt; ++iStation ){
std::ostringstream s; s << "Station" << iStation;
TEveElementList* cStation = new TEveElementList( s.str().c_str() );
teEndcap->AddElement( cStation );

Int_t iRing = 1;
for( Int_t iLayer = GEMDetId::minLayerId; iLayer <= GEMDetId::maxLayerId ; ++iLayer ){
int maxChamber = 36;
if (iStation >= 2) maxChamber = 18;

for( Int_t iChamber = 1; iChamber <= maxChamber; ++iChamber ){
int maxRoll = iChamber%2 ? 9:10;
if (iStation == 2) maxRoll = 8;
if (iStation == 3) maxRoll = 12;

for (Int_t iRoll = GEMDetId::minRollId; iRoll <= maxRoll ; ++iRoll ){
GEMDetId id( iRegion, iRing, iStation, iLayer, iChamber, iRoll );
TEveGeoShape* shape = m_geom->getEveShape( id.rawId() );
if (shape){
shape->SetTitle(TString::Format("GEM: , Rng=%d, St=%d, Ch=%d Rl=%d\ndet-id=%u",
iRing, iStation, iChamber, iRoll, id.rawId()));

cRing->AddElement( shape );
addToCompound(shape, kFWMuonEndcapLineColorIndex );
}
}
}
}
}
cStation->AddElement( shape );
addToCompound(shape, kFWMuonEndcapLineColorIndex);
}
}
}
}
}
}
m_muonEndcapElements->AddElement(GEMlist);

// EVE debug :: add list on bottom of TEveBrowser list tree
gEve->AddToListTree(GEMlist, false);
// adding me0
if (m_geom->versionInfo().haveExtraDet("ME0") ){
for( Int_t iRegion = ME0DetId::minRegionId; iRegion <= ME0DetId::maxRegionId; iRegion= iRegion+2 ){
TEveElementList* teEndcap = 0;
if( iRegion == 1 )
teEndcap = new TEveElementList( "ME0 Forward" );
else
teEndcap = new TEveElementList( "ME0 Backward" );
m_muonEndcapElements->AddElement( teEndcap );

for( Int_t iLayer = 1; iLayer <= 6 ; ++iLayer ){
std::ostringstream s; s << "Layer" << iLayer;
TEveElementList* cLayer = new TEveElementList( s.str().c_str() );
teEndcap->AddElement( cLayer );

for( Int_t iChamber = 1; iChamber <= 18; ++iChamber ){
Int_t iRoll = 1;
// for (Int_t iRoll = ME0DetId::minRollId; iRoll <= ME0DetId::maxRollId ; ++iRoll ){
ME0DetId id( iRegion, iLayer, iChamber, iRoll );
TEveGeoShape* shape = m_geom->getEveShape( id.rawId() );
if (shape){
shape->SetTitle(TString::Format("ME0: , Ch=%d Rl=%d\ndet-id=%u",
iChamber, iRoll, id.rawId()));

addToCompound(shape, kFWMuonEndcapLineColorIndex );
cLayer->AddElement( shape );
}
}
}
}
}

AddElement( m_muonEndcapElements );

}

if( m_muonEndcapElements )
Expand Down
4 changes: 4 additions & 0 deletions Fireworks/Core/src/FWRPZView.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ FWRPZView::FWRPZView(TEveWindowSlot* iParent, FWViewType::EType id) :
m_showTrackerEndcap(this, "Show Tracker Endcap", false),
m_showRpcEndcap(this, "Show RPC Endcap", false ),
m_showGEM(this, "Show GEM", false ),
m_showME0(this, "Show ME0", false ),

m_shiftOrigin(this,"Shift origin to beam-spot", false),
m_fishEyeDistortion(this,"Distortion",0., 0., 100.),
Expand Down Expand Up @@ -178,6 +179,7 @@ FWRPZView::setContext(const fireworks::Context& ctx)
m_showTrackerEndcap.changed_.connect(boost::bind(&FWRPZViewGeometry::showTrackerEndcap,m_geometryList,_1));
m_showRpcEndcap.changed_.connect(boost::bind(&FWRPZViewGeometry::showRpcEndcap,m_geometryList,_1));
m_showGEM.changed_.connect(boost::bind(&FWRPZViewGeometry::showGEM,m_geometryList,_1));
m_showME0.changed_.connect(boost::bind(&FWRPZViewGeometry::showME0,m_geometryList,_1));

}

Expand Down Expand Up @@ -408,6 +410,8 @@ FWRPZView::populateController(ViewerParameterGUI& gui) const
det.addParam(&m_showRpcEndcap);
bool showGEM = m_context->getGeom()->versionInfo().haveExtraDet("GEM");
if (showGEM) det.addParam(&m_showGEM);
bool showME0 = m_context->getGeom()->versionInfo().haveExtraDet("ME0");
if (showME0) det.addParam(&m_showME0);
}

#ifdef TEVEPROJECTIONS_DISPLACE_ORIGIN_MODE
Expand Down
103 changes: 71 additions & 32 deletions Fireworks/Core/src/FWRPZViewGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "DataFormats/MuonDetId/interface/CSCDetId.h"
#include "DataFormats/MuonDetId/interface/RPCDetId.h"
#include "DataFormats/MuonDetId/interface/GEMDetId.h"
#include "DataFormats/MuonDetId/interface/ME0DetId.h"

//
//
Expand All @@ -61,7 +62,8 @@ FWRPZViewGeometry::FWRPZViewGeometry(const fireworks::Context& context):
m_trackerBarrelElements(0),
m_trackerEndcapElements(0),
m_rpcEndcapElements(0),
m_GEMElements(0)
m_GEMElements(0),
m_ME0Elements(0)
{
SetElementName("RPZGeomShared");
}
Expand Down Expand Up @@ -549,40 +551,77 @@ FWRPZViewGeometry::showRpcEndcap( bool show )
void
FWRPZViewGeometry::showGEM( bool show )
{
if( !m_GEMElements && show )
{
m_GEMElements = new TEveElementList("GEM");

// hardcoded gem and me0; need to find better way for different gem geometries
if( !m_GEMElements && show ){
m_GEMElements = new TEveElementList("GEM");

for( Int_t iRegion = GEMDetId::minRegionId; iRegion <= GEMDetId::maxRegionId; iRegion= iRegion+2){
int mxSt = m_geom->versionInfo().haveExtraDet("GE2") ? 3:1;

for( Int_t iStation = GEMDetId::minStationId; iStation <= mxSt; ++iStation ){
Int_t iRing = 1;
for( Int_t iLayer = GEMDetId::minLayerId; iLayer <= GEMDetId::maxLayerId ; ++iLayer ){
int maxChamber = 36;
if (iStation >= 2) maxChamber = 18;

for( Int_t iChamber = 1; iChamber <= maxChamber; ++iChamber ){
int maxRoll = iChamber%2 ? 9:10;
if (iStation == 2) maxRoll = 8;
if (iStation == 3) maxRoll = 12;

for (Int_t iRoll = GEMDetId::minRollId; iRoll <= maxRoll ; ++iRoll ){
GEMDetId id( iRegion, iRing, iStation, iLayer, iChamber, iRoll );
TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
if (shape){
addToCompound(shape, kFWMuonEndcapLineColorIndex);
m_GEMElements->AddElement( shape );
gEve->AddToListTree(shape, true);
}
}
}
}
}
}

std::vector<GEMDetId> ids;
int rArr [] = { -1, 1}; // front back region
int cArr [] = { 9, 10, 29, 30}; // top bottom chamber

for (int ri = 0; ri < 2; ++ri )
for (int ci= 0; ci < 4; ++ci) {
int minRoll = 2;
//if (ci == 1 || ci == 3) minRoll = 2;
for (int roll = minRoll; roll <=10; ++roll)
for (int layer = 1; layer <=2; ++layer)
{
GEMDetId id(rArr[ri], 1, 1, layer, cArr[ci], roll);
TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
addToCompound(shape, kFWMuonEndcapLineColorIndex);
m_GEMElements->AddElement( shape );
}
}


AddElement(m_GEMElements);
importNew(m_GEMElements);
}
if (m_GEMElements){
m_GEMElements->SetRnrState(show);
gEve->Redraw3D();
}
}

AddElement(m_GEMElements);
importNew(m_GEMElements);
}
if (m_GEMElements)
{
m_GEMElements->SetRnrState(show);
gEve->Redraw3D();
}
void
FWRPZViewGeometry::showME0( bool show )
{
if( !m_ME0Elements && show ){
m_ME0Elements = new TEveElementList("ME0");

for( Int_t iRegion = ME0DetId::minRegionId; iRegion <= ME0DetId::maxRegionId; iRegion= iRegion+2 ){
for( Int_t iLayer = 1; iLayer <= 6 ; ++iLayer ){
for( Int_t iChamber = 1; iChamber <= 18; ++iChamber ){
Int_t iRoll = 1;
ME0DetId id( iRegion, iLayer, iChamber, iRoll );
TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
if (shape){
addToCompound(shape, kFWMuonEndcapLineColorIndex);
m_ME0Elements->AddElement( shape );
gEve->AddToListTree(shape, true);
}
}
}
}

AddElement(m_ME0Elements);
importNew(m_ME0Elements);
}
if (m_ME0Elements){
m_ME0Elements->SetRnrState(show);
gEve->Redraw3D();
}
}

//-------------------------------------

void FWRPZViewGeometry::importNew(TEveElementList* x)
Expand Down
Loading

0 comments on commit fe7d957

Please sign in to comment.