10 treenames_({{
"CEE",
"CHSi",
"CHSci"}}) {
12 estokenGeom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
14 for (
unsigned i(0);
i < nsubdetectors; ++
i) {
15 estokens_[
i] = esConsumes<HGCalGeometry, IdealGeometryRecord>(
edm::ESInputTag{
"", handles_str_[
i]});
16 trees_[
i] =
fs->make<TTree>(treenames_[
i].c_str(), treenames_[
i].c_str());
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();
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,
static const std::string kSharedResource
HeterogeneousHGCalRecHitsValidator(const edm::ParameterSet &)
T getParameter(std::string const &) const
constexpr const DetId & detid() const
#define DEFINE_FWK_MODULE(type)
float signalOverSigmaNoise() const
std::array< ValidHitCollection, nsubdetectors > cpuValidRecHits
std::array< edm::ESGetToken< HGCalGeometry, IdealGeometryRecord >, nsubdetectors > estokens_
constexpr float energy() const
void analyze(const edm::Event &, const edm::EventSetup &) override
std::array< std::array< edm::EDGetTokenT< HGChefRecHitCollection >, ncomputingdevices >, nsubdetectors > tokens_
std::array< TTree *, nsubdetectors > trees_
static const unsigned nsubdetectors
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_
constexpr float time() const
uint32_t flagBits() const
hgcal::RecHitTools recHitTools_
std::array< ValidHitCollection, nsubdetectors > diffsValidRecHits