CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/DQMOffline/JetMET/interface/BeamHaloAnalyzer.h

Go to the documentation of this file.
00001 #ifndef DQMOFFLINE_JETMET_BEAMHALO_ANALYZER_H
00002 #define DQMOFFLINE_JETMET_BEAMHALO_ANALYZER_H (1)
00003 
00004 //authors:  Ronny Remington, University of Florida
00005 //date:  08/01/09
00006 
00007 //Included Classes (semi-alphabetical)
00008 #include "DataFormats/CaloTowers/interface/CaloTowerDetId.h"
00009 #include "DataFormats/Candidate/interface/CandidateFwd.h"
00010 #include "DataFormats/Candidate/interface/Candidate.h"
00011 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
00012 #include "DataFormats/Common/interface/Handle.h"
00013 #include "DataFormats/Common/interface/View.h"
00014 #include "DataFormats/Common/interface/TriggerResults.h"
00015 #include "DataFormats/CSCRecHit/interface/CSCRecHit2D.h"
00016 #include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
00017 #include "DataFormats/CSCRecHit/interface/CSCRecHit2DCollection.h"
00018 #include "DataFormats/CSCRecHit/interface/CSCSegment.h"
00019 #include "DataFormats/DetId/interface/DetId.h"
00020 #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
00021 #include "DataFormats/DTRecHit/interface/DTRecSegment4D.h"
00022 #include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
00023 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
00024 #include "DataFormats/EcalDetId/interface/EBDetId.h"
00025 #include "DataFormats/EcalDetId/interface/EEDetId.h"
00026 #include "DataFormats/EcalDetId/interface/ESDetId.h"
00027 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00028 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
00029 #include "DataFormats/EgammaCandidates/interface/Conversion.h"
00030 #include "DataFormats/EgammaCandidates/interface/ConversionFwd.h"
00031 #include "DataFormats/EgammaCandidates/interface/Photon.h"
00032 #include "DataFormats/EgammaCandidates/interface/PhotonFwd.h"
00033 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
00034 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
00035 #include "DataFormats/GeometrySurface/interface/Cylinder.h"
00036 #include "DataFormats/GeometrySurface/interface/Plane.h"
00037 #include "DataFormats/GeometrySurface/interface/Cone.h"
00038 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00039 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
00040 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
00041 #include "DataFormats/GeometryVector/interface/LocalVector.h"
00042 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
00043 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
00044 #include "DataFormats/HcalRecHit/interface/HBHERecHit.h"
00045 #include "DataFormats/HcalRecHit/interface/HFRecHit.h"
00046 #include "DataFormats/HcalRecHit/interface/HORecHit.h"
00047 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
00048 #include "DataFormats/L1CSCTrackFinder/interface/L1CSCTrackCollection.h"
00049 #include "DataFormats/L1CSCTrackFinder/interface/L1CSCStatusDigiCollection.h"
00050 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h"
00051 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutRecord.h"
00052 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutCollection.h"
00053 #include "DataFormats/Math/interface/LorentzVector.h"
00054 
00055 #include "DataFormats/METReco/interface/CSCHaloData.h"
00056 #include "DataFormats/METReco/interface/EcalHaloData.h"
00057 #include "DataFormats/METReco/interface/HcalHaloData.h"
00058 #include "DataFormats/METReco/interface/GlobalHaloData.h"
00059 #include "DataFormats/METReco/interface/BeamHaloSummary.h"
00060 #include "DataFormats/METReco/interface/CaloMET.h"
00061 #include "DataFormats/METReco/interface/CaloMETFwd.h"
00062 #include "DataFormats/METReco/interface/GenMET.h"
00063 #include "DataFormats/METReco/interface/MET.h"
00064 #include "DataFormats/METReco/interface/METFwd.h"
00065 #include "DataFormats/MuonDetId/interface/CSCIndexer.h"
00066 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
00067 #include "DataFormats/MuonDetId/interface/RPCDetId.h"
00068 #include "DataFormats/MuonDetId/interface/DTWireId.h"
00069 #include "DataFormats/MuonReco/interface/MuonFwd.h"
00070 #include "DataFormats/MuonReco/interface/Muon.h"
00071 #include "DataFormats/MuonReco/interface/MuonTimeExtra.h"
00072 #include "DataFormats/MuonReco/interface/MuonTimeExtraMap.h"
00073 #include "DataFormats/RecoCandidate/interface/RecoCandidate.h"
00074 #include "DataFormats/RecoCandidate/interface/IsoDepositFwd.h" 
00075 #include "DataFormats/RecoCandidate/interface/IsoDeposit.h" 
00076 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00077 #include "DataFormats/TrackReco/interface/Track.h"
00078 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
00079 #include "DQMServices/Core/interface/DQMStore.h"
00080 #include "DQMServices/Core/interface/MonitorElement.h"
00081 
00082 #include "FWCore/Framework/interface/Frameworkfwd.h"
00083 #include "FWCore/Framework/interface/EDAnalyzer.h"
00084 #include "FWCore/Framework/interface/Event.h"
00085 #include "FWCore/Framework/interface/MakerMacros.h"
00086 #include "FWCore/Framework/interface/EventSetup.h"
00087 #include "FWCore/Framework/interface/ESHandle.h"
00088 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00089 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00090 #include "FWCore/PluginManager/interface/ModuleDef.h"
00091 
00092 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
00093 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00094 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
00095 #include "Geometry/CommonDetUnit/interface/TrackingGeometry.h"
00096 #include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
00097 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
00098 #include "Geometry/CommonTopologies/interface/PixelTopology.h"
00099 #include "Geometry/CommonTopologies/interface/StripTopology.h"
00100 #include "Geometry/CSCGeometry/interface/CSCGeometry.h"
00101 #include "Geometry/CSCGeometry/interface/CSCChamber.h"
00102 #include "Geometry/CSCGeometry/interface/CSCLayer.h"
00103 #include "Geometry/CSCGeometry/interface/CSCLayerGeometry.h"
00104 #include "Geometry/DTGeometry/interface/DTGeometry.h"
00105 #include "Geometry/DTGeometry/interface/DTLayer.h"
00106 #include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"
00107 #include "Geometry/RPCGeometry/interface/RPCRoll.h"
00108 #include "Geometry/RPCGeometry/interface/RPCGeometry.h"
00109 #include "Geometry/Records/interface/CaloGeometryRecord.h"
00110 #include "Geometry/Records/interface/MuonGeometryRecord.h"
00111 #include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"
00112 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
00113 
00114 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
00115 #include "MagneticField/Engine/interface/MagneticField.h"
00116 
00117 #include "RecoMuon/MuonIdentification/interface/TimeMeasurementSequence.h"
00118 #include "RecoMuon/TrackingTools/interface/MuonSegmentMatcher.h"
00119 #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h"
00120 
00121 //Root Classes
00122 
00123 #include "TH1F.h"
00124 #include "TH2F.h"
00125 #include "TH1I.h"
00126 #include "TFile.h"
00127 #include "TDirectory.h"
00128 #include "TTree.h"
00129 #include "TStyle.h"
00130 #include "TCanvas.h"
00131 #include "TString.h"
00132 #include "TMath.h"
00133 #include "TLorentzVector.h"
00134 #include "TLegend.h"
00135 
00136 
00137 //Standard C++ classes
00138 #include <iostream>
00139 #include <ostream>
00140 #include <string>
00141 #include <map>
00142 #include <vector>
00143 #include <utility>
00144 #include <ostream>
00145 #include <fstream>
00146 #include <algorithm>
00147 #include <cmath>
00148 #include <memory>
00149 #include <iomanip>
00150 
00151 class MuonServiceProxy;
00152 
00153 class BeamHaloAnalyzer: public edm::EDAnalyzer {
00154  public:
00155   explicit BeamHaloAnalyzer(const edm::ParameterSet&);
00156   ~BeamHaloAnalyzer();
00157  
00158  private:
00159 
00160   virtual void beginJob();
00161   virtual void beginRun(const edm::Run&, const edm::EventSetup& iSetup);
00162   virtual void analyze(const edm::Event& , const edm::EventSetup&);
00163   virtual void endJob();
00164   virtual void endRun(const edm::Run&, const edm::EventSetup&){ if (OutputFileName!="") dqm->save(OutputFileName);}
00165 
00166   edm::InputTag IT_L1MuGMTReadout;
00167 
00168   //RecHit Level
00169   edm::InputTag IT_CSCRecHit;
00170   edm::InputTag IT_EBRecHit;
00171   edm::InputTag IT_EERecHit;
00172   edm::InputTag IT_ESRecHit;
00173   edm::InputTag IT_HBHERecHit;
00174   edm::InputTag IT_HORecHit;
00175   edm::InputTag IT_HFRecHit;
00176 
00177   //Higher Level Reco
00178   edm::InputTag IT_CosmicMuon;
00179   edm::InputTag IT_CSCSegment;
00180   edm::InputTag IT_CollisionMuon;
00181   edm::InputTag IT_CollisionStandAloneMuon;
00182   edm::InputTag IT_BeamHaloMuon;
00183   edm::InputTag IT_CosmicStandAloneMuon;
00184   edm::InputTag IT_met;
00185   edm::InputTag IT_CaloTower;
00186   edm::InputTag IT_SuperCluster;
00187   edm::InputTag IT_Photon;
00188 
00189   // Halo Data
00190   edm::InputTag IT_CSCHaloData;
00191   edm::InputTag IT_EcalHaloData;
00192   edm::InputTag IT_HcalHaloData;
00193   edm::InputTag IT_GlobalHaloData;
00194   edm::InputTag IT_BeamHaloSummary;
00195 
00196   //Output File
00197   std::string OutputFileName;
00198   std::string TextFileName;
00199   std::string FolderName;
00200 
00201   ofstream* out;
00202   double DumpMET;
00203 
00204   //Muon-Segment Matching
00205   MuonServiceProxy* TheService;
00206   MuonSegmentMatcher *TheMatcher;
00207 
00208   bool StandardDQM;
00209 
00210   // DAQ Tools
00211   DQMStore* dqm;
00212 
00213   MonitorElement* hEcalHaloData_PhiWedgeMultiplicity;
00214   MonitorElement* hEcalHaloData_PhiWedgeConstituents;
00215   MonitorElement* hEcalHaloData_PhiWedgeZDirectionConfidence;
00216   MonitorElement* hEcalHaloData_SuperClusterShowerShapes;
00217   MonitorElement* hEcalHaloData_SuperClusterEnergy;
00218   MonitorElement* hEcalHaloData_SuperClusterNHits;
00219   
00220   MonitorElement* hEcalHaloData_PhiWedgeEnergy;
00221   MonitorElement* hEcalHaloData_PhiWedgeMinTime;
00222   MonitorElement* hEcalHaloData_PhiWedgeMaxTime;
00223   MonitorElement* hEcalHaloData_PhiWedgeiPhi;
00224   MonitorElement* hEcalHaloData_PhiWedgePlusZDirectionConfidence;
00225   MonitorElement* hEcalHaloData_PhiWedgeMinVsMaxTime;
00226   MonitorElement* hEcalHaloData_SuperClusterPhiVsEta;
00227   
00228   MonitorElement* hHcalHaloData_PhiWedgeMultiplicity;
00229   MonitorElement* hHcalHaloData_PhiWedgeConstituents;
00230   MonitorElement* hHcalHaloData_PhiWedgeZDirectionConfidence;
00231   
00232   MonitorElement* hHcalHaloData_PhiWedgeEnergy;
00233   MonitorElement* hHcalHaloData_PhiWedgeiPhi;
00234   MonitorElement* hHcalHaloData_PhiWedgeMinTime;
00235   MonitorElement* hHcalHaloData_PhiWedgeMaxTime;
00236   MonitorElement* hHcalHaloData_PhiWedgePlusZDirectionConfidence;
00237   MonitorElement* hHcalHaloData_PhiWedgeMinVsMaxTime;
00238 
00239   MonitorElement* hCSCHaloData_TrackMultiplicity;
00240   MonitorElement* hCSCHaloData_TrackMultiplicityMEPlus;
00241   MonitorElement* hCSCHaloData_TrackMultiplicityMEMinus;
00242   MonitorElement* hCSCHaloData_InnerMostTrackHitR;
00243   MonitorElement* hCSCHaloData_InnerMostTrackHitPhi;
00244   MonitorElement* hCSCHaloData_L1HaloTriggersMEPlus;
00245   MonitorElement* hCSCHaloData_L1HaloTriggersMEMinus;
00246   MonitorElement* hCSCHaloData_L1HaloTriggers;
00247   MonitorElement* hCSCHaloData_HLHaloTriggers;
00248   MonitorElement* hCSCHaloData_NOutOfTimeTriggersvsL1HaloExists;
00249   MonitorElement* hCSCHaloData_NOutOfTimeTriggersMEPlus;
00250   MonitorElement* hCSCHaloData_NOutOfTimeTriggersMEMinus;
00251   MonitorElement* hCSCHaloData_NOutOfTimeTriggers;
00252   MonitorElement* hCSCHaloData_NOutOfTimeHits;
00253   MonitorElement* hCSCHaloData_NTracksSmalldT;
00254   MonitorElement* hCSCHaloData_NTracksSmallBeta;
00255   MonitorElement* hCSCHaloData_NTracksSmallBetaAndSmalldT; 
00256   MonitorElement* hCSCHaloData_NTracksSmalldTvsNHaloTracks; 
00257 
00258   MonitorElement* hCSCHaloData_InnerMostTrackHitXY;
00259   MonitorElement* hCSCHaloData_InnerMostTrackHitRPlusZ;
00260   MonitorElement* hCSCHaloData_InnerMostTrackHitRMinusZ;
00261   MonitorElement* hCSCHaloData_InnerMostTrackHitiPhi;
00262 
00263   MonitorElement* hCSCHaloData_SegmentdT;
00264   MonitorElement* hCSCHaloData_FreeInverseBeta;
00265   MonitorElement* hCSCHaloData_FreeInverseBetaVsSegmentdT;
00266 
00267   // MLR
00268   MonitorElement* hCSCHaloData_NFlatHaloSegments;
00269   MonitorElement* hCSCHaloData_SegmentsInBothEndcaps;
00270   MonitorElement* hCSCHaloData_NFlatSegmentsInBothEndcaps;
00271   // End MLR
00272 
00273   MonitorElement* hGlobalHaloData_MExCorrection;
00274   MonitorElement* hGlobalHaloData_MEyCorrection;
00275   MonitorElement* hGlobalHaloData_SumEtCorrection;
00276   MonitorElement* hGlobalHaloData_HaloCorrectedMET;
00277   MonitorElement* hGlobalHaloData_RawMETMinusHaloCorrectedMET;
00278   MonitorElement* hGlobalHaloData_RawMETOverSumEt;
00279   MonitorElement* hGlobalHaloData_MatchedHcalPhiWedgeMultiplicity;
00280   MonitorElement* hGlobalHaloData_MatchedHcalPhiWedgeEnergy;
00281   MonitorElement* hGlobalHaloData_MatchedHcalPhiWedgeConstituents;
00282   MonitorElement* hGlobalHaloData_MatchedHcalPhiWedgeiPhi;
00283   MonitorElement* hGlobalHaloData_MatchedHcalPhiWedgeMinTime;
00284   MonitorElement* hGlobalHaloData_MatchedHcalPhiWedgeMaxTime;
00285   MonitorElement* hGlobalHaloData_MatchedHcalPhiWedgeZDirectionConfidence;
00286   MonitorElement* hGlobalHaloData_MatchedEcalPhiWedgeMultiplicity;
00287   MonitorElement* hGlobalHaloData_MatchedEcalPhiWedgeEnergy;
00288   MonitorElement* hGlobalHaloData_MatchedEcalPhiWedgeConstituents;
00289   MonitorElement* hGlobalHaloData_MatchedEcalPhiWedgeiPhi;
00290   MonitorElement* hGlobalHaloData_MatchedEcalPhiWedgeMinTime;
00291   MonitorElement* hGlobalHaloData_MatchedEcalPhiWedgeMaxTime;
00292   MonitorElement* hGlobalHaloData_MatchedEcalPhiWedgeZDirectionConfidence;
00293 
00294   MonitorElement* hBeamHaloSummary_Id;
00295 
00296   MonitorElement* hBeamHaloSummary_BXN;
00297   MonitorElement* hExtra_InnerMostTrackHitR;
00298   MonitorElement* hExtra_CSCActivityWithMET;
00299   MonitorElement* hExtra_HcalToF;
00300   MonitorElement* hExtra_HcalToF_HaloId;
00301   MonitorElement* hExtra_EcalToF;
00302   MonitorElement* hExtra_EcalToF_HaloId;
00303   MonitorElement* hExtra_CSCTrackInnerOuterDPhi;
00304   MonitorElement* hExtra_CSCTrackInnerOuterDEta;
00305   MonitorElement* hExtra_CSCTrackChi2Ndof;
00306   MonitorElement* hExtra_CSCTrackNHits;
00307   MonitorElement* hExtra_InnerMostTrackHitXY;
00308   MonitorElement* hExtra_InnerMostTrackHitRPlusZ;
00309   MonitorElement* hExtra_InnerMostTrackHitRMinusZ;
00310   MonitorElement* hExtra_InnerMostTrackHitiPhi;
00311   MonitorElement* hExtra_InnerMostTrackHitPhi;
00312   MonitorElement* hExtra_BXN;
00313 };
00314 
00315 #endif