File indexing completed on 2024-04-06 12:29:23
0001 #include "FWCore/Utilities/interface/InputTag.h"
0002 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0003 #include "FWCore/Framework/interface/ESHandle.h"
0004 #include "FWCore/Framework/interface/Event.h"
0005 #include "FWCore/Utilities/interface/EDGetToken.h"
0006 #include "FWCore/Utilities/interface/ESGetToken.h"
0007 #include "FWCore/Framework/interface/MakerMacros.h"
0008 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0009 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0010 #include "Geometry/CaloTopology/interface/EcalTrigTowerConstituentsMap.h"
0011 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
0012 #include "Geometry/Records/interface/IdealGeometryRecord.h"
0013 #include "Geometry/Records/interface/EcalBarrelGeometryRecord.h"
0014 #include "CalibCalorimetry/EcalTPGTools/interface/EcalTPGScale.h"
0015
0016 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0017 #include <vector>
0018 #include <string>
0019 #include <TH1I.h>
0020 #include <TFile.h>
0021 #include <TTree.h>
0022 #include <TH2F.h>
0023 #include <TH1F.h>
0024
0025
0026
0027
0028
0029 class EcalEBTrigPrimAnalyzer : public edm::one::EDAnalyzer<> {
0030 public:
0031 explicit EcalEBTrigPrimAnalyzer(const edm::ParameterSet &);
0032 ~EcalEBTrigPrimAnalyzer() override;
0033
0034 void analyze(const edm::Event &, const edm::EventSetup &) override;
0035 void endJob() override;
0036
0037 private:
0038 int nEvents_;
0039 void init(const edm::EventSetup &);
0040
0041
0042 std::vector<std::string> ecal_parts_;
0043 TH1I *ecal_et_[2];
0044 TH1I *ecal_tt_[2];
0045 TH1I *ecal_fgvb_[2];
0046 TH1I *histEndc, *histBar;
0047 TFile *histfile_;
0048 TH1F *hAllTPperEvt_;
0049 TH1F *hTPperEvt_;
0050 TH2F *hTPvsRechit_;
0051 TH1F *hTPoverRechit_;
0052 TH1F *hDeltaEt_;
0053 TH1F *hAllRechitEt_;
0054 TH1F *hRechitEt_;
0055 TH1F *hTPEt_;
0056 TH1F *hRatioEt_;
0057 TH2F *hTPvsTow_ieta_;
0058 TH2F *hTPvsTow_eta_;
0059 TH2F *hTP_iphiVsieta_;
0060 TH2F *hRH_iphiVsieta_;
0061 TH2F *hTP_iphiVsieta_fullrange_;
0062 TH2F *hRH_iphiVsieta_fullrange_;
0063
0064 TTree *tree_;
0065
0066 int tpIphi_, tpIeta_, tpgADC_, ttf_, fg_;
0067 int rhIeta_, rhIphi_;
0068 float eRec_, tpgGeV_;
0069
0070
0071 edm::EDGetTokenT<EcalEBTrigPrimDigiCollection> primToken_;
0072 edm::EDGetTokenT<EcalRecHitCollection> rechits_labelEB_;
0073 edm::EDGetTokenT<EBDigiCollection> tokenEBdigi_;
0074 bool recHits_;
0075 bool debug_;
0076 edm::ESHandle<EcalTrigTowerConstituentsMap> eTTmap_;
0077 edm::ESGetToken<EcalTrigTowerConstituentsMap, IdealGeometryRecord> eTTmapToken_;
0078 edm::ESGetToken<CaloSubdetectorGeometry, EcalBarrelGeometryRecord> barrelGeomToken_;
0079 EcalTPGScale::Tokens tokens_;
0080
0081 int getIndex(const EBDigiCollection *, EcalTrigTowerDetId &id) { return id.hashedIndex(); }
0082 };