Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:09:25

0001 #ifndef DQMOFFLINE_JETMET_BEAMHALO_ANALYZER_H
0002 #define DQMOFFLINE_JETMET_BEAMHALO_ANALYZER_H (1)
0003 
0004 //authors:  Ronny Remington, University of Florida
0005 //date:  08/01/09
0006 
0007 //Included Classes (semi-alphabetical)
0008 #include "DataFormats/CaloTowers/interface/CaloTowerDetId.h"
0009 #include "DataFormats/Candidate/interface/CandidateFwd.h"
0010 #include "DataFormats/Candidate/interface/Candidate.h"
0011 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
0012 #include "DataFormats/Common/interface/Handle.h"
0013 #include "DataFormats/Common/interface/View.h"
0014 #include "DataFormats/Common/interface/TriggerResults.h"
0015 #include "DataFormats/CSCRecHit/interface/CSCRecHit2D.h"
0016 #include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
0017 #include "DataFormats/CSCRecHit/interface/CSCRecHit2DCollection.h"
0018 #include "DataFormats/CSCRecHit/interface/CSCSegment.h"
0019 #include "DataFormats/DetId/interface/DetId.h"
0020 #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
0021 #include "DataFormats/DTRecHit/interface/DTRecSegment4D.h"
0022 #include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
0023 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
0024 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0025 #include "DataFormats/EcalDetId/interface/EEDetId.h"
0026 #include "DataFormats/EcalDetId/interface/ESDetId.h"
0027 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0028 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
0029 #include "DataFormats/EgammaCandidates/interface/Conversion.h"
0030 #include "DataFormats/EgammaCandidates/interface/ConversionFwd.h"
0031 #include "DataFormats/EgammaCandidates/interface/Photon.h"
0032 #include "DataFormats/EgammaCandidates/interface/PhotonFwd.h"
0033 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0034 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
0035 #include "DataFormats/GeometrySurface/interface/Cylinder.h"
0036 #include "DataFormats/GeometrySurface/interface/Plane.h"
0037 #include "DataFormats/GeometrySurface/interface/Cone.h"
0038 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0039 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0040 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0041 #include "DataFormats/GeometryVector/interface/LocalVector.h"
0042 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
0043 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0044 #include "DataFormats/HcalRecHit/interface/HBHERecHit.h"
0045 #include "DataFormats/HcalRecHit/interface/HFRecHit.h"
0046 #include "DataFormats/HcalRecHit/interface/HORecHit.h"
0047 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
0048 #include "DataFormats/L1CSCTrackFinder/interface/L1CSCTrackCollection.h"
0049 #include "DataFormats/L1CSCTrackFinder/interface/L1CSCStatusDigiCollection.h"
0050 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h"
0051 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutRecord.h"
0052 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutCollection.h"
0053 #include "DataFormats/Math/interface/LorentzVector.h"
0054 
0055 #include "DataFormats/METReco/interface/CSCHaloData.h"
0056 #include "DataFormats/METReco/interface/EcalHaloData.h"
0057 #include "DataFormats/METReco/interface/HcalHaloData.h"
0058 #include "DataFormats/METReco/interface/GlobalHaloData.h"
0059 #include "DataFormats/METReco/interface/BeamHaloSummary.h"
0060 #include "DataFormats/METReco/interface/CaloMET.h"
0061 #include "DataFormats/METReco/interface/CaloMETFwd.h"
0062 #include "DataFormats/METReco/interface/GenMET.h"
0063 #include "DataFormats/METReco/interface/MET.h"
0064 #include "DataFormats/METReco/interface/METFwd.h"
0065 #include "DataFormats/MuonDetId/interface/CSCIndexer.h"
0066 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0067 #include "DataFormats/MuonDetId/interface/RPCDetId.h"
0068 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0069 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0070 #include "DataFormats/MuonReco/interface/Muon.h"
0071 #include "DataFormats/MuonReco/interface/MuonTimeExtra.h"
0072 #include "DataFormats/MuonReco/interface/MuonTimeExtraMap.h"
0073 #include "DataFormats/RecoCandidate/interface/RecoCandidate.h"
0074 #include "DataFormats/RecoCandidate/interface/IsoDepositFwd.h"
0075 #include "DataFormats/RecoCandidate/interface/IsoDeposit.h"
0076 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0077 #include "DataFormats/TrackReco/interface/Track.h"
0078 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
0079 #include "DQMServices/Core/interface/DQMStore.h"
0080 
0081 #include "FWCore/Framework/interface/Frameworkfwd.h"
0082 #include "FWCore/Framework/interface/Event.h"
0083 #include "FWCore/Framework/interface/MakerMacros.h"
0084 #include "FWCore/Framework/interface/EventSetup.h"
0085 #include "FWCore/Framework/interface/ESHandle.h"
0086 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0087 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0088 
0089 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
0090 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0091 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
0092 #include "Geometry/CommonDetUnit/interface/TrackingGeometry.h"
0093 #include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
0094 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0095 #include "Geometry/CommonTopologies/interface/PixelTopology.h"
0096 #include "Geometry/CommonTopologies/interface/StripTopology.h"
0097 #include "Geometry/CSCGeometry/interface/CSCGeometry.h"
0098 #include "Geometry/CSCGeometry/interface/CSCChamber.h"
0099 #include "Geometry/CSCGeometry/interface/CSCLayer.h"
0100 #include "Geometry/CSCGeometry/interface/CSCLayerGeometry.h"
0101 #include "Geometry/DTGeometry/interface/DTGeometry.h"
0102 #include "Geometry/DTGeometry/interface/DTLayer.h"
0103 #include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"
0104 #include "Geometry/RPCGeometry/interface/RPCRoll.h"
0105 #include "Geometry/RPCGeometry/interface/RPCGeometry.h"
0106 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0107 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0108 #include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"
0109 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0110 
0111 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0112 #include "MagneticField/Engine/interface/MagneticField.h"
0113 
0114 #include "RecoMuon/MuonIdentification/interface/TimeMeasurementSequence.h"
0115 #include "RecoMuon/TrackingTools/interface/MuonSegmentMatcher.h"
0116 #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h"
0117 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0118 
0119 //Root Classes
0120 
0121 #include "TH1F.h"
0122 #include "TH2F.h"
0123 #include "TH1I.h"
0124 #include "TFile.h"
0125 #include "TDirectory.h"
0126 #include "TTree.h"
0127 #include "TStyle.h"
0128 #include "TCanvas.h"
0129 #include "TString.h"
0130 #include "TMath.h"
0131 #include "TLorentzVector.h"
0132 #include "TLegend.h"
0133 
0134 //Standard C++ classes
0135 #include <string>
0136 #include <map>
0137 #include <vector>
0138 #include <utility>
0139 #include <ostream>
0140 #include <fstream>
0141 #include <algorithm>
0142 #include <cmath>
0143 #include <memory>
0144 #include <iomanip>
0145 
0146 class MuonServiceProxy;
0147 
0148 class BeamHaloAnalyzer : public DQMEDAnalyzer {
0149 public:
0150   explicit BeamHaloAnalyzer(const edm::ParameterSet&);
0151   ~BeamHaloAnalyzer() override;
0152 
0153 private:
0154   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0155   void analyze(const edm::Event&, const edm::EventSetup&) override;
0156 
0157   edm::InputTag IT_L1MuGMTReadout;
0158 
0159   //RecHit Level
0160   edm::EDGetTokenT<CSCRecHit2DCollection> IT_CSCRecHit;
0161   edm::EDGetTokenT<EBRecHitCollection> IT_EBRecHit;
0162   edm::EDGetTokenT<EERecHitCollection> IT_EERecHit;
0163   edm::EDGetTokenT<ESRecHitCollection> IT_ESRecHit;
0164   edm::EDGetTokenT<HBHERecHitCollection> IT_HBHERecHit;
0165   edm::EDGetTokenT<HORecHitCollection> IT_HORecHit;
0166   edm::EDGetTokenT<HFRecHitCollection> IT_HFRecHit;
0167 
0168   //Higher Level Reco
0169   edm::EDGetTokenT<CSCSegmentCollection> IT_CSCSegment;
0170   edm::EDGetTokenT<reco::MuonCollection> IT_CollisionMuon;
0171   edm::EDGetTokenT<reco::MuonCollection> IT_CollisionStandAloneMuon;
0172   edm::EDGetTokenT<reco::MuonCollection> IT_BeamHaloMuon;
0173   edm::EDGetTokenT<reco::MuonCollection> IT_CosmicStandAloneMuon;
0174   edm::EDGetTokenT<reco::CaloMETCollection> IT_met;
0175   edm::EDGetTokenT<edm::View<reco::Candidate> > IT_CaloTower;
0176   edm::EDGetTokenT<reco::SuperClusterCollection> IT_SuperCluster;
0177   edm::EDGetTokenT<reco::PhotonCollection> IT_Photon;
0178 
0179   // Halo Data
0180   edm::EDGetTokenT<reco::CSCHaloData> IT_CSCHaloData;
0181   edm::EDGetTokenT<reco::EcalHaloData> IT_EcalHaloData;
0182   edm::EDGetTokenT<reco::HcalHaloData> IT_HcalHaloData;
0183   edm::EDGetTokenT<reco::GlobalHaloData> IT_GlobalHaloData;
0184   edm::EDGetTokenT<reco::BeamHaloSummary> IT_BeamHaloSummary;
0185   edm::EDGetTokenT<reco::MuonTimeExtraMap> IT_CSCTimeMapToken;
0186 
0187   edm::ESGetToken<CSCGeometry, MuonGeometryRecord> cscGeomToken_;
0188 
0189   //Output File
0190   std::string OutputFileName;
0191   std::string TextFileName;
0192   std::string FolderName;
0193 
0194   std::ofstream* out;
0195 
0196   double DumpMET;
0197 
0198   //Muon-Segment Matching
0199   MuonServiceProxy* TheService;
0200   MuonSegmentMatcher* TheMatcher;
0201 
0202   bool StandardDQM;
0203 
0204   MonitorElement* hEcalHaloData_PhiWedgeMultiplicity;
0205   MonitorElement* hEcalHaloData_PhiWedgeConstituents;
0206   MonitorElement* hEcalHaloData_PhiWedgeZDirectionConfidence;
0207   MonitorElement* hEcalHaloData_SuperClusterShowerShapes;
0208   MonitorElement* hEcalHaloData_SuperClusterEnergy;
0209   MonitorElement* hEcalHaloData_SuperClusterNHits;
0210 
0211   MonitorElement* hEcalHaloData_PhiWedgeEnergy;
0212   MonitorElement* hEcalHaloData_PhiWedgeMinTime;
0213   MonitorElement* hEcalHaloData_PhiWedgeMaxTime;
0214   MonitorElement* hEcalHaloData_PhiWedgeiPhi;
0215   MonitorElement* hEcalHaloData_PhiWedgePlusZDirectionConfidence;
0216   MonitorElement* hEcalHaloData_PhiWedgeMinVsMaxTime;
0217   MonitorElement* hEcalHaloData_SuperClusterPhiVsEta;
0218 
0219   MonitorElement* hHcalHaloData_PhiWedgeMultiplicity;
0220   MonitorElement* hHcalHaloData_PhiWedgeConstituents;
0221   MonitorElement* hHcalHaloData_PhiWedgeZDirectionConfidence;
0222 
0223   MonitorElement* hHcalHaloData_PhiWedgeEnergy;
0224   MonitorElement* hHcalHaloData_PhiWedgeiPhi;
0225   MonitorElement* hHcalHaloData_PhiWedgeMinTime;
0226   MonitorElement* hHcalHaloData_PhiWedgeMaxTime;
0227   MonitorElement* hHcalHaloData_PhiWedgePlusZDirectionConfidence;
0228   MonitorElement* hHcalHaloData_PhiWedgeMinVsMaxTime;
0229 
0230   MonitorElement* hCSCHaloData_TrackMultiplicity;
0231   MonitorElement* hCSCHaloData_TrackMultiplicityMEPlus;
0232   MonitorElement* hCSCHaloData_TrackMultiplicityMEMinus;
0233   MonitorElement* hCSCHaloData_InnerMostTrackHitR;
0234   MonitorElement* hCSCHaloData_InnerMostTrackHitPhi;
0235   MonitorElement* hCSCHaloData_L1HaloTriggersMEPlus;
0236   MonitorElement* hCSCHaloData_L1HaloTriggersMEMinus;
0237   MonitorElement* hCSCHaloData_L1HaloTriggers;
0238   MonitorElement* hCSCHaloData_HLHaloTriggers;
0239   MonitorElement* hCSCHaloData_NOutOfTimeTriggersvsL1HaloExists;
0240   MonitorElement* hCSCHaloData_NOutOfTimeTriggersMEPlus;
0241   MonitorElement* hCSCHaloData_NOutOfTimeTriggersMEMinus;
0242   MonitorElement* hCSCHaloData_NOutOfTimeTriggers;
0243   MonitorElement* hCSCHaloData_NOutOfTimeHits;
0244   MonitorElement* hCSCHaloData_NTracksSmalldT;
0245   MonitorElement* hCSCHaloData_NTracksSmallBeta;
0246   MonitorElement* hCSCHaloData_NTracksSmallBetaAndSmalldT;
0247   MonitorElement* hCSCHaloData_NTracksSmalldTvsNHaloTracks;
0248 
0249   MonitorElement* hCSCHaloData_InnerMostTrackHitXY;
0250   MonitorElement* hCSCHaloData_InnerMostTrackHitRPlusZ;
0251   MonitorElement* hCSCHaloData_InnerMostTrackHitRMinusZ;
0252   MonitorElement* hCSCHaloData_InnerMostTrackHitiPhi;
0253 
0254   MonitorElement* hCSCHaloData_SegmentdT;
0255   MonitorElement* hCSCHaloData_FreeInverseBeta;
0256   MonitorElement* hCSCHaloData_FreeInverseBetaVsSegmentdT;
0257 
0258   // MLR
0259   MonitorElement* hCSCHaloData_NFlatHaloSegments;
0260   MonitorElement* hCSCHaloData_SegmentsInBothEndcaps;
0261   MonitorElement* hCSCHaloData_NFlatSegmentsInBothEndcaps;
0262   // End MLR
0263 
0264   MonitorElement* hGlobalHaloData_MExCorrection;
0265   MonitorElement* hGlobalHaloData_MEyCorrection;
0266   MonitorElement* hGlobalHaloData_SumEtCorrection;
0267   MonitorElement* hGlobalHaloData_HaloCorrectedMET;
0268   MonitorElement* hGlobalHaloData_RawMETMinusHaloCorrectedMET;
0269   MonitorElement* hGlobalHaloData_RawMETOverSumEt;
0270   MonitorElement* hGlobalHaloData_MatchedHcalPhiWedgeMultiplicity;
0271   MonitorElement* hGlobalHaloData_MatchedHcalPhiWedgeEnergy;
0272   MonitorElement* hGlobalHaloData_MatchedHcalPhiWedgeConstituents;
0273   MonitorElement* hGlobalHaloData_MatchedHcalPhiWedgeiPhi;
0274   MonitorElement* hGlobalHaloData_MatchedHcalPhiWedgeMinTime;
0275   MonitorElement* hGlobalHaloData_MatchedHcalPhiWedgeMaxTime;
0276   MonitorElement* hGlobalHaloData_MatchedHcalPhiWedgeZDirectionConfidence;
0277   MonitorElement* hGlobalHaloData_MatchedEcalPhiWedgeMultiplicity;
0278   MonitorElement* hGlobalHaloData_MatchedEcalPhiWedgeEnergy;
0279   MonitorElement* hGlobalHaloData_MatchedEcalPhiWedgeConstituents;
0280   MonitorElement* hGlobalHaloData_MatchedEcalPhiWedgeiPhi;
0281   MonitorElement* hGlobalHaloData_MatchedEcalPhiWedgeMinTime;
0282   MonitorElement* hGlobalHaloData_MatchedEcalPhiWedgeMaxTime;
0283   MonitorElement* hGlobalHaloData_MatchedEcalPhiWedgeZDirectionConfidence;
0284 
0285   MonitorElement* hBeamHaloSummary_Id;
0286 
0287   MonitorElement* hBeamHaloSummary_BXN;
0288   MonitorElement* hExtra_InnerMostTrackHitR;
0289   MonitorElement* hExtra_CSCActivityWithMET;
0290   MonitorElement* hExtra_HcalToF;
0291   MonitorElement* hExtra_HcalToF_HaloId;
0292   MonitorElement* hExtra_EcalToF;
0293   MonitorElement* hExtra_EcalToF_HaloId;
0294   MonitorElement* hExtra_CSCTrackInnerOuterDPhi;
0295   MonitorElement* hExtra_CSCTrackInnerOuterDEta;
0296   MonitorElement* hExtra_CSCTrackChi2Ndof;
0297   MonitorElement* hExtra_CSCTrackNHits;
0298   MonitorElement* hExtra_InnerMostTrackHitXY;
0299   MonitorElement* hExtra_InnerMostTrackHitRPlusZ;
0300   MonitorElement* hExtra_InnerMostTrackHitRMinusZ;
0301   MonitorElement* hExtra_InnerMostTrackHitiPhi;
0302   MonitorElement* hExtra_InnerMostTrackHitPhi;
0303   MonitorElement* hExtra_BXN;
0304 };
0305 
0306 #endif