00001 #ifndef PlotMakerReco_h 00002 #define PlotMakerReco_h 00003 00004 /* \class PlotMakerReco 00005 * 00006 * Class to produce some plots of Off-line variables in the TriggerValidation Code 00007 * 00008 * Author: Massimiliano Chiorboli Date: September 2007 00009 // Maurizio Pierini 00010 // Maria Spiropulu 00011 * 00012 */ 00013 #include <memory> 00014 #include <string> 00015 #include <iostream> 00016 00017 #include "FWCore/Framework/interface/Event.h" 00018 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00019 #include "DataFormats/Common/interface/Handle.h" 00020 00021 00022 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h" 00023 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" 00024 #include "DataFormats/EgammaCandidates/interface/Photon.h" 00025 #include "DataFormats/EgammaCandidates/interface/PhotonFwd.h" 00026 #include "DataFormats/MuonReco/interface/Muon.h" 00027 #include "DataFormats/MuonReco/interface/MuonFwd.h" 00028 #include "DataFormats/JetReco/interface/Jet.h" 00029 #include "DataFormats/JetReco/interface/CaloJetCollection.h" 00030 #include "DataFormats/JetReco/interface/CaloJet.h" 00031 #include "DataFormats/METReco/interface/CaloMET.h" 00032 #include "DataFormats/METReco/interface/CaloMETCollection.h" 00033 00034 00035 //l1extra 00036 #include "DataFormats/L1Trigger/interface/L1EmParticle.h" 00037 #include "DataFormats/L1Trigger/interface/L1EmParticleFwd.h" 00038 #include "DataFormats/L1Trigger/interface/L1EtMissParticle.h" 00039 #include "DataFormats/L1Trigger/interface/L1EtMissParticleFwd.h" 00040 #include "DataFormats/L1Trigger/interface/L1JetParticle.h" 00041 #include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h" 00042 #include "DataFormats/L1Trigger/interface/L1MuonParticle.h" 00043 #include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h" 00044 00045 //#include "DataFormats/L1Trigger/interface/L1ParticleMap.h" 00046 00047 //included for DQM 00048 #include "DQMServices/Core/interface/DQMStore.h" 00049 #include "DQMServices/Core/interface/MonitorElement.h" 00050 #include "FWCore/ServiceRegistry/interface/Service.h" 00051 #include "FWCore/MessageLogger/interface/MessageLogger.h" 00052 00053 00054 00055 class PlotMakerReco { 00056 00057 public: 00058 PlotMakerReco(edm::ParameterSet objectList); 00059 virtual ~PlotMakerReco(){}; 00060 00061 void handleObjects(const edm::Event&); 00062 void fillPlots(const edm::Event&); 00063 void bookHistos(DQMStore *, std::vector<int>*, std::vector<int>*,std::vector<std::string>*,std::vector<std::string>*); 00064 // void writeHistos(); 00065 00066 00067 private: 00068 00069 std::string dirname_; 00070 00071 void setBits(std::vector<int>* l1bits, std::vector<int>* hltbits) {l1bits_=l1bits; hltbits_=hltbits;} 00072 double invariantMass(reco::Candidate*,reco::Candidate*); 00073 std::vector<int>* l1bits_; 00074 std::vector<int>* hltbits_; 00075 00076 00077 00078 // Define the parameters 00079 std::string m_electronSrc; 00080 std::string m_muonSrc; 00081 std::string m_jetsSrc; 00082 std::string m_photonSrc; 00083 std::string m_photonProducerSrc; 00084 std::string m_calometSrc; 00085 00086 00087 double def_electronPtMin; 00088 double def_muonPtMin ; 00089 double def_jetPtMin ; 00090 double def_photonPtMin ; 00091 00092 int binFactor; 00093 00094 reco::GsfElectronCollection theElectronCollection; 00095 reco::MuonCollection theMuonCollection ; 00096 reco::PhotonCollection thePhotonCollection ; 00097 reco::CaloJetCollection theCaloJetCollection ; 00098 reco::CaloMETCollection theCaloMETCollection ; 00099 00100 //histos 00101 00102 //Jets 00103 MonitorElement* hJetMult; 00104 std::vector<MonitorElement*> hJetMultAfterL1; 00105 std::vector<MonitorElement*> hJetMultAfterHLT; 00106 MonitorElement* hJet1Pt; 00107 std::vector<MonitorElement*> hJet1PtAfterL1; 00108 std::vector<MonitorElement*> hJet1PtAfterHLT; 00109 MonitorElement* hJet2Pt; 00110 std::vector<MonitorElement*> hJet2PtAfterL1; 00111 std::vector<MonitorElement*> hJet2PtAfterHLT; 00112 MonitorElement* hJet1Eta; 00113 std::vector<MonitorElement*> hJet1EtaAfterL1; 00114 std::vector<MonitorElement*> hJet1EtaAfterHLT; 00115 MonitorElement* hJet2Eta; 00116 std::vector<MonitorElement*> hJet2EtaAfterL1; 00117 std::vector<MonitorElement*> hJet2EtaAfterHLT; 00118 MonitorElement* hJet1Phi; 00119 std::vector<MonitorElement*> hJet1PhiAfterL1; 00120 std::vector<MonitorElement*> hJet1PhiAfterHLT; 00121 MonitorElement* hJet2Phi; 00122 std::vector<MonitorElement*> hJet2PhiAfterL1; 00123 std::vector<MonitorElement*> hJet2PhiAfterHLT; 00124 00125 MonitorElement* hDiJetInvMass; 00126 std::vector<MonitorElement*> hDiJetInvMassAfterL1; 00127 std::vector<MonitorElement*> hDiJetInvMassAfterHLT; 00128 00129 00130 00131 00132 //Electrons 00133 MonitorElement* hElecMult; 00134 std::vector<MonitorElement*> hElecMultAfterL1; 00135 std::vector<MonitorElement*> hElecMultAfterHLT; 00136 MonitorElement* hElec1Pt; 00137 std::vector<MonitorElement*> hElec1PtAfterL1; 00138 std::vector<MonitorElement*> hElec1PtAfterHLT; 00139 MonitorElement* hElec2Pt; 00140 std::vector<MonitorElement*> hElec2PtAfterL1; 00141 std::vector<MonitorElement*> hElec2PtAfterHLT; 00142 MonitorElement* hElec1Eta; 00143 std::vector<MonitorElement*> hElec1EtaAfterL1; 00144 std::vector<MonitorElement*> hElec1EtaAfterHLT; 00145 MonitorElement* hElec2Eta; 00146 std::vector<MonitorElement*> hElec2EtaAfterL1; 00147 std::vector<MonitorElement*> hElec2EtaAfterHLT; 00148 MonitorElement* hElec1Phi; 00149 std::vector<MonitorElement*> hElec1PhiAfterL1; 00150 std::vector<MonitorElement*> hElec1PhiAfterHLT; 00151 MonitorElement* hElec2Phi; 00152 std::vector<MonitorElement*> hElec2PhiAfterL1; 00153 std::vector<MonitorElement*> hElec2PhiAfterHLT; 00154 00155 MonitorElement* hDiElecInvMass; 00156 std::vector<MonitorElement*> hDiElecInvMassAfterL1; 00157 std::vector<MonitorElement*> hDiElecInvMassAfterHLT; 00158 00159 00160 //Muons 00161 MonitorElement* hMuonMult; 00162 std::vector<MonitorElement*> hMuonMultAfterL1; 00163 std::vector<MonitorElement*> hMuonMultAfterHLT; 00164 MonitorElement* hMuon1Pt; 00165 std::vector<MonitorElement*> hMuon1PtAfterL1; 00166 std::vector<MonitorElement*> hMuon1PtAfterHLT; 00167 MonitorElement* hMuon2Pt; 00168 std::vector<MonitorElement*> hMuon2PtAfterL1; 00169 std::vector<MonitorElement*> hMuon2PtAfterHLT; 00170 MonitorElement* hMuon1Eta; 00171 std::vector<MonitorElement*> hMuon1EtaAfterL1; 00172 std::vector<MonitorElement*> hMuon1EtaAfterHLT; 00173 MonitorElement* hMuon2Eta; 00174 std::vector<MonitorElement*> hMuon2EtaAfterL1; 00175 std::vector<MonitorElement*> hMuon2EtaAfterHLT; 00176 MonitorElement* hMuon1Phi; 00177 std::vector<MonitorElement*> hMuon1PhiAfterL1; 00178 std::vector<MonitorElement*> hMuon1PhiAfterHLT; 00179 MonitorElement* hMuon2Phi; 00180 std::vector<MonitorElement*> hMuon2PhiAfterL1; 00181 std::vector<MonitorElement*> hMuon2PhiAfterHLT; 00182 00183 MonitorElement* hDiMuonInvMass; 00184 std::vector<MonitorElement*> hDiMuonInvMassAfterL1; 00185 std::vector<MonitorElement*> hDiMuonInvMassAfterHLT; 00186 00187 00188 //Photons 00189 MonitorElement* hPhotonMult; 00190 std::vector<MonitorElement*> hPhotonMultAfterL1; 00191 std::vector<MonitorElement*> hPhotonMultAfterHLT; 00192 MonitorElement* hPhoton1Pt; 00193 std::vector<MonitorElement*> hPhoton1PtAfterL1; 00194 std::vector<MonitorElement*> hPhoton1PtAfterHLT; 00195 MonitorElement* hPhoton2Pt; 00196 std::vector<MonitorElement*> hPhoton2PtAfterL1; 00197 std::vector<MonitorElement*> hPhoton2PtAfterHLT; 00198 MonitorElement* hPhoton1Eta; 00199 std::vector<MonitorElement*> hPhoton1EtaAfterL1; 00200 std::vector<MonitorElement*> hPhoton1EtaAfterHLT; 00201 MonitorElement* hPhoton2Eta; 00202 std::vector<MonitorElement*> hPhoton2EtaAfterL1; 00203 std::vector<MonitorElement*> hPhoton2EtaAfterHLT; 00204 MonitorElement* hPhoton1Phi; 00205 std::vector<MonitorElement*> hPhoton1PhiAfterL1; 00206 std::vector<MonitorElement*> hPhoton1PhiAfterHLT; 00207 MonitorElement* hPhoton2Phi; 00208 std::vector<MonitorElement*> hPhoton2PhiAfterL1; 00209 std::vector<MonitorElement*> hPhoton2PhiAfterHLT; 00210 00211 MonitorElement* hDiPhotonInvMass; 00212 std::vector<MonitorElement*> hDiPhotonInvMassAfterL1; 00213 std::vector<MonitorElement*> hDiPhotonInvMassAfterHLT; 00214 00215 00216 //MET 00217 MonitorElement* hMET; 00218 MonitorElement* hMETphi; 00219 MonitorElement* hMETx; 00220 MonitorElement* hMETy; 00221 MonitorElement* hSumEt; 00222 MonitorElement* hMETSignificance; 00223 00224 std::vector<MonitorElement*> hMETAfterL1; 00225 std::vector<MonitorElement*> hMETAfterHLT; 00226 std::vector<MonitorElement*> hMETphiAfterL1; 00227 std::vector<MonitorElement*> hMETphiAfterHLT; 00228 std::vector<MonitorElement*> hMETxAfterL1; 00229 std::vector<MonitorElement*> hMETxAfterHLT; 00230 std::vector<MonitorElement*> hMETyAfterL1; 00231 std::vector<MonitorElement*> hMETyAfterHLT; 00232 std::vector<MonitorElement*> hSumEtAfterL1; 00233 std::vector<MonitorElement*> hSumEtAfterHLT; 00234 std::vector<MonitorElement*> hMETSignificanceAfterL1; 00235 std::vector<MonitorElement*> hMETSignificanceAfterHLT; 00236 00237 00238 00239 00240 00241 std::string myHistoName; 00242 std::string myHistoTitle; 00243 00244 }; 00245 00246 00247 #endif