Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Validation/HGCalValidation/interface/HGCalValidator.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* \author HGCal
*/
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/EDGetToken.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
Expand Down
9 changes: 4 additions & 5 deletions Validation/HGCalValidation/plugins/HGCalShowerSeparation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"

#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"

Expand Down Expand Up @@ -55,6 +54,7 @@ class HGCalShowerSeparation : public DQMEDAnalyzer {

edm::EDGetTokenT<std::unordered_map<DetId, const HGCRecHit*>> hitMap_;
edm::EDGetTokenT<std::vector<CaloParticle>> caloParticles_;
const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> tok_geom_;

int debug_;
bool filterOnEnergyAndCaloP_;
Expand Down Expand Up @@ -82,7 +82,8 @@ class HGCalShowerSeparation : public DQMEDAnalyzer {
};

HGCalShowerSeparation::HGCalShowerSeparation(const edm::ParameterSet& iConfig)
: debug_(iConfig.getParameter<int>("debug")),
: tok_geom_(esConsumes<CaloGeometry, CaloGeometryRecord>()),
debug_(iConfig.getParameter<int>("debug")),
filterOnEnergyAndCaloP_(iConfig.getParameter<bool>("filterOnEnergyAndCaloP")) {
auto hitMapInputTag = iConfig.getParameter<edm::InputTag>("hitMapTag");
auto caloParticles = iConfig.getParameter<edm::InputTag>("caloParticles");
Expand Down Expand Up @@ -160,9 +161,7 @@ void HGCalShowerSeparation::bookHistograms(DQMStore::IBooker& ibooker,
void HGCalShowerSeparation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
using namespace edm;

edm::ESHandle<CaloGeometry> geom;
iSetup.get<CaloGeometryRecord>().get(geom);
recHitTools_.setGeometry(*geom);
recHitTools_.setGeometry(iSetup.getData(tok_geom_));

Handle<std::vector<CaloParticle>> caloParticleHandle;
iEvent.getByToken(caloParticles_, caloParticleHandle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ HeterogeneousHGCalRecHitsValidator::HeterogeneousHGCalRecHitsValidator(const edm
consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("gpuRecHitsHSciToken"))}}}}),
treenames_({{"CEE", "CHSi", "CHSci"}}) {
usesResource(TFileService::kSharedResource);
estokenGeom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
edm::Service<TFileService> fs;
for (unsigned i(0); i < nsubdetectors; ++i) {
estokens_[i] = esConsumes<HGCalGeometry, IdealGeometryRecord>(edm::ESInputTag{"", handles_str_[i]});
trees_[i] = fs->make<TTree>(treenames_[i].c_str(), treenames_[i].c_str());
trees_[i]->Branch("cpu", "ValidHitCollection", &cpuValidRecHits[i]);
trees_[i]->Branch("gpu", "ValidHitCollection", &gpuValidRecHits[i]);
Expand All @@ -23,14 +25,11 @@ HeterogeneousHGCalRecHitsValidator::~HeterogeneousHGCalRecHitsValidator() {}
void HeterogeneousHGCalRecHitsValidator::endJob() {}

void HeterogeneousHGCalRecHitsValidator::set_geometry_(const edm::EventSetup &setup, const unsigned &detidx) {
edm::ESHandle<HGCalGeometry> handle;
setup.get<IdealGeometryRecord>().get(handles_str_[detidx], handle);
edm::ESHandle<HGCalGeometry> handle = setup.getHandle(estokens_[detidx]);
}

void HeterogeneousHGCalRecHitsValidator::analyze(const edm::Event &event, const edm::EventSetup &setup) {
edm::ESHandle<CaloGeometry> baseGeom;
setup.get<CaloGeometryRecord>().get(baseGeom);
recHitTools_.setGeometry(*baseGeom);
recHitTools_.setGeometry(setup.getData(estokenGeom_));

//future subdetector loop
for (size_t idet = 0; idet < nsubdetectors; ++idet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#include "CommonTools/UtilAlgos/interface/TFileService.h"
#include "DataFormats/HGCRecHit/interface/HGCRecHit.h"
#include "DataFormats/HGCRecHit/interface/HGCRecHitCollections.h"
#include "Geometry/Records/interface/CaloGeometryRecord.h"
#include "Geometry/Records/interface/IdealGeometryRecord.h"
#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
#include "Geometry/HGCalGeometry/interface/HGCalGeometry.h"
#include "RecoLocalCalo/HGCalRecAlgos/interface/RecHitTools.h"
#include "Validation/HGCalValidation/interface/ValidHit.h"
Expand Down Expand Up @@ -41,6 +43,9 @@ class HeterogeneousHGCalRecHitsValidator : public edm::one::EDAnalyzer<edm::one:
static const unsigned ncomputingdevices = 2; //cpu, gpu
//cpu amd gpu tokens and handles for the 3 subdetectors, cpu and gpu
std::array<std::array<edm::EDGetTokenT<HGChefRecHitCollection>, ncomputingdevices>, nsubdetectors> tokens_;
std::array<edm::ESGetToken<HGCalGeometry, IdealGeometryRecord>, nsubdetectors> estokens_;
edm::ESGetToken<CaloGeometry, CaloGeometryRecord> estokenGeom_;

std::array<std::string, nsubdetectors> handles_str_ = {
{"HGCalEESensitive", "HGCalHESiliconSensitive", "HGCalHEScintillatorSensitive"}};
hgcal::RecHitTools recHitTools_;
Expand Down
Loading