File indexing completed on 2024-04-06 12:08:04
0001 #ifndef ExoticaDQM_H
0002 #define ExoticaDQM_H
0003
0004 #include <memory>
0005
0006
0007 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0008 #include "DQMServices/Core/interface/DQMStore.h"
0009
0010
0011 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0012 #include "FWCore/Framework/interface/Event.h"
0013 #include "FWCore/Framework/interface/EventSetup.h"
0014 #include "FWCore/Framework/interface/Run.h"
0015 #include "FWCore/Framework/interface/LuminosityBlock.h"
0016 #include "DataFormats/Provenance/interface/EventID.h"
0017 #include "FWCore/Framework/interface/ESHandle.h"
0018 #include "FWCore/Framework/interface/DataKeyTags.h"
0019 #include "FWCore/Utilities/interface/EDGetToken.h"
0020 #include "FWCore/Utilities/interface/InputTag.h"
0021 #include "FWCore/ServiceRegistry/interface/Service.h"
0022 #include "FWCore/ParameterSet/interface/FileInPath.h"
0023 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0024
0025
0026 #include "DataFormats/Common/interface/Handle.h"
0027 #include "DataFormats/Candidate/interface/Candidate.h"
0028 #include "DataFormats/Candidate/interface/CandidateFwd.h"
0029 #include "DataFormats/Candidate/interface/OverlapChecker.h"
0030 #include "DataFormats/Candidate/interface/CompositeCandidate.h"
0031 #include "DataFormats/Candidate/interface/CompositeCandidateFwd.h"
0032 #include "DataFormats/Candidate/interface/CandMatchMap.h"
0033 #include "DataFormats/MuonReco/interface/Muon.h"
0034 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0035 #include "DataFormats/MuonReco/interface/MuonSelectors.h"
0036 #include "DataFormats/MuonReco/interface/MuonIsolation.h"
0037 #include "DataFormats/EgammaCandidates/interface/Electron.h"
0038 #include "DataFormats/EgammaCandidates/interface/ElectronFwd.h"
0039 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
0040 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
0041 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0042 #include "RecoEcal/EgammaCoreTools/interface/EcalClusterTools.h"
0043 #include "DataFormats/GsfTrackReco/interface/GsfTrack.h"
0044 #include "DataFormats/EgammaCandidates/interface/Photon.h"
0045 #include "DataFormats/EgammaCandidates/interface/PhotonFwd.h"
0046 #include "DataFormats/TauReco/interface/PFTau.h"
0047 #include "DataFormats/JetReco/interface/PFJetCollection.h"
0048 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
0049 #include "RecoJets/JetProducers/interface/JetIDHelper.h"
0050 #include "JetMETCorrections/JetCorrector/interface/JetCorrector.h"
0051 #include "DataFormats/METReco/interface/CaloMETCollection.h"
0052 #include "DataFormats/METReco/interface/PFMETCollection.h"
0053 #include "DataFormats/METReco/interface/CaloMET.h"
0054 #include "DataFormats/METReco/interface/PFMET.h"
0055 #include "DataFormats/METReco/interface/MET.h"
0056 #include "DataFormats/METReco/interface/METCollection.h"
0057 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
0058 #include "DataFormats/VertexReco/interface/Vertex.h"
0059 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0060 #include "DataFormats/TrackReco/interface/TrackBase.h"
0061 #include "DataFormats/TrackReco/interface/HitPattern.h"
0062 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
0063 #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
0064 #include "TrackingTools/Records/interface/TransientTrackRecord.h"
0065 #include "TrackingTools/PatternTools/interface/TSCBLBuilderNoMaterial.h"
0066 #include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h"
0067 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0068 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0069 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0070 #include "MagneticField/Engine/interface/MagneticField.h"
0071 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0072 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0073 #include "DataFormats/GeometryCommonDetAlgo/interface/Measurement1D.h"
0074 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0075
0076 #include "DataFormats/DetId/interface/DetId.h"
0077 #include "DataFormats/Common/interface/RefToBase.h"
0078 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
0079
0080
0081 #include "TLorentzVector.h"
0082
0083
0084 #include <iostream>
0085 #include <iomanip>
0086 #include <fstream>
0087 #include <cstdio>
0088 #include <string>
0089 #include <sstream>
0090 #include <cmath>
0091 #include <vector>
0092 #include <map>
0093
0094 class ExoticaDQM : public DQMEDAnalyzer {
0095 public:
0096 ExoticaDQM(const edm::ParameterSet& ps);
0097 ~ExoticaDQM() override;
0098
0099 protected:
0100 void analyze(edm::Event const& e, edm::EventSetup const& eSetup) override;
0101
0102
0103 virtual void analyzeDiJets(edm::Event const& e);
0104 virtual void analyzeDiMuons(edm::Event const& e);
0105 virtual void analyzeDiElectrons(edm::Event const& e);
0106 virtual void analyzeDiPhotons(edm::Event const& e);
0107
0108
0109 virtual void analyzeMonoJets(edm::Event const& e);
0110 virtual void analyzeMonoMuons(edm::Event const& e);
0111 virtual void analyzeMonoElectrons(edm::Event const& e);
0112 virtual void analyzeMonoPhotons(edm::Event const& e);
0113
0114
0115 virtual void analyzeDisplacedLeptons(edm::Event const& e, const edm::EventSetup& s);
0116 virtual void analyzeDisplacedJets(edm::Event const& e, const edm::EventSetup& s);
0117
0118
0119 virtual GlobalVector getGenParticleTrajectoryAtBeamline(const edm::EventSetup& iSetup, const reco::GenParticle* gen);
0120
0121 private:
0122 void bookHistograms(DQMStore::IBooker& bei, edm::Run const&, edm::EventSetup const&) override;
0123
0124 int nLumiSecs_;
0125 int nEvents_, irun, ievt;
0126
0127
0128 edm::EDGetTokenT<reco::VertexCollection> VertexToken_;
0129 edm::Handle<reco::VertexCollection> VertexCollection_;
0130
0131
0132 edm::EDGetTokenT<reco::GsfElectronCollection> ElectronToken_;
0133 edm::Handle<reco::GsfElectronCollection> ElectronCollection_;
0134
0135
0136 edm::EDGetTokenT<reco::MuonCollection> MuonToken_;
0137 edm::Handle<reco::MuonCollection> MuonCollection_;
0138
0139
0140 edm::EDGetTokenT<reco::PhotonCollection> PhotonToken_;
0141 edm::Handle<reco::PhotonCollection> PhotonCollection_;
0142
0143
0144 edm::EDGetTokenT<reco::CaloJetCollection> CaloJetToken_;
0145 edm::Handle<reco::CaloJetCollection> caloJetCollection_;
0146 reco::CaloJetCollection calojets;
0147
0148 edm::EDGetTokenT<reco::PFJetCollection> PFJetToken_;
0149 edm::Handle<reco::PFJetCollection> pfJetCollection_;
0150 reco::PFJetCollection pfjets;
0151
0152
0153 std::vector<edm::EDGetTokenT<reco::PFJetCollection> > DiJetPFJetToken_;
0154 std::vector<edm::InputTag> DiJetPFJetCollection_;
0155 edm::Handle<reco::PFJetCollection> DiJetpfJetCollection_;
0156 reco::PFJetCollection DiJetpfjets;
0157
0158
0159 edm::EDGetTokenT<reco::CaloMETCollection> CaloMETToken_;
0160 edm::Handle<reco::CaloMETCollection> caloMETCollection_;
0161
0162 edm::EDGetTokenT<reco::PFMETCollection> PFMETToken_;
0163 edm::Handle<reco::PFMETCollection> pfMETCollection_;
0164
0165
0166 edm::EDGetTokenT<EBRecHitCollection> ecalBarrelRecHitToken_;
0167 edm::EDGetTokenT<EERecHitCollection> ecalEndcapRecHitToken_;
0168
0169 edm::EDGetTokenT<reco::JetCorrector> JetCorrectorToken_;
0170 edm::Handle<reco::JetCorrector> JetCorrector_;
0171
0172
0173 edm::EDGetTokenT<reco::TrackCollection> TrackToken_;
0174 edm::Handle<reco::TrackCollection> TrackCollection_;
0175
0176
0177 edm::EDGetTokenT<reco::TrackCollection> MuonDispToken_;
0178 edm::Handle<reco::TrackCollection> MuonDispCollection_;
0179 edm::EDGetTokenT<reco::TrackCollection> MuonDispSAToken_;
0180 edm::Handle<reco::TrackCollection> MuonDispSACollection_;
0181
0182
0183 edm::EDGetTokenT<reco::GenParticleCollection> GenParticleToken_;
0184 edm::Handle<reco::GenParticleCollection> GenCollection_;
0185
0186
0187 edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magFieldToken_;
0188
0189
0190
0191
0192
0193
0194
0195 reco::helper::JetIDHelper* jetID;
0196
0197
0198
0199 double PFJetPx[2];
0200 double PFJetPy[2];
0201 double PFJetPt[2];
0202 double PFJetEta[2];
0203 double PFJetPhi[2];
0204 double PFJetRapidity[2];
0205 double PFJetMass[2];
0206 double PFJetNHEF[2];
0207 double PFJetCHEF[2];
0208 double PFJetNEMF[2];
0209 double PFJetCEMF[2];
0210
0211
0212
0213 double MuonPx[2];
0214 double MuonPy[2];
0215 double MuonPt[2];
0216 double MuonEta[2];
0217 double MuonPhi[2];
0218 double MuonCharge[2];
0219
0220
0221
0222 double ElectronPx[2];
0223 double ElectronPy[2];
0224 double ElectronPt[2];
0225 double ElectronEta[2];
0226 double ElectronPhi[2];
0227 double ElectronCharge[2];
0228
0229
0230
0231 double PhotonEnergy[2];
0232 double PhotonPt[2];
0233 double PhotonEt[2];
0234 double PhotonEta[2];
0235 double PhotonEtaSc[2];
0236 double PhotonPhi[2];
0237 double PhotonHoverE[2];
0238 double PhotonSigmaIetaIeta[2];
0239 double PhotonTrkSumPtSolidConeDR03[2];
0240 double PhotonE1x5E5x5[2];
0241 double PhotonE2x5E5x5[2];
0242
0243
0244
0245
0246
0247 std::vector<MonitorElement*> dijet_PFJet_pt;
0248 std::vector<MonitorElement*> dijet_PFJet_eta;
0249 std::vector<MonitorElement*> dijet_PFJet_phi;
0250 std::vector<MonitorElement*> dijet_PFJet_rapidity;
0251 std::vector<MonitorElement*> dijet_PFJet_mass;
0252 std::vector<MonitorElement*> dijet_deltaPhiPFJet1PFJet2;
0253 std::vector<MonitorElement*> dijet_deltaEtaPFJet1PFJet2;
0254 std::vector<MonitorElement*> dijet_deltaRPFJet1PFJet2;
0255 std::vector<MonitorElement*> dijet_invMassPFJet1PFJet2;
0256 std::vector<MonitorElement*> dijet_PFchef;
0257 std::vector<MonitorElement*> dijet_PFnhef;
0258 std::vector<MonitorElement*> dijet_PFcemf;
0259 std::vector<MonitorElement*> dijet_PFnemf;
0260 std::vector<MonitorElement*> dijet_PFJetMulti;
0261
0262 double dijet_PFJet1_pt_cut_;
0263 double dijet_PFJet2_pt_cut_;
0264 int dijet_countPFJet_;
0265
0266
0267
0268
0269 MonitorElement* dimuon_Muon_pt;
0270 MonitorElement* dimuon_Muon_eta;
0271 MonitorElement* dimuon_Muon_phi;
0272 MonitorElement* dimuon_Charge;
0273 MonitorElement* dimuon_deltaEtaMuon1Muon2;
0274 MonitorElement* dimuon_deltaPhiMuon1Muon2;
0275 MonitorElement* dimuon_deltaRMuon1Muon2;
0276 MonitorElement* dimuon_invMassMuon1Muon2;
0277 MonitorElement* dimuon_MuonMulti;
0278
0279 double dimuon_Muon1_pt_cut_;
0280 double dimuon_Muon2_pt_cut_;
0281 int dimuon_countMuon_;
0282
0283
0284
0285
0286 MonitorElement* dielectron_Electron_pt;
0287 MonitorElement* dielectron_Electron_eta;
0288 MonitorElement* dielectron_Electron_phi;
0289 MonitorElement* dielectron_Charge;
0290 MonitorElement* dielectron_deltaEtaElectron1Electron2;
0291 MonitorElement* dielectron_deltaPhiElectron1Electron2;
0292 MonitorElement* dielectron_deltaRElectron1Electron2;
0293 MonitorElement* dielectron_invMassElectron1Electron2;
0294 MonitorElement* dielectron_ElectronMulti;
0295
0296 double dielectron_Electron1_pt_cut_;
0297 double dielectron_Electron2_pt_cut_;
0298 int dielectron_countElectron_;
0299
0300
0301
0302
0303 MonitorElement* diphoton_Photon_pt;
0304 MonitorElement* diphoton_Photon_energy;
0305 MonitorElement* diphoton_Photon_et;
0306 MonitorElement* diphoton_Photon_eta;
0307 MonitorElement* diphoton_Photon_etasc;
0308 MonitorElement* diphoton_Photon_phi;
0309 MonitorElement* diphoton_Photon_hovere_eb;
0310 MonitorElement* diphoton_Photon_hovere_ee;
0311 MonitorElement* diphoton_Photon_sigmaietaieta_eb;
0312 MonitorElement* diphoton_Photon_sigmaietaieta_ee;
0313 MonitorElement* diphoton_Photon_trksumptsolidconedr03_eb;
0314 MonitorElement* diphoton_Photon_trksumptsolidconedr03_ee;
0315 MonitorElement* diphoton_Photon_e1x5e5x5_eb;
0316 MonitorElement* diphoton_Photon_e1x5e5x5_ee;
0317 MonitorElement* diphoton_Photon_e2x5e5x5_eb;
0318 MonitorElement* diphoton_Photon_e2x5e5x5_ee;
0319 MonitorElement* diphoton_deltaEtaPhoton1Photon2;
0320 MonitorElement* diphoton_deltaPhiPhoton1Photon2;
0321 MonitorElement* diphoton_deltaRPhoton1Photon2;
0322 MonitorElement* diphoton_invMassPhoton1Photon2;
0323 MonitorElement* diphoton_PhotonMulti;
0324
0325 double diphoton_Photon1_pt_cut_;
0326 double diphoton_Photon2_pt_cut_;
0327 int diphoton_countPhoton_;
0328
0329
0330
0331
0332 MonitorElement* monojet_PFJet_pt;
0333 MonitorElement* monojet_PFJet_eta;
0334 MonitorElement* monojet_PFJet_phi;
0335 MonitorElement* monojet_PFMet;
0336 MonitorElement* monojet_PFMet_phi;
0337 MonitorElement* monojet_PFJetPtOverPFMet;
0338 MonitorElement* monojet_deltaPhiPFJetPFMet;
0339 MonitorElement* monojet_PFchef;
0340 MonitorElement* monojet_PFnhef;
0341 MonitorElement* monojet_PFcemf;
0342 MonitorElement* monojet_PFnemf;
0343 MonitorElement* monojet_PFJetMulti;
0344
0345 double monojet_PFJet_pt_cut_;
0346 double monojet_PFJet_met_cut_;
0347 int monojet_countPFJet_;
0348
0349
0350
0351
0352 MonitorElement* monomuon_Muon_pt;
0353 MonitorElement* monomuon_Muon_eta;
0354 MonitorElement* monomuon_Muon_phi;
0355 MonitorElement* monomuon_Charge;
0356 MonitorElement* monomuon_PFMet;
0357 MonitorElement* monomuon_PFMet_phi;
0358 MonitorElement* monomuon_MuonPtOverPFMet;
0359 MonitorElement* monomuon_deltaPhiMuonPFMet;
0360 MonitorElement* monomuon_TransverseMass;
0361 MonitorElement* monomuon_MuonMulti;
0362
0363 double monomuon_Muon_pt_cut_;
0364 double monomuon_Muon_met_cut_;
0365 int monomuon_countMuon_;
0366
0367
0368
0369
0370 MonitorElement* monoelectron_Electron_pt;
0371 MonitorElement* monoelectron_Electron_eta;
0372 MonitorElement* monoelectron_Electron_phi;
0373 MonitorElement* monoelectron_Charge;
0374 MonitorElement* monoelectron_PFMet;
0375 MonitorElement* monoelectron_ElectronPtOverPFMet;
0376 MonitorElement* monoelectron_PFMet_phi;
0377 MonitorElement* monoelectron_deltaPhiElectronPFMet;
0378 MonitorElement* monoelectron_TransverseMass;
0379 MonitorElement* monoelectron_ElectronMulti;
0380
0381 double monoelectron_Electron_pt_cut_;
0382 double monoelectron_Electron_met_cut_;
0383 int monoelectron_countElectron_;
0384
0385
0386
0387
0388 MonitorElement* monophoton_Photon_pt;
0389 MonitorElement* monophoton_Photon_energy;
0390 MonitorElement* monophoton_Photon_et;
0391 MonitorElement* monophoton_Photon_eta;
0392 MonitorElement* monophoton_Photon_etasc;
0393 MonitorElement* monophoton_Photon_phi;
0394 MonitorElement* monophoton_Photon_hovere;
0395 MonitorElement* monophoton_Photon_sigmaietaieta;
0396 MonitorElement* monophoton_Photon_trksumptsolidconedr03;
0397 MonitorElement* monophoton_Photon_e1x5e5x5;
0398 MonitorElement* monophoton_Photon_e2x5e5x5;
0399 MonitorElement* monophoton_PFMet;
0400 MonitorElement* monophoton_PhotonPtOverPFMet;
0401 MonitorElement* monophoton_PFMet_phi;
0402 MonitorElement* monophoton_deltaPhiPhotonPFMet;
0403 MonitorElement* monophoton_PhotonMulti;
0404
0405 double monophoton_Photon_pt_cut_;
0406 double monophoton_Photon_met_cut_;
0407 int monophoton_countPhoton_;
0408
0409
0410
0411
0412 MonitorElement* dispElec_track_effi_lxy;
0413 MonitorElement* dispElec_elec_effi_lxy;
0414 MonitorElement* dispMuon_track_effi_lxy;
0415 MonitorElement* dispMuon_muon_effi_lxy;
0416 MonitorElement* dispMuon_muonDisp_effi_lxy;
0417 MonitorElement* dispMuon_muonDispSA_effi_lxy;
0418 MonitorElement* dispJet_track_effi_lxy;
0419
0420 double dispFermion_eta_cut_;
0421 double dispFermion_pt_cut_;
0422 };
0423
0424 #endif
0425
0426
0427
0428
0429