-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 #36041 from bsunanda/Phase2-hgx294B
Phase2-294B Extend functionality of RecHitTools of HGCal and add a testing code
- Loading branch information
Showing
5 changed files
with
139 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<use name="FWCore/MessageLogger"/> | ||
<use name="FWCore/ParameterSet"/> | ||
<use name="FWCore/Framework"/> | ||
<use name="Geometry/HGCalGeometry"/> | ||
<use name="Geometry/Records"/> | ||
<use name="RecoLocalCalo/HGCalRecAlgos"/> | ||
<flags EDM_PLUGIN="1"/> | ||
<library name="RecoLocalCaloHGCalRecAlgosTestPlugin" file="*.cc"> | ||
</library> |
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,57 @@ | ||
#include "FWCore/Framework/interface/one/EDAnalyzer.h" | ||
#include "FWCore/Framework/interface/EventSetup.h" | ||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
#include "FWCore/MessageLogger/interface/MessageLogger.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" | ||
#include "Geometry/CaloGeometry/interface/CaloGeometry.h" | ||
#include "Geometry/Records/interface/CaloGeometryRecord.h" | ||
#include "DataFormats/ForwardDetId/interface/HGCScintillatorDetId.h" | ||
#include "DataFormats/ForwardDetId/interface/HGCSiliconDetId.h" | ||
#include "RecoLocalCalo/HGCalRecAlgos/interface/RecHitTools.h" | ||
|
||
#include <vector> | ||
|
||
class HGCalTestRecHitTools : public edm::one::EDAnalyzer<> { | ||
public: | ||
explicit HGCalTestRecHitTools(const edm::ParameterSet&); | ||
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); | ||
|
||
void beginJob() override {} | ||
void analyze(edm::Event const& iEvent, edm::EventSetup const&) override; | ||
void endJob() override {} | ||
|
||
private: | ||
const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> tok_geom_; | ||
hgcal::RecHitTools tool_; | ||
}; | ||
|
||
HGCalTestRecHitTools::HGCalTestRecHitTools(const edm::ParameterSet&) | ||
: tok_geom_(esConsumes<CaloGeometry, CaloGeometryRecord>()) {} | ||
|
||
void HGCalTestRecHitTools::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { | ||
edm::ParameterSetDescription desc; | ||
descriptions.add("hgcalRecHitTools", desc); | ||
} | ||
|
||
void HGCalTestRecHitTools::analyze(const edm::Event& /*iEvent*/, const edm::EventSetup& iSetup) { | ||
const CaloGeometry geo = iSetup.getData(tok_geom_); | ||
tool_.setGeometry(geo); | ||
|
||
edm::LogVerbatim("HGCalGeom") << "EE: Last Layer " << tool_.lastLayerEE(); | ||
edm::LogVerbatim("HGCalGeom") << "FH: Last Layer " << tool_.lastLayerFH(); | ||
edm::LogVerbatim("HGCalGeom") << "BH: First & Last Layer " << tool_.firstLayerBH() << ":" << tool_.lastLayerBH(); | ||
edm::LogVerbatim("HGCalGeom") << "Last Layer " << tool_.lastLayer(); | ||
std::vector<DetId::Detector> dets = {DetId::HGCalEE, DetId::HGCalHSi, DetId::HGCalHSc}; | ||
for (const auto& det : dets) { | ||
auto layer = tool_.firstAndLastLayer(det, 0); | ||
edm::LogVerbatim("HGCalGeom") << "First & Last Layer for Det " << det << " are " << layer.first << ":" | ||
<< layer.second; | ||
} | ||
|
||
edm::LogVerbatim("HGCalGeom") << "Maximum # of wafers per layer " << tool_.maxNumberOfWafersPerLayer(); | ||
edm::LogVerbatim("HGCalGeom") << "Maximum # of iphi: " << tool_.getScintMaxIphi(); | ||
edm::LogVerbatim("HGCalGeom") << "Geometry type " << tool_.getGeometryType(); | ||
} | ||
|
||
DEFINE_FWK_MODULE(HGCalTestRecHitTools); |
38 changes: 38 additions & 0 deletions
38
RecoLocalCalo/HGCalRecAlgos/test/testHGCalRecHitTools_cfg.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,38 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 | ||
process = cms.Process('PROD',Phase2C11) | ||
|
||
process.load("SimGeneral.HepPDTESSource.pdt_cfi") | ||
process.load('Configuration.Geometry.GeometryExtended2026D86Reco_cff') | ||
process.load('FWCore.MessageService.MessageLogger_cfi') | ||
process.load("RecoLocalCalo.HGCalRecAlgos.hgcalRecHitTools_cfi") | ||
|
||
if hasattr(process,'MessageLogger'): | ||
process.MessageLogger.HGCalGeom=dict() | ||
|
||
process.load("IOMC.RandomEngine.IOMC_cff") | ||
process.RandomNumberGeneratorService.generator.initialSeed = 456789 | ||
|
||
process.source = cms.Source("EmptySource") | ||
|
||
process.generator = cms.EDProducer("FlatRandomEGunProducer", | ||
PGunParameters = cms.PSet( | ||
PartID = cms.vint32(14), | ||
MinEta = cms.double(-3.5), | ||
MaxEta = cms.double(3.5), | ||
MinPhi = cms.double(-3.14159265359), | ||
MaxPhi = cms.double(3.14159265359), | ||
MinE = cms.double(9.99), | ||
MaxE = cms.double(10.01) | ||
), | ||
AddAntiParticle = cms.bool(False), | ||
Verbosity = cms.untracked.int32(0), | ||
firstRun = cms.untracked.uint32(1) | ||
) | ||
|
||
process.maxEvents = cms.untracked.PSet( | ||
input = cms.untracked.int32(1) | ||
) | ||
|
||
process.p1 = cms.Path(process.generator*process.hgcalRecHitTools) |