00001 #ifndef HLTHiggsBits_h 00002 #define HLTHiggsBits_h 00003 00017 #include "TH1.h" 00018 #include "TH2.h" 00019 #include "TFile.h" 00020 #include "TNamed.h" 00021 #include "TROOT.h" 00022 #include "TChain.h" 00023 #include <iostream> 00024 #include <fstream> 00025 00026 #include "FWCore/Framework/interface/Frameworkfwd.h" 00027 #include "FWCore/Framework/interface/MakerMacros.h" 00028 #include "FWCore/Framework/interface/EventSetup.h" 00029 #include "FWCore/Framework/interface/ESHandle.h" 00030 //#include "Geometry/Records/interface/IdealGeometryRecord.h" 00031 00032 00033 #include "FWCore/Framework/interface/Event.h" 00034 #include "FWCore/Framework/interface/EDAnalyzer.h" 00035 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00036 00037 #include "DataFormats/Common/interface/Handle.h" 00038 #include "DataFormats/Common/interface/TriggerResults.h" 00039 00040 00041 #include "FWCore/ServiceRegistry/interface/Service.h" 00042 //#include "PhysicsTools/UtilAlgos/interface/TFileService.h" 00043 00044 00045 //Include DQM core 00046 #include "DQMServices/Core/interface/DQMStore.h" 00047 #include "DQMServices/Core/interface/MonitorElement.h" 00048 00049 00050 00051 00052 #include<vector> 00053 #include<string> 00054 00055 #include "HLTriggerOffline/Higgs/interface/HLTHiggsTruth.h" 00056 00057 // 00058 // class declaration 00059 // 00060 00061 class HLTHiggsBits : public edm::EDAnalyzer { 00062 00063 public: 00064 explicit HLTHiggsBits(const edm::ParameterSet&); 00065 ~HLTHiggsBits(); 00066 virtual void endJob(); 00067 virtual void analyze(const edm::Event&, const edm::EventSetup&); 00068 00069 00070 00071 00072 00073 00074 00075 edm::ParameterSet parameters; 00076 00077 DQMStore* dbe; 00078 00079 00080 TTree *HltTree; 00081 /* MonitorElement *hlt_mult_hist; 00082 MonitorElement *hlt_mult_hist_mc; 00083 MonitorElement *hlt_mult_hist_l1; 00084 MonitorElement *hlt_bit_hist; 00085 MonitorElement *hlt_bit_hist_reco; 00086 MonitorElement *hlt_bit_hist_mc; 00087 MonitorElement *hlt_bit_hist_l1; 00088 MonitorElement *hlt_bit_cumul; 00089 MonitorElement *hlt_bit_cumul_mc; 00090 MonitorElement *hlt_bit_cumul_l1; 00091 MonitorElement *hlt_redundancy[10]; 00092 MonitorElement *hlt_redundancy_mc[10]; 00093 MonitorElement *hlt_redundancy_l1[10]; 00094 MonitorElement *trg_eff_gen; 00095 MonitorElement *trg_eff_gen_mc; 00096 00097 00098 MonitorElement *trg_eff_gen_mc_mu; 00099 MonitorElement *trg_eff_gen_mc_elec; 00100 MonitorElement *trg_eff_gen_mc_emu; 00101 00102 00103 00104 MonitorElement *hlt_bitmu_hist; 00105 MonitorElement *hlt_bitel_hist; 00106 MonitorElement *hlt_bitemu_hist; 00107 MonitorElement *hlt_bitph_hist; 00108 MonitorElement *hlt_bittau_hist; 00109 00110 00111 MonitorElement *hlt_bitmu_hist_reco; 00112 MonitorElement *hlt_bitel_hist_reco; 00113 MonitorElement *hlt_bitemu_hist_reco; 00114 MonitorElement *hlt_bitph_hist_reco; 00115 MonitorElement *hlt_bittau_hist_reco; 00116 00117 00118 MonitorElement *ev_clasif; 00119 00120 00121 MonitorElement *h_mu; 00122 MonitorElement *h_el; 00123 MonitorElement *h_ph; 00124 MonitorElement *h_tau; 00125 MonitorElement *h_emu; 00126 MonitorElement *h_tot; 00127 MonitorElement *h_mc; 00128 MonitorElement *h_mc_reco; 00129 00130 MonitorElement *h_mu_reco; 00131 MonitorElement *h_el_reco; 00132 MonitorElement *h_ph_reco; 00133 MonitorElement *h_tau_reco; 00134 MonitorElement *h_emu_reco; 00135 00136 MonitorElement *h_l3pt; 00137 MonitorElement *h_l3eta;*/ 00138 00139 MonitorElement *h_ptmu1; 00140 MonitorElement *h_ptmu2; 00141 MonitorElement *h_ptmu1_trig[20]; 00142 MonitorElement *h_ptmu2_trig[20]; 00143 00144 MonitorElement *h_ptel1; 00145 MonitorElement *h_ptel2; 00146 MonitorElement *h_ptel1_trig[20]; 00147 MonitorElement *h_ptel2_trig[20]; 00148 00149 MonitorElement *h_ptmu1_emu; 00150 MonitorElement *h_etamu1_emu; 00151 MonitorElement *h_ptel1_emu; 00152 MonitorElement *h_etael1_emu; 00153 MonitorElement *h_ptmu1_emu_trig[20]; 00154 MonitorElement *h_etamu1_emu_trig[20]; 00155 MonitorElement *h_ptel1_emu_trig[20]; 00156 MonitorElement *h_etael1_emu_trig[20]; 00157 00158 00159 MonitorElement *h_ptph1; 00160 MonitorElement *h_ptph2; 00161 MonitorElement *h_ptph1_trig[20]; 00162 MonitorElement *h_ptph2_trig[20]; 00163 00164 /* MonitorElement *h_ptmu1_match[20]; 00165 MonitorElement *h_ptmu2_match[20]; 00166 00167 MonitorElement *h_etamu1_match[20]; 00168 MonitorElement *h_etamu2_match[20]; 00169 00170 MonitorElement *h_ptel1_match[20]; 00171 MonitorElement *h_ptel2_match[20]; 00172 00173 MonitorElement *h_ptph1_match[20]; 00174 MonitorElement *h_ptph2_match[20];*/ 00175 00176 MonitorElement *h_pttau1; 00177 // MonitorElement *h_pttau2; 00178 MonitorElement *h_pttau1_trig[20]; 00179 // MonitorElement *h_pttau2_trig[20]; 00180 00181 MonitorElement *h_etamu1; 00182 MonitorElement *h_etamu2; 00183 MonitorElement *h_etamu1_trig[20]; 00184 MonitorElement *h_etamu2_trig[20]; 00185 00186 MonitorElement *h_etael1; 00187 MonitorElement *h_etael2; 00188 MonitorElement *h_etael1_trig[20]; 00189 MonitorElement *h_etael2_trig[20]; 00190 00191 MonitorElement *h_etaph1; 00192 MonitorElement *h_etaph2; 00193 MonitorElement *h_etaph1_trig[20]; 00194 MonitorElement *h_etaph2_trig[20]; 00195 00196 MonitorElement *h_etatau1; 00197 // MonitorElement *h_etatau2; 00198 MonitorElement *h_etatau1_trig[20]; 00199 // MonitorElement *h_etatau2_trig[20]; 00200 00201 00202 MonitorElement* hlt_bitmu_hist_reco ; 00203 MonitorElement* h_mu_reco; 00204 00205 MonitorElement* hlt_bitel_hist_reco ; 00206 MonitorElement* h_el_reco; 00207 00208 MonitorElement* hlt_bitemu_hist_reco ; 00209 MonitorElement* h_emu_reco; 00210 00211 MonitorElement* hlt_bitph_hist_reco; 00212 MonitorElement* h_ph_reco; 00213 00214 MonitorElement* hlt_bittau_hist_gen; 00215 MonitorElement* h_tau_gen; 00216 00217 00218 00219 MonitorElement *h_met_hwwdimu; 00220 MonitorElement *h_met_hwwdiel; 00221 MonitorElement *h_met_hwwemu; 00222 00223 00224 /* MonitorElement *h_gen; 00225 MonitorElement *h_reco; 00226 00227 MonitorElement *h_ptph1_l3; 00228 MonitorElement *h_etaph1_l3; 00229 MonitorElement *h_ptph2_l3; 00230 MonitorElement *h_etaph2_l3;*/ 00231 00232 00233 private: 00234 00235 edm::InputTag hlTriggerResults_; // Input tag for TriggerResults 00236 /* edm::InputTag l1ParticleMapTag_; // Input tag for L1-Particles maps 00237 edm::InputTag l1GTReadoutRecTag_; // Input tag for Tag for L1 Trigger Results 00238 edm::InputTag l1GTObjectMapTag_;*/ 00239 edm::InputTag mctruth_; 00240 00241 int n_channel_; 00242 int n_hlt_bits, n_hlt_bits_eg, n_hlt_bits_mu, n_hlt_bits_ph, n_hlt_bits_tau; 00243 00244 // std::map<int, std::string> algoBitToName; 00245 00246 HLTHiggsTruth mct_analysis_; 00247 00248 edm::Handle<edm::TriggerResults> HLTR; 00249 00250 /* 00251 00252 unsigned int n_true_; // total selected (taken by HLT, passing MC preselection) 00253 unsigned int n_fake_; // total fakes (taken by HLT, not passing MC preselection) 00254 unsigned int n_miss_; // total misses (passing MC preselection, not taken by HLT) 00255 unsigned int n_inmc_; // total of events passing MC preselection 00256 unsigned int n_L1acc_; // total of L1 accepts 00257 unsigned int n_L1acc_mc_; // L1 accepts of events, passing MC preselection 00258 unsigned int n_hlt_of_L1_; // HLT accepts of all L1 accepted 00259 unsigned int n_mm_; 00260 unsigned int n_mm_acc; 00261 unsigned int n_ee_; 00262 unsigned int n_ee_acc; 00263 unsigned int n_em_;*/ 00264 00265 unsigned int nEvents_; // number of events processed 00266 std::vector<std::string> hlNames_; // name of each HLT algorithm 00267 bool init_; // vectors initialised or not 00268 00269 bool l1_decision; 00270 00271 int hlt_whichbit[3][20][21]; 00272 00273 00274 TFile* m_file; // pointer to Histogram file 00275 int *hlt_nbits; 00276 int neventcount; 00277 00278 std::string histName; 00279 std::vector<std::string> hlt_bitnames; 00280 std::vector<std::string> hlt_bitnamesMu; 00281 std::vector<std::string> hlt_bitnamesEg; 00282 00283 std::vector<std::string> hlt_bitnamesPh; 00284 std::vector<std::string> hlt_bitnamesTau; 00285 00286 /* std::vector<std::string> hlt_labels; 00287 std::vector<std::string> hlt_labelsMu; 00288 std::vector<std::string> hlt_labelsEg;*/ 00289 00290 00291 std::ofstream outfile; 00292 00293 /* typedef math::XYZTLorentzVector LorentzVector;*/ 00294 00295 00296 00297 std::string triggerTag_; 00298 std::string outFile_, outputFileName; 00299 bool outputMEsInRootFile; 00300 00301 00302 00303 00304 }; 00305 00306 #endif //HLTHiggsBits_h