Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:32:32

0001 #ifndef _HGCalMaskResolutionAna_h_
0002 #define _HGCalMaskResolutionAna_h_
0003 
0004 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0005 #include "FWCore/Framework/interface/Event.h"
0006 #include "FWCore/Framework/interface/EventSetup.h"
0007 #include "FWCore/Framework/interface/MakerMacros.h"
0008 #include "FWCore/ServiceRegistry/interface/Service.h"
0009 #include "CommonTools/UtilAlgos/interface/TFileService.h"
0010 #include "DataFormats/HGCRecHit/interface/HGCRecHit.h"
0011 #include "DataFormats/HGCRecHit/interface/HGCRecHitCollections.h"
0012 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0013 #include "Geometry/Records/interface/IdealGeometryRecord.h"
0014 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0015 #include "Geometry/HGCalGeometry/interface/HGCalGeometry.h"
0016 #include "RecoLocalCalo/HGCalRecAlgos/interface/RecHitTools.h"
0017 #include "Validation/HGCalValidation/interface/ValidHit.h"
0018 
0019 #include "TTree.h"
0020 #include "TH1F.h"
0021 
0022 #include <iostream>
0023 #include <string>
0024 
0025 struct ValidRecHits {
0026   std::vector<float> energy;
0027   std::vector<float> time;
0028   std::vector<float> timeError;
0029   std::vector<unsigned> detid;
0030   std::vector<unsigned> flagBits;
0031   std::vector<float> son;
0032 };
0033 
0034 class HeterogeneousHGCalRecHitsValidator : public edm::one::EDAnalyzer<edm::one::SharedResources> {
0035 public:
0036   explicit HeterogeneousHGCalRecHitsValidator(const edm::ParameterSet&);
0037   ~HeterogeneousHGCalRecHitsValidator() override;
0038   void analyze(const edm::Event&, const edm::EventSetup&) override;
0039   void endJob() override;
0040 
0041 private:
0042   static const unsigned nsubdetectors = 3;      //ce-e, ce-h-fine, ce-h-coarse
0043   static const unsigned ncomputingdevices = 2;  //cpu, gpu
0044   //cpu amd gpu tokens and handles for the 3 subdetectors, cpu and gpu
0045   std::array<std::array<edm::EDGetTokenT<HGChefRecHitCollection>, ncomputingdevices>, nsubdetectors> tokens_;
0046   std::array<edm::ESGetToken<HGCalGeometry, IdealGeometryRecord>, nsubdetectors> estokens_;
0047   edm::ESGetToken<CaloGeometry, CaloGeometryRecord> estokenGeom_;
0048 
0049   std::array<std::string, nsubdetectors> handles_str_ = {
0050       {"HGCalEESensitive", "HGCalHESiliconSensitive", "HGCalHEScintillatorSensitive"}};
0051   hgcal::RecHitTools recHitTools_;
0052 
0053   std::array<TTree*, nsubdetectors> trees_;
0054   std::array<std::string, nsubdetectors> treenames_;
0055   std::array<ValidHitCollection, nsubdetectors> cpuValidRecHits, gpuValidRecHits, diffsValidRecHits;
0056   //std::vector< TH1F* > zhist;
0057 
0058   void set_geometry_(const edm::EventSetup&, const unsigned&);
0059 };
0060 
0061 #endif