Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-06-30 04:13:32

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