CMS 3D CMS Logo

HeterogeneousHGCalRecHitsValidator.h
Go to the documentation of this file.
1 #ifndef _HGCalMaskResolutionAna_h_
2 #define _HGCalMaskResolutionAna_h_
3 
18 
19 #include "TTree.h"
20 #include "TH1F.h"
21 
22 #include <iostream>
23 #include <string>
24 
25 struct ValidRecHits {
26  std::vector<float> energy;
27  std::vector<float> time;
28  std::vector<float> timeError;
29  std::vector<unsigned> detid;
30  std::vector<unsigned> flagBits;
31  std::vector<float> son;
32 };
33 
34 class HeterogeneousHGCalRecHitsValidator : public edm::one::EDAnalyzer<edm::one::SharedResources> {
35 public:
38  void analyze(const edm::Event&, const edm::EventSetup&) override;
39  void endJob() override;
40 
41 private:
42  static const unsigned nsubdetectors = 3; //ce-e, ce-h-fine, ce-h-coarse
43  static const unsigned ncomputingdevices = 2; //cpu, gpu
44  //cpu amd gpu tokens and handles for the 3 subdetectors, cpu and gpu
45  std::array<std::array<edm::EDGetTokenT<HGChefRecHitCollection>, ncomputingdevices>, nsubdetectors> tokens_;
46  std::array<edm::ESGetToken<HGCalGeometry, IdealGeometryRecord>, nsubdetectors> estokens_;
48 
49  std::array<std::string, nsubdetectors> handles_str_ = {
50  {"HGCalEESensitive", "HGCalHESiliconSensitive", "HGCalHEScintillatorSensitive"}};
52 
53  std::array<TTree*, nsubdetectors> trees_;
54  std::array<std::string, nsubdetectors> treenames_;
55  std::array<ValidHitCollection, nsubdetectors> cpuValidRecHits, gpuValidRecHits, diffsValidRecHits;
56  //std::vector< TH1F* > zhist;
57 
58  void set_geometry_(const edm::EventSetup&, const unsigned&);
59 };
60 
61 #endif
HeterogeneousHGCalRecHitsValidator(const edm::ParameterSet &)
std::array< std::string, nsubdetectors > handles_str_
std::array< ValidHitCollection, nsubdetectors > cpuValidRecHits
std::array< edm::ESGetToken< HGCalGeometry, IdealGeometryRecord >, nsubdetectors > estokens_
void analyze(const edm::Event &, const edm::EventSetup &) override
std::array< std::array< edm::EDGetTokenT< HGChefRecHitCollection >, ncomputingdevices >, nsubdetectors > tokens_
std::array< TTree *, nsubdetectors > trees_
void set_geometry_(const edm::EventSetup &, const unsigned &)
std::vector< float > timeError
std::array< std::string, nsubdetectors > treenames_
std::array< ValidHitCollection, nsubdetectors > gpuValidRecHits
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > estokenGeom_
std::array< ValidHitCollection, nsubdetectors > diffsValidRecHits
std::vector< unsigned > flagBits
std::vector< unsigned > detid