File indexing completed on 2024-04-06 12:09:24
0001 #ifndef _DQMOFFLINE_HCAL_HCALRECHITSANALYZER_H_
0002 #define _DQMOFFLINE_HCAL_HCALRECHITSANALYZER_H_
0003
0004 #include "FWCore/Framework/interface/Event.h"
0005 #include "FWCore/Framework/interface/EventSetup.h"
0006 #include "FWCore/Framework/interface/Frameworkfwd.h"
0007 #include "FWCore/Framework/interface/MakerMacros.h"
0008 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010 #include "FWCore/Utilities/interface/ESGetToken.h"
0011
0012 #include "DQMServices/Core/interface/DQMStore.h"
0013
0014 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
0015 #include "DataFormats/HcalRecHit/interface/HcalSourcePositionData.h"
0016
0017 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0018 #include <DataFormats/EcalDetId/interface/EBDetId.h>
0019 #include <DataFormats/EcalDetId/interface/EEDetId.h>
0020
0021 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0022 #include "DataFormats/HcalDetId/interface/HcalElectronicsId.h"
0023 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
0024 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
0025 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0026 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
0027 #include "Geometry/CaloTopology/interface/HcalTopology.h"
0028 #include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h"
0029 #include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h"
0030 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0031 #include "Geometry/Records/interface/HcalRecNumberingRecord.h"
0032
0033 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0034 #include <algorithm>
0035 #include <cmath>
0036 #include <ostream>
0037 #include <string>
0038 #include <utility>
0039 #include <vector>
0040
0041 #include "DataFormats/DetId/interface/DetId.h"
0042
0043 #include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h"
0044 #include "CondFormats/EcalObjects/interface/EcalChannelStatus.h"
0045
0046 #include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h"
0047 #include "CondFormats/HcalObjects/interface/HcalChannelQuality.h"
0048
0049
0050 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputer.h"
0051 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputerRcd.h"
0052
0053
0054 #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h"
0055
0056 class HcalRecHitsAnalyzer : public DQMEDAnalyzer {
0057 public:
0058 HcalRecHitsAnalyzer(edm::ParameterSet const &conf);
0059
0060 void analyze(edm::Event const &ev, edm::EventSetup const &) override;
0061 void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
0062
0063
0064 void dqmBeginRun(const edm::Run &run, const edm::EventSetup &) override;
0065
0066 private:
0067 virtual void fillRecHitsTmp(int subdet_, edm::Event const &ev);
0068 double dR(double eta1, double phi1, double eta2, double phi2);
0069 double phi12(double phi1, double en1, double phi2, double en2);
0070 double dPhiWsign(double phi1, double phi2);
0071
0072 std::string topFolderName_;
0073
0074 std::string outputFile_;
0075 std::string hcalselector_;
0076 std::string ecalselector_;
0077 std::string eventype_;
0078 std::string sign_;
0079 bool hep17_;
0080 std::string mc_;
0081 bool famos_;
0082
0083 int maxDepthHB_, maxDepthHE_, maxDepthHO_, maxDepthHF_, maxDepthAll_;
0084
0085 int nChannels_[5];
0086
0087 int iphi_bins_;
0088 float iphi_min_, iphi_max_;
0089
0090 int ieta_bins_;
0091 float ieta_min_, ieta_max_;
0092
0093
0094 edm::EDGetTokenT<HBHERecHitCollection> tok_hbhe_;
0095 edm::EDGetTokenT<HORecHitCollection> tok_ho_;
0096 edm::EDGetTokenT<HFRecHitCollection> tok_hf_;
0097 edm::EDGetTokenT<EBRecHitCollection> tok_EB_;
0098 edm::EDGetTokenT<EERecHitCollection> tok_EE_;
0099
0100 edm::ESGetToken<HcalDDDRecConstants, HcalRecNumberingRecord> hcalDDDRecConstantsToken_;
0101 edm::ESGetToken<CaloGeometry, CaloGeometryRecord> caloGeometryRunToken_;
0102 edm::ESGetToken<CaloGeometry, CaloGeometryRecord> caloGeometryEventToken_;
0103 edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> hcalTopologyToken_;
0104 edm::ESGetToken<HcalChannelQuality, HcalChannelQualityRcd> hcalChannelQualityToken_;
0105 edm::ESGetToken<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd> hcalSeverityLevelComputerToken_;
0106
0107
0108 int subdet_;
0109
0110
0111 int etype_;
0112 int iz;
0113 int imc;
0114
0115
0116 const HcalTopology *theHcalTopology = nullptr;
0117
0118 const HcalChannelQuality *theHcalChStatus = nullptr;
0119
0120 const HcalSeverityLevelComputer *theHcalSevLvlComputer = nullptr;
0121 int hcalSevLvl(const CaloRecHit *hit);
0122
0123 std::vector<int> hcalHBSevLvlVec, hcalHESevLvlVec, hcalHFSevLvlVec, hcalHOSevLvlVec;
0124
0125 MonitorElement *sevLvl_HB;
0126 MonitorElement *sevLvl_HE;
0127 MonitorElement *sevLvl_HF;
0128 MonitorElement *sevLvl_HO;
0129
0130
0131 std::vector<MonitorElement *> Nhb;
0132 std::vector<MonitorElement *> Nhe;
0133 std::vector<MonitorElement *> Nho;
0134 std::vector<MonitorElement *> Nhf;
0135
0136
0137
0138
0139
0140
0141 MonitorElement *map_ecal;
0142
0143 std::vector<MonitorElement *> emap;
0144 MonitorElement *emap_HO;
0145
0146 std::vector<MonitorElement *> emean_vs_ieta_HB;
0147 std::vector<MonitorElement *> emean_vs_ieta_HBM0;
0148 std::vector<MonitorElement *> emean_vs_ieta_HBM3;
0149 std::vector<MonitorElement *> emean_vs_ieta_HE;
0150 std::vector<MonitorElement *> emean_vs_ieta_HEM0;
0151 std::vector<MonitorElement *> emean_vs_ieta_HEM3;
0152 std::vector<MonitorElement *> emean_vs_ieta_HEP17;
0153 std::vector<MonitorElement *> emean_vs_ieta_HEP17M0;
0154 std::vector<MonitorElement *> emean_vs_ieta_HEP17M3;
0155 std::vector<MonitorElement *> emean_vs_ieta_HF;
0156 MonitorElement *emean_vs_ieta_HO;
0157
0158 std::vector<MonitorElement *> occupancy_map_HB;
0159 std::vector<MonitorElement *> occupancy_map_HE;
0160 std::vector<MonitorElement *> occupancy_map_HF;
0161 MonitorElement *occupancy_map_HO;
0162
0163 std::vector<MonitorElement *> occupancy_vs_ieta_HB;
0164 std::vector<MonitorElement *> occupancy_vs_ieta_HE;
0165 std::vector<MonitorElement *> occupancy_vs_ieta_HF;
0166 MonitorElement *occupancy_vs_ieta_HO;
0167
0168 std::vector<MonitorElement *> nrechits_vs_iphi_HBP, nrechits_vs_iphi_HBM;
0169 std::vector<MonitorElement *> nrechits_vs_iphi_HEP, nrechits_vs_iphi_HEM;
0170 std::vector<MonitorElement *> nrechits_vs_iphi_HFP, nrechits_vs_iphi_HFM;
0171 MonitorElement *nrechits_vs_iphi_HOP, *nrechits_vs_iphi_HOM;
0172
0173
0174 MonitorElement *meEnConeEtaProfile;
0175 MonitorElement *meEnConeEtaProfile_E;
0176 MonitorElement *meEnConeEtaProfile_EH;
0177
0178 MonitorElement *meDeltaPhi;
0179 MonitorElement *meDeltaEta;
0180
0181
0182 MonitorElement *meTimeHB;
0183 MonitorElement *meTimeHE;
0184 MonitorElement *meTimeHO;
0185 MonitorElement *meTimeHF;
0186
0187
0188 MonitorElement *meRecHitsEnergyHB;
0189 MonitorElement *meRecHitsCleanedEnergyHB;
0190 MonitorElement *meRecHitsEnergyHBM0;
0191 MonitorElement *meRecHitsEnergyHBM3;
0192 MonitorElement *meRecHitsEnergyM2vM0HB;
0193 MonitorElement *meRecHitsEnergyM3vM0HB;
0194 MonitorElement *meRecHitsEnergyM3vM2HB;
0195 MonitorElement *meRecHitsM2Chi2HB;
0196
0197 MonitorElement *meRecHitsEnergyHE;
0198 MonitorElement *meRecHitsCleanedEnergyHE;
0199 MonitorElement *meRecHitsEnergyHEM0;
0200 MonitorElement *meRecHitsEnergyHEM3;
0201 std::vector<MonitorElement *> meRecHitsEnergyHEP17;
0202 std::vector<MonitorElement *> meRecHitsEnergyHEP17M0;
0203 std::vector<MonitorElement *> meRecHitsEnergyHEP17M3;
0204 MonitorElement *meRecHitsEnergyM2vM0HE;
0205 MonitorElement *meRecHitsEnergyM3vM0HE;
0206 MonitorElement *meRecHitsEnergyM3vM2HE;
0207 MonitorElement *meRecHitsM2Chi2HE;
0208
0209 MonitorElement *meRecHitsEnergyHO;
0210 MonitorElement *meRecHitsCleanedEnergyHO;
0211
0212 MonitorElement *meRecHitsEnergyHF;
0213 MonitorElement *meRecHitsCleanedEnergyHF;
0214
0215 MonitorElement *meTE_Low_HB;
0216 MonitorElement *meTE_HB;
0217 MonitorElement *meTE_High_HB;
0218 MonitorElement *meTEprofileHB_Low;
0219 MonitorElement *meTEprofileHB;
0220 MonitorElement *meLog10Chi2profileHB;
0221 MonitorElement *meTEprofileHB_High;
0222
0223 MonitorElement *meTE_Low_HE;
0224 MonitorElement *meTE_HE;
0225 MonitorElement *meTEprofileHE_Low;
0226 MonitorElement *meTEprofileHE;
0227 MonitorElement *meLog10Chi2profileHE;
0228
0229 MonitorElement *meTE_HO;
0230 MonitorElement *meTE_High_HO;
0231 MonitorElement *meTEprofileHO;
0232 MonitorElement *meTEprofileHO_High;
0233
0234 MonitorElement *meTE_Low_HF;
0235 MonitorElement *meTE_HF;
0236 MonitorElement *meTEprofileHF_Low;
0237 MonitorElement *meTEprofileHF;
0238
0239 MonitorElement *meSumRecHitsEnergyHB;
0240 MonitorElement *meSumRecHitsEnergyHE;
0241 MonitorElement *meSumRecHitsEnergyHO;
0242 MonitorElement *meSumRecHitsEnergyHF;
0243
0244 MonitorElement *meSumRecHitsEnergyConeHB;
0245 MonitorElement *meSumRecHitsEnergyConeHE;
0246 MonitorElement *meSumRecHitsEnergyConeHO;
0247 MonitorElement *meSumRecHitsEnergyConeHF;
0248 MonitorElement *meSumRecHitsEnergyConeHFL;
0249 MonitorElement *meSumRecHitsEnergyConeHFS;
0250
0251 MonitorElement *meEcalHcalEnergyHB;
0252 MonitorElement *meEcalHcalEnergyHE;
0253
0254 MonitorElement *meEcalHcalEnergyConeHB;
0255 MonitorElement *meEcalHcalEnergyConeHE;
0256 MonitorElement *meEcalHcalEnergyConeHO;
0257 MonitorElement *meEcalHcalEnergyConeHF;
0258
0259
0260 MonitorElement *meEnergyHcalVsEcalHB;
0261 MonitorElement *meEnergyHcalVsEcalHE;
0262
0263
0264 MonitorElement *meNumEcalRecHitsConeHB;
0265 MonitorElement *meNumEcalRecHitsConeHE;
0266
0267 CaloGeometry const *geometry = nullptr;
0268
0269
0270 MonitorElement *RecHit_StatusWord_HB;
0271 MonitorElement *RecHit_StatusWord_HE;
0272 MonitorElement *RecHit_StatusWord_HF;
0273 MonitorElement *RecHit_StatusWord_HF67;
0274 MonitorElement *RecHit_StatusWord_HO;
0275
0276
0277 MonitorElement *RecHit_StatusWordCorr_HB;
0278 MonitorElement *RecHit_StatusWordCorr_HE;
0279
0280
0281 MonitorElement *RecHit_Aux_StatusWord_HB;
0282 MonitorElement *RecHit_Aux_StatusWord_HE;
0283 MonitorElement *RecHit_Aux_StatusWord_HF;
0284 MonitorElement *RecHit_Aux_StatusWord_HO;
0285
0286
0287 std::vector<int> csub;
0288 std::vector<int> cieta;
0289 std::vector<int> ciphi;
0290 std::vector<int> cdepth;
0291 std::vector<double> cen;
0292 std::vector<double> cenM0;
0293 std::vector<double> cenM3;
0294 std::vector<double> cchi2;
0295 std::vector<double> ceta;
0296 std::vector<double> cphi;
0297 std::vector<double> ctime;
0298 std::vector<double> cz;
0299 std::vector<uint32_t> cstwd;
0300 std::vector<uint32_t> cauxstwd;
0301 std::vector<int> csevlev;
0302
0303
0304 int nevtot;
0305 };
0306
0307 #endif