Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:54

0001 #ifndef CaloTowersValidation_H
0002 #define CaloTowersValidation_H
0003 
0004 #include "FWCore/Framework/interface/Frameworkfwd.h"
0005 #include "FWCore/Framework/interface/Event.h"
0006 #include "FWCore/Framework/interface/EventSetup.h"
0007 #include "FWCore/Framework/interface/ESHandle.h"
0008 #include "FWCore/PluginManager/interface/ModuleDef.h"
0009 #include "FWCore/Framework/interface/MakerMacros.h"
0010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0011 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0012 #include "FWCore/ServiceRegistry/interface/Service.h"
0013 
0014 #include "DataFormats/DetId/interface/DetId.h"
0015 #include "DataFormats/CaloTowers/interface/CaloTowerDetId.h"
0016 #include "DataFormats/Math/interface/Vector3D.h"
0017 
0018 #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h"
0019 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
0020 
0021 #include <vector>
0022 #include <utility>
0023 #include <ostream>
0024 #include <string>
0025 #include <algorithm>
0026 #include <cmath>
0027 #include "DQMServices/Core/interface/DQMStore.h"
0028 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0029 
0030 class CaloTowersValidation : public DQMEDAnalyzer {
0031 public:
0032   CaloTowersValidation(edm::ParameterSet const& conf);
0033   ~CaloTowersValidation() override;
0034   void analyze(edm::Event const& e, edm::EventSetup const& c) override;
0035   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0036 
0037 private:
0038   double dR(double eta1, double phi1, double eta2, double phi2);
0039 
0040   std::string outputFile_;
0041   std::string hcalselector_;
0042   bool mc_;
0043   bool useAllHistos_;
0044 
0045   typedef math::RhoEtaPhiVector Vector;
0046 
0047   edm::EDGetTokenT<CaloTowerCollection> tok_calo_;
0048   edm::EDGetTokenT<edm::HepMCProduct> tok_evt_;
0049 
0050   int isub;
0051   int nevent;
0052 
0053   int imc;
0054 
0055   // eta limits to calcualte MET, SET (not to include HF if not needed)
0056   double etaMax[3];
0057   double etaMin[3];
0058 
0059   // ieta scan
0060   MonitorElement* emean_vs_ieta_E;
0061   MonitorElement* emean_vs_ieta_H;
0062   MonitorElement* emean_vs_ieta_EH;
0063 
0064   MonitorElement* emean_vs_ieta_E1;
0065   MonitorElement* emean_vs_ieta_H1;
0066   MonitorElement* emean_vs_ieta_EH1;
0067 
0068   MonitorElement* Ntowers_vs_ieta;
0069   MonitorElement* occupancy_map;
0070   MonitorElement* occupancy_vs_ieta;
0071 
0072   // Global maps
0073   MonitorElement* mapEnergy_E;
0074   MonitorElement* mapEnergy_H;
0075   MonitorElement* mapEnergy_EH;
0076   MonitorElement* mapEnergy_N;
0077 
0078   // for number of bad, recovered and problematic Ecal and Hcal cells
0079   MonitorElement* numBadCellsEcal_EB;
0080   MonitorElement* numBadCellsEcal_EE;
0081   MonitorElement* numRcvCellsEcal_EB;
0082   MonitorElement* numRcvCellsEcal_EE;
0083   MonitorElement* numPrbCellsEcal_EB;
0084   MonitorElement* numPrbCellsEcal_EE;
0085 
0086   MonitorElement* numBadCellsHcal_HB;
0087   MonitorElement* numBadCellsHcal_HE;
0088   MonitorElement* numBadCellsHcal_HF;
0089   MonitorElement* numRcvCellsHcal_HB;
0090   MonitorElement* numRcvCellsHcal_HE;
0091   MonitorElement* numRcvCellsHcal_HF;
0092   MonitorElement* numPrbCellsHcal_HB;
0093   MonitorElement* numPrbCellsHcal_HE;
0094   MonitorElement* numPrbCellsHcal_HF;
0095 
0096   // HB
0097   MonitorElement* meEnergyHcalvsEcal_HB;
0098   MonitorElement* meEnergyHO_HB;
0099   MonitorElement* meEnergyEcal_HB;
0100   MonitorElement* meEnergyHcal_HB;
0101   MonitorElement* meNumFiredTowers_HB;
0102 
0103   MonitorElement* meEnergyEcalTower_HB;
0104   MonitorElement* meEnergyHcalTower_HB;
0105   MonitorElement* meTotEnergy_HB;
0106 
0107   MonitorElement* mapEnergy_HB;
0108   MonitorElement* mapEnergyEcal_HB;
0109   MonitorElement* mapEnergyHcal_HB;
0110   MonitorElement* MET_HB;
0111   MonitorElement* SET_HB;
0112   MonitorElement* phiMET_HB;
0113 
0114   MonitorElement* emTiming_HB;
0115   MonitorElement* hadTiming_HB;
0116 
0117   MonitorElement* emEnergyTiming_Low_HB;
0118   MonitorElement* emEnergyTiming_HB;
0119   MonitorElement* emEnergyTiming_High_HB;
0120   MonitorElement* emEnergyTiming_profile_Low_HB;
0121   MonitorElement* emEnergyTiming_profile_HB;
0122   MonitorElement* emEnergyTiming_profile_High_HB;
0123 
0124   MonitorElement* hadEnergyTiming_Low_HB;
0125   MonitorElement* hadEnergyTiming_HB;
0126   MonitorElement* hadEnergyTiming_High_HB;
0127   MonitorElement* hadEnergyTiming_profile_Low_HB;
0128   MonitorElement* hadEnergyTiming_profile_HB;
0129   MonitorElement* hadEnergyTiming_profile_High_HB;
0130 
0131   // HE
0132   MonitorElement* meEnergyHcalvsEcal_HE;
0133   MonitorElement* meEnergyHO_HE;
0134   MonitorElement* meEnergyEcal_HE;
0135   MonitorElement* meEnergyHcal_HE;
0136   MonitorElement* meNumFiredTowers_HE;
0137 
0138   MonitorElement* meEnergyEcalTower_HE;
0139   MonitorElement* meEnergyHcalTower_HE;
0140   MonitorElement* meTotEnergy_HE;
0141 
0142   MonitorElement* mapEnergy_HE;
0143   MonitorElement* mapEnergyEcal_HE;
0144   MonitorElement* mapEnergyHcal_HE;
0145   MonitorElement* MET_HE;
0146   MonitorElement* SET_HE;
0147   MonitorElement* phiMET_HE;
0148 
0149   MonitorElement* emTiming_HE;
0150   MonitorElement* hadTiming_HE;
0151 
0152   MonitorElement* emEnergyTiming_Low_HE;
0153   MonitorElement* emEnergyTiming_HE;
0154   MonitorElement* emEnergyTiming_profile_Low_HE;
0155   MonitorElement* emEnergyTiming_profile_HE;
0156 
0157   MonitorElement* hadEnergyTiming_Low_HE;
0158   MonitorElement* hadEnergyTiming_HE;
0159   MonitorElement* hadEnergyTiming_profile_Low_HE;
0160   MonitorElement* hadEnergyTiming_profile_HE;
0161 
0162   // HF
0163   MonitorElement* meEnergyHcalvsEcal_HF;
0164   MonitorElement* meEnergyHO_HF;
0165   MonitorElement* meEnergyEcal_HF;
0166   MonitorElement* meEnergyHcal_HF;
0167   MonitorElement* meNumFiredTowers_HF;
0168 
0169   MonitorElement* meEnergyEcalTower_HF;
0170   MonitorElement* meEnergyHcalTower_HF;
0171   MonitorElement* meTotEnergy_HF;
0172 
0173   MonitorElement* mapEnergy_HF;
0174   MonitorElement* mapEnergyEcal_HF;
0175   MonitorElement* mapEnergyHcal_HF;
0176   MonitorElement* MET_HF;
0177   MonitorElement* SET_HF;
0178   MonitorElement* phiMET_HF;
0179 
0180   MonitorElement* emTiming_HF;
0181   MonitorElement* hadTiming_HF;
0182   MonitorElement* emEnergyTiming_HF;
0183   MonitorElement* emEnergyTiming_profile_HF;
0184 
0185   MonitorElement* hadEnergyTiming_Low_HF;
0186   MonitorElement* hadEnergyTiming_HF;
0187   MonitorElement* hadEnergyTiming_profile_Low_HF;
0188   MonitorElement* hadEnergyTiming_profile_HF;
0189 };
0190 
0191 #endif