CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BeamHaloAnalyzer.cc
Go to the documentation of this file.
3 
4 //author : Ronny Remington, University of Florida
5 //date : 11/11/09
6 
7 using namespace edm;
8 using namespace reco;
9 
10 int Phi_To_iPhi(float phi)
11 {
12  phi = phi < 0 ? phi + 2.*TMath::Pi() : phi ;
13  float phi_degrees = phi * (360.) / ( 2. * TMath::Pi() ) ;
14  int iPhi = (int) ( ( phi_degrees/5. ) + 1.);
15 
16  return iPhi < 73 ? iPhi : 73 ;
17 }
18 
19 
21 {
22  OutputFileName = iConfig.getParameter<std::string>("OutputFile");
23  TextFileName = iConfig.getParameter<std::string>("TextFile");
24 
25  if(TextFileName.size())
26  out = new ofstream(TextFileName.c_str() );
27 
28 
29  if( iConfig.exists("StandardDQM") ) // If StandardDQM == true , coarse binning is used on selected (important) histograms
30  StandardDQM = iConfig.getParameter<bool>("StandardDQM");
31  else
32  StandardDQM = false;
33 
34  //Get Input Tags
35  //Digi Level
36  IT_L1MuGMTReadout = iConfig.getParameter<edm::InputTag>("L1MuGMTReadoutLabel");
37 
38  //RecHit Level
39  IT_CSCRecHit = iConfig.getParameter<edm::InputTag>("CSCRecHitLabel");
40  IT_EBRecHit = iConfig.getParameter<edm::InputTag>("EBRecHitLabel");
41  IT_EERecHit = iConfig.getParameter<edm::InputTag>("EERecHitLabel");
42  IT_ESRecHit = iConfig.getParameter<edm::InputTag>("ESRecHitLabel");
43  IT_HBHERecHit = iConfig.getParameter<edm::InputTag>("HBHERecHitLabel");
44  IT_HFRecHit = iConfig.getParameter<edm::InputTag>("HFRecHitLabel");
45  IT_HORecHit = iConfig.getParameter<edm::InputTag>("HORecHitLabel");
46 
47  //Higher Level Reco
48  IT_CSCSegment = iConfig.getParameter<edm::InputTag>("CSCSegmentLabel");
49  IT_CosmicStandAloneMuon = iConfig.getParameter<edm::InputTag>("CosmicStandAloneMuonLabel");
50  IT_BeamHaloMuon = iConfig.getParameter<edm::InputTag>("BeamHaloMuonLabel");
51  IT_CollisionMuon = iConfig.getParameter<edm::InputTag>("CollisionMuonLabel");
52  IT_CollisionStandAloneMuon = iConfig.getParameter<edm::InputTag>("CollisionStandAloneMuonLabel");
53  IT_met = iConfig.getParameter<edm::InputTag>("metLabel");
54  IT_CaloTower = iConfig.getParameter<edm::InputTag>("CaloTowerLabel");
55  IT_SuperCluster = iConfig.getParameter<edm::InputTag>("SuperClusterLabel");
56  IT_Photon = iConfig.getParameter<edm::InputTag>("PhotonLabel") ;
57 
58  //Halo Data
59  IT_CSCHaloData = iConfig.getParameter<edm::InputTag> ("CSCHaloDataLabel");
60  IT_EcalHaloData = iConfig.getParameter<edm::InputTag>("EcalHaloDataLabel");
61  IT_HcalHaloData = iConfig.getParameter<edm::InputTag>("HcalHaloDataLabel");
62  IT_GlobalHaloData = iConfig.getParameter<edm::InputTag>("GlobalHaloDataLabel");
63  IT_BeamHaloSummary = iConfig.getParameter<edm::InputTag>("BeamHaloSummaryLabel");
64 
65  FolderName = iConfig.getParameter<std::string>("folderName");
66  DumpMET = iConfig.getParameter<double>("DumpMET");
67 }
68 
69 
71 
73 
74  dqm = edm::Service<DQMStore>().operator->();
75  if( dqm ) {
76 
77  // EcalHaloData
78  dqm->setCurrentFolder(FolderName+"/EcalHaloData");
79  if(StandardDQM)
80  {
81  hEcalHaloData_PhiWedgeMultiplicity = dqm->book1D("EcalHaloData_PhiWedgeMultiplicity","",20, -0.5, 19.5);
82  hEcalHaloData_PhiWedgeConstituents = dqm->book1D("EcalHaloData_PhiWedgeConstituents","",20,-0.5, 19.5);
83  // hEcalHaloData_PhiWedgeiPhi = dqm->book1D("EcalHaloData_PhiWedgeiPhi","", 360, 0.5, 360.5) ;
84  hEcalHaloData_PhiWedgeZDirectionConfidence = dqm->book1D("EcalHaloData_ZDirectionConfidence","", 120, -1.2, 1.2);
85  hEcalHaloData_SuperClusterShowerShapes = dqm->book2D("EcalHaloData_SuperClusterShowerShapes","", 25,0.0, TMath::Pi(), 25,0.0, 2.0);
86  hEcalHaloData_SuperClusterEnergy = dqm->book1D("EcalHaloData_SuperClusterEnergy","",50,-0.5,99.5);
87  hEcalHaloData_SuperClusterNHits = dqm->book1D("EcalHaloData_SuperClusterNHits", "", 20, -0.5, 19.5);
88  }
89  else
90  {
91  hEcalHaloData_PhiWedgeMultiplicity = dqm->book1D("EcalHaloData_PhiWedgeMultiplicity","",20, -0.5, 19.5);
92  hEcalHaloData_PhiWedgeEnergy = dqm->book1D("EcalHaloData_PhiWedgeEnergy","", 50,-0.5,199.5);
93  hEcalHaloData_PhiWedgeConstituents = dqm->book1D("EcalHaloData_PhiWedgeConstituents","",20,-0.5, 19.5);
94  hEcalHaloData_PhiWedgeMinTime = dqm->book1D("EcalHaloData_PhiWedgeMinTime","", 100, -225.0, 225.0);
95  hEcalHaloData_PhiWedgeMaxTime = dqm->book1D("EcalHaloData_PhiWedgeMaxTime","", 100, -225.0, 225.0);
96  hEcalHaloData_PhiWedgeiPhi = dqm->book1D("EcalHaloData_PhiWedgeiPhi","", 360, 0.5, 360.5) ;
97  hEcalHaloData_PhiWedgePlusZDirectionConfidence = dqm->book1D("EcalHaloData_PlusZDirectionConfidence","", 50, 0., 1.0);
98  hEcalHaloData_PhiWedgeZDirectionConfidence = dqm->book1D("EcalHaloData_ZDirectionConfidence","", 120, -1.2, 1.2);
99  hEcalHaloData_PhiWedgeMinVsMaxTime = dqm->book2D("EcalHaloData_PhiWedgeMinVsMaxTime","", 50,-100.0, 100.0, 50, -100.0, 100.0);
100  hEcalHaloData_SuperClusterShowerShapes = dqm->book2D("EcalHaloData_SuperClusterShowerShapes","", 25,0.0, TMath::Pi(), 25,0.0, 2.0);
101  hEcalHaloData_SuperClusterEnergy = dqm->book1D("EcalHaloData_SuperClusterEnergy","",100,-0.5,99.5);
102  hEcalHaloData_SuperClusterNHits = dqm->book1D("EcalHaloData_SuperClusterNHits", "", 20, -0.5, 19.5);
103  hEcalHaloData_SuperClusterPhiVsEta = dqm->book2D("EcalHaloData_SuperClusterPhiVsEta","",60, -3.0, 3.0,72, -TMath::Pi(), TMath::Pi());
104  }
105 
106  // HcalHaloData
107  dqm->setCurrentFolder(FolderName+"/HcalHaloData");
108  if( StandardDQM )
109  {
110  hHcalHaloData_PhiWedgeMultiplicity = dqm->book1D("HcalHaloData_PhiWedgeMultiplicity","", 20, -0.5, 19.5);
111  hHcalHaloData_PhiWedgeConstituents = dqm->book1D("HcalHaloData_PhiWedgeConstituents","", 20,-0.5, 19.5);
112  //hHcalHaloData_PhiWedgeiPhi = dqm->book1D("HcalHaloData_PhiWedgeiPhi","", 72, 0.5,72.5);
113  hHcalHaloData_PhiWedgeZDirectionConfidence = dqm->book1D("HcalHaloData_ZDirectionConfidence","", 120, -1.2, 1.2);
114  }
115  else
116  {
117  hHcalHaloData_PhiWedgeMultiplicity = dqm->book1D("HcalHaloData_PhiWedgeMultiplicity","", 20, -0.5, 19.5);
118  hHcalHaloData_PhiWedgeEnergy = dqm->book1D("HcalHaloData_PhiWedgeEnergy", "", 50,-0.5,199.5);
119  hHcalHaloData_PhiWedgeConstituents = dqm->book1D("HcalHaloData_PhiWedgeConstituents","", 20,-0.5, 19.5);
120  hHcalHaloData_PhiWedgeiPhi = dqm->book1D("HcalHaloData_PhiWedgeiPhi","", 72, 0.5,72.5);
121  hHcalHaloData_PhiWedgeMinTime = dqm->book1D("HcalHaloData_PhiWedgeMinTime", "", 50, -100.0, 100.0);
122  hHcalHaloData_PhiWedgeMaxTime = dqm->book1D("HcalHaloData_PhiWedgeMaxTime", "", 50, -100.0, 100.0);
123  hHcalHaloData_PhiWedgePlusZDirectionConfidence = dqm->book1D("HcalHaloData_PlusZDirectionConfidence","", 50, 0., 1.0);
124  hHcalHaloData_PhiWedgeZDirectionConfidence = dqm->book1D("HcalHaloData_ZDirectionConfidence","", 120, -1.2, 1.2);
125  hHcalHaloData_PhiWedgeMinVsMaxTime = dqm->book2D("HcalHaloData_PhiWedgeMinVsMaxTime","" , 50,-100.0, 100.0, 50, -100.0, 100.0);
126  }
127 
128  // CSCHaloData
129  dqm->setCurrentFolder(FolderName+"/CSCHaloData");
130  if( StandardDQM )
131  {
132  hCSCHaloData_TrackMultiplicity = dqm->book1D("CSCHaloData_TrackMultiplicity", "", 15, -0.5, 14.5);
133  hCSCHaloData_TrackMultiplicityMEPlus = dqm->book1D("CSCHaloData_TrackMultiplicityMEPlus", "", 15, -0.5, 14.5);
134  hCSCHaloData_TrackMultiplicityMEMinus = dqm->book1D("CSCHaloData_TrackMultiplicityMEMinus", "", 15, -0.5, 14.5);
135  hCSCHaloData_InnerMostTrackHitR = dqm->book1D("CSCHaloData_InnerMostTrackHitR", "", 70, 99.5, 799.5);
136  hCSCHaloData_InnerMostTrackHitPhi = dqm->book1D("CSCHaloData_InnerMostTrackHitPhi","", 72, -TMath::Pi(), TMath::Pi());
137  hCSCHaloData_L1HaloTriggersMEPlus = dqm->book1D("CSCHaloData_L1HaloTriggersMEPlus", "", 10, -0.5, 9.5);
138  hCSCHaloData_L1HaloTriggersMEMinus = dqm->book1D("CSCHaloData_L1HaloTriggersMEMinus", "" , 10, -0.5, 9.5);
139  hCSCHaloData_L1HaloTriggers = dqm->book1D("CSCHaloData_L1HaloTriggers", "", 10, -0.5, 9.5);
140  hCSCHaloData_HLHaloTriggers = dqm->book1D("CSCHaloData_HLHaloTriggers", "", 2, -0.5, 1.5);
141  hCSCHaloData_NOutOfTimeTriggersvsL1HaloExists = dqm->book2D("CSCHaloData_NOutOfTimeTriggersvsL1HaloExists", "", 20, -0.5, 19.5, 2, -0.5, 1.5);
142  hCSCHaloData_NOutOfTimeTriggersMEPlus = dqm->book1D("CSCHaloData_NOutOfTimeTriggersMEPlus", "", 20, -0.5, 19.5);
143  hCSCHaloData_NOutOfTimeTriggersMEMinus = dqm->book1D("CSCHaloData_NOutOfTimeTriggersMEMinus", "", 20, -0.5, 19.5);
144  hCSCHaloData_NOutOfTimeTriggers = dqm->book1D("CSCHaloData_NOutOfTimeTriggers", "", 20, -0.5, 19.5);
145  hCSCHaloData_NOutOfTimeHits = dqm->book1D("CSCHaloData_NOutOfTimeHits", "", 60, -0.5, 59.5);
146  }
147  else
148  {
149  hCSCHaloData_TrackMultiplicity = dqm->book1D("CSCHaloData_TrackMultiplicity", "", 15, -0.5, 14.5);
150  hCSCHaloData_TrackMultiplicityMEPlus = dqm->book1D("CSCHaloData_TrackMultiplicityMEPlus", "", 15, -0.5, 14.5);
151  hCSCHaloData_TrackMultiplicityMEMinus = dqm->book1D("CSCHaloData_TrackMultiplicityMEMinus", "", 15, -0.5, 14.5);
152  hCSCHaloData_InnerMostTrackHitXY = dqm->book2D("CSCHaloData_InnerMostTrackHitXY","", 100,-700,700,100, -700,700);
153  hCSCHaloData_InnerMostTrackHitR = dqm->book1D("CSCHaloData_InnerMostTrackHitR", "", 400, -0.5, 799.5);
154  hCSCHaloData_InnerMostTrackHitRPlusZ = dqm->book2D("CSCHaloData_InnerMostTrackHitRPlusZ","", 400 , 400, 1200, 400, -0.5, 799.5 );
155  hCSCHaloData_InnerMostTrackHitRMinusZ = dqm->book2D("CSCHaloData_InnerMostTrackHitRMinusZ","", 400 , -1200, -400, 400, -0.5, 799.5 );
156  hCSCHaloData_InnerMostTrackHitiPhi = dqm->book1D("CSCHaloData_InnerMostTrackHitiPhi","", 72, 0.5, 72.5);
157  hCSCHaloData_InnerMostTrackHitPhi = dqm->book1D("CSCHaloData_InnerMostTrackHitPhi","", 72, -TMath::Pi(), TMath::Pi());
158  hCSCHaloData_L1HaloTriggersMEPlus = dqm->book1D("CSCHaloData_L1HaloTriggersMEPlus", "", 10, -0.5, 9.5);
159  hCSCHaloData_L1HaloTriggersMEMinus = dqm->book1D("CSCHaloData_L1HaloTriggersMEMinus", "" , 10, -0.5, 9.5);
160  hCSCHaloData_L1HaloTriggers = dqm->book1D("CSCHaloData_L1HaloTriggers", "", 10, -0.5, 9.5);
161  hCSCHaloData_HLHaloTriggers = dqm->book1D("CSCHaloData_HLHaloTriggers", "", 2, -0.5, 1.5);
162  hCSCHaloData_NOutOfTimeTriggersvsL1HaloExists = dqm->book2D("CSCHaloData_NOutOfTimeTriggersvsL1HaloExists", "", 20, -0.5, 19.5, 2, -0.5, 1.5);
163  hCSCHaloData_NOutOfTimeTriggers = dqm->book1D("CSCHaloData_NOutOfTimeTriggers", "", 20, -0.5, 19.5);
164  hCSCHaloData_NOutOfTimeHits = dqm->book1D("CSCHaloData_NOutOfTimeHits", "", 60, -0.5, 59.5);
165  }
166 
167  // GlobalHaloData
168  dqm->setCurrentFolder(FolderName+"/GlobalHaloData");
169  if(!StandardDQM)
170  {
171  hGlobalHaloData_MExCorrection = dqm->book1D("GlobalHaloData_MExCorrection", "" , 200, -200., 200.);
172  hGlobalHaloData_MEyCorrection = dqm->book1D("GlobalHaloData_MEyCorrection", "" , 200, -200., 200.);
173  hGlobalHaloData_SumEtCorrection = dqm->book1D("GlobalHaloData_SumEtCorrection", "" , 200, -0.5, 399.5);
174  hGlobalHaloData_HaloCorrectedMET = dqm->book1D("GlobalHaloData_HaloCorrectedMET", "" , 500, -0.5, 1999.5);
175  hGlobalHaloData_RawMETMinusHaloCorrectedMET = dqm->book1D("GlobalHaloData_RawMETMinusHaloCorrectedMET","" , 250, -500., 500.);
176  hGlobalHaloData_RawMETOverSumEt = dqm->book1D("GlobalHaloData_RawMETOverSumEt","" , 100, 0.0, 1.0);
177  hGlobalHaloData_MatchedHcalPhiWedgeMultiplicity = dqm->book1D("GlobalHaloData_MatchedHcalPhiWedgeMultiplicity","", 15, -0.5, 14.5);
178  hGlobalHaloData_MatchedHcalPhiWedgeEnergy = dqm->book1D("GlobalHaloData_MatchedHcalPhiWedgeEnergy", "", 50,-0.5,199.5);
179  hGlobalHaloData_MatchedHcalPhiWedgeConstituents = dqm->book1D("GlobalHaloData_MatchedHcalPhiWedgeConstituents","", 20,-0.5, 19.5);
180  hGlobalHaloData_MatchedHcalPhiWedgeiPhi = dqm->book1D("GlobalHaloData_MatchedHcalPhiWedgeiPhi","", 1, 0.5,72.5);
181  hGlobalHaloData_MatchedHcalPhiWedgeMinTime = dqm->book1D("GlobalHaloData_MatchedHcalPhiWedgeMinTime", "", 50, -100.0, 100.0);
182  hGlobalHaloData_MatchedHcalPhiWedgeMaxTime = dqm->book1D("GlobalHaloData_MatchedHcalPhiWedgeMaxTime", "", 50, -100.0, 100.0);
183  hGlobalHaloData_MatchedHcalPhiWedgeZDirectionConfidence = dqm->book1D("GlobalHaloData_MatchedHcalPhiWedgeZDirectionConfidence","", 120, -1.2, 1.2);
184  hGlobalHaloData_MatchedEcalPhiWedgeMultiplicity = dqm->book1D("GlobalHaloData_MatchedEcalPhiWedgeMultiplicity","", 15, -0.5, 14.5);
185  hGlobalHaloData_MatchedEcalPhiWedgeEnergy = dqm->book1D("GlobalHaloData_MatchedEcalPhiWedgeEnergy", "", 50,-0.5,199.5);
186  hGlobalHaloData_MatchedEcalPhiWedgeConstituents = dqm->book1D("GlobalHaloData_MatchedEcalPhiWedgeConstituents","", 20,-0.5, 19.5);
187  hGlobalHaloData_MatchedEcalPhiWedgeiPhi = dqm->book1D("GlobalHaloData_MatchedEcalPhiWedgeiPhi","", 360, 0.5,360.5);
188  hGlobalHaloData_MatchedEcalPhiWedgeMinTime = dqm->book1D("GlobalHaloData_MatchedEcalPhiWedgeMinTime", "", 50, -100.0, 100.0);
189  hGlobalHaloData_MatchedEcalPhiWedgeMaxTime = dqm->book1D("GlobalHaloData_MatchedEcalPhiWedgeMaxTime", "", 50, -100.0, 100.0);
190  hGlobalHaloData_MatchedEcalPhiWedgeZDirectionConfidence = dqm->book1D("GlobalHaloData_MatchedEcalPhiWedgeZDirectionConfidence","", 120, 1.2, 1.2);
191  }
192  // BeamHaloSummary
193  dqm->setCurrentFolder(FolderName+"/BeamHaloSummary");
194 
195  hBeamHaloSummary_Id = dqm->book1D("BeamHaloSumamry_Id", "", 11, 0.5,11.5);
196  hBeamHaloSummary_Id ->setBinLabel(1,"CSC Loose");
197  hBeamHaloSummary_Id ->setBinLabel(2,"CSC Tight");
198  hBeamHaloSummary_Id ->setBinLabel(3,"Ecal Loose");
199  hBeamHaloSummary_Id ->setBinLabel(4,"Ecal Tight");
200  hBeamHaloSummary_Id ->setBinLabel(5,"Hcal Loose");
201  hBeamHaloSummary_Id ->setBinLabel(6,"Hcal Tight");
202  hBeamHaloSummary_Id ->setBinLabel(7,"Global Loose");
203  hBeamHaloSummary_Id ->setBinLabel(8,"Global Tight");
204  hBeamHaloSummary_Id ->setBinLabel(9,"Event Loose");
205  hBeamHaloSummary_Id ->setBinLabel(10,"Event Tight");
206  hBeamHaloSummary_Id ->setBinLabel(11,"Nothing");
207  if(!StandardDQM)
208  {
209  hBeamHaloSummary_BXN = dqm->book2D("BeamHaloSummary_BXN", "",11, 0.5, 11.5, 4000, -0.5,3999.5);
210  hBeamHaloSummary_BXN ->setBinLabel(1,"CSC Loose");
211  hBeamHaloSummary_BXN ->setBinLabel(2,"CSC Tight");
212  hBeamHaloSummary_BXN ->setBinLabel(3,"Ecal Loose");
213  hBeamHaloSummary_BXN ->setBinLabel(4,"Ecal Tight");
214  hBeamHaloSummary_BXN ->setBinLabel(5,"Hcal Loose");
215  hBeamHaloSummary_BXN ->setBinLabel(6,"Hcal Tight");
216  hBeamHaloSummary_BXN ->setBinLabel(7,"Global Loose");
217  hBeamHaloSummary_BXN ->setBinLabel(8,"Global Tight");
218  hBeamHaloSummary_BXN ->setBinLabel(9,"Event Loose");
219  hBeamHaloSummary_BXN ->setBinLabel(10,"Event Tight");
220  hBeamHaloSummary_BXN ->setBinLabel(11,"Nothing");
221  }
222  // Extra
223  dqm->setCurrentFolder(FolderName+"/ExtraHaloData");
224  if(StandardDQM)
225  {
226  hExtra_CSCTrackInnerOuterDPhi = dqm->book1D("Extra_CSCTrackInnerOuterDPhi","",100, 0, TMath::Pi() );
227  hExtra_CSCTrackInnerOuterDEta = dqm->book1D("Extra_CSCTrackInnerOuterDEta","", 100, 0, 3.0 );
228  hExtra_CSCTrackChi2Ndof = dqm->book1D("Extra_CSCTrackChi2Ndof","", 25, 0, 10);
229  hExtra_CSCTrackNHits = dqm->book1D("Extra_CSCTrackNHits","", 75,0, 75);
230  hExtra_CSCActivityWithMET= dqm->book2D("Extra_CSCActivityWithMET", "", 4, 0.5, 4.5, 4, 0.5, 4.5);
231  hExtra_CSCActivityWithMET->setBinLabel(1,"Track",1);
232  hExtra_CSCActivityWithMET->setBinLabel(1,"Track",2);
233  hExtra_CSCActivityWithMET->setBinLabel(2, "Segments",1);
234  hExtra_CSCActivityWithMET->setBinLabel(2, "Segments",2);
235  hExtra_CSCActivityWithMET->setBinLabel(3, "RecHits", 1);
236  hExtra_CSCActivityWithMET->setBinLabel(3, "RecHits", 2);
237  hExtra_CSCActivityWithMET->setBinLabel(4, "Nothing", 1);
238  hExtra_CSCActivityWithMET->setBinLabel(4, "Nothing", 2);
239  hExtra_InnerMostTrackHitR = dqm->book1D("Extra_InnerMostTrackHitR", "", 70, 99.5, 799.5);
240  hExtra_InnerMostTrackHitPhi = dqm->book1D("Extra_InnerMostTrackHitPhi","", 72, -TMath::Pi(), TMath::Pi());
241  }
242  else
243  {
244  hExtra_CSCActivityWithMET= dqm->book2D("Extra_CSCActivityWithMET", "", 4, 0.5, 4.5, 4, 0.5, 4.5);
245  hExtra_CSCActivityWithMET->setBinLabel(1,"Track",1);
246  hExtra_CSCActivityWithMET->setBinLabel(1,"Track",2);
247  hExtra_CSCActivityWithMET->setBinLabel(2, "Segments",1);
248  hExtra_CSCActivityWithMET->setBinLabel(2, "Segments",2);
249  hExtra_CSCActivityWithMET->setBinLabel(3, "RecHits", 1);
250  hExtra_CSCActivityWithMET->setBinLabel(3, "RecHits", 2);
251  hExtra_CSCActivityWithMET->setBinLabel(4, "Nothing", 1);
252  hExtra_CSCActivityWithMET->setBinLabel(4, "Nothing", 2);
253  hExtra_HcalToF = dqm->book2D("Extra_HcalToF","" , 83,-41.5,41.5 , 1000, -125., 125.);
254  hExtra_HcalToF_HaloId = dqm->book2D("Extra_HcalToF_HaloId","", 83,-41.5,41.5 , 1000, -125., 125.);
255  hExtra_EcalToF = dqm->book2D("Extra_EcalToF","", 171,-85.5,85.5 , 2000, -225., 225.);
256  hExtra_EcalToF_HaloId = dqm->book2D("Extra_EcalToF_HaloId","", 171,-85.5,85.5 , 2000, -225., 225.);
257  hExtra_CSCTrackInnerOuterDPhi = dqm->book1D("Extra_CSCTrackInnerOuterDPhi","",100, 0, TMath::Pi() );
258  hExtra_CSCTrackInnerOuterDEta = dqm->book1D("Extra_CSCTrackInnerOuterDEta","", 100, 0, TMath::Pi() );
259  hExtra_CSCTrackChi2Ndof = dqm->book1D("Extra_CSCTrackChi2Ndof","", 100, 0, 10);
260  hExtra_CSCTrackNHits = dqm->book1D("Extra_CSCTrackNHits","", 75,0, 75);
261  hExtra_InnerMostTrackHitXY = dqm->book2D("Extra_InnerMostTrackHitXY","", 100,-700,700,100, -700,700);
262  hExtra_InnerMostTrackHitR = dqm->book1D("Extra_InnerMostTrackHitR", "", 400, -0.5, 799.5);
263  hExtra_InnerMostTrackHitRPlusZ = dqm->book2D("Extra_InnerMostTrackHitRPlusZ","", 400 , 400, 1200, 400, -0.5, 799.5 );
264  hExtra_InnerMostTrackHitRMinusZ = dqm->book2D("Extra_InnerMostTrackHitRMinusZ","", 400 , -1200, -400, 400, -0.5, 799.5 );
265  hExtra_InnerMostTrackHitiPhi = dqm->book1D("Extra_InnerMostTrackHitiPhi","", 72, 0.5, 72.5);
266  hExtra_InnerMostTrackHitPhi = dqm->book1D("Extra_InnerMostTrackHitPhi","", 72, -TMath::Pi(), TMath::Pi());
267  hExtra_BXN = dqm->book1D("Extra_BXN", "BXN Occupancy", 4000, 0.5, 4000.5);
268  }
269  }
270 }
271 
273 {
274  EventID TheEvent = iEvent.id();
275  int BXN = iEvent.bunchCrossing() ;
276  bool Dump = TextFileName.size();
277  int TheEventNumber = TheEvent.event();
278  int Lumi = iEvent.luminosityBlock();
279  int Run = iEvent.run();
280 
281  //Get CSC Geometry
282  edm::ESHandle<CSCGeometry> TheCSCGeometry;
283  iSetup.get<MuonGeometryRecord>().get(TheCSCGeometry);
284 
285  //Get CaloGeometry
286  edm::ESHandle<CaloGeometry> TheCaloGeometry;
287  iSetup.get<CaloGeometryRecord>().get(TheCaloGeometry);
288 
289  //Get Stand-alone Muons from Cosmic Muon Reconstruction
291  iEvent.getByLabel(IT_CosmicStandAloneMuon, TheCosmics);
292  bool CSCTrackPlus = false; bool CSCTrackMinus = false;
293  if( TheCosmics.isValid() )
294  {
295  for( reco::TrackCollection::const_iterator cosmic = TheCosmics ->begin() ; cosmic != TheCosmics->end() ; cosmic++ )
296  {
297  if( !CSCTrackPlus || !CSCTrackMinus )
298  {
299  if( cosmic->eta() > 0 || cosmic->outerPosition().z() > 0 || cosmic->innerPosition().z() > 0 ) CSCTrackPlus = true ;
300  else if( cosmic->eta() < 0 || cosmic->outerPosition().z() < 0 || cosmic->innerPosition().z() < 0) CSCTrackMinus = true;
301  }
302 
303  float innermost_phi = 0.;
304  float outermost_phi = 0.;
305  float innermost_z = 99999.;
306  float outermost_z = 0.;
307  float innermost_eta = 0.;
308  float outermost_eta = 0.;
309  float innermost_x =0.;
310  float innermost_y =0.;
311  float innermost_r =0.;
312  for(unsigned int j = 0 ; j < cosmic->extra()->recHits().size(); j++ )
313  {
314  edm::Ref<TrackingRecHitCollection> hit( cosmic->extra()->recHits(), j );
315  DetId TheDetUnitId(hit->geographicalId());
316  if( TheDetUnitId.det() != DetId::Muon ) continue;
317  if( TheDetUnitId.subdetId() != MuonSubdetId::CSC ) continue;
318 
319  const GeomDetUnit *TheUnit = TheCSCGeometry->idToDetUnit(TheDetUnitId);
320  LocalPoint TheLocalPosition = hit->localPosition();
321  const BoundPlane& TheSurface = TheUnit->surface();
322  const GlobalPoint TheGlobalPosition = TheSurface.toGlobal(TheLocalPosition);
323 
324  float z = TheGlobalPosition.z();
325  if( TMath::Abs(z) < innermost_z )
326  {
327  innermost_phi = TheGlobalPosition.phi();
328  innermost_eta = TheGlobalPosition.eta();
329  innermost_z = TheGlobalPosition.z();
330  innermost_x = TheGlobalPosition.x();
331  innermost_y = TheGlobalPosition.y();
332  innermost_r = TMath::Sqrt( innermost_x*innermost_x + innermost_y*innermost_y );
333  }
334  if( TMath::Abs(z) > outermost_z)
335  {
336  outermost_phi = TheGlobalPosition.phi() ;
337  outermost_eta = TheGlobalPosition.eta() ;
338  outermost_z = TheGlobalPosition.z();
339  }
340  }
341  float dphi = TMath::Abs( outermost_phi - innermost_phi );
342  float deta = TMath::Abs( outermost_eta - innermost_eta );
343  hExtra_CSCTrackInnerOuterDPhi -> Fill( dphi );
344  hExtra_CSCTrackInnerOuterDEta -> Fill( deta );
345  hExtra_CSCTrackChi2Ndof -> Fill(cosmic->normalizedChi2() );
346  hExtra_CSCTrackNHits -> Fill(cosmic->numberOfValidHits() );
347  hExtra_InnerMostTrackHitR ->Fill(innermost_r);
348  hExtra_InnerMostTrackHitPhi ->Fill(innermost_phi);
349  if( !StandardDQM )
350  {
351  hExtra_InnerMostTrackHitXY ->Fill(innermost_x, innermost_y);
352  hExtra_InnerMostTrackHitiPhi ->Fill(Phi_To_iPhi(innermost_phi));
353  if(innermost_z > 0 )
354  hExtra_InnerMostTrackHitRPlusZ ->Fill(innermost_z, innermost_r);
355  else
356  hExtra_InnerMostTrackHitRMinusZ ->Fill(innermost_z, innermost_r);
357  }
358  }
359  }
360 
361  //Get CSC Segments
362  edm::Handle<CSCSegmentCollection> TheCSCSegments;
363  iEvent.getByLabel(IT_CSCSegment, TheCSCSegments);
364 
365  // Group segments according to endcaps
366  std::vector< CSCSegment> vCSCSegments_Plus;
367  std::vector< CSCSegment> vCSCSegments_Minus;
368 
369  bool CSCSegmentPlus = false;
370  bool CSCSegmentMinus=false;
371  if( TheCSCSegments.isValid() )
372  {
373  for(CSCSegmentCollection::const_iterator iSegment = TheCSCSegments->begin(); iSegment != TheCSCSegments->end(); iSegment++)
374  {
375  const std::vector<CSCRecHit2D> vCSCRecHits = iSegment->specificRecHits();
376  CSCDetId iDetId = (CSCDetId)(*iSegment).cscDetId();
377 
378  if ( iDetId.endcap() == 1 ) vCSCSegments_Plus.push_back( *iSegment );
379  else vCSCSegments_Minus.push_back( *iSegment );
380  }
381  }
382 
383  // Are there segments on the plus/minus side?
384  if( vCSCSegments_Plus.size() ) CSCSegmentPlus = true;
385  if( vCSCSegments_Minus.size() ) CSCSegmentMinus = true;
386 
387  //Get CSC RecHits
388  Handle<CSCRecHit2DCollection> TheCSCRecHits;
389  iEvent.getByLabel(IT_CSCRecHit, TheCSCRecHits);
390  bool CSCRecHitPlus = false;
391  bool CSCRecHitMinus = false;
392  if( TheCSCRecHits.isValid() )
393  {
394  for(CSCRecHit2DCollection::const_iterator iCSCRecHit = TheCSCRecHits->begin(); iCSCRecHit != TheCSCRecHits->end(); iCSCRecHit++ )
395  {
396  DetId TheDetUnitId(iCSCRecHit->geographicalId());
397  const GeomDetUnit *TheUnit = (*TheCSCGeometry).idToDetUnit(TheDetUnitId);
398  LocalPoint TheLocalPosition = iCSCRecHit->localPosition();
399  const BoundPlane& TheSurface = TheUnit->surface();
400  GlobalPoint TheGlobalPosition = TheSurface.toGlobal(TheLocalPosition);
401 
402  //Are there hits on the plus/minus side?
403  if ( TheGlobalPosition.z() > 0 ) CSCRecHitPlus = true;
404  else CSCRecHitMinus = true;
405  }
406  }
407 
408  //Get EB RecHits
409  edm::Handle<EBRecHitCollection> TheEBRecHits;
410  iEvent.getByLabel(IT_EBRecHit, TheEBRecHits);
411  int EBHits=0;
412  if( TheEBRecHits.isValid() )
413  {
414  for( EBRecHitCollection::const_iterator iEBRecHit = TheEBRecHits->begin() ; iEBRecHit != TheEBRecHits->end(); iEBRecHit++)
415  {
416  if( iEBRecHit->energy() < 0.5 ) continue;
417  DetId id = DetId( iEBRecHit->id() ) ;
418  EBDetId EcalId ( id.rawId() );
419  int ieta = EcalId.ieta() ;
420  if(!StandardDQM)
421  hExtra_EcalToF ->Fill(ieta, iEBRecHit->time() );
422  EBHits++;
423  }
424  }
425 
426 
427  //Get HB/HE RecHits
428  edm::Handle<HBHERecHitCollection> TheHBHERecHits;
429  iEvent.getByLabel(IT_HBHERecHit, TheHBHERecHits);
430  if( TheHBHERecHits.isValid() )
431  {
432  for( HBHERecHitCollection::const_iterator iHBHERecHit = TheHBHERecHits->begin(); iHBHERecHit != TheHBHERecHits->end(); iHBHERecHit++)
433  {
434  if( iHBHERecHit->energy() < 1.) continue;
435  HcalDetId id = HcalDetId( iHBHERecHit->id() );
436  if(!StandardDQM)
437  hExtra_HcalToF->Fill( id.ieta(), iHBHERecHit->time() ) ;
438  }
439  }
440 
441  //Get MET
443  iEvent.getByLabel(IT_met, TheCaloMET);
444 
445  //Get CSCHaloData
446  edm::Handle<reco::CSCHaloData> TheCSCDataHandle;
447  iEvent.getByLabel(IT_CSCHaloData,TheCSCDataHandle);
448  int TheHaloOrigin = 0;
449  if (TheCSCDataHandle.isValid())
450  {
451  const CSCHaloData CSCData = (*TheCSCDataHandle.product());
453  TheHaloOrigin = 1;
455  TheHaloOrigin = -1 ;
456 
457  for( std::vector<GlobalPoint>::const_iterator i=CSCData.GetCSCTrackImpactPositions().begin(); i != CSCData.GetCSCTrackImpactPositions().end() ; i++ )
458  {
459  float r = TMath::Sqrt( i->x()*i->x() + i->y()*i->y() );
460  if( !StandardDQM )
461  {
462  hCSCHaloData_InnerMostTrackHitXY->Fill( i->x(), i->y() );
463  hCSCHaloData_InnerMostTrackHitiPhi ->Fill( Phi_To_iPhi( i->phi()));
464  if( i->z() > 0 )
465  hCSCHaloData_InnerMostTrackHitRPlusZ ->Fill(i->z(), r) ;
466  else
467  hCSCHaloData_InnerMostTrackHitRMinusZ ->Fill(i->z(), r) ;
468  }
469  hCSCHaloData_InnerMostTrackHitR ->Fill(r);
470  hCSCHaloData_InnerMostTrackHitPhi ->Fill( i->phi());
471  }
472  hCSCHaloData_L1HaloTriggersMEPlus -> Fill ( CSCData.NumberOfHaloTriggers(HaloData::plus) );
473  hCSCHaloData_L1HaloTriggersMEMinus -> Fill ( CSCData.NumberOfHaloTriggers(HaloData::minus));
474  hCSCHaloData_L1HaloTriggers -> Fill ( CSCData.NumberOfHaloTriggers(HaloData::both));
475  hCSCHaloData_HLHaloTriggers -> Fill ( CSCData.CSCHaloHLTAccept());
476  hCSCHaloData_TrackMultiplicityMEPlus ->Fill ( CSCData.NumberOfHaloTracks(HaloData::plus) );
477  hCSCHaloData_TrackMultiplicityMEMinus ->Fill ( CSCData.NumberOfHaloTracks(HaloData::minus) );
478  hCSCHaloData_TrackMultiplicity->Fill( CSCData.GetTracks().size() );
479  hCSCHaloData_NOutOfTimeTriggersMEPlus->Fill( CSCData.NOutOfTimeTriggers(HaloData::plus) );
480  hCSCHaloData_NOutOfTimeTriggersMEMinus->Fill( CSCData.NOutOfTimeTriggers(HaloData::minus) );
481  hCSCHaloData_NOutOfTimeTriggers->Fill( CSCData.NOutOfTimeTriggers(HaloData::both) );
482  hCSCHaloData_NOutOfTimeHits->Fill( CSCData.NOutOfTimeHits() );
483  hCSCHaloData_NOutOfTimeTriggersvsL1HaloExists->Fill( CSCData.NOutOfTimeTriggers(HaloData::both), CSCData.NumberOfHaloTriggers(HaloData::both) >0 );
484  }
485 
486  //Get EcalHaloData
487  edm::Handle<reco::EcalHaloData> TheEcalHaloData;
488  iEvent.getByLabel(IT_EcalHaloData, TheEcalHaloData );
489  if( TheEcalHaloData.isValid() )
490  {
491  const EcalHaloData EcalData = (*TheEcalHaloData.product());
492  std::vector<PhiWedge> EcalWedges = EcalData.GetPhiWedges();
493  for(std::vector<PhiWedge>::const_iterator iWedge = EcalWedges.begin() ; iWedge != EcalWedges.end(); iWedge ++ )
494  {
495  if(!StandardDQM )
496  {
497  hEcalHaloData_PhiWedgeEnergy->Fill( iWedge->Energy() );
498  hEcalHaloData_PhiWedgeMinTime ->Fill( iWedge->MinTime() );
499  hEcalHaloData_PhiWedgeMaxTime ->Fill( iWedge->MaxTime() );
500  hEcalHaloData_PhiWedgeMinVsMaxTime->Fill(iWedge->MinTime() , iWedge->MaxTime() ) ;
501  hEcalHaloData_PhiWedgePlusZDirectionConfidence->Fill( iWedge->PlusZDirectionConfidence() );
502  hEcalHaloData_PhiWedgeiPhi->Fill(iWedge->iPhi() ) ;
503  }
504  hEcalHaloData_PhiWedgeZDirectionConfidence ->Fill( iWedge->ZDirectionConfidence() );
505  hEcalHaloData_PhiWedgeConstituents->Fill( iWedge->NumberOfConstituents() ) ;
506  }
507 
508  hEcalHaloData_PhiWedgeMultiplicity->Fill( EcalWedges.size() );
509 
510  edm::ValueMap<float> vm_Angle = EcalData.GetShowerShapesAngle();
511  edm::ValueMap<float> vm_Roundness = EcalData.GetShowerShapesRoundness();
512  //Access selected SuperClusters
513  for(unsigned int n = 0 ; n < EcalData.GetSuperClusters().size() ; n++ )
514  {
516  float angle = vm_Angle[cluster];
517  float roundness = vm_Roundness[cluster];
518  hEcalHaloData_SuperClusterShowerShapes->Fill(angle, roundness);
519  hEcalHaloData_SuperClusterNHits->Fill( cluster->size() );
520  hEcalHaloData_SuperClusterEnergy->Fill(cluster->energy() );
521 
522  if(!StandardDQM)
523  {
524  hEcalHaloData_SuperClusterPhiVsEta->Fill(cluster->eta() ,cluster->phi() );
525  }
526  }
527  }
528 
529  //Get HcalHaloData
530  edm::Handle<reco::HcalHaloData> TheHcalHaloData;
531  iEvent.getByLabel(IT_HcalHaloData ,TheHcalHaloData );
532  if( TheHcalHaloData.isValid( ) )
533  {
534  const HcalHaloData HcalData = (*TheHcalHaloData.product());
535  std::vector<PhiWedge> HcalWedges = HcalData.GetPhiWedges();
536  hHcalHaloData_PhiWedgeMultiplicity ->Fill( HcalWedges.size() );
537  for(std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin() ; iWedge != HcalWedges.end(); iWedge ++ )
538  {
539  if( !StandardDQM )
540  {
541  hHcalHaloData_PhiWedgeEnergy ->Fill( iWedge->Energy() );
542  hHcalHaloData_PhiWedgeMinTime ->Fill( iWedge->MinTime() );
543  hHcalHaloData_PhiWedgeMaxTime ->Fill( iWedge->MaxTime() );
544  hHcalHaloData_PhiWedgePlusZDirectionConfidence ->Fill( iWedge->PlusZDirectionConfidence() );
545  hHcalHaloData_PhiWedgeMinVsMaxTime ->Fill( iWedge->MinTime() , iWedge->MaxTime() );
546  hHcalHaloData_PhiWedgeiPhi ->Fill( iWedge->iPhi() );
547  }
548 
549  hHcalHaloData_PhiWedgeConstituents ->Fill( iWedge->NumberOfConstituents() );
550  hHcalHaloData_PhiWedgeZDirectionConfidence ->Fill( iWedge->ZDirectionConfidence() );
551  }
552  }
553 
554 
555  if(!StandardDQM)
556  {
557  //Get GlobalHaloData
558  edm::Handle<reco::GlobalHaloData> TheGlobalHaloData;
559  iEvent.getByLabel(IT_GlobalHaloData, TheGlobalHaloData );
560  if( TheGlobalHaloData.isValid() )
561  {
562  const GlobalHaloData GlobalData =(*TheGlobalHaloData.product());
563  if( TheCaloMET.isValid() )
564  {
565  // Get Raw Uncorrected CaloMET
566  const CaloMETCollection *calometcol = TheCaloMET.product();
567  const CaloMET *RawMET = &(calometcol->front());
568 
569  // Get BeamHalo Corrected CaloMET
570  const CaloMET CorrectedMET = GlobalData.GetCorrectedCaloMET(*RawMET);
571  hGlobalHaloData_MExCorrection ->Fill( GlobalData.DeltaMEx() );
572  hGlobalHaloData_MEyCorrection ->Fill( GlobalData.DeltaMEy() );
573  hGlobalHaloData_HaloCorrectedMET->Fill(CorrectedMET.pt() );
574  hGlobalHaloData_RawMETMinusHaloCorrectedMET ->Fill( RawMET->pt() - CorrectedMET.pt() );
575  if( RawMET->sumEt() )
576  hGlobalHaloData_RawMETOverSumEt ->Fill( RawMET->pt() / RawMET->sumEt() );
577 
578  }
579 
580  // Get Matched Hcal Phi Wedges
581  std::vector<PhiWedge> HcalWedges = GlobalData.GetMatchedHcalPhiWedges();
582  hGlobalHaloData_MatchedHcalPhiWedgeMultiplicity ->Fill(HcalWedges.size());
583  // Loop over Matched Hcal Phi Wedges
584  for( std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin() ; iWedge != HcalWedges.end() ; iWedge ++ )
585  {
586  hGlobalHaloData_MatchedHcalPhiWedgeEnergy ->Fill( iWedge->Energy() );
587  hGlobalHaloData_MatchedHcalPhiWedgeConstituents ->Fill( iWedge->NumberOfConstituents());
588  hGlobalHaloData_MatchedHcalPhiWedgeiPhi ->Fill( iWedge->iPhi() );
589  hGlobalHaloData_MatchedHcalPhiWedgeMinTime ->Fill( iWedge->MinTime() );
590  hGlobalHaloData_MatchedHcalPhiWedgeMaxTime ->Fill( iWedge->MaxTime() );
591  hGlobalHaloData_MatchedHcalPhiWedgeZDirectionConfidence ->Fill( iWedge->ZDirectionConfidence() ) ;
592  if( TheHBHERecHits.isValid() )
593  {
594  for( HBHERecHitCollection::const_iterator iHBHERecHit = TheHBHERecHits->begin(); iHBHERecHit != TheHBHERecHits->end(); iHBHERecHit++)
595  {
596  HcalDetId id = HcalDetId( iHBHERecHit->id() ) ;
597  int iphi = id.iphi() ;
598  if( iphi != iWedge->iPhi() ) continue;
599  if( iHBHERecHit->energy() < 1.0) continue; // Otherwise there are thousands of hits per event (even with negative energies)
600 
601  float time = iHBHERecHit->time();
602  int ieta = id.ieta();
603  hExtra_HcalToF_HaloId ->Fill( ieta, time );
604  }
605  }
606  }
607 
608  // Get Matched Hcal Phi Wedges
609  std::vector<PhiWedge> EcalWedges = GlobalData.GetMatchedEcalPhiWedges();
610  hGlobalHaloData_MatchedEcalPhiWedgeMultiplicity ->Fill(EcalWedges.size());
611  for( std::vector<PhiWedge>::const_iterator iWedge = EcalWedges.begin() ; iWedge != EcalWedges.end() ; iWedge ++ )
612  {
613  hGlobalHaloData_MatchedEcalPhiWedgeEnergy ->Fill(iWedge->Energy());
614  hGlobalHaloData_MatchedEcalPhiWedgeConstituents ->Fill(iWedge->NumberOfConstituents());
615  hGlobalHaloData_MatchedEcalPhiWedgeiPhi ->Fill(iWedge->iPhi());
616  hGlobalHaloData_MatchedEcalPhiWedgeMinTime ->Fill(iWedge->MinTime());
617  hGlobalHaloData_MatchedEcalPhiWedgeMaxTime ->Fill(iWedge->MaxTime());
618  hGlobalHaloData_MatchedEcalPhiWedgeZDirectionConfidence ->Fill( iWedge->ZDirectionConfidence() ) ;
619  if( TheEBRecHits.isValid() )
620  {
621  for( EBRecHitCollection::const_iterator iEBRecHit = TheEBRecHits->begin() ; iEBRecHit != TheEBRecHits->end(); iEBRecHit++ )
622  {
623  if( iEBRecHit->energy() < 0.5 ) continue;
624  DetId id = DetId( iEBRecHit->id() ) ;
625  EBDetId EcalId ( id.rawId() );
626  int iPhi = EcalId.iphi() ;
627  iPhi = (iPhi-1)/5 + 1;
628  if( iPhi != iWedge->iPhi() ) continue;
629  hExtra_EcalToF_HaloId ->Fill(EcalId.ieta(), iEBRecHit->time() );
630  }
631  }
632  }
633  }
634  }
635 
636 
637  // Get BeamHaloSummary
638  edm::Handle<BeamHaloSummary> TheBeamHaloSummary ;
639  iEvent.getByLabel(IT_BeamHaloSummary, TheBeamHaloSummary) ;
640  if( TheBeamHaloSummary.isValid() )
641  {
642  const BeamHaloSummary TheSummary = (*TheBeamHaloSummary.product() );
643  if( TheSummary.CSCLooseHaloId() )
644  {
645  hBeamHaloSummary_Id ->Fill(1);
646  if(!StandardDQM) hBeamHaloSummary_BXN -> Fill( 1, BXN );
647  if(Dump)*out << std::setw(15) << "CSCLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
648  }
649  if( TheSummary.CSCTightHaloId() )
650  {
651  hBeamHaloSummary_Id ->Fill(2);
652  if(!StandardDQM)hBeamHaloSummary_BXN -> Fill( 2, BXN );
653  }
654  if( TheSummary.EcalLooseHaloId() )
655  {
656  hBeamHaloSummary_Id ->Fill(3);
657  if(!StandardDQM) hBeamHaloSummary_BXN -> Fill( 3, BXN );
658  if(Dump) *out << std::setw(15) << "EcalLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
659  }
660  if( TheSummary.EcalTightHaloId() )
661  {
662  hBeamHaloSummary_Id ->Fill(4);
663  if(!StandardDQM)hBeamHaloSummary_BXN -> Fill( 4, BXN );
664  }
665  if( TheSummary.HcalLooseHaloId() )
666  {
667  hBeamHaloSummary_Id ->Fill(5);
668  if(!StandardDQM) hBeamHaloSummary_BXN -> Fill( 5, BXN );
669  if(Dump) *out << std::setw(15) << "HcalLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
670  }
671  if( TheSummary.HcalTightHaloId() )
672  {
673  hBeamHaloSummary_Id ->Fill(6);
674  if(!StandardDQM)hBeamHaloSummary_BXN -> Fill( 6, BXN );
675  }
676  if( TheSummary.GlobalLooseHaloId())
677  {
678  hBeamHaloSummary_Id ->Fill(7);
679  if(!StandardDQM)hBeamHaloSummary_BXN -> Fill( 7, BXN );
680  if(Dump) *out << std::setw(15) << "GlobalLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
681  }
682  if( TheSummary.GlobalTightHaloId() )
683  {
684  hBeamHaloSummary_Id ->Fill(8);
685  if(!StandardDQM)hBeamHaloSummary_BXN -> Fill( 8, BXN );
686  }
687  if( TheSummary.LooseId() )
688  {
689  hBeamHaloSummary_Id ->Fill(9);
690  if(!StandardDQM)hBeamHaloSummary_BXN -> Fill( 9, BXN );
691  }
692  if( TheSummary.TightId() )
693  {
694  hBeamHaloSummary_Id ->Fill(10);
695  if(!StandardDQM)hBeamHaloSummary_BXN -> Fill( 10, BXN );
696  }
697  if( !TheSummary.EcalLooseHaloId() && !TheSummary.HcalLooseHaloId() && !TheSummary.CSCLooseHaloId() && !TheSummary.GlobalLooseHaloId() )
698  {
699  hBeamHaloSummary_Id ->Fill(11);
700  if(!StandardDQM)hBeamHaloSummary_BXN -> Fill( 11, BXN );
701  }
702  }
703 
704  if( TheCaloMET.isValid() )
705  {
706  const CaloMETCollection *calometcol = TheCaloMET.product();
707  const CaloMET *calomet = &(calometcol->front());
708 
709  if( calomet->pt() > DumpMET )
710  if(Dump) *out << std::setw(15) << "HighMET" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
711 
712  //Fill CSC Activity Plot
713  if( calomet->pt() > 15.0 )
714  {
715  if( TheHaloOrigin > 0 )
716  {
717  if( CSCTrackPlus && CSCTrackMinus )
718  hExtra_CSCActivityWithMET->Fill(1,1);
719  else if( CSCTrackPlus && CSCSegmentMinus)
720  hExtra_CSCActivityWithMET->Fill(1,2);
721  else if( CSCTrackPlus && CSCRecHitMinus )
722  hExtra_CSCActivityWithMET->Fill(1,3);
723  else if( CSCTrackPlus )
724  hExtra_CSCActivityWithMET->Fill(1,4);
725  else if( CSCSegmentPlus && CSCTrackMinus )
726  hExtra_CSCActivityWithMET->Fill(2,1);
727  else if( CSCSegmentPlus && CSCSegmentMinus )
728  hExtra_CSCActivityWithMET-> Fill(2,2);
729  else if( CSCSegmentPlus && CSCRecHitMinus )
730  hExtra_CSCActivityWithMET-> Fill(2,3);
731  else if( CSCSegmentPlus )
732  hExtra_CSCActivityWithMET->Fill(2,4 );
733  else if( CSCRecHitPlus && CSCTrackMinus )
734  hExtra_CSCActivityWithMET->Fill(3,1);
735  else if( CSCRecHitPlus && CSCSegmentMinus )
736  hExtra_CSCActivityWithMET->Fill(3,2);
737  else if( CSCRecHitPlus && CSCRecHitMinus )
738  hExtra_CSCActivityWithMET->Fill(3,3);
739  else if( CSCRecHitPlus )
740  hExtra_CSCActivityWithMET->Fill(3,4);
741  else
742  hExtra_CSCActivityWithMET->Fill(4,4);
743  }
744  else if( TheHaloOrigin < 0 )
745  {
746  if( CSCTrackMinus && CSCTrackPlus )
747  hExtra_CSCActivityWithMET->Fill(1,1);
748  else if( CSCTrackMinus && CSCSegmentPlus)
749  hExtra_CSCActivityWithMET->Fill(1,2);
750  else if( CSCTrackMinus && CSCRecHitPlus )
751  hExtra_CSCActivityWithMET->Fill(1,3);
752  else if( CSCTrackMinus )
753  hExtra_CSCActivityWithMET->Fill(1,4);
754  else if( CSCSegmentMinus && CSCTrackPlus)
755  hExtra_CSCActivityWithMET->Fill(2,1);
756  else if( CSCSegmentMinus && CSCSegmentPlus )
757  hExtra_CSCActivityWithMET->Fill(2,2 );
758  else if( CSCSegmentMinus && CSCRecHitPlus )
759  hExtra_CSCActivityWithMET->Fill(2,3);
760  else if( CSCSegmentMinus )
761  hExtra_CSCActivityWithMET->Fill(2,4);
762  else if( CSCRecHitMinus && CSCTrackPlus )
763  hExtra_CSCActivityWithMET->Fill(3,1 );
764  else if( CSCRecHitMinus && CSCSegmentPlus )
765  hExtra_CSCActivityWithMET->Fill(3,2 );
766  else if( CSCRecHitMinus && CSCRecHitPlus )
767  hExtra_CSCActivityWithMET->Fill(3,3);
768  else if( CSCRecHitMinus )
769  hExtra_CSCActivityWithMET->Fill(3,4);
770  else hExtra_CSCActivityWithMET->Fill(4,4);
771  }
772  }
773  }
774 
775 }
776 
778 {
779 
780 }
781 
783 }
784 
785 //DEFINE_FWK_MODULE(CMSEventAnalyzer);
786 
787 
788 
789 
short int NOutOfTimeTriggers(HaloData::Endcap z=HaloData::both) const
Definition: CSCHaloData.h:44
const double Pi
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
string OutputFileName
const bool EcalTightHaloId() const
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
int i
Definition: DBlmapReader.cc:9
int NumberOfHaloTracks(HaloData::Endcap z=HaloData::both) const
Definition: CSCHaloData.cc:47
edm::ValueMap< float > & GetShowerShapesRoundness()
Definition: EcalHaloData.h:41
const bool HcalTightHaloId() const
const bool GlobalLooseHaloId() const
const std::vector< PhiWedge > & GetPhiWedges() const
Definition: EcalHaloData.h:32
virtual void endJob()
edm::RefVector< reco::SuperClusterCollection > & GetSuperClusters()
Definition: EcalHaloData.h:36
const bool LooseId() const
edm::ValueMap< float > & GetShowerShapesAngle()
Definition: EcalHaloData.h:44
bool CSCHaloHLTAccept() const
Definition: CSCHaloData.h:40
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
std::vector< T >::const_iterator const_iterator
T y() const
Definition: PV3DBase.h:57
bool exists(std::string const &parameterName) const
checks if a parameter exists
int bunchCrossing() const
Definition: EventBase.h:62
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
short int NumberOfOutOfTimeTriggers(HaloData::Endcap z=HaloData::both) const
Definition: CSCHaloData.cc:37
const bool TightId() const
const bool GlobalTightHaloId() const
std::vector< PhiWedge > & GetMatchedEcalPhiWedges()
double double double z
virtual void beginRun(const edm::Run &, const edm::EventSetup &iSetup)
const bool HcalLooseHaloId() const
int endcap() const
Definition: CSCDetId.h:95
Collection of Calo MET.
const bool CSCTightHaloId() const
int Phi_To_iPhi(float phi)
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:46
int iEvent
Definition: GenABIO.cc:243
double sumEt() const
Definition: MET.h:48
static const int CSC
Definition: MuonSubdetId.h:15
float DeltaMEx() const
float DeltaMEy() const
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
T z() const
Definition: PV3DBase.h:58
RunNumber_t run() const
Definition: Event.h:66
const std::vector< GlobalPoint > & GetCSCTrackImpactPositions() const
Definition: CSCHaloData.h:66
int j
Definition: DBlmapReader.cc:9
short int NOutOfTimeHits() const
Definition: CSCHaloData.h:47
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
int NumberOfHaloTriggers(HaloData::Endcap z=HaloData::both) const
Definition: CSCHaloData.cc:27
reco::CaloMET GetCorrectedCaloMET(const reco::CaloMET &RawMET) const
tuple out
Definition: dbtoconf.py:99
int iphi() const
get the cell iphi
Definition: HcalDetId.h:40
Definition: DetId.h:20
virtual double pt() const
transverse momentum
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: Handle.h:74
T eta() const
Definition: PV3DBase.h:70
const bool CSCLooseHaloId() const
edm::EventID id() const
Definition: EventBase.h:56
#define begin
Definition: vmac.h:31
std::vector< PhiWedge > & GetMatchedHcalPhiWedges()
size_type size() const
Size of the RefVector.
Definition: RefVector.h:84
const std::vector< PhiWedge > & GetPhiWedges() const
Definition: HcalHaloData.h:21
T x() const
Definition: PV3DBase.h:56
virtual void analyze(const edm::Event &, const edm::EventSetup &)
BeamHaloAnalyzer(const edm::ParameterSet &)
const bool EcalLooseHaloId() const
virtual void beginJob()
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
Definition: Run.h:32
edm::RefVector< reco::TrackCollection > & GetTracks()
Definition: CSCHaloData.h:50
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
Definition: DDAxes.h:10