forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cms-sw#58 from jbsauvan/geometry-esproduct
Geometry included in EventSetup
- Loading branch information
Showing
22 changed files
with
166 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
L1Trigger/L1THGCal/plugins/HGCalTriggerGeometryESProducer.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
|
||
#include <memory> | ||
|
||
#include "FWCore/Framework/interface/ModuleFactory.h" | ||
#include "FWCore/Framework/interface/ESProducer.h" | ||
#include "FWCore/Framework/interface/ESHandle.h" | ||
#include "FWCore/Framework/interface/ESProducts.h" | ||
|
||
#include "L1Trigger/L1THGCal/interface/HGCalTriggerGeometryBase.h" | ||
|
||
class HGCalTriggerGeometryESProducer : public edm::ESProducer | ||
{ | ||
public: | ||
HGCalTriggerGeometryESProducer(const edm::ParameterSet&); | ||
~HGCalTriggerGeometryESProducer(); | ||
|
||
typedef std::unique_ptr<HGCalTriggerGeometryBase> ReturnType; | ||
|
||
ReturnType produce(const IdealGeometryRecord&); | ||
|
||
private: | ||
edm::ParameterSet geometry_config_; | ||
std::string geometry_name_; | ||
}; | ||
|
||
HGCalTriggerGeometryESProducer:: | ||
HGCalTriggerGeometryESProducer(const edm::ParameterSet& iConfig): | ||
geometry_config_(iConfig.getParameterSet("TriggerGeometry")), | ||
geometry_name_(geometry_config_.getParameter<std::string>("TriggerGeometryName")) | ||
{ | ||
setWhatProduced(this); | ||
} | ||
|
||
|
||
HGCalTriggerGeometryESProducer:: | ||
~HGCalTriggerGeometryESProducer() | ||
{ | ||
|
||
// do anything here that needs to be done at desctruction time | ||
// (e.g. close files, deallocate resources etc.) | ||
|
||
} | ||
|
||
HGCalTriggerGeometryESProducer::ReturnType | ||
HGCalTriggerGeometryESProducer:: | ||
produce(const IdealGeometryRecord& iRecord) | ||
{ | ||
//using namespace edm::es; | ||
ReturnType geometry(HGCalTriggerGeometryFactory::get()->create(geometry_name_,geometry_config_)); | ||
geometry->reset(); | ||
HGCalTriggerGeometryBase::es_info info; | ||
const std::string& ee_sd_name = geometry->eeSDName(); | ||
const std::string& fh_sd_name = geometry->fhSDName(); | ||
const std::string& bh_sd_name = geometry->bhSDName(); | ||
iRecord.get(ee_sd_name, info.geom_ee); | ||
iRecord.get(fh_sd_name, info.geom_fh); | ||
iRecord.get(bh_sd_name, info.geom_bh); | ||
iRecord.get(ee_sd_name, info.topo_ee); | ||
iRecord.get(fh_sd_name, info.topo_fh); | ||
iRecord.get(bh_sd_name, info.topo_bh); | ||
geometry->initialize(info); | ||
return geometry; | ||
|
||
} | ||
|
||
//define this as a plug-in | ||
DEFINE_FWK_EVENTSETUP_MODULE(HGCalTriggerGeometryESProducer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
L1Trigger/L1THGCal/python/hgcalTriggerGeometryESProducer_cfi.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
|
||
geometry = cms.PSet( TriggerGeometryName = cms.string('HGCalTriggerGeometryHexImp2'), | ||
L1TCellsMapping = cms.FileInPath("L1Trigger/L1THGCal/data/triggercell_mapping.txt"), | ||
L1TModulesMapping = cms.FileInPath("L1Trigger/L1THGCal/data/module_mapping.txt"), | ||
eeSDName = cms.string('HGCalEESensitive'), | ||
fhSDName = cms.string('HGCalHESiliconSensitive'), | ||
bhSDName = cms.string('HGCalHEScintillatorSensitive'), | ||
) | ||
|
||
hgcalTriggerGeometryESProducer = cms.ESProducer( | ||
'HGCalTriggerGeometryESProducer', | ||
TriggerGeometry = geometry | ||
) |
Oops, something went wrong.