00001 #include "DQMOffline/JetMET/interface/BeamHaloAnalyzer.h"
00002 #include "FWCore/ServiceRegistry/interface/Service.h"
00003
00004
00005
00006
00007 using namespace edm;
00008 using namespace reco;
00009
00010 int Phi_To_iPhi(float phi)
00011 {
00012 phi = phi < 0 ? phi + 2.*TMath::Pi() : phi ;
00013 float phi_degrees = phi * (360.) / ( 2. * TMath::Pi() ) ;
00014 int iPhi = (int) ( ( phi_degrees/5. ) + 1.);
00015
00016 return iPhi < 73 ? iPhi : 73 ;
00017 }
00018
00019
00020 BeamHaloAnalyzer::BeamHaloAnalyzer( const edm::ParameterSet& iConfig)
00021 {
00022 OutputFileName = iConfig.getParameter<std::string>("OutputFile");
00023 TextFileName = iConfig.getParameter<std::string>("TextFile");
00024
00025 if(TextFileName.size())
00026 out = new ofstream(TextFileName.c_str() );
00027
00028
00029 if( iConfig.exists("StandardDQM") )
00030 StandardDQM = iConfig.getParameter<bool>("StandardDQM");
00031 else
00032 StandardDQM = false;
00033
00034
00035
00036 IT_L1MuGMTReadout = iConfig.getParameter<edm::InputTag>("L1MuGMTReadoutLabel");
00037
00038
00039 IT_CSCRecHit = iConfig.getParameter<edm::InputTag>("CSCRecHitLabel");
00040 IT_EBRecHit = iConfig.getParameter<edm::InputTag>("EBRecHitLabel");
00041 IT_EERecHit = iConfig.getParameter<edm::InputTag>("EERecHitLabel");
00042 IT_ESRecHit = iConfig.getParameter<edm::InputTag>("ESRecHitLabel");
00043 IT_HBHERecHit = iConfig.getParameter<edm::InputTag>("HBHERecHitLabel");
00044 IT_HFRecHit = iConfig.getParameter<edm::InputTag>("HFRecHitLabel");
00045 IT_HORecHit = iConfig.getParameter<edm::InputTag>("HORecHitLabel");
00046
00047
00048 IT_CSCSegment = iConfig.getParameter<edm::InputTag>("CSCSegmentLabel");
00049 IT_CosmicStandAloneMuon = iConfig.getParameter<edm::InputTag>("CosmicStandAloneMuonLabel");
00050 IT_BeamHaloMuon = iConfig.getParameter<edm::InputTag>("BeamHaloMuonLabel");
00051 IT_CollisionMuon = iConfig.getParameter<edm::InputTag>("CollisionMuonLabel");
00052 IT_CollisionStandAloneMuon = iConfig.getParameter<edm::InputTag>("CollisionStandAloneMuonLabel");
00053 IT_met = iConfig.getParameter<edm::InputTag>("metLabel");
00054 IT_CaloTower = iConfig.getParameter<edm::InputTag>("CaloTowerLabel");
00055 IT_SuperCluster = iConfig.getParameter<edm::InputTag>("SuperClusterLabel");
00056 IT_Photon = iConfig.getParameter<edm::InputTag>("PhotonLabel") ;
00057
00058
00059 IT_CSCHaloData = iConfig.getParameter<edm::InputTag> ("CSCHaloDataLabel");
00060 IT_EcalHaloData = iConfig.getParameter<edm::InputTag>("EcalHaloDataLabel");
00061 IT_HcalHaloData = iConfig.getParameter<edm::InputTag>("HcalHaloDataLabel");
00062 IT_GlobalHaloData = iConfig.getParameter<edm::InputTag>("GlobalHaloDataLabel");
00063 IT_BeamHaloSummary = iConfig.getParameter<edm::InputTag>("BeamHaloSummaryLabel");
00064
00065 FolderName = iConfig.getParameter<std::string>("folderName");
00066 DumpMET = iConfig.getParameter<double>("DumpMET");
00067
00068
00069 edm::ParameterSet serviceParameters = iConfig.getParameter<edm::ParameterSet>("ServiceParameters");
00070 TheService = new MuonServiceProxy(serviceParameters);
00071 edm::ParameterSet matchParameters = iConfig.getParameter<edm::ParameterSet>("MatchParameters");
00072 TheMatcher = new MuonSegmentMatcher(matchParameters, TheService);
00073
00074 }
00075
00076
00077 void BeamHaloAnalyzer::beginJob(void){}
00078
00079 void BeamHaloAnalyzer::beginRun(const edm::Run&, const edm::EventSetup& iSetup){
00080
00081 dqm = edm::Service<DQMStore>().operator->();
00082 if( dqm ) {
00083
00084
00085 dqm->setCurrentFolder(FolderName+"/EcalHaloData");
00086 if(StandardDQM)
00087 {
00088 hEcalHaloData_PhiWedgeMultiplicity = dqm->book1D("EcalHaloData_PhiWedgeMultiplicity","",20, -0.5, 19.5);
00089 hEcalHaloData_PhiWedgeConstituents = dqm->book1D("EcalHaloData_PhiWedgeConstituents","",20,-0.5, 19.5);
00090
00091 hEcalHaloData_PhiWedgeZDirectionConfidence = dqm->book1D("EcalHaloData_ZDirectionConfidence","", 120, -1.2, 1.2);
00092 hEcalHaloData_SuperClusterShowerShapes = dqm->book2D("EcalHaloData_SuperClusterShowerShapes","", 30, 0, 3.2, 25,0.0, 2.0);
00093 hEcalHaloData_SuperClusterEnergy = dqm->book1D("EcalHaloData_SuperClusterEnergy","",50,-0.5,99.5);
00094 hEcalHaloData_SuperClusterNHits = dqm->book1D("EcalHaloData_SuperClusterNHits", "", 20, -0.5, 19.5);
00095 }
00096 else
00097 {
00098 hEcalHaloData_PhiWedgeMultiplicity = dqm->book1D("EcalHaloData_PhiWedgeMultiplicity","",20, -0.5, 19.5);
00099 hEcalHaloData_PhiWedgeEnergy = dqm->book1D("EcalHaloData_PhiWedgeEnergy","", 50,-0.5,199.5);
00100 hEcalHaloData_PhiWedgeConstituents = dqm->book1D("EcalHaloData_PhiWedgeConstituents","",20,-0.5, 19.5);
00101 hEcalHaloData_PhiWedgeMinTime = dqm->book1D("EcalHaloData_PhiWedgeMinTime","", 100, -225.0, 225.0);
00102 hEcalHaloData_PhiWedgeMaxTime = dqm->book1D("EcalHaloData_PhiWedgeMaxTime","", 100, -225.0, 225.0);
00103 hEcalHaloData_PhiWedgeiPhi = dqm->book1D("EcalHaloData_PhiWedgeiPhi","", 360, 0.5, 360.5) ;
00104 hEcalHaloData_PhiWedgePlusZDirectionConfidence = dqm->book1D("EcalHaloData_PlusZDirectionConfidence","", 50, 0., 1.0);
00105 hEcalHaloData_PhiWedgeZDirectionConfidence = dqm->book1D("EcalHaloData_ZDirectionConfidence","", 120, -1.2, 1.2);
00106 hEcalHaloData_PhiWedgeMinVsMaxTime = dqm->book2D("EcalHaloData_PhiWedgeMinVsMaxTime","", 50,-100.0, 100.0, 50, -100.0, 100.0);
00107 hEcalHaloData_SuperClusterShowerShapes = dqm->book2D("EcalHaloData_SuperClusterShowerShapes","", 30, 0, 3.2, 25,0.0, 2.0);
00108 hEcalHaloData_SuperClusterEnergy = dqm->book1D("EcalHaloData_SuperClusterEnergy","",100,-0.5,99.5);
00109 hEcalHaloData_SuperClusterNHits = dqm->book1D("EcalHaloData_SuperClusterNHits", "", 20, -0.5, 19.5);
00110 hEcalHaloData_SuperClusterPhiVsEta = dqm->book2D("EcalHaloData_SuperClusterPhiVsEta","",60, -3.0, 3.0, 60, -3.2, 3.2);
00111 }
00112
00113
00114 dqm->setCurrentFolder(FolderName+"/HcalHaloData");
00115 if( StandardDQM )
00116 {
00117 hHcalHaloData_PhiWedgeMultiplicity = dqm->book1D("HcalHaloData_PhiWedgeMultiplicity","", 20, -0.5, 19.5);
00118 hHcalHaloData_PhiWedgeConstituents = dqm->book1D("HcalHaloData_PhiWedgeConstituents","", 20,-0.5, 19.5);
00119
00120 hHcalHaloData_PhiWedgeZDirectionConfidence = dqm->book1D("HcalHaloData_ZDirectionConfidence","", 120, -1.2, 1.2);
00121 }
00122 else
00123 {
00124 hHcalHaloData_PhiWedgeMultiplicity = dqm->book1D("HcalHaloData_PhiWedgeMultiplicity","", 20, -0.5, 19.5);
00125 hHcalHaloData_PhiWedgeEnergy = dqm->book1D("HcalHaloData_PhiWedgeEnergy", "", 50,-0.5,199.5);
00126 hHcalHaloData_PhiWedgeConstituents = dqm->book1D("HcalHaloData_PhiWedgeConstituents","", 20,-0.5, 19.5);
00127 hHcalHaloData_PhiWedgeiPhi = dqm->book1D("HcalHaloData_PhiWedgeiPhi","", 72, 0.5,72.5);
00128 hHcalHaloData_PhiWedgeMinTime = dqm->book1D("HcalHaloData_PhiWedgeMinTime", "", 50, -100.0, 100.0);
00129 hHcalHaloData_PhiWedgeMaxTime = dqm->book1D("HcalHaloData_PhiWedgeMaxTime", "", 50, -100.0, 100.0);
00130 hHcalHaloData_PhiWedgePlusZDirectionConfidence = dqm->book1D("HcalHaloData_PlusZDirectionConfidence","", 50, 0., 1.0);
00131 hHcalHaloData_PhiWedgeZDirectionConfidence = dqm->book1D("HcalHaloData_ZDirectionConfidence","", 120, -1.2, 1.2);
00132 hHcalHaloData_PhiWedgeMinVsMaxTime = dqm->book2D("HcalHaloData_PhiWedgeMinVsMaxTime","" , 50,-100.0, 100.0, 50, -100.0, 100.0);
00133 }
00134
00135
00136 dqm->setCurrentFolder(FolderName+"/CSCHaloData");
00137 if( StandardDQM )
00138 {
00139 hCSCHaloData_TrackMultiplicity = dqm->book1D("CSCHaloData_TrackMultiplicity", "", 15, -0.5, 14.5);
00140 hCSCHaloData_TrackMultiplicityMEPlus = dqm->book1D("CSCHaloData_TrackMultiplicityMEPlus", "", 15, -0.5, 14.5);
00141 hCSCHaloData_TrackMultiplicityMEMinus = dqm->book1D("CSCHaloData_TrackMultiplicityMEMinus", "", 15, -0.5, 14.5);
00142 hCSCHaloData_InnerMostTrackHitR = dqm->book1D("CSCHaloData_InnerMostTrackHitR", "", 70, 99.5, 799.5);
00143 hCSCHaloData_InnerMostTrackHitPhi = dqm->book1D("CSCHaloData_InnerMostTrackHitPhi","", 60, -3.2, 3.2);
00144 hCSCHaloData_L1HaloTriggersMEPlus = dqm->book1D("CSCHaloData_L1HaloTriggersMEPlus", "", 10, -0.5, 9.5);
00145 hCSCHaloData_L1HaloTriggersMEMinus = dqm->book1D("CSCHaloData_L1HaloTriggersMEMinus", "" , 10, -0.5, 9.5);
00146 hCSCHaloData_L1HaloTriggers = dqm->book1D("CSCHaloData_L1HaloTriggers", "", 10, -0.5, 9.5);
00147 hCSCHaloData_HLHaloTriggers = dqm->book1D("CSCHaloData_HLHaloTriggers", "", 2, -0.5, 1.5);
00148 hCSCHaloData_NOutOfTimeTriggersvsL1HaloExists = dqm->book2D("CSCHaloData_NOutOfTimeTriggersvsL1HaloExists", "", 20, -0.5, 19.5, 2, -0.5, 1.5);
00149 hCSCHaloData_NOutOfTimeTriggersMEPlus = dqm->book1D("CSCHaloData_NOutOfTimeTriggersMEPlus", "", 20, -0.5, 19.5);
00150 hCSCHaloData_NOutOfTimeTriggersMEMinus = dqm->book1D("CSCHaloData_NOutOfTimeTriggersMEMinus", "", 20, -0.5, 19.5);
00151 hCSCHaloData_NOutOfTimeTriggers = dqm->book1D("CSCHaloData_NOutOfTimeTriggers", "", 20, -0.5, 19.5);
00152 hCSCHaloData_NOutOfTimeHits = dqm->book1D("CSCHaloData_NOutOfTimeHits", "", 60, -0.5, 59.5);
00153 hCSCHaloData_NTracksSmalldT = dqm->book1D("CSCHaloData_NTracksSmalldT", "", 15, -0.5, 14.5);
00154 hCSCHaloData_NTracksSmallBeta = dqm->book1D("CSCHaloData_NTracksSmallBeta", "", 15, -0.5, 14.5);
00155 hCSCHaloData_NTracksSmallBetaAndSmalldT = dqm->book1D("CSCHaloData_NTracksSmallBetaAndSmalldT", "", 15, -0.5, 14.5);
00156 hCSCHaloData_NTracksSmalldTvsNHaloTracks = dqm->book2D("CSCHaloData_NTracksSmalldTvsNHaloTracks","",15, -0.5, 14.5,15, -0.5, 14.5);
00157 hCSCHaloData_SegmentdT = dqm->book1D("CSCHaloData_SegmentdT","",100,-100,100);
00158 hCSCHaloData_FreeInverseBeta = dqm->book1D("CSCHaloData_FreeInverseBeta","",80,-4,4);
00159 hCSCHaloData_FreeInverseBetaVsSegmentdT = dqm->book2D("CSCHaloData_FreeInverseBetaVsSegmentdT","",100,-100,100,80,-4,4);
00160
00161 hCSCHaloData_NFlatHaloSegments = dqm->book1D("CSCHaloData_NFlatHaloSegments","",20,0,20);
00162 hCSCHaloData_SegmentsInBothEndcaps = dqm->book1D("CSCHaloData_SegmentsInBothEndcaps","",2,0,2);
00163 hCSCHaloData_NFlatSegmentsInBothEndcaps = dqm->book1D("CSCHaloData_NFlatSegmentsInBothEndcaps","",20,0,20);
00164
00165 }
00166 else
00167 {
00168 hCSCHaloData_TrackMultiplicity = dqm->book1D("CSCHaloData_TrackMultiplicity", "", 15, -0.5, 14.5);
00169 hCSCHaloData_TrackMultiplicityMEPlus = dqm->book1D("CSCHaloData_TrackMultiplicityMEPlus", "", 15, -0.5, 14.5);
00170 hCSCHaloData_TrackMultiplicityMEMinus = dqm->book1D("CSCHaloData_TrackMultiplicityMEMinus", "", 15, -0.5, 14.5);
00171 hCSCHaloData_InnerMostTrackHitXY = dqm->book2D("CSCHaloData_InnerMostTrackHitXY","", 100,-700,700,100, -700,700);
00172 hCSCHaloData_InnerMostTrackHitR = dqm->book1D("CSCHaloData_InnerMostTrackHitR", "", 400, -0.5, 799.5);
00173 hCSCHaloData_InnerMostTrackHitRPlusZ = dqm->book2D("CSCHaloData_InnerMostTrackHitRPlusZ","", 400 , 400, 1200, 400, -0.5, 799.5 );
00174 hCSCHaloData_InnerMostTrackHitRMinusZ = dqm->book2D("CSCHaloData_InnerMostTrackHitRMinusZ","", 400 , -1200, -400, 400, -0.5, 799.5 );
00175 hCSCHaloData_InnerMostTrackHitiPhi = dqm->book1D("CSCHaloData_InnerMostTrackHitiPhi","", 72, 0.5, 72.5);
00176 hCSCHaloData_InnerMostTrackHitPhi = dqm->book1D("CSCHaloData_InnerMostTrackHitPhi","", 60, -3.2, 3.2);
00177 hCSCHaloData_L1HaloTriggersMEPlus = dqm->book1D("CSCHaloData_L1HaloTriggersMEPlus", "", 10, -0.5, 9.5);
00178 hCSCHaloData_L1HaloTriggersMEMinus = dqm->book1D("CSCHaloData_L1HaloTriggersMEMinus", "" , 10, -0.5, 9.5);
00179 hCSCHaloData_L1HaloTriggers = dqm->book1D("CSCHaloData_L1HaloTriggers", "", 10, -0.5, 9.5);
00180 hCSCHaloData_HLHaloTriggers = dqm->book1D("CSCHaloData_HLHaloTriggers", "", 2, -0.5, 1.5);
00181 hCSCHaloData_NOutOfTimeTriggersvsL1HaloExists = dqm->book2D("CSCHaloData_NOutOfTimeTriggersvsL1HaloExists", "", 20, -0.5, 19.5, 2, -0.5, 1.5);
00182 hCSCHaloData_NOutOfTimeTriggers = dqm->book1D("CSCHaloData_NOutOfTimeTriggers", "", 20, -0.5, 19.5);
00183 hCSCHaloData_NOutOfTimeHits = dqm->book1D("CSCHaloData_NOutOfTimeHits", "", 60, -0.5, 59.5);
00184 hCSCHaloData_NTracksSmalldT = dqm->book1D("CSCHaloData_NTracksSmalldT", "", 15, -0.5, 14.5);
00185 hCSCHaloData_NTracksSmallBeta = dqm->book1D("CSCHaloData_NTracksSmallBeta", "", 15, -0.5, 14.5);
00186 hCSCHaloData_NTracksSmallBetaAndSmalldT = dqm->book1D("CSCHaloData_NTracksSmallBetaAndSmalldT", "", 15, -0.5, 14.5);
00187 hCSCHaloData_NTracksSmalldTvsNHaloTracks = dqm->book2D("CSCHaloData_NTracksSmalldTvsNHaloTracks","",15, -0.5, 14.5,15, -0.5, 14.5);
00188 hCSCHaloData_SegmentdT = dqm->book1D("CSCHaloData_SegmentdT","",100,-100,100);
00189 hCSCHaloData_FreeInverseBeta = dqm->book1D("CSCHaloData_FreeInverseBeta","",80,-4,4);
00190 hCSCHaloData_FreeInverseBetaVsSegmentdT = dqm->book2D("CSCHaloData_FreeInverseBetaVsSegmentdT","",100,-100,100,80,-4,4);
00191
00192 hCSCHaloData_NFlatHaloSegments = dqm->book1D("CSCHaloData_NFlatHaloSegments","",20,0,20);
00193 hCSCHaloData_SegmentsInBothEndcaps = dqm->book1D("CSCHaloData_SegmentsInBothEndcaps","",2,0,2);
00194 hCSCHaloData_NFlatSegmentsInBothEndcaps = dqm->book1D("CSCHaloData_NFlatSegmentsInBothEndcaps","",20,0,20);
00195
00196 }
00197
00198
00199 dqm->setCurrentFolder(FolderName+"/GlobalHaloData");
00200 if(!StandardDQM)
00201 {
00202 hGlobalHaloData_MExCorrection = dqm->book1D("GlobalHaloData_MExCorrection", "" , 200, -200., 200.);
00203 hGlobalHaloData_MEyCorrection = dqm->book1D("GlobalHaloData_MEyCorrection", "" , 200, -200., 200.);
00204 hGlobalHaloData_SumEtCorrection = dqm->book1D("GlobalHaloData_SumEtCorrection", "" , 200, -0.5, 399.5);
00205 hGlobalHaloData_HaloCorrectedMET = dqm->book1D("GlobalHaloData_HaloCorrectedMET", "" , 500, -0.5, 1999.5);
00206 hGlobalHaloData_RawMETMinusHaloCorrectedMET = dqm->book1D("GlobalHaloData_RawMETMinusHaloCorrectedMET","" , 250, -500., 500.);
00207 hGlobalHaloData_RawMETOverSumEt = dqm->book1D("GlobalHaloData_RawMETOverSumEt","" , 100, 0.0, 1.0);
00208 hGlobalHaloData_MatchedHcalPhiWedgeMultiplicity = dqm->book1D("GlobalHaloData_MatchedHcalPhiWedgeMultiplicity","", 15, -0.5, 14.5);
00209 hGlobalHaloData_MatchedHcalPhiWedgeEnergy = dqm->book1D("GlobalHaloData_MatchedHcalPhiWedgeEnergy", "", 50,-0.5,199.5);
00210 hGlobalHaloData_MatchedHcalPhiWedgeConstituents = dqm->book1D("GlobalHaloData_MatchedHcalPhiWedgeConstituents","", 20,-0.5, 19.5);
00211 hGlobalHaloData_MatchedHcalPhiWedgeiPhi = dqm->book1D("GlobalHaloData_MatchedHcalPhiWedgeiPhi","", 1, 0.5,72.5);
00212 hGlobalHaloData_MatchedHcalPhiWedgeMinTime = dqm->book1D("GlobalHaloData_MatchedHcalPhiWedgeMinTime", "", 50, -100.0, 100.0);
00213 hGlobalHaloData_MatchedHcalPhiWedgeMaxTime = dqm->book1D("GlobalHaloData_MatchedHcalPhiWedgeMaxTime", "", 50, -100.0, 100.0);
00214 hGlobalHaloData_MatchedHcalPhiWedgeZDirectionConfidence = dqm->book1D("GlobalHaloData_MatchedHcalPhiWedgeZDirectionConfidence","", 120, -1.2, 1.2);
00215 hGlobalHaloData_MatchedEcalPhiWedgeMultiplicity = dqm->book1D("GlobalHaloData_MatchedEcalPhiWedgeMultiplicity","", 15, -0.5, 14.5);
00216 hGlobalHaloData_MatchedEcalPhiWedgeEnergy = dqm->book1D("GlobalHaloData_MatchedEcalPhiWedgeEnergy", "", 50,-0.5,199.5);
00217 hGlobalHaloData_MatchedEcalPhiWedgeConstituents = dqm->book1D("GlobalHaloData_MatchedEcalPhiWedgeConstituents","", 20,-0.5, 19.5);
00218 hGlobalHaloData_MatchedEcalPhiWedgeiPhi = dqm->book1D("GlobalHaloData_MatchedEcalPhiWedgeiPhi","", 360, 0.5,360.5);
00219 hGlobalHaloData_MatchedEcalPhiWedgeMinTime = dqm->book1D("GlobalHaloData_MatchedEcalPhiWedgeMinTime", "", 50, -100.0, 100.0);
00220 hGlobalHaloData_MatchedEcalPhiWedgeMaxTime = dqm->book1D("GlobalHaloData_MatchedEcalPhiWedgeMaxTime", "", 50, -100.0, 100.0);
00221 hGlobalHaloData_MatchedEcalPhiWedgeZDirectionConfidence = dqm->book1D("GlobalHaloData_MatchedEcalPhiWedgeZDirectionConfidence","", 120, 1.2, 1.2);
00222 }
00223
00224 dqm->setCurrentFolder(FolderName+"/BeamHaloSummary");
00225
00226 hBeamHaloSummary_Id = dqm->book1D("BeamHaloSumamry_Id", "", 11, 0.5,11.5);
00227 hBeamHaloSummary_Id ->setBinLabel(1,"CSC Loose");
00228 hBeamHaloSummary_Id ->setBinLabel(2,"CSC Tight");
00229 hBeamHaloSummary_Id ->setBinLabel(3,"Ecal Loose");
00230 hBeamHaloSummary_Id ->setBinLabel(4,"Ecal Tight");
00231 hBeamHaloSummary_Id ->setBinLabel(5,"Hcal Loose");
00232 hBeamHaloSummary_Id ->setBinLabel(6,"Hcal Tight");
00233 hBeamHaloSummary_Id ->setBinLabel(7,"Global Loose");
00234 hBeamHaloSummary_Id ->setBinLabel(8,"Global Tight");
00235 hBeamHaloSummary_Id ->setBinLabel(9,"Event Loose");
00236 hBeamHaloSummary_Id ->setBinLabel(10,"Event Tight");
00237 hBeamHaloSummary_Id ->setBinLabel(11,"Nothing");
00238 if(!StandardDQM)
00239 {
00240 hBeamHaloSummary_BXN = dqm->book2D("BeamHaloSummary_BXN", "",11, 0.5, 11.5, 4000, -0.5,3999.5);
00241 hBeamHaloSummary_BXN ->setBinLabel(1,"CSC Loose");
00242 hBeamHaloSummary_BXN ->setBinLabel(2,"CSC Tight");
00243 hBeamHaloSummary_BXN ->setBinLabel(3,"Ecal Loose");
00244 hBeamHaloSummary_BXN ->setBinLabel(4,"Ecal Tight");
00245 hBeamHaloSummary_BXN ->setBinLabel(5,"Hcal Loose");
00246 hBeamHaloSummary_BXN ->setBinLabel(6,"Hcal Tight");
00247 hBeamHaloSummary_BXN ->setBinLabel(7,"Global Loose");
00248 hBeamHaloSummary_BXN ->setBinLabel(8,"Global Tight");
00249 hBeamHaloSummary_BXN ->setBinLabel(9,"Event Loose");
00250 hBeamHaloSummary_BXN ->setBinLabel(10,"Event Tight");
00251 hBeamHaloSummary_BXN ->setBinLabel(11,"Nothing");
00252 }
00253
00254 dqm->setCurrentFolder(FolderName+"/ExtraHaloData");
00255 if(StandardDQM)
00256 {
00257 hExtra_CSCTrackInnerOuterDPhi = dqm->book1D("Extra_CSCTrackInnerOuterDPhi","", 30, 0, 3.2);
00258 hExtra_CSCTrackInnerOuterDEta = dqm->book1D("Extra_CSCTrackInnerOuterDEta","", 100, 0, 3.0 );
00259 hExtra_CSCTrackChi2Ndof = dqm->book1D("Extra_CSCTrackChi2Ndof","", 25, 0, 10);
00260 hExtra_CSCTrackNHits = dqm->book1D("Extra_CSCTrackNHits","", 75,0, 75);
00261 hExtra_CSCActivityWithMET= dqm->book2D("Extra_CSCActivityWithMET", "", 4, 0.5, 4.5, 4, 0.5, 4.5);
00262 hExtra_CSCActivityWithMET->setBinLabel(1,"Track",1);
00263 hExtra_CSCActivityWithMET->setBinLabel(1,"Track",2);
00264 hExtra_CSCActivityWithMET->setBinLabel(2, "Segments",1);
00265 hExtra_CSCActivityWithMET->setBinLabel(2, "Segments",2);
00266 hExtra_CSCActivityWithMET->setBinLabel(3, "RecHits", 1);
00267 hExtra_CSCActivityWithMET->setBinLabel(3, "RecHits", 2);
00268 hExtra_CSCActivityWithMET->setBinLabel(4, "Nothing", 1);
00269 hExtra_CSCActivityWithMET->setBinLabel(4, "Nothing", 2);
00270 hExtra_InnerMostTrackHitR = dqm->book1D("Extra_InnerMostTrackHitR", "", 70, 99.5, 799.5);
00271 hExtra_InnerMostTrackHitPhi = dqm->book1D("Extra_InnerMostTrackHitPhi","", 60, -3.2, 3.2);
00272 }
00273 else
00274 {
00275 hExtra_CSCActivityWithMET= dqm->book2D("Extra_CSCActivityWithMET", "", 4, 0.5, 4.5, 4, 0.5, 4.5);
00276 hExtra_CSCActivityWithMET->setBinLabel(1,"Track",1);
00277 hExtra_CSCActivityWithMET->setBinLabel(1,"Track",2);
00278 hExtra_CSCActivityWithMET->setBinLabel(2, "Segments",1);
00279 hExtra_CSCActivityWithMET->setBinLabel(2, "Segments",2);
00280 hExtra_CSCActivityWithMET->setBinLabel(3, "RecHits", 1);
00281 hExtra_CSCActivityWithMET->setBinLabel(3, "RecHits", 2);
00282 hExtra_CSCActivityWithMET->setBinLabel(4, "Nothing", 1);
00283 hExtra_CSCActivityWithMET->setBinLabel(4, "Nothing", 2);
00284 hExtra_HcalToF = dqm->book2D("Extra_HcalToF","" , 83,-41.5,41.5 , 1000, -125., 125.);
00285 hExtra_HcalToF_HaloId = dqm->book2D("Extra_HcalToF_HaloId","", 83,-41.5,41.5 , 1000, -125., 125.);
00286 hExtra_EcalToF = dqm->book2D("Extra_EcalToF","", 171,-85.5,85.5 , 2000, -225., 225.);
00287 hExtra_EcalToF_HaloId = dqm->book2D("Extra_EcalToF_HaloId","", 171,-85.5,85.5 , 2000, -225., 225.);
00288 hExtra_CSCTrackInnerOuterDPhi = dqm->book1D("Extra_CSCTrackInnerOuterDPhi","", 30, 0, 3.2);
00289 hExtra_CSCTrackInnerOuterDEta = dqm->book1D("Extra_CSCTrackInnerOuterDEta","", 30, 0, 3.2);
00290 hExtra_CSCTrackChi2Ndof = dqm->book1D("Extra_CSCTrackChi2Ndof","", 100, 0, 10);
00291 hExtra_CSCTrackNHits = dqm->book1D("Extra_CSCTrackNHits","", 75,0, 75);
00292 hExtra_InnerMostTrackHitXY = dqm->book2D("Extra_InnerMostTrackHitXY","", 100,-700,700,100, -700,700);
00293 hExtra_InnerMostTrackHitR = dqm->book1D("Extra_InnerMostTrackHitR", "", 400, -0.5, 799.5);
00294 hExtra_InnerMostTrackHitRPlusZ = dqm->book2D("Extra_InnerMostTrackHitRPlusZ","", 400 , 400, 1200, 400, -0.5, 799.5 );
00295 hExtra_InnerMostTrackHitRMinusZ = dqm->book2D("Extra_InnerMostTrackHitRMinusZ","", 400 , -1200, -400, 400, -0.5, 799.5 );
00296 hExtra_InnerMostTrackHitiPhi = dqm->book1D("Extra_InnerMostTrackHitiPhi","", 72, 0.5, 72.5);
00297 hExtra_InnerMostTrackHitPhi = dqm->book1D("Extra_InnerMostTrackHitPhi","", 60, -3.2, 3.2);
00298 hExtra_BXN = dqm->book1D("Extra_BXN", "BXN Occupancy", 4000, 0.5, 4000.5);
00299 }
00300 }
00301 }
00302
00303 void BeamHaloAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
00304 {
00305 EventID TheEvent = iEvent.id();
00306 int BXN = iEvent.bunchCrossing() ;
00307 bool Dump = TextFileName.size();
00308 int TheEventNumber = TheEvent.event();
00309 int Lumi = iEvent.luminosityBlock();
00310 int Run = iEvent.run();
00311
00312
00313 edm::ESHandle<CSCGeometry> TheCSCGeometry;
00314 iSetup.get<MuonGeometryRecord>().get(TheCSCGeometry);
00315
00316
00317 edm::ESHandle<CaloGeometry> TheCaloGeometry;
00318 iSetup.get<CaloGeometryRecord>().get(TheCaloGeometry);
00319
00320
00321 edm::Handle< reco::MuonCollection > TheCosmics;
00322 iEvent.getByLabel(IT_CosmicStandAloneMuon, TheCosmics);
00323 edm::Handle<reco::MuonTimeExtraMap> TheCSCTimeMap;
00324 iEvent.getByLabel(IT_CosmicStandAloneMuon.label(),"csc",TheCSCTimeMap);
00325 bool CSCTrackPlus = false; bool CSCTrackMinus = false;
00326 int imucount=0;
00327 if( TheCosmics.isValid() )
00328 {
00329 for( reco::MuonCollection::const_iterator iMuon = TheCosmics->begin() ; iMuon != TheCosmics->end() ; iMuon++, imucount++ )
00330 {
00331 reco::TrackRef Track = iMuon->outerTrack();
00332 if(!Track) continue;
00333
00334 if( !CSCTrackPlus || !CSCTrackMinus )
00335 {
00336 if( Track->eta() > 0 || Track->outerPosition().z() > 0 || Track->innerPosition().z() > 0 ) CSCTrackPlus = true ;
00337 else if( Track->eta() < 0 || Track->outerPosition().z() < 0 || Track->innerPosition().z() < 0) CSCTrackMinus = true;
00338 }
00339
00340 float innermost_phi = 0.;
00341 float outermost_phi = 0.;
00342 float innermost_z = 99999.;
00343 float outermost_z = 0.;
00344 float innermost_eta = 0.;
00345 float outermost_eta = 0.;
00346 float innermost_x =0.;
00347 float innermost_y =0.;
00348 float innermost_r =0.;
00349 for(unsigned int j = 0 ; j < Track->extra()->recHits().size(); j++ )
00350 {
00351 edm::Ref<TrackingRecHitCollection> hit( Track->extra()->recHits(), j );
00352 DetId TheDetUnitId(hit->geographicalId());
00353 if( TheDetUnitId.det() != DetId::Muon ) continue;
00354 if( TheDetUnitId.subdetId() != MuonSubdetId::CSC ) continue;
00355
00356 const GeomDetUnit *TheUnit = TheCSCGeometry->idToDetUnit(TheDetUnitId);
00357 LocalPoint TheLocalPosition = hit->localPosition();
00358 const BoundPlane& TheSurface = TheUnit->surface();
00359 const GlobalPoint TheGlobalPosition = TheSurface.toGlobal(TheLocalPosition);
00360
00361 float z = TheGlobalPosition.z();
00362 if( TMath::Abs(z) < innermost_z )
00363 {
00364 innermost_phi = TheGlobalPosition.phi();
00365 innermost_eta = TheGlobalPosition.eta();
00366 innermost_z = TheGlobalPosition.z();
00367 innermost_x = TheGlobalPosition.x();
00368 innermost_y = TheGlobalPosition.y();
00369 innermost_r = TMath::Sqrt( innermost_x*innermost_x + innermost_y*innermost_y );
00370 }
00371 if( TMath::Abs(z) > outermost_z)
00372 {
00373 outermost_phi = TheGlobalPosition.phi() ;
00374 outermost_eta = TheGlobalPosition.eta() ;
00375 outermost_z = TheGlobalPosition.z();
00376 }
00377 }
00378 float dphi = TMath::Abs( outermost_phi - innermost_phi );
00379 float deta = TMath::Abs( outermost_eta - innermost_eta );
00380 hExtra_CSCTrackInnerOuterDPhi -> Fill( dphi );
00381 hExtra_CSCTrackInnerOuterDEta -> Fill( deta );
00382 hExtra_CSCTrackChi2Ndof -> Fill(Track->normalizedChi2() );
00383 hExtra_CSCTrackNHits -> Fill(Track->numberOfValidHits() );
00384 hExtra_InnerMostTrackHitR ->Fill(innermost_r);
00385 hExtra_InnerMostTrackHitPhi ->Fill(innermost_phi);
00386 if( !StandardDQM )
00387 {
00388 hExtra_InnerMostTrackHitXY ->Fill(innermost_x, innermost_y);
00389 hExtra_InnerMostTrackHitiPhi ->Fill(Phi_To_iPhi(innermost_phi));
00390 if(innermost_z > 0 )
00391 hExtra_InnerMostTrackHitRPlusZ ->Fill(innermost_z, innermost_r);
00392 else
00393 hExtra_InnerMostTrackHitRMinusZ ->Fill(innermost_z, innermost_r);
00394 }
00395
00396 std::vector<const CSCSegment*> MatchedSegments = TheMatcher->matchCSC(*Track,iEvent);
00397
00398
00399 float InnerSegmentTime[2] = {0,0};
00400 float OuterSegmentTime[2] = {0,0};
00401 float innermost_seg_z[2] = {1500,1500};
00402 float outermost_seg_z[2] = {0,0};
00403 for (std::vector<const CSCSegment*>::const_iterator segment =MatchedSegments.begin();
00404 segment != MatchedSegments.end(); ++segment)
00405 {
00406 CSCDetId TheCSCDetId((*segment)->cscDetId());
00407 const CSCChamber* TheCSCChamber = TheCSCGeometry->chamber(TheCSCDetId);
00408 LocalPoint TheLocalPosition = (*segment)->localPosition();
00409 const GlobalPoint TheGlobalPosition = TheCSCChamber->toGlobal(TheLocalPosition);
00410 float z = TheGlobalPosition.z();
00411 int TheEndcap = TheCSCDetId.endcap();
00412 if( TMath::Abs(z) < innermost_seg_z[TheEndcap-1] )
00413 {
00414 innermost_seg_z[TheEndcap-1] = TMath::Abs(z);
00415 InnerSegmentTime[TheEndcap-1] = (*segment)->time();
00416 }
00417 if( TMath::Abs(z) > outermost_seg_z[TheEndcap-1] )
00418 {
00419 outermost_seg_z[TheEndcap-1] = TMath::Abs(z);
00420 OuterSegmentTime[TheEndcap-1] = (*segment)->time();
00421 }
00422 }
00423
00424 float dT_Segment = 0;
00425 if( innermost_seg_z[0] < outermost_seg_z[0])
00426 dT_Segment = OuterSegmentTime[0]-InnerSegmentTime[0];
00427 if( innermost_seg_z[1] < outermost_seg_z[1])
00428 {
00429
00430
00431 if (dT_Segment == 0.0 || OuterSegmentTime[1]-InnerSegmentTime[1] < dT_Segment)
00432 dT_Segment = OuterSegmentTime[1]-InnerSegmentTime[1] ;
00433 }
00434 hCSCHaloData_SegmentdT->Fill(dT_Segment);
00435
00436
00437 reco::MuonRef muonR(TheCosmics,imucount);
00438 if (TheCSCTimeMap.isValid()){
00439 const reco::MuonTimeExtraMap & timeMapCSC = *TheCSCTimeMap;
00440 reco::MuonTimeExtra timecsc = timeMapCSC[muonR];
00441 float freeInverseBeta = timecsc.freeInverseBeta();
00442 hCSCHaloData_FreeInverseBeta->Fill(freeInverseBeta);
00443 hCSCHaloData_FreeInverseBetaVsSegmentdT->Fill(dT_Segment,freeInverseBeta);
00444 }
00445
00446 }
00447 }
00448
00449
00450 edm::Handle<CSCSegmentCollection> TheCSCSegments;
00451 iEvent.getByLabel(IT_CSCSegment, TheCSCSegments);
00452
00453
00454 std::vector< CSCSegment> vCSCSegments_Plus;
00455 std::vector< CSCSegment> vCSCSegments_Minus;
00456
00457 bool CSCSegmentPlus = false;
00458 bool CSCSegmentMinus=false;
00459 if( TheCSCSegments.isValid() )
00460 {
00461 for(CSCSegmentCollection::const_iterator iSegment = TheCSCSegments->begin(); iSegment != TheCSCSegments->end(); iSegment++)
00462 {
00463 const std::vector<CSCRecHit2D> vCSCRecHits = iSegment->specificRecHits();
00464 CSCDetId iDetId = (CSCDetId)(*iSegment).cscDetId();
00465
00466 if ( iDetId.endcap() == 1 ) vCSCSegments_Plus.push_back( *iSegment );
00467 else vCSCSegments_Minus.push_back( *iSegment );
00468 }
00469 }
00470
00471
00472 if( vCSCSegments_Plus.size() ) CSCSegmentPlus = true;
00473 if( vCSCSegments_Minus.size() ) CSCSegmentMinus = true;
00474
00475
00476 Handle<CSCRecHit2DCollection> TheCSCRecHits;
00477 iEvent.getByLabel(IT_CSCRecHit, TheCSCRecHits);
00478 bool CSCRecHitPlus = false;
00479 bool CSCRecHitMinus = false;
00480 if( TheCSCRecHits.isValid() )
00481 {
00482 for(CSCRecHit2DCollection::const_iterator iCSCRecHit = TheCSCRecHits->begin(); iCSCRecHit != TheCSCRecHits->end(); iCSCRecHit++ )
00483 {
00484 DetId TheDetUnitId(iCSCRecHit->geographicalId());
00485 const GeomDetUnit *TheUnit = (*TheCSCGeometry).idToDetUnit(TheDetUnitId);
00486 LocalPoint TheLocalPosition = iCSCRecHit->localPosition();
00487 const BoundPlane& TheSurface = TheUnit->surface();
00488 GlobalPoint TheGlobalPosition = TheSurface.toGlobal(TheLocalPosition);
00489
00490
00491 if ( TheGlobalPosition.z() > 0 ) CSCRecHitPlus = true;
00492 else CSCRecHitMinus = true;
00493 }
00494 }
00495
00496
00497 edm::Handle<EBRecHitCollection> TheEBRecHits;
00498 iEvent.getByLabel(IT_EBRecHit, TheEBRecHits);
00499 int EBHits=0;
00500 if( TheEBRecHits.isValid() )
00501 {
00502 for( EBRecHitCollection::const_iterator iEBRecHit = TheEBRecHits->begin() ; iEBRecHit != TheEBRecHits->end(); iEBRecHit++)
00503 {
00504 if( iEBRecHit->energy() < 0.5 ) continue;
00505 DetId id = DetId( iEBRecHit->id() ) ;
00506 EBDetId EcalId ( id.rawId() );
00507 int ieta = EcalId.ieta() ;
00508 if(!StandardDQM)
00509 hExtra_EcalToF ->Fill(ieta, iEBRecHit->time() );
00510 EBHits++;
00511 }
00512 }
00513
00514
00515
00516 edm::Handle<HBHERecHitCollection> TheHBHERecHits;
00517 iEvent.getByLabel(IT_HBHERecHit, TheHBHERecHits);
00518 if( TheHBHERecHits.isValid() )
00519 {
00520 for( HBHERecHitCollection::const_iterator iHBHERecHit = TheHBHERecHits->begin(); iHBHERecHit != TheHBHERecHits->end(); iHBHERecHit++)
00521 {
00522 if( iHBHERecHit->energy() < 1.) continue;
00523 HcalDetId id = HcalDetId( iHBHERecHit->id() );
00524 if(!StandardDQM)
00525 hExtra_HcalToF->Fill( id.ieta(), iHBHERecHit->time() ) ;
00526 }
00527 }
00528
00529
00530 edm::Handle< reco::CaloMETCollection > TheCaloMET;
00531 iEvent.getByLabel(IT_met, TheCaloMET);
00532
00533
00534 edm::Handle<reco::CSCHaloData> TheCSCDataHandle;
00535 iEvent.getByLabel(IT_CSCHaloData,TheCSCDataHandle);
00536 int TheHaloOrigin = 0;
00537 if (TheCSCDataHandle.isValid())
00538 {
00539 const CSCHaloData CSCData = (*TheCSCDataHandle.product());
00540 if( CSCData.NumberOfOutOfTimeTriggers(HaloData::plus) && !CSCData.NumberOfOutOfTimeTriggers(HaloData::minus) )
00541 TheHaloOrigin = 1;
00542 else if ( CSCData.NumberOfOutOfTimeTriggers(HaloData::minus) && !CSCData.NumberOfOutOfTimeTriggers(HaloData::plus))
00543 TheHaloOrigin = -1 ;
00544
00545 for( std::vector<GlobalPoint>::const_iterator i=CSCData.GetCSCTrackImpactPositions().begin(); i != CSCData.GetCSCTrackImpactPositions().end() ; i++ )
00546 {
00547 float r = TMath::Sqrt( i->x()*i->x() + i->y()*i->y() );
00548 if( !StandardDQM )
00549 {
00550 hCSCHaloData_InnerMostTrackHitXY->Fill( i->x(), i->y() );
00551 hCSCHaloData_InnerMostTrackHitiPhi ->Fill( Phi_To_iPhi( i->phi()));
00552 if( i->z() > 0 )
00553 hCSCHaloData_InnerMostTrackHitRPlusZ ->Fill(i->z(), r) ;
00554 else
00555 hCSCHaloData_InnerMostTrackHitRMinusZ ->Fill(i->z(), r) ;
00556 }
00557 hCSCHaloData_InnerMostTrackHitR ->Fill(r);
00558 hCSCHaloData_InnerMostTrackHitPhi ->Fill( i->phi());
00559 }
00560 hCSCHaloData_L1HaloTriggersMEPlus -> Fill ( CSCData.NumberOfHaloTriggers(HaloData::plus) );
00561 hCSCHaloData_L1HaloTriggersMEMinus -> Fill ( CSCData.NumberOfHaloTriggers(HaloData::minus));
00562 hCSCHaloData_L1HaloTriggers -> Fill ( CSCData.NumberOfHaloTriggers(HaloData::both));
00563 hCSCHaloData_HLHaloTriggers -> Fill ( CSCData.CSCHaloHLTAccept());
00564 hCSCHaloData_TrackMultiplicityMEPlus ->Fill ( CSCData.NumberOfHaloTracks(HaloData::plus) );
00565 hCSCHaloData_TrackMultiplicityMEMinus ->Fill ( CSCData.NumberOfHaloTracks(HaloData::minus) );
00566 hCSCHaloData_TrackMultiplicity->Fill( CSCData.GetTracks().size() );
00567 hCSCHaloData_NOutOfTimeTriggersMEPlus->Fill( CSCData.NOutOfTimeTriggers(HaloData::plus) );
00568 hCSCHaloData_NOutOfTimeTriggersMEMinus->Fill( CSCData.NOutOfTimeTriggers(HaloData::minus) );
00569 hCSCHaloData_NOutOfTimeTriggers->Fill( CSCData.NOutOfTimeTriggers(HaloData::both) );
00570 hCSCHaloData_NOutOfTimeHits->Fill( CSCData.NOutOfTimeHits() );
00571 hCSCHaloData_NOutOfTimeTriggersvsL1HaloExists->Fill( CSCData.NOutOfTimeTriggers(HaloData::both), CSCData.NumberOfHaloTriggers(HaloData::both) >0 );
00572 hCSCHaloData_NTracksSmalldT ->Fill( CSCData.NTracksSmalldT() );
00573 hCSCHaloData_NTracksSmallBeta ->Fill( CSCData.NTracksSmallBeta() );
00574 hCSCHaloData_NTracksSmallBetaAndSmalldT->Fill( CSCData.NTracksSmallBetaAndSmalldT());
00575 hCSCHaloData_NTracksSmalldTvsNHaloTracks->Fill( CSCData.GetTracks().size(), CSCData.NTracksSmalldT() );
00576
00577 hCSCHaloData_NFlatHaloSegments->Fill(CSCData.NFlatHaloSegments());
00578 hCSCHaloData_SegmentsInBothEndcaps->Fill(CSCData.GetSegmentsInBothEndcaps());
00579 if (CSCData.GetSegmentsInBothEndcaps())
00580 hCSCHaloData_NFlatSegmentsInBothEndcaps->Fill(CSCData.NFlatHaloSegments());
00581
00582 }
00583
00584
00585 edm::Handle<reco::EcalHaloData> TheEcalHaloData;
00586 iEvent.getByLabel(IT_EcalHaloData, TheEcalHaloData );
00587 if( TheEcalHaloData.isValid() )
00588 {
00589 const EcalHaloData EcalData = (*TheEcalHaloData.product());
00590 std::vector<PhiWedge> EcalWedges = EcalData.GetPhiWedges();
00591 for(std::vector<PhiWedge>::const_iterator iWedge = EcalWedges.begin() ; iWedge != EcalWedges.end(); iWedge ++ )
00592 {
00593 if(!StandardDQM )
00594 {
00595 hEcalHaloData_PhiWedgeEnergy->Fill( iWedge->Energy() );
00596 hEcalHaloData_PhiWedgeMinTime ->Fill( iWedge->MinTime() );
00597 hEcalHaloData_PhiWedgeMaxTime ->Fill( iWedge->MaxTime() );
00598 hEcalHaloData_PhiWedgeMinVsMaxTime->Fill(iWedge->MinTime() , iWedge->MaxTime() ) ;
00599 hEcalHaloData_PhiWedgePlusZDirectionConfidence->Fill( iWedge->PlusZDirectionConfidence() );
00600 hEcalHaloData_PhiWedgeiPhi->Fill(iWedge->iPhi() ) ;
00601 }
00602 hEcalHaloData_PhiWedgeZDirectionConfidence ->Fill( iWedge->ZDirectionConfidence() );
00603 hEcalHaloData_PhiWedgeConstituents->Fill( iWedge->NumberOfConstituents() ) ;
00604 }
00605
00606 hEcalHaloData_PhiWedgeMultiplicity->Fill( EcalWedges.size() );
00607
00608 edm::ValueMap<float> vm_Angle = EcalData.GetShowerShapesAngle();
00609 edm::ValueMap<float> vm_Roundness = EcalData.GetShowerShapesRoundness();
00610
00611 for(unsigned int n = 0 ; n < EcalData.GetSuperClusters().size() ; n++ )
00612 {
00613 edm::Ref<SuperClusterCollection> cluster(EcalData.GetSuperClusters(), n );
00614 float angle = vm_Angle[cluster];
00615 float roundness = vm_Roundness[cluster];
00616 hEcalHaloData_SuperClusterShowerShapes->Fill(angle, roundness);
00617 hEcalHaloData_SuperClusterNHits->Fill( cluster->size() );
00618 hEcalHaloData_SuperClusterEnergy->Fill(cluster->energy() );
00619
00620 if(!StandardDQM)
00621 {
00622 hEcalHaloData_SuperClusterPhiVsEta->Fill(cluster->eta() ,cluster->phi() );
00623 }
00624 }
00625 }
00626
00627
00628 edm::Handle<reco::HcalHaloData> TheHcalHaloData;
00629 iEvent.getByLabel(IT_HcalHaloData ,TheHcalHaloData );
00630 if( TheHcalHaloData.isValid( ) )
00631 {
00632 const HcalHaloData HcalData = (*TheHcalHaloData.product());
00633 std::vector<PhiWedge> HcalWedges = HcalData.GetPhiWedges();
00634 hHcalHaloData_PhiWedgeMultiplicity ->Fill( HcalWedges.size() );
00635 for(std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin() ; iWedge != HcalWedges.end(); iWedge ++ )
00636 {
00637 if( !StandardDQM )
00638 {
00639 hHcalHaloData_PhiWedgeEnergy ->Fill( iWedge->Energy() );
00640 hHcalHaloData_PhiWedgeMinTime ->Fill( iWedge->MinTime() );
00641 hHcalHaloData_PhiWedgeMaxTime ->Fill( iWedge->MaxTime() );
00642 hHcalHaloData_PhiWedgePlusZDirectionConfidence ->Fill( iWedge->PlusZDirectionConfidence() );
00643 hHcalHaloData_PhiWedgeMinVsMaxTime ->Fill( iWedge->MinTime() , iWedge->MaxTime() );
00644 hHcalHaloData_PhiWedgeiPhi ->Fill( iWedge->iPhi() );
00645 }
00646
00647 hHcalHaloData_PhiWedgeConstituents ->Fill( iWedge->NumberOfConstituents() );
00648 hHcalHaloData_PhiWedgeZDirectionConfidence ->Fill( iWedge->ZDirectionConfidence() );
00649 }
00650 }
00651
00652
00653 if(!StandardDQM)
00654 {
00655
00656 edm::Handle<reco::GlobalHaloData> TheGlobalHaloData;
00657 iEvent.getByLabel(IT_GlobalHaloData, TheGlobalHaloData );
00658 if( TheGlobalHaloData.isValid() )
00659 {
00660 const GlobalHaloData GlobalData =(*TheGlobalHaloData.product());
00661 if( TheCaloMET.isValid() )
00662 {
00663
00664 const CaloMETCollection *calometcol = TheCaloMET.product();
00665 const CaloMET *RawMET = &(calometcol->front());
00666
00667
00668 const CaloMET CorrectedMET = GlobalData.GetCorrectedCaloMET(*RawMET);
00669 hGlobalHaloData_MExCorrection ->Fill( GlobalData.DeltaMEx() );
00670 hGlobalHaloData_MEyCorrection ->Fill( GlobalData.DeltaMEy() );
00671 hGlobalHaloData_HaloCorrectedMET->Fill(CorrectedMET.pt() );
00672 hGlobalHaloData_RawMETMinusHaloCorrectedMET ->Fill( RawMET->pt() - CorrectedMET.pt() );
00673 if( RawMET->sumEt() )
00674 hGlobalHaloData_RawMETOverSumEt ->Fill( RawMET->pt() / RawMET->sumEt() );
00675
00676 }
00677
00678
00679 std::vector<PhiWedge> HcalWedges = GlobalData.GetMatchedHcalPhiWedges();
00680 hGlobalHaloData_MatchedHcalPhiWedgeMultiplicity ->Fill(HcalWedges.size());
00681
00682 for( std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin() ; iWedge != HcalWedges.end() ; iWedge ++ )
00683 {
00684 hGlobalHaloData_MatchedHcalPhiWedgeEnergy ->Fill( iWedge->Energy() );
00685 hGlobalHaloData_MatchedHcalPhiWedgeConstituents ->Fill( iWedge->NumberOfConstituents());
00686 hGlobalHaloData_MatchedHcalPhiWedgeiPhi ->Fill( iWedge->iPhi() );
00687 hGlobalHaloData_MatchedHcalPhiWedgeMinTime ->Fill( iWedge->MinTime() );
00688 hGlobalHaloData_MatchedHcalPhiWedgeMaxTime ->Fill( iWedge->MaxTime() );
00689 hGlobalHaloData_MatchedHcalPhiWedgeZDirectionConfidence ->Fill( iWedge->ZDirectionConfidence() ) ;
00690 if( TheHBHERecHits.isValid() )
00691 {
00692 for( HBHERecHitCollection::const_iterator iHBHERecHit = TheHBHERecHits->begin(); iHBHERecHit != TheHBHERecHits->end(); iHBHERecHit++)
00693 {
00694 HcalDetId id = HcalDetId( iHBHERecHit->id() ) ;
00695 int iphi = id.iphi() ;
00696 if( iphi != iWedge->iPhi() ) continue;
00697 if( iHBHERecHit->energy() < 1.0) continue;
00698
00699 float time = iHBHERecHit->time();
00700 int ieta = id.ieta();
00701 hExtra_HcalToF_HaloId ->Fill( ieta, time );
00702 }
00703 }
00704 }
00705
00706
00707 std::vector<PhiWedge> EcalWedges = GlobalData.GetMatchedEcalPhiWedges();
00708 hGlobalHaloData_MatchedEcalPhiWedgeMultiplicity ->Fill(EcalWedges.size());
00709 for( std::vector<PhiWedge>::const_iterator iWedge = EcalWedges.begin() ; iWedge != EcalWedges.end() ; iWedge ++ )
00710 {
00711 hGlobalHaloData_MatchedEcalPhiWedgeEnergy ->Fill(iWedge->Energy());
00712 hGlobalHaloData_MatchedEcalPhiWedgeConstituents ->Fill(iWedge->NumberOfConstituents());
00713 hGlobalHaloData_MatchedEcalPhiWedgeiPhi ->Fill(iWedge->iPhi());
00714 hGlobalHaloData_MatchedEcalPhiWedgeMinTime ->Fill(iWedge->MinTime());
00715 hGlobalHaloData_MatchedEcalPhiWedgeMaxTime ->Fill(iWedge->MaxTime());
00716 hGlobalHaloData_MatchedEcalPhiWedgeZDirectionConfidence ->Fill( iWedge->ZDirectionConfidence() ) ;
00717 if( TheEBRecHits.isValid() )
00718 {
00719 for( EBRecHitCollection::const_iterator iEBRecHit = TheEBRecHits->begin() ; iEBRecHit != TheEBRecHits->end(); iEBRecHit++ )
00720 {
00721 if( iEBRecHit->energy() < 0.5 ) continue;
00722 DetId id = DetId( iEBRecHit->id() ) ;
00723 EBDetId EcalId ( id.rawId() );
00724 int iPhi = EcalId.iphi() ;
00725 iPhi = (iPhi-1)/5 + 1;
00726 if( iPhi != iWedge->iPhi() ) continue;
00727 hExtra_EcalToF_HaloId ->Fill(EcalId.ieta(), iEBRecHit->time() );
00728 }
00729 }
00730 }
00731 }
00732 }
00733
00734
00735
00736 edm::Handle<BeamHaloSummary> TheBeamHaloSummary ;
00737 iEvent.getByLabel(IT_BeamHaloSummary, TheBeamHaloSummary) ;
00738 if( TheBeamHaloSummary.isValid() )
00739 {
00740 const BeamHaloSummary TheSummary = (*TheBeamHaloSummary.product() );
00741 if( TheSummary.CSCLooseHaloId() )
00742 {
00743 hBeamHaloSummary_Id ->Fill(1);
00744 if(!StandardDQM) hBeamHaloSummary_BXN -> Fill( 1, BXN );
00745 if(Dump)*out << std::setw(15) << "CSCLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
00746 }
00747 if( TheSummary.CSCTightHaloId() )
00748 {
00749 hBeamHaloSummary_Id ->Fill(2);
00750 if(!StandardDQM)hBeamHaloSummary_BXN -> Fill( 2, BXN );
00751 }
00752 if( TheSummary.EcalLooseHaloId() )
00753 {
00754 hBeamHaloSummary_Id ->Fill(3);
00755 if(!StandardDQM) hBeamHaloSummary_BXN -> Fill( 3, BXN );
00756 if(Dump) *out << std::setw(15) << "EcalLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
00757 }
00758 if( TheSummary.EcalTightHaloId() )
00759 {
00760 hBeamHaloSummary_Id ->Fill(4);
00761 if(!StandardDQM)hBeamHaloSummary_BXN -> Fill( 4, BXN );
00762 }
00763 if( TheSummary.HcalLooseHaloId() )
00764 {
00765 hBeamHaloSummary_Id ->Fill(5);
00766 if(!StandardDQM) hBeamHaloSummary_BXN -> Fill( 5, BXN );
00767 if(Dump) *out << std::setw(15) << "HcalLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
00768 }
00769 if( TheSummary.HcalTightHaloId() )
00770 {
00771 hBeamHaloSummary_Id ->Fill(6);
00772 if(!StandardDQM)hBeamHaloSummary_BXN -> Fill( 6, BXN );
00773 }
00774 if( TheSummary.GlobalLooseHaloId())
00775 {
00776 hBeamHaloSummary_Id ->Fill(7);
00777 if(!StandardDQM)hBeamHaloSummary_BXN -> Fill( 7, BXN );
00778 if(Dump) *out << std::setw(15) << "GlobalLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
00779 }
00780 if( TheSummary.GlobalTightHaloId() )
00781 {
00782 hBeamHaloSummary_Id ->Fill(8);
00783 if(!StandardDQM)hBeamHaloSummary_BXN -> Fill( 8, BXN );
00784 }
00785 if( TheSummary.LooseId() )
00786 {
00787 hBeamHaloSummary_Id ->Fill(9);
00788 if(!StandardDQM)hBeamHaloSummary_BXN -> Fill( 9, BXN );
00789 }
00790 if( TheSummary.TightId() )
00791 {
00792 hBeamHaloSummary_Id ->Fill(10);
00793 if(!StandardDQM)hBeamHaloSummary_BXN -> Fill( 10, BXN );
00794 }
00795 if( !TheSummary.EcalLooseHaloId() && !TheSummary.HcalLooseHaloId() && !TheSummary.CSCLooseHaloId() && !TheSummary.GlobalLooseHaloId() )
00796 {
00797 hBeamHaloSummary_Id ->Fill(11);
00798 if(!StandardDQM)hBeamHaloSummary_BXN -> Fill( 11, BXN );
00799 }
00800 }
00801
00802 if( TheCaloMET.isValid() )
00803 {
00804 const CaloMETCollection *calometcol = TheCaloMET.product();
00805 const CaloMET *calomet = &(calometcol->front());
00806
00807 if( calomet->pt() > DumpMET )
00808 if(Dump) *out << std::setw(15) << "HighMET" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
00809
00810
00811 if( calomet->pt() > 15.0 )
00812 {
00813 if( TheHaloOrigin > 0 )
00814 {
00815 if( CSCTrackPlus && CSCTrackMinus )
00816 hExtra_CSCActivityWithMET->Fill(1,1);
00817 else if( CSCTrackPlus && CSCSegmentMinus)
00818 hExtra_CSCActivityWithMET->Fill(1,2);
00819 else if( CSCTrackPlus && CSCRecHitMinus )
00820 hExtra_CSCActivityWithMET->Fill(1,3);
00821 else if( CSCTrackPlus )
00822 hExtra_CSCActivityWithMET->Fill(1,4);
00823 else if( CSCSegmentPlus && CSCTrackMinus )
00824 hExtra_CSCActivityWithMET->Fill(2,1);
00825 else if( CSCSegmentPlus && CSCSegmentMinus )
00826 hExtra_CSCActivityWithMET-> Fill(2,2);
00827 else if( CSCSegmentPlus && CSCRecHitMinus )
00828 hExtra_CSCActivityWithMET-> Fill(2,3);
00829 else if( CSCSegmentPlus )
00830 hExtra_CSCActivityWithMET->Fill(2,4 );
00831 else if( CSCRecHitPlus && CSCTrackMinus )
00832 hExtra_CSCActivityWithMET->Fill(3,1);
00833 else if( CSCRecHitPlus && CSCSegmentMinus )
00834 hExtra_CSCActivityWithMET->Fill(3,2);
00835 else if( CSCRecHitPlus && CSCRecHitMinus )
00836 hExtra_CSCActivityWithMET->Fill(3,3);
00837 else if( CSCRecHitPlus )
00838 hExtra_CSCActivityWithMET->Fill(3,4);
00839 else
00840 hExtra_CSCActivityWithMET->Fill(4,4);
00841 }
00842 else if( TheHaloOrigin < 0 )
00843 {
00844 if( CSCTrackMinus && CSCTrackPlus )
00845 hExtra_CSCActivityWithMET->Fill(1,1);
00846 else if( CSCTrackMinus && CSCSegmentPlus)
00847 hExtra_CSCActivityWithMET->Fill(1,2);
00848 else if( CSCTrackMinus && CSCRecHitPlus )
00849 hExtra_CSCActivityWithMET->Fill(1,3);
00850 else if( CSCTrackMinus )
00851 hExtra_CSCActivityWithMET->Fill(1,4);
00852 else if( CSCSegmentMinus && CSCTrackPlus)
00853 hExtra_CSCActivityWithMET->Fill(2,1);
00854 else if( CSCSegmentMinus && CSCSegmentPlus )
00855 hExtra_CSCActivityWithMET->Fill(2,2 );
00856 else if( CSCSegmentMinus && CSCRecHitPlus )
00857 hExtra_CSCActivityWithMET->Fill(2,3);
00858 else if( CSCSegmentMinus )
00859 hExtra_CSCActivityWithMET->Fill(2,4);
00860 else if( CSCRecHitMinus && CSCTrackPlus )
00861 hExtra_CSCActivityWithMET->Fill(3,1 );
00862 else if( CSCRecHitMinus && CSCSegmentPlus )
00863 hExtra_CSCActivityWithMET->Fill(3,2 );
00864 else if( CSCRecHitMinus && CSCRecHitPlus )
00865 hExtra_CSCActivityWithMET->Fill(3,3);
00866 else if( CSCRecHitMinus )
00867 hExtra_CSCActivityWithMET->Fill(3,4);
00868 else hExtra_CSCActivityWithMET->Fill(4,4);
00869 }
00870 }
00871 }
00872
00873 }
00874
00875 void BeamHaloAnalyzer::endJob()
00876 {
00877
00878 }
00879
00880 BeamHaloAnalyzer::~BeamHaloAnalyzer(){
00881 }
00882
00883
00884
00885
00886
00887