Skip to content

Commit

Permalink
add baseline processing for HGCal geometry to Fireworks
Browse files Browse the repository at this point in the history
  • Loading branch information
lgray committed Feb 5, 2016
1 parent 323c8c1 commit 9a9dca1
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
1 change: 1 addition & 0 deletions Fireworks/Geometry/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<use name="Geometry/CSCGeometryBuilder"/>
<use name="DetectorDescription/Core"/>
<use name="Geometry/CaloGeometry"/>
<use name="Geometry/HGCalGeometry"/>
<use name="Geometry/DTGeometry"/>
<use name="Geometry/CSCGeometry"/>
<use name="Geometry/RPCGeometry"/>
Expand Down
10 changes: 6 additions & 4 deletions Fireworks/Geometry/interface/FWRecoGeometryESProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace edm
}

class CaloGeometry;
class HGCalGeometry;
class GlobalTrackingGeometry;
class TrackerGeometry;
class FWRecoGeometry;
Expand Down Expand Up @@ -48,10 +49,11 @@ class FWRecoGeometryESProducer : public edm::ESProducer
void fillPoints( unsigned int id, std::vector<GlobalPoint>::const_iterator begin, std::vector<GlobalPoint>::const_iterator end );
void fillShapeAndPlacement( unsigned int id, const GeomDet *det );

edm::ESHandle<GlobalTrackingGeometry> m_geomRecord;
edm::ESHandle<CaloGeometry> m_caloGeom;
const TrackerGeometry* m_trackerGeom;
boost::shared_ptr<FWRecoGeometry> m_fwGeometry;
edm::ESHandle<GlobalTrackingGeometry> m_geomRecord;
edm::ESHandle<CaloGeometry> m_caloGeom;
std::vector<edm::ESHandle<HGCalGeometry> > m_hgcalGeoms;
const TrackerGeometry* m_trackerGeom;
boost::shared_ptr<FWRecoGeometry> m_fwGeometry;

unsigned int m_current;
};
Expand Down
9 changes: 9 additions & 0 deletions Fireworks/Geometry/python/dumpRecoGeometry_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ def recoGeoLoad(score):
#from SLHCUpgradeSimulations.Configuration.combinedCustoms import cust_2019
#process = cust_2019(process)

elif score == "2023Dev":
from Configuration.AlCa.autoCond import autoCond
process.GlobalTag.globaltag = autoCond['mc']
#from Configuration.AlCa.GlobalTag import GlobalTag
#process.GlobalTag = GlobalTag(process.GlobalTag, 'PH2_1K_FB_V6::All', '')
process.load('Configuration.Geometry.GeometryExtended2023DevReco_cff')
#from SLHCUpgradeSimulations.Configuration.combinedCustoms import cust_2019
#process = cust_2019(process)

elif score == "2023Muon":
from Configuration.AlCa.autoCond import autoCond
process.GlobalTag.globaltag = autoCond['mc']
Expand Down
24 changes: 24 additions & 0 deletions Fireworks/Geometry/src/FWRecoGeometryESProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "DataFormats/GeometrySurface/interface/TrapezoidalPlaneBounds.h"
#include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
#include "Geometry/HGCalGeometry/interface/HGCalGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
#include "Geometry/CSCGeometry/interface/CSCGeometry.h"
#include "Geometry/DTGeometry/interface/DTGeometry.h"
Expand Down Expand Up @@ -63,6 +64,12 @@
m_fwGeometry->idToName[rawid].topology[3] = topo->pitch(); \
} \
} \

namespace {
static const std::array<std::string,3> hgcal_geom_names = { { "HGCalEESensitive",
"HGCalHESiliconSensitive",
"HGCalHEScintillatorSensitive" } };
}

FWRecoGeometryESProducer::FWRecoGeometryESProducer( const edm::ParameterSet& )
: m_current( -1 )
Expand All @@ -86,6 +93,14 @@ FWRecoGeometryESProducer::produce( const FWRecoGeometryRecord& record )
m_trackerGeom = (const TrackerGeometry*) m_geomRecord->slaveGeometry( detId );

record.getRecord<CaloGeometryRecord>().get( m_caloGeom );
edm::ESHandle<HGCalGeometry> test;
for( const auto& name : hgcal_geom_names ) {
const auto& calogr = record.getRecord<CaloGeometryRecord>();
calogr.getRecord<IdealGeometryRecord>().get( name , test );
if( test.isValid() ) {
m_hgcalGeoms.push_back(test);
}
}

addPixelBarrelGeometry( );
addPixelForwardGeometry();
Expand Down Expand Up @@ -470,6 +485,15 @@ FWRecoGeometryESProducer::addCaloGeometry( void )
unsigned int id = insert_id( it->rawId());
fillPoints( id, cor.begin(), cor.end());
}
for( const auto& hgc : m_hgcalGeoms ) {
const auto& hgcprod = *hgc;
const auto& vid = hgcprod.getValidDetIds();
for( const auto& id : vid ) {
uint32_t intid = insert_id( id.rawId() );
const auto& cor = hgcprod.getCorners( id );
fillPoints( intid, cor.begin(), cor.end() );
}
}
}

unsigned int
Expand Down

0 comments on commit 9a9dca1

Please sign in to comment.