00001 #ifndef _DQMOFFLINE_HCAL_CALOTOWERSANALYZER_H_ 00002 #define _DQMOFFLINE_HCAL_CALOTOWERSANALYZER_H_ 00003 00004 #include "FWCore/Framework/interface/Frameworkfwd.h" 00005 #include "FWCore/Framework/interface/EDAnalyzer.h" 00006 #include "FWCore/Framework/interface/Event.h" 00007 #include "FWCore/Framework/interface/EventSetup.h" 00008 #include "FWCore/Framework/interface/ESHandle.h" 00009 #include "FWCore/PluginManager/interface/ModuleDef.h" 00010 #include "FWCore/Framework/interface/MakerMacros.h" 00011 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00012 #include "FWCore/MessageLogger/interface/MessageLogger.h" 00013 #include "FWCore/ServiceRegistry/interface/Service.h" 00014 00015 #include "DQMServices/Core/interface/DQMStore.h" 00016 00017 #include "DataFormats/DetId/interface/DetId.h" 00018 #include "DataFormats/CaloTowers/interface/CaloTowerDetId.h" 00019 #include "DataFormats/Math/interface/Vector3D.h" 00020 00021 #include <vector> 00022 #include <utility> 00023 #include <ostream> 00024 #include <string> 00025 #include <algorithm> 00026 #include <cmath> 00027 #include "DQMServices/Core/interface/MonitorElement.h" 00028 00029 00030 class CaloTowersAnalyzer : public edm::EDAnalyzer { 00031 public: 00032 CaloTowersAnalyzer(edm::ParameterSet const& conf); 00033 ~CaloTowersAnalyzer(); 00034 virtual void analyze(edm::Event const& e, edm::EventSetup const& c); 00035 virtual void beginJob() ; 00036 virtual void endJob() ; 00037 virtual void beginRun() ; 00038 virtual void endRun() ; 00039 00040 private: 00041 double dR(double eta1, double phi1, double eta2, double phi2); 00042 00043 DQMStore* dbe_; 00044 std::string outputFile_; 00045 std::string hcalselector_; 00046 std::string mc_; 00047 bool useAllHistos_; 00048 00049 typedef math::RhoEtaPhiVector Vector; 00050 00051 edm::InputTag theCaloTowerCollectionLabel; 00052 00053 int isub; 00054 int nevent; 00055 00056 int imc; 00057 00058 // eta limits to calcualte MET, SET (not to include HF if not needed) 00059 double etaMax[3]; 00060 double etaMin[3]; 00061 00062 // ieta scan 00063 MonitorElement* emean_vs_ieta_E; 00064 MonitorElement* emean_vs_ieta_H; 00065 MonitorElement* emean_vs_ieta_EH; 00066 00067 MonitorElement* emean_vs_ieta_E1; 00068 MonitorElement* emean_vs_ieta_H1; 00069 MonitorElement* emean_vs_ieta_EH1; 00070 00071 MonitorElement* Ntowers_vs_ieta; 00072 MonitorElement* occupancy_map; 00073 MonitorElement* occupancy_vs_ieta; 00074 00075 // Global maps 00076 MonitorElement* mapEnergy_E; 00077 MonitorElement* mapEnergy_H; 00078 MonitorElement* mapEnergy_EH; 00079 MonitorElement* mapEnergy_N; 00080 00081 // for number of bad, recovered and problematic Ecal and Hcal cells 00082 MonitorElement* numBadCellsEcal_EB; 00083 MonitorElement* numBadCellsEcal_EE; 00084 MonitorElement* numRcvCellsEcal_EB; 00085 MonitorElement* numRcvCellsEcal_EE; 00086 MonitorElement* numPrbCellsEcal_EB; 00087 MonitorElement* numPrbCellsEcal_EE; 00088 00089 MonitorElement* numBadCellsHcal_HB; 00090 MonitorElement* numBadCellsHcal_HE; 00091 MonitorElement* numBadCellsHcal_HF; 00092 MonitorElement* numRcvCellsHcal_HB; 00093 MonitorElement* numRcvCellsHcal_HE; 00094 MonitorElement* numRcvCellsHcal_HF; 00095 MonitorElement* numPrbCellsHcal_HB; 00096 MonitorElement* numPrbCellsHcal_HE; 00097 MonitorElement* numPrbCellsHcal_HF; 00098 00099 // HB 00100 MonitorElement* meEnergyHcalvsEcal_HB; 00101 MonitorElement* meEnergyHO_HB; 00102 MonitorElement* meEnergyEcal_HB; 00103 MonitorElement* meEnergyHcal_HB; 00104 MonitorElement* meNumFiredTowers_HB; 00105 00106 MonitorElement* meEnergyEcalTower_HB; 00107 MonitorElement* meEnergyHcalTower_HB; 00108 MonitorElement* meTotEnergy_HB; 00109 00110 MonitorElement* mapEnergy_HB; 00111 MonitorElement* mapEnergyEcal_HB; 00112 MonitorElement* mapEnergyHcal_HB; 00113 MonitorElement* MET_HB; 00114 MonitorElement* SET_HB; 00115 MonitorElement* phiMET_HB; 00116 00117 MonitorElement* emTiming_HB; 00118 MonitorElement* hadTiming_HB; 00119 00120 MonitorElement* emEnergyTiming_Low_HB; 00121 MonitorElement* emEnergyTiming_HB; 00122 MonitorElement* emEnergyTiming_High_HB; 00123 MonitorElement* emEnergyTiming_profile_Low_HB; 00124 MonitorElement* emEnergyTiming_profile_HB; 00125 MonitorElement* emEnergyTiming_profile_High_HB; 00126 00127 MonitorElement* hadEnergyTiming_Low_HB; 00128 MonitorElement* hadEnergyTiming_HB; 00129 MonitorElement* hadEnergyTiming_High_HB; 00130 MonitorElement* hadEnergyTiming_profile_Low_HB; 00131 MonitorElement* hadEnergyTiming_profile_HB; 00132 MonitorElement* hadEnergyTiming_profile_High_HB; 00133 00134 // HE 00135 MonitorElement* meEnergyHcalvsEcal_HE; 00136 MonitorElement* meEnergyHO_HE; 00137 MonitorElement* meEnergyEcal_HE; 00138 MonitorElement* meEnergyHcal_HE; 00139 MonitorElement* meNumFiredTowers_HE; 00140 00141 MonitorElement* meEnergyEcalTower_HE; 00142 MonitorElement* meEnergyHcalTower_HE; 00143 MonitorElement* meTotEnergy_HE; 00144 00145 MonitorElement* mapEnergy_HE; 00146 MonitorElement* mapEnergyEcal_HE; 00147 MonitorElement* mapEnergyHcal_HE; 00148 MonitorElement* MET_HE; 00149 MonitorElement* SET_HE; 00150 MonitorElement* phiMET_HE; 00151 00152 MonitorElement* emTiming_HE; 00153 MonitorElement* hadTiming_HE; 00154 00155 MonitorElement* emEnergyTiming_Low_HE; 00156 MonitorElement* emEnergyTiming_HE; 00157 MonitorElement* emEnergyTiming_profile_Low_HE; 00158 MonitorElement* emEnergyTiming_profile_HE; 00159 00160 MonitorElement* hadEnergyTiming_Low_HE; 00161 MonitorElement* hadEnergyTiming_HE; 00162 MonitorElement* hadEnergyTiming_profile_Low_HE; 00163 MonitorElement* hadEnergyTiming_profile_HE; 00164 00165 // HF 00166 MonitorElement* meEnergyHcalvsEcal_HF; 00167 MonitorElement* meEnergyHO_HF; 00168 MonitorElement* meEnergyEcal_HF; 00169 MonitorElement* meEnergyHcal_HF; 00170 MonitorElement* meNumFiredTowers_HF; 00171 00172 MonitorElement* meEnergyEcalTower_HF; 00173 MonitorElement* meEnergyHcalTower_HF; 00174 MonitorElement* meTotEnergy_HF; 00175 00176 MonitorElement* mapEnergy_HF; 00177 MonitorElement* mapEnergyEcal_HF; 00178 MonitorElement* mapEnergyHcal_HF; 00179 MonitorElement* MET_HF; 00180 MonitorElement* SET_HF; 00181 MonitorElement* phiMET_HF; 00182 00183 MonitorElement* emTiming_HF; 00184 MonitorElement* hadTiming_HF; 00185 MonitorElement* emEnergyTiming_HF; 00186 MonitorElement* emEnergyTiming_profile_HF; 00187 00188 MonitorElement* hadEnergyTiming_Low_HF; 00189 MonitorElement* hadEnergyTiming_HF; 00190 MonitorElement* hadEnergyTiming_profile_Low_HF; 00191 MonitorElement* hadEnergyTiming_profile_HF; 00192 00193 }; 00194 00195 #endif