12 estokenGeom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
14 for (
unsigned i(0);
i < nsubdetectors; ++
i) {
15 estokens_[
i] = esConsumes<HGCalGeometry, IdealGeometryRecord>(
edm::ESInputTag{
"", handles_str_[
i]});
17 trees_[
i]->Branch(
"cpu",
"ValidHitCollection", &cpuValidRecHits[
i]);
18 trees_[
i]->Branch(
"gpu",
"ValidHitCollection", &gpuValidRecHits[i]);
19 trees_[
i]->Branch(
"diffs",
"ValidHitCollection", &diffsValidRecHits[i]);
39 const auto &cpuhits =
event.get(
tokens_[idet][0]);
42 const auto &gpuhits =
event.get(
tokens_[idet][1]);
44 size_t nhits = cpuhits.size();
45 std::cout << nhits <<
", " << gpuhits.size() << std::endl;
46 assert(nhits == gpuhits.size());
48 for (
unsigned i(0); i <
nhits; i++) {
52 const float cpuEn = cpuHit.
energy();
53 const float gpuEn = gpuHit.
energy();
56 const float cpuTime = cpuHit.
time();
57 const float gpuTime = gpuHit.
time();
58 const float cpuTimeErr = cpuHit.
timeError();
59 const float gpuTimeErr = gpuHit.
timeError();
62 const float cpuFB = cpuHit.
flagBits();
63 const float gpuFB = gpuHit.
flagBits();
68 ValidHit vCPU(cpuEn, cpuTime, cpuTimeErr, cpuDetId, cpuFB, cpuSoN);
69 ValidHit vGPU(gpuEn, gpuTime, gpuTimeErr, gpuDetId, gpuFB, gpuSoN);
72 cpuTimeErr - gpuTimeErr,
constexpr float energy() const
static const std::string kSharedResource
HeterogeneousHGCalRecHitsValidator(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
constexpr const DetId & detid() const
std::array< ValidHitCollection, nsubdetectors > cpuValidRecHits
std::array< edm::ESGetToken< HGCalGeometry, IdealGeometryRecord >, nsubdetectors > estokens_
float signalOverSigmaNoise() const
void analyze(const edm::Event &, const edm::EventSetup &) override
bool getData(T &iHolder) const
std::array< std::array< edm::EDGetTokenT< HGChefRecHitCollection >, ncomputingdevices >, nsubdetectors > tokens_
static const unsigned nsubdetectors
uint32_t flagBits() const
constexpr float time() const
void set_geometry_(const edm::EventSetup &, const unsigned &)
~HeterogeneousHGCalRecHitsValidator() override
std::vector< edm::EDGetTokenT< int > > tokens_
std::array< ValidHitCollection, nsubdetectors > gpuValidRecHits
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > estokenGeom_
T getParameter(std::string const &) const
hgcal::RecHitTools recHitTools_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
treenames_({{"CEE","CHSi","CHSci"}})
std::array< ValidHitCollection, nsubdetectors > diffsValidRecHits