CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloMETAnalyzer.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * $Date: 2011/04/02 13:52:48 $
5  * $Revision: 1.54.6.1 $
6  * \author F. Chlebana - Fermilab
7  * K. Hatakeyama - Rockefeller University
8  */
9 
12 
15 
20 
22 
26 
27 #include "TLorentzVector.h"
28 
29 #include <string>
30 using namespace edm;
31 
32 // ***********************************************************
34 
35  parameters = pSet;
36 
37  edm::ParameterSet highptjetparms = parameters.getParameter<edm::ParameterSet>("highPtJetTrigger");
38  edm::ParameterSet lowptjetparms = parameters.getParameter<edm::ParameterSet>("lowPtJetTrigger" );
39  edm::ParameterSet minbiasparms = parameters.getParameter<edm::ParameterSet>("minBiasTrigger" );
40  edm::ParameterSet highmetparms = parameters.getParameter<edm::ParameterSet>("highMETTrigger" );
41  edm::ParameterSet lowmetparms = parameters.getParameter<edm::ParameterSet>("lowMETTrigger" );
42  edm::ParameterSet eleparms = parameters.getParameter<edm::ParameterSet>("eleTrigger" );
43  edm::ParameterSet muonparms = parameters.getParameter<edm::ParameterSet>("muonTrigger" );
44 
45  _hlt_HighPtJet = highptjetparms.getParameter<std::string>("hltDBKey");
46  _hlt_LowPtJet = lowptjetparms .getParameter<std::string>("hltDBKey");
47  _hlt_MinBias = minbiasparms .getParameter<std::string>("hltDBKey");
48  _hlt_HighMET = highmetparms .getParameter<std::string>("hltDBKey");
49  _hlt_LowMET = lowmetparms .getParameter<std::string>("hltDBKey");
50  _hlt_Ele = eleparms .getParameter<std::string>("hltDBKey");
51  _hlt_Muon = muonparms .getParameter<std::string>("hltDBKey");
52 
53 
54  //genericTriggerEventFlag_( new GenericTriggerEventFlag( conf_ ) );
55  _HighPtJetEventFlag = new GenericTriggerEventFlag( highptjetparms );
56  _LowPtJetEventFlag = new GenericTriggerEventFlag( lowptjetparms );
57  _MinBiasEventFlag = new GenericTriggerEventFlag( minbiasparms );
58  _HighMETEventFlag = new GenericTriggerEventFlag( highmetparms );
59  _LowMETEventFlag = new GenericTriggerEventFlag( lowmetparms );
60  _EleEventFlag = new GenericTriggerEventFlag( eleparms );
61  _MuonEventFlag = new GenericTriggerEventFlag( muonparms );
62 
63 }
64 
65 // ***********************************************************
67 
68  delete _HighPtJetEventFlag;
69  delete _LowPtJetEventFlag;
70  delete _MinBiasEventFlag;
71  delete _HighMETEventFlag;
72  delete _LowMETEventFlag;
73  delete _EleEventFlag;
74  delete _MuonEventFlag;
75 
76 }
77 
78 // ***********************************************************
80 
81  evtCounter = 0;
82  metname = "caloMETAnalyzer";
83 
84  // trigger information
85  HLTPathsJetMBByName_ = parameters.getParameter<std::vector<std::string > >("HLTPathsJetMB");
86 
87  //_hlt_HighPtJet = parameters.getParameter<std::string>("HLT_HighPtJet");
88  //_hlt_LowPtJet = parameters.getParameter<std::string>("HLT_LowPtJet");
89  //_hlt_MinBias = parameters.getParameter<std::string>("HLT_MinBias");
90  //_hlt_HighMET = parameters.getParameter<std::string>("HLT_HighMET");
91  //_hlt_LowMET = parameters.getParameter<std::string>("HLT_LowMET");
92  //_hlt_Ele = parameters.getParameter<std::string>("HLT_Ele");
93  //_hlt_Muon = parameters.getParameter<std::string>("HLT_Muon");
94 
95  theCleaningParameters = parameters.getParameter<ParameterSet>("CleaningParameters"),
96 
97  //Trigger parameters
98  gtTag = theCleaningParameters.getParameter<edm::InputTag>("gtLabel");
99  _techTrigsAND = theCleaningParameters.getParameter<std::vector<unsigned > >("techTrigsAND");
100  _techTrigsOR = theCleaningParameters.getParameter<std::vector<unsigned > >("techTrigsOR");
101  _techTrigsNOT = theCleaningParameters.getParameter<std::vector<unsigned > >("techTrigsNOT");
102 
103  _doHLTPhysicsOn = theCleaningParameters.getParameter<bool>("doHLTPhysicsOn");
104  _hlt_PhysDec = theCleaningParameters.getParameter<std::string>("HLT_PhysDec");
105 
106  _tightBHFiltering = theCleaningParameters.getParameter<bool>("tightBHFiltering");
107  _tightJetIDFiltering = theCleaningParameters.getParameter<int>("tightJetIDFiltering");
108  _tightHcalFiltering = theCleaningParameters.getParameter<bool>("tightHcalFiltering");
109 
110  // ==========================================================
111  //DCS information
112  // ==========================================================
113  DCSFilter = new JetMETDQMDCSFilter(parameters.getParameter<ParameterSet>("DCSFilter"));
114 
115  //Vertex requirements
116  _doPVCheck = theCleaningParameters.getParameter<bool>("doPrimaryVertexCheck");
117  vertexTag = theCleaningParameters.getParameter<edm::InputTag>("vertexLabel");
118 
119  if (_doPVCheck) {
120  _nvtx_min = theCleaningParameters.getParameter<int>("nvtx_min");
121  _nvtxtrks_min = theCleaningParameters.getParameter<int>("nvtxtrks_min");
122  _vtxndof_min = theCleaningParameters.getParameter<int>("vtxndof_min");
123  _vtxchi2_max = theCleaningParameters.getParameter<double>("vtxchi2_max");
124  _vtxz_max = theCleaningParameters.getParameter<double>("vtxz_max");
125  }
126 
127 
128  // CaloMET information
129  theCaloMETCollectionLabel = parameters.getParameter<edm::InputTag>("METCollectionLabel");
130  _source = parameters.getParameter<std::string>("Source");
131 
132  if (theCaloMETCollectionLabel.label() == "corMetGlobalMuons" ) {
133  inputBeamSpotLabel = parameters.getParameter<edm::InputTag>("InputBeamSpotLabel");
134  }
135 
136  // Other data collections
137  theCaloTowersLabel = parameters.getParameter<edm::InputTag>("CaloTowersLabel");
138  theJetCollectionLabel = parameters.getParameter<edm::InputTag>("JetCollectionLabel");
139  HcalNoiseRBXCollectionTag = parameters.getParameter<edm::InputTag>("HcalNoiseRBXCollection");
140  HcalNoiseSummaryTag = parameters.getParameter<edm::InputTag>("HcalNoiseSummary");
141  BeamHaloSummaryTag = parameters.getParameter<edm::InputTag>("BeamHaloSummaryLabel");
142 
143  // misc
144  _verbose = parameters.getParameter<int>("verbose");
145  _print = parameters.getParameter<int>("printOut");
146  _etThreshold = parameters.getParameter<double>("etThreshold"); // MET threshold
147  _allhist = parameters.getParameter<bool>("allHist"); // Full set of monitoring histograms
148  _allSelection= parameters.getParameter<bool>("allSelection"); // Plot with all sets of event selection
149  _cleanupSelection= parameters.getParameter<bool>("cleanupSelection"); // Plot with all sets of event selection
150 
151  _highPtJetThreshold = parameters.getParameter<double>("HighPtJetThreshold"); // High Pt Jet threshold
152  _lowPtJetThreshold = parameters.getParameter<double>("LowPtJetThreshold"); // Low Pt Jet threshold
153  _highMETThreshold = parameters.getParameter<double>("HighMETThreshold"); // High MET threshold
154  _lowMETThreshold = parameters.getParameter<double>("LowMETThreshold"); // Low MET threshold
155 
156  //
157  jetID = new reco::helper::JetIDHelper(parameters.getParameter<ParameterSet>("JetIDParams"));
158 
159  // DQStore stuff
160  LogTrace(metname)<<"[CaloMETAnalyzer] Parameters initialization";
161  std::string DirName = "JetMET/MET/"+_source;
162  dbe->setCurrentFolder(DirName);
163 
164  hmetME = dbe->book1D("metReco", "metReco", 4, 1, 5);
165  hmetME->setBinLabel(1,"CaloMET",1);
166 
167  _dbe = dbe;
168 
169  _FolderNames.push_back("All");
170  _FolderNames.push_back("BasicCleanup");
171  _FolderNames.push_back("ExtraCleanup");
172  _FolderNames.push_back("HcalNoiseFilter");
173  _FolderNames.push_back("HcalNoiseFilterTight");
174  _FolderNames.push_back("JetIDMinimal");
175  _FolderNames.push_back("JetIDLoose");
176  _FolderNames.push_back("JetIDTight");
177  _FolderNames.push_back("BeamHaloIDTightPass");
178  _FolderNames.push_back("BeamHaloIDLoosePass");
179  _FolderNames.push_back("Triggers");
180  _FolderNames.push_back("PV");
181 
182  for (std::vector<std::string>::const_iterator ic = _FolderNames.begin();
183  ic != _FolderNames.end(); ic++){
184  if (*ic=="All") bookMESet(DirName+"/"+*ic);
185  if (_cleanupSelection){
186  if (*ic=="BasicCleanup") bookMESet(DirName+"/"+*ic);
187  if (*ic=="ExtraCleanup") bookMESet(DirName+"/"+*ic);
188  }
189  if (_allSelection){
190  if (*ic=="HcalNoiseFilter") bookMESet(DirName+"/"+*ic);
191  if (*ic=="HcalNoiseFilterTight") bookMESet(DirName+"/"+*ic);
192  if (*ic=="JetIDMinimal") bookMESet(DirName+"/"+*ic);
193  if (*ic=="JetIDLoose") bookMESet(DirName+"/"+*ic);
194  if (*ic=="JetIDTight") bookMESet(DirName+"/"+*ic);
195  if (*ic=="BeamHaloIDTightPass") bookMESet(DirName+"/"+*ic);
196  if (*ic=="BeamHaloIDLoosePass") bookMESet(DirName+"/"+*ic);
197  if (*ic=="Triggers") bookMESet(DirName+"/"+*ic);
198  if (*ic=="PV") bookMESet(DirName+"/"+*ic);
199  }
200  }
201 
202 }
203 
204 // ***********************************************************
206 
207  delete jetID;
208  delete DCSFilter;
209 
210 }
211 
212 // ***********************************************************
214 {
215 
216  bool bLumiSecPlot=false;
217  if (DirName.find("All")!=std::string::npos) bLumiSecPlot=true;
218 
219  bookMonitorElement(DirName,bLumiSecPlot);
220 
221  if ( _HighPtJetEventFlag->on() ) {
222  bookMonitorElement(DirName+"/"+"HighPtJet",false);
223  hTriggerName_HighPtJet = _dbe->bookString("triggerName_HighPtJet", _hlt_HighPtJet);
224  }
225 
226  if ( _LowPtJetEventFlag->on() ) {
227  bookMonitorElement(DirName+"/"+"LowPtJet",false);
228  hTriggerName_LowPtJet = _dbe->bookString("triggerName_LowPtJet", _hlt_LowPtJet);
229  }
230 
231  if ( _MinBiasEventFlag->on() ) {
232  bookMonitorElement(DirName+"/"+"MinBias",false);
233  hTriggerName_MinBias = _dbe->bookString("triggerName_MinBias", _hlt_MinBias);
234  }
235 
236  if ( _HighMETEventFlag->on() ) {
237  bookMonitorElement(DirName+"/"+"HighMET",false);
238  hTriggerName_HighMET = _dbe->bookString("triggerName_HighMET", _hlt_HighMET);
239  }
240 
241  if ( _LowMETEventFlag->on() ) {
242  bookMonitorElement(DirName+"/"+"LowMET",false);
243  hTriggerName_LowMET = _dbe->bookString("triggerName_LowMET", _hlt_LowMET);
244  }
245 
246  if ( _EleEventFlag->on() ) {
247  bookMonitorElement(DirName+"/"+"Ele",false);
248  hTriggerName_Ele = _dbe->bookString("triggerName_Ele", _hlt_Ele);
249  }
250 
251  if ( _MuonEventFlag->on() ) {
252  bookMonitorElement(DirName+"/"+"Muon",false);
253  hTriggerName_Muon = _dbe->bookString("triggerName_Muon", _hlt_Muon);
254  }
255 }
256 
257 // ***********************************************************
258 void CaloMETAnalyzer::bookMonitorElement(std::string DirName, bool bLumiSecPlot=false)
259 {
260 
261  if (_verbose) std::cout << "bookMonitorElement " << DirName << std::endl;
262  _dbe->setCurrentFolder(DirName);
263 
264  hNevents = _dbe->book1D("METTask_Nevents", "METTask_Nevents" ,1,0,1);
265  hCaloMEx = _dbe->book1D("METTask_CaloMEx", "METTask_CaloMEx" ,500,-500,500);
266  hCaloMEx->setAxisTitle("MEx [GeV]",1);
267  hCaloMEy = _dbe->book1D("METTask_CaloMEy", "METTask_CaloMEy" ,500,-500,500);
268  hCaloMEy->setAxisTitle("MEy [GeV]",1);
269  hCaloEz = _dbe->book1D("METTask_CaloEz", "METTask_CaloEz" ,500,-500,500);
270  hCaloEz->setAxisTitle("Ez [GeV]",1);
271  hCaloMETSig = _dbe->book1D("METTask_CaloMETSig","METTask_CaloMETSig",51,0,51);
272  hCaloMETSig->setAxisTitle("METSig",1);
273  hCaloMET = _dbe->book1D("METTask_CaloMET", "METTask_CaloMET" ,500,0,1000);
274  hCaloMET->setAxisTitle("MET [GeV]",1);
275  //meCaloMET->getTH1F()->SetStats(111111);
276  //meCaloMET->getTH1F()->SetOption("logy");
277  hCaloMETPhi = _dbe->book1D("METTask_CaloMETPhi","METTask_CaloMETPhi",80,-TMath::Pi(),TMath::Pi());
278  hCaloMETPhi->setAxisTitle("METPhi [rad]",1);
279  hCaloSumET = _dbe->book1D("METTask_CaloSumET", "METTask_CaloSumET" ,500,0,2000);
280  hCaloSumET->setAxisTitle("SumET [GeV]",1);
281 
282  hCaloMET_logx = _dbe->book1D("METTask_CaloMET_logx", "METTask_CaloMET_logx" ,40,-1.,7.);
283  hCaloMET_logx->setAxisTitle("log(MET) [GeV]",1);
284  hCaloSumET_logx = _dbe->book1D("METTask_CaloSumET_logx", "METTask_CaloSumET_logx" ,40,-1.,7.);
285  hCaloSumET_logx->setAxisTitle("log(SumET) [GeV]",1);
286 
287  hCaloMETIonFeedbck = _dbe->book1D("METTask_CaloMETIonFeedbck", "METTask_CaloMETIonFeedbck" ,500,0,1000);
288  hCaloMETIonFeedbck->setAxisTitle("MET [GeV]",1);
289  hCaloMETHPDNoise = _dbe->book1D("METTask_CaloMETHPDNoise", "METTask_CaloMETHPDNoise" ,500,0,1000);
290  hCaloMETHPDNoise->setAxisTitle("MET [GeV]",1);
291  hCaloMETRBXNoise = _dbe->book1D("METTask_CaloMETRBXNoise", "METTask_CaloMETRBXNoise" ,500,0,1000);
292  hCaloMETRBXNoise->setAxisTitle("MET [GeV]",1);
293 
294  hCaloMETPhi002 = _dbe->book1D("METTask_CaloMETPhi002","METTask_CaloMETPhi002",72,-TMath::Pi(),TMath::Pi());
295  hCaloMETPhi002->setAxisTitle("METPhi [rad] (MET>2 GeV)",1);
296  hCaloMETPhi010 = _dbe->book1D("METTask_CaloMETPhi010","METTask_CaloMETPhi010",72,-TMath::Pi(),TMath::Pi());
297  hCaloMETPhi010->setAxisTitle("METPhi [rad] (MET>10 GeV)",1);
298  hCaloMETPhi020 = _dbe->book1D("METTask_CaloMETPhi020","METTask_CaloMETPhi020",72,-TMath::Pi(),TMath::Pi());
299  hCaloMETPhi020->setAxisTitle("METPhi [rad] (MET>20 GeV)",1);
300 
301  if (_allhist){
302  if (bLumiSecPlot){
303  hCaloMExLS = _dbe->book2D("METTask_CaloMEx_LS","METTask_CaloMEx_LS",200,-200,200,50,0.,500.);
304  hCaloMExLS->setAxisTitle("MEx [GeV]",1);
305  hCaloMExLS->setAxisTitle("Lumi Section",2);
306  hCaloMEyLS = _dbe->book2D("METTask_CaloMEy_LS","METTask_CaloMEy_LS",200,-200,200,50,0.,500.);
307  hCaloMEyLS->setAxisTitle("MEy [GeV]",1);
308  hCaloMEyLS->setAxisTitle("Lumi Section",2);
309  }
310 
311  hCaloMaxEtInEmTowers = _dbe->book1D("METTask_CaloMaxEtInEmTowers", "METTask_CaloMaxEtInEmTowers" ,100,0,2000);
312  hCaloMaxEtInEmTowers->setAxisTitle("Et(Max) in EM Tower [GeV]",1);
313  hCaloMaxEtInHadTowers = _dbe->book1D("METTask_CaloMaxEtInHadTowers", "METTask_CaloMaxEtInHadTowers" ,100,0,2000);
314  hCaloMaxEtInHadTowers->setAxisTitle("Et(Max) in Had Tower [GeV]",1);
315  hCaloEtFractionHadronic = _dbe->book1D("METTask_CaloEtFractionHadronic","METTask_CaloEtFractionHadronic",100,0,1);
316  hCaloEtFractionHadronic->setAxisTitle("Hadronic Et Fraction",1);
317  hCaloEmEtFraction = _dbe->book1D("METTask_CaloEmEtFraction", "METTask_CaloEmEtFraction" ,100,0,1);
318  hCaloEmEtFraction->setAxisTitle("EM Et Fraction",1);
319 
320  hCaloEmEtFraction002 = _dbe->book1D("METTask_CaloEmEtFraction002", "METTask_CaloEmEtFraction002" ,100,0,1);
321  hCaloEmEtFraction002->setAxisTitle("EM Et Fraction (MET>2 GeV)",1);
322  hCaloEmEtFraction010 = _dbe->book1D("METTask_CaloEmEtFraction010", "METTask_CaloEmEtFraction010" ,100,0,1);
323  hCaloEmEtFraction010->setAxisTitle("EM Et Fraction (MET>10 GeV)",1);
324  hCaloEmEtFraction020 = _dbe->book1D("METTask_CaloEmEtFraction020", "METTask_CaloEmEtFraction020" ,100,0,1);
325  hCaloEmEtFraction020->setAxisTitle("EM Et Fraction (MET>20 GeV)",1);
326 
327  hCaloHadEtInHB = _dbe->book1D("METTask_CaloHadEtInHB","METTask_CaloHadEtInHB",100,0,2000);
328  hCaloHadEtInHB->setAxisTitle("Had Et [GeV]",1);
329  hCaloHadEtInHO = _dbe->book1D("METTask_CaloHadEtInHO","METTask_CaloHadEtInHO",100,0,2000);
330  hCaloHadEtInHO->setAxisTitle("Had Et [GeV]",1);
331  hCaloHadEtInHE = _dbe->book1D("METTask_CaloHadEtInHE","METTask_CaloHadEtInHE",100,0,2000);
332  hCaloHadEtInHE->setAxisTitle("Had Et [GeV]",1);
333  hCaloHadEtInHF = _dbe->book1D("METTask_CaloHadEtInHF","METTask_CaloHadEtInHF",100,0,2000);
334  hCaloHadEtInHF->setAxisTitle("Had Et [GeV]",1);
335  hCaloEmEtInHF = _dbe->book1D("METTask_CaloEmEtInHF" ,"METTask_CaloEmEtInHF" ,100,0,2000);
336  hCaloEmEtInHF->setAxisTitle("EM Et [GeV]",1);
337  hCaloEmEtInEE = _dbe->book1D("METTask_CaloEmEtInEE" ,"METTask_CaloEmEtInEE" ,100,0,2000);
338  hCaloEmEtInEE->setAxisTitle("EM Et [GeV]",1);
339  hCaloEmEtInEB = _dbe->book1D("METTask_CaloEmEtInEB" ,"METTask_CaloEmEtInEB" ,100,0,2000);
340  hCaloEmEtInEB->setAxisTitle("EM Et [GeV]",1);
341 
342  hCaloEmMEx= _dbe->book1D("METTask_CaloEmMEx","METTask_CaloEmMEx",500,-500,500);
343  hCaloEmMEx->setAxisTitle("EM MEx [GeV]",1);
344  hCaloEmMEy= _dbe->book1D("METTask_CaloEmMEy","METTask_CaloEmMEy",500,-500,500);
345  hCaloEmMEy->setAxisTitle("EM MEy [GeV]",1);
346  hCaloEmEz= _dbe->book1D("METTask_CaloEmEz","METTask_CaloEmEz",500,-500,500);
347  hCaloEmEz->setAxisTitle("EM Ez [GeV]",1);
348  hCaloEmMET= _dbe->book1D("METTask_CaloEmMET","METTask_CaloEmMET",500,0,1000);
349  hCaloEmMET->setAxisTitle("EM MET [GeV]",1);
350  hCaloEmMETPhi= _dbe->book1D("METTask_CaloEmMETPhi","METTask_CaloEmMETPhi",80,-TMath::Pi(),TMath::Pi());
351  hCaloEmMETPhi->setAxisTitle("EM METPhi [rad]",1);
352  hCaloEmSumET= _dbe->book1D("METTask_CaloEmSumET","METTask_CaloEmSumET",500,0,2000);
353  hCaloEmSumET->setAxisTitle("EM SumET [GeV]",1);
354 
355  hCaloHaMEx= _dbe->book1D("METTask_CaloHaMEx","METTask_CaloHaMEx",500,-500,500);
356  hCaloHaMEx->setAxisTitle("HA MEx [GeV]",1);
357  hCaloHaMEy= _dbe->book1D("METTask_CaloHaMEy","METTask_CaloHaMEy",500,-500,500);
358  hCaloHaMEy->setAxisTitle("HA MEy [GeV]",1);
359  hCaloHaEz= _dbe->book1D("METTask_CaloHaEz","METTask_CaloHaEz",500,-500,500);
360  hCaloHaEz->setAxisTitle("HA Ez [GeV]",1);
361  hCaloHaMET= _dbe->book1D("METTask_CaloHaMET","METTask_CaloHaMET",500,0,1000);
362  hCaloHaMET->setAxisTitle("HA MET [GeV]",1);
363  hCaloHaMETPhi= _dbe->book1D("METTask_CaloHaMETPhi","METTask_CaloHaMETPhi",80,-TMath::Pi(),TMath::Pi());
364  hCaloHaMETPhi->setAxisTitle("HA METPhi [rad]",1);
365  hCaloHaSumET= _dbe->book1D("METTask_CaloHaSumET","METTask_CaloHaSumET",500,0,2000);
366  hCaloHaSumET->setAxisTitle("HA SumET [GeV]",1);
367  }
368 
369  if (theCaloMETCollectionLabel.label() == "corMetGlobalMuons" ) {
370  hCalomuPt = _dbe->book1D("METTask_CalomuonPt", "METTask_CalomuonPt", 50, 0, 500);
371  hCalomuEta = _dbe->book1D("METTask_CalomuonEta", "METTask_CalomuonEta", 60, -3.0, 3.0);
372  hCalomuNhits = _dbe->book1D("METTask_CalomuonNhits", "METTask_CalomuonNhits", 50, 0, 50);
373  hCalomuChi2 = _dbe->book1D("METTask_CalomuonNormalizedChi2", "METTask_CalomuonNormalizedChi2", 20, 0, 20);
374  hCalomuD0 = _dbe->book1D("METTask_CalomuonD0", "METTask_CalomuonD0", 50, -1, 1);
375  hCaloMExCorrection = _dbe->book1D("METTask_CaloMExCorrection", "METTask_CaloMExCorrection", 100, -500.0,500.0);
376  hCaloMEyCorrection = _dbe->book1D("METTask_CaloMEyCorrection", "METTask_CaloMEyCorrection", 100, -500.0,500.0);
377  hCaloMuonCorrectionFlag = _dbe->book1D("METTask_CaloCorrectionFlag","METTask_CaloCorrectionFlag", 5, -0.5, 4.5);
378  }
379 
380 }
381 
382 // ***********************************************************
383 void CaloMETAnalyzer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup)
384 {
385  if ( _HighPtJetEventFlag->on() ) _HighPtJetEventFlag->initRun( iRun, iSetup );
386  if ( _LowPtJetEventFlag ->on() ) _LowPtJetEventFlag ->initRun( iRun, iSetup );
387  if ( _MinBiasEventFlag ->on() ) _MinBiasEventFlag ->initRun( iRun, iSetup );
388  if ( _HighMETEventFlag ->on() ) _HighMETEventFlag ->initRun( iRun, iSetup );
389  if ( _LowMETEventFlag ->on() ) _LowMETEventFlag ->initRun( iRun, iSetup );
390  if ( _EleEventFlag ->on() ) _EleEventFlag ->initRun( iRun, iSetup );
391  if ( _MuonEventFlag ->on() ) _MuonEventFlag ->initRun( iRun, iSetup );
392 
393 }
394 
395 // ***********************************************************
396 void CaloMETAnalyzer::endRun(const edm::Run& iRun, const edm::EventSetup& iSetup, DQMStore * dbe)
397 {
398 
399  //
400  //--- Check the time length of the Run from the lumi section plots
401 
402  std::string dirName = "JetMET/MET/"+_source+"/";
403  _dbe->setCurrentFolder(dirName);
404 
405  TH1F* tlumisec;
406 
407  MonitorElement *meLumiSec = _dbe->get("aaa");
408  meLumiSec = _dbe->get("JetMET/lumisec");
409 
410  int totlsec=0;
411  double totltime=0.;
412  if ( meLumiSec->getRootObject() ) {
413  tlumisec = meLumiSec->getTH1F();
414  for (int i=0; i<500; i++){
415  if (tlumisec->GetBinContent(i+1)) totlsec++;
416  }
417  totltime = double(totlsec*90); // one lumi sec ~ 90 (sec)
418  }
419 
420  if (totltime==0.) totltime=1.;
421 
422  //
423  //--- Make the integrated plots with rate (Hz)
424 
425  for (std::vector<std::string>::const_iterator ic = _FolderNames.begin(); ic != _FolderNames.end(); ic++)
426  {
427 
428  std::string DirName;
429  DirName = dirName+*ic;
430 
431  makeRatePlot(DirName,totltime);
432  if ( _HighPtJetEventFlag->on() )
433  makeRatePlot(DirName+"/"+"triggerName_HighJetPt",totltime);
434  if ( _LowPtJetEventFlag->on() )
435  makeRatePlot(DirName+"/"+"triggerName_LowJetPt",totltime);
436  if ( _MinBiasEventFlag->on() )
437  makeRatePlot(DirName+"/"+"triggerName_MinBias",totltime);
438  if ( _HighMETEventFlag->on() )
439  makeRatePlot(DirName+"/"+"triggerName_HighMET",totltime);
440  if ( _LowMETEventFlag->on() )
441  makeRatePlot(DirName+"/"+"triggerName_LowMET",totltime);
442  if ( _EleEventFlag->on() )
443  makeRatePlot(DirName+"/"+"triggerName_Ele",totltime);
444  if ( _MuonEventFlag->on() )
445  makeRatePlot(DirName+"/"+"triggerName_Muon",totltime);
446  }
447 
448 }
449 
450 // ***********************************************************
451 void CaloMETAnalyzer::makeRatePlot(std::string DirName, double totltime)
452 {
453 
454  _dbe->setCurrentFolder(DirName);
455  MonitorElement *meCaloMET = _dbe->get(DirName+"/"+"METTask_CaloMET");
456 
457  TH1F* tCaloMET;
458  TH1F* tCaloMETRate;
459 
460  if ( meCaloMET )
461  if ( meCaloMET->getRootObject() ) {
462  tCaloMET = meCaloMET->getTH1F();
463 
464  // Integral plot & convert number of events to rate (hz)
465  tCaloMETRate = (TH1F*) tCaloMET->Clone("METTask_CaloMETRate");
466  for (int i = tCaloMETRate->GetNbinsX()-1; i>=0; i--){
467  tCaloMETRate->SetBinContent(i+1,tCaloMETRate->GetBinContent(i+2)+tCaloMET->GetBinContent(i+1));
468  }
469  for (int i = 0; i<tCaloMETRate->GetNbinsX(); i++){
470  tCaloMETRate->SetBinContent(i+1,tCaloMETRate->GetBinContent(i+1)/double(totltime));
471  }
472 
473  tCaloMETRate->SetName("METTask_CaloMETRate");
474  tCaloMETRate->SetTitle("METTask_CaloMETRate");
475  hCaloMETRate = _dbe->book1D("METTask_CaloMETRate",tCaloMETRate);
476  hCaloMETRate->setAxisTitle("MET Threshold [GeV]",1);
477  }
478 }
479 
480 
481 // ***********************************************************
483  const edm::TriggerResults& triggerResults) {
484 
485  if (_verbose) std::cout << "CaloMETAnalyzer analyze" << std::endl;
486 
487  std::string DirName = "JetMET/MET/"+_source;
488 
489  if (_print){
490  std::cout << " " << std::endl;
491  std::cout << "Event = " << iEvent.id().event() << std::endl;
492  }
493 
494  LogTrace(metname)<<"[CaloMETAnalyzer] Analyze CaloMET";
495 
496  hmetME->Fill(1);
497 
498  // ==========================================================
499  // Trigger information
500  //
501  _trig_JetMB=0;
502  _trig_HighPtJet=0;
503  _trig_LowPtJet=0;
504  _trig_MinBias=0;
505  _trig_HighMET=0;
506  _trig_LowMET=0;
507  _trig_Ele=0;
508  _trig_Muon=0;
509  _trig_PhysDec=0;
510  if(&triggerResults) {
511 
513 
514  //
515  //
516  // Check how many HLT triggers are in triggerResults
517  int ntrigs = triggerResults.size();
518  if (_verbose) std::cout << "ntrigs=" << ntrigs << std::endl;
519 
520  //
521  //
522  // If index=ntrigs, this HLT trigger doesn't exist in the HLT table for this data.
523  const edm::TriggerNames & triggerNames = iEvent.triggerNames(triggerResults);
524 
525  //
526  //
527  // count number of requested Jet or MB HLT paths which have fired
528  for (unsigned int i=0; i!=HLTPathsJetMBByName_.size(); i++) {
529  unsigned int triggerIndex = triggerNames.triggerIndex(HLTPathsJetMBByName_[i]);
530  if (triggerIndex<triggerResults.size()) {
531  if (triggerResults.accept(triggerIndex)) {
532  _trig_JetMB++;
533  }
534  }
535  }
536  // for empty input vectors (n==0), take all HLT triggers!
537  if (HLTPathsJetMBByName_.size()==0) _trig_JetMB=triggerResults.size()-1;
538 
539  //
540  //if (_verbose) std::cout << "triggerNames size" << " " << triggerNames.size() << std::endl;
541  //if (_verbose) std::cout << _hlt_HighPtJet << " " << triggerNames.triggerIndex(_hlt_HighPtJet) << std::endl;
542  //if (_verbose) std::cout << _hlt_LowPtJet << " " << triggerNames.triggerIndex(_hlt_LowPtJet) << std::endl;
543  //if (_verbose) std::cout << _hlt_MinBias << " " << triggerNames.triggerIndex(_hlt_MinBias) << std::endl;
544  //if (_verbose) std::cout << _hlt_HighMET << " " << triggerNames.triggerIndex(_hlt_HighMET) << std::endl;
545  //if (_verbose) std::cout << _hlt_LowMET << " " << triggerNames.triggerIndex(_hlt_LowMET) << std::endl;
546  //if (_verbose) std::cout << _hlt_Ele << " " << triggerNames.triggerIndex(_hlt_Ele) << std::endl;
547  //if (_verbose) std::cout << _hlt_Muon << " " << triggerNames.triggerIndex(_hlt_Muon) << std::endl;
548  //if (_verbose) std::cout << _hlt_PhysDec << " " << triggerNames.triggerIndex(_hlt_PhysDec) << std::endl;
549 
550  if ( _HighPtJetEventFlag->on() && _HighPtJetEventFlag->accept( iEvent, iSetup ) )
551  _trig_HighPtJet=1;
552 
553  if ( _LowPtJetEventFlag->on() && _LowPtJetEventFlag->accept( iEvent, iSetup ) )
554  _trig_LowPtJet=1;
555 
556  if ( _MinBiasEventFlag->on() && _MinBiasEventFlag->accept( iEvent, iSetup ) )
557  _trig_MinBias=1;
558 
559  if ( _HighMETEventFlag->on() && _HighMETEventFlag->accept( iEvent, iSetup ) )
560  _trig_HighMET=1;
561 
562  if ( _LowMETEventFlag->on() && _LowMETEventFlag->accept( iEvent, iSetup ) )
563  _trig_LowMET=1;
564 
565  if ( _EleEventFlag->on() && _EleEventFlag->accept( iEvent, iSetup ) )
566  _trig_Ele=1;
567 
568  if ( _MuonEventFlag->on() && _MuonEventFlag->accept( iEvent, iSetup ) )
569  _trig_Muon=1;
570 
571  if (triggerNames.triggerIndex(_hlt_PhysDec) != triggerNames.size() &&
572  triggerResults.accept(triggerNames.triggerIndex(_hlt_PhysDec))) _trig_PhysDec=1;
573 
574  } else {
575 
576  edm::LogInfo("CaloMetAnalyzer") << "TriggerResults::HLT not found, "
577  "automatically select events";
578  //
579  // TriggerResults object not found. Look at all events.
580  _trig_JetMB=1;
581 
582  }
583 
584  // ==========================================================
585  // CaloMET information
586 
587  // **** Get the MET container
589  iEvent.getByLabel(theCaloMETCollectionLabel, calometcoll);
590 
591  if(!calometcoll.isValid()) {
592  std::cout<<"Unable to find MET results for CaloMET collection "<<theCaloMETCollectionLabel<<std::endl;
593  return;
594  }
595 
596  const reco::CaloMETCollection *calometcol = calometcoll.product();
597  const reco::CaloMET *calomet;
598  calomet = &(calometcol->front());
599 
600  LogTrace(metname)<<"[CaloMETAnalyzer] Call to the CaloMET analyzer";
601 
602  //Only for corMetGlobalMuons
603  if (theCaloMETCollectionLabel.label() == "corMetGlobalMuons" ) {
604 
605  iEvent.getByLabel("muonMETValueMapProducer" , "muCorrData", corMetGlobalMuons_ValueMap_Handle);
606  iEvent.getByLabel("muons", muon_h);
607  iEvent.getByLabel(inputBeamSpotLabel, beamSpot_h);
608 
609  if(!beamSpot_h.isValid()) edm::LogInfo("OutputInfo") << "falied to retrieve beam spot data require by MET Task";
610 
611  bspot = ( beamSpot_h.isValid() ) ? beamSpot_h->position() : math::XYZPoint(0, 0, 0);
612 
613  }
614 
615 
616  // ==========================================================
617  //
619  iEvent.getByLabel(HcalNoiseRBXCollectionTag,HRBXCollection);
620  if (!HRBXCollection.isValid()) {
621  LogDebug("") << "CaloMETAnalyzer: Could not find HcalNoiseRBX Collection" << std::endl;
622  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find HcalNoiseRBX Collection" << std::endl;
623  }
624 
625  edm::Handle<HcalNoiseSummary> HNoiseSummary;
626  iEvent.getByLabel(HcalNoiseSummaryTag,HNoiseSummary);
627  if (!HNoiseSummary.isValid()) {
628  LogDebug("") << "CaloMETAnalyzer: Could not find Hcal NoiseSummary product" << std::endl;
629  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find Hcal NoiseSummary product" << std::endl;
630  }
631 
633  iEvent.getByLabel(theJetCollectionLabel, caloJets);
634  if (!caloJets.isValid()) {
635  LogDebug("") << "CaloMETAnalyzer: Could not find jet product" << std::endl;
636  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find jet product" << std::endl;
637  }
638 
640  iEvent.getByLabel(theCaloTowersLabel, towers);
641  if (!towers.isValid()) {
642  LogDebug("") << "CaloMETAnalyzer: Could not find caltower product" << std::endl;
643  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find caltower product" << std::endl;
644  }
645 
646  // ==========================================================
647  // CaloMET sanity check
648 
649  if (_source=="CaloMET") validateMET(*calomet,towers);
650 
651  // ==========================================================
652 
653  if (_allhist) computeEmHaMET(towers);
654 
655  // ==========================================================
656  // JetID
657 
658  if (_verbose) std::cout << "JetID starts" << std::endl;
659 
660  //
661  // --- Minimal cuts
662  //
663  bool bJetIDMinimal=true;
664  int nj=0;
665  for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
666  cal!=caloJets->end(); ++cal){
667  jetID->calculate(iEvent, *cal);
668  if (_print && nj<=1) std::cout << "Jet pT = " << cal->pt() << " (GeV) "
669  << " eta = " << cal->eta() << " "
670  << " phi = " << cal->phi() << " "
671  << " emf = " << cal->emEnergyFraction() << std::endl;
672  nj++;
673  if (cal->pt()>10.){
674  if (fabs(cal->eta())<=2.6 &&
675  cal->emEnergyFraction()<=0.01) bJetIDMinimal=false;
676  }
677  }
678 
679  //
680  // --- Loose cuts
681  //
682  bool bJetIDLoose=true;
683  for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
684  cal!=caloJets->end(); ++cal){
685  jetID->calculate(iEvent, *cal);
686  if (_verbose) std::cout << jetID->n90Hits() << " "
687  << jetID->restrictedEMF() << " "
688  << cal->pt() << std::endl;
689  if (cal->pt()>10.){
690  //
691  // for all regions
692  if (jetID->n90Hits()<2) bJetIDLoose=false;
693  if (jetID->fHPD()>=0.98) bJetIDLoose=false;
694  //
695  // for non-forward
696  if (fabs(cal->eta())<2.55){
697  if (cal->emEnergyFraction()<=0.01) bJetIDLoose=false;
698  }
699  // for forward
700  else {
701  if (cal->emEnergyFraction()<=-0.9) bJetIDLoose=false;
702  if (cal->pt()>80.){
703  if (cal->emEnergyFraction()>= 1.0) bJetIDLoose=false;
704  }
705  } // forward vs non-forward
706  } // pt>10 GeV/c
707  } // calor-jets loop
708 
709  //
710  // --- Tight cuts
711  //
712  bool bJetIDTight=true;
713  bJetIDTight=bJetIDLoose;
714  for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
715  cal!=caloJets->end(); ++cal){
716  jetID->calculate(iEvent, *cal);
717  if (cal->pt()>25.){
718  //
719  // for all regions
720  if (jetID->fHPD()>=0.95) bJetIDTight=false;
721  //
722  // for 1.0<|eta|<1.75
723  if (fabs(cal->eta())>=1.00 && fabs(cal->eta())<1.75){
724  if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=false;
725  }
726  //
727  // for 1.75<|eta|<2.55
728  else if (fabs(cal->eta())>=1.75 && fabs(cal->eta())<2.55){
729  if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=false;
730  }
731  //
732  // for 2.55<|eta|<3.25
733  else if (fabs(cal->eta())>=2.55 && fabs(cal->eta())<3.25){
734  if (cal->pt()< 50. && cal->emEnergyFraction()<=-0.3) bJetIDTight=false;
735  if (cal->pt()>=50. && cal->pt()< 80. && cal->emEnergyFraction()<=-0.2) bJetIDTight=false;
736  if (cal->pt()>=80. && cal->pt()<340. && cal->emEnergyFraction()<=-0.1) bJetIDTight=false;
737  if (cal->pt()>=340. && cal->emEnergyFraction()<=-0.1
738  && cal->emEnergyFraction()>=0.95) bJetIDTight=false;
739  }
740  //
741  // for 3.25<|eta|
742  else if (fabs(cal->eta())>=3.25){
743  if (cal->pt()< 50. && cal->emEnergyFraction()<=-0.3
744  && cal->emEnergyFraction()>=0.90) bJetIDTight=false;
745  if (cal->pt()>=50. && cal->pt()<130. && cal->emEnergyFraction()<=-0.2
746  && cal->emEnergyFraction()>=0.80) bJetIDTight=false;
747  if (cal->pt()>=130. && cal->emEnergyFraction()<=-0.1
748  && cal->emEnergyFraction()>=0.70) bJetIDTight=false;
749  }
750  } // pt>10 GeV/c
751  } // calor-jets loop
752 
753  if (_verbose) std::cout << "JetID ends" << std::endl;
754 
755  // ==========================================================
756  // HCAL Noise filter
757 
758  bool bHcalNoiseFilter = HNoiseSummary->passLooseNoiseFilter();
759  bool bHcalNoiseFilterTight = HNoiseSummary->passTightNoiseFilter();
760 
761  if (_verbose) std::cout << "HcalNoiseFilter Summary ends" << std::endl;
762 
763  // ==========================================================
764  // Get BeamHaloSummary
765  edm::Handle<reco::BeamHaloSummary> TheBeamHaloSummary ;
766  iEvent.getByLabel(BeamHaloSummaryTag, TheBeamHaloSummary) ;
767 
768  bool bBeamHaloIDTightPass = true;
769  bool bBeamHaloIDLoosePass = true;
770 
771  if(TheBeamHaloSummary.isValid()) {
772 
773  const reco::BeamHaloSummary TheSummary = (*TheBeamHaloSummary.product() );
774 
775  // std::cout << TheSummary.EcalLooseHaloId() << " "
776  // << TheSummary.HcalLooseHaloId() << " "
777  // << TheSummary.CSCLooseHaloId() << " "
778  // << TheSummary.GlobalLooseHaloId() << std::endl;
779 
780  if( TheSummary.EcalLooseHaloId() || TheSummary.HcalLooseHaloId() ||
781  TheSummary.CSCLooseHaloId() || TheSummary.GlobalLooseHaloId() )
782  bBeamHaloIDLoosePass = false;
783 
784  if( TheSummary.EcalTightHaloId() || TheSummary.HcalTightHaloId() ||
785  TheSummary.CSCTightHaloId() || TheSummary.GlobalTightHaloId() )
786  bBeamHaloIDTightPass = false;
787 
788  }
789 
790  if (_verbose) std::cout << "BeamHaloSummary ends" << std::endl;
791 
792  // ==========================================================
793  //Vertex information
794 
795  bool bPrimaryVertex = true;
796  if(_doPVCheck){
797  bPrimaryVertex = false;
798  Handle<reco::VertexCollection> vertexHandle;
799 
800  iEvent.getByLabel(vertexTag, vertexHandle);
801 
802  if (!vertexHandle.isValid()) {
803  LogDebug("") << "CaloMETAnalyzer: Could not find vertex collection" << std::endl;
804  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find vertex collection" << std::endl;
805  }
806 
807  if ( vertexHandle.isValid() ){
808  reco::VertexCollection vertexCollection = *(vertexHandle.product());
809  int vertex_number = vertexCollection.size();
810  reco::VertexCollection::const_iterator v = vertexCollection.begin();
811  double vertex_chi2 = v->normalizedChi2();
812  double vertex_ndof = v->ndof();
813  bool fakeVtx = v->isFake();
814  double vertex_Z = v->z();
815 
816  if ( !fakeVtx
817  && vertex_number>=_nvtx_min
818  && vertex_ndof >_vtxndof_min
819  && vertex_chi2 <_vtxchi2_max
820  && fabs(vertex_Z)<_vtxz_max )
821  bPrimaryVertex = true;
822  }
823  }
824  // ==========================================================
825 
827  iEvent.getByLabel( gtTag, gtReadoutRecord);
828 
829  if (!gtReadoutRecord.isValid()) {
830  LogDebug("") << "CaloMETAnalyzer: Could not find GT readout record" << std::endl;
831  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find GT readout record product" << std::endl;
832  }
833 
834  bool bTechTriggers = true;
835  bool bTechTriggersAND = true;
836  bool bTechTriggersOR = false;
837  bool bTechTriggersNOT = false;
838 
839  if (gtReadoutRecord.isValid()) {
840  const TechnicalTriggerWord& technicalTriggerWordBeforeMask = gtReadoutRecord->technicalTriggerWord();
841 
842  if (_techTrigsAND.size() == 0)
843  bTechTriggersAND = true;
844  else
845  for (unsigned ttr = 0; ttr != _techTrigsAND.size(); ttr++) {
846  bTechTriggersAND = bTechTriggersAND && technicalTriggerWordBeforeMask.at(_techTrigsAND.at(ttr));
847  }
848 
849  if (_techTrigsAND.size() == 0)
850  bTechTriggersOR = true;
851  else
852  for (unsigned ttr = 0; ttr != _techTrigsOR.size(); ttr++) {
853  bTechTriggersOR = bTechTriggersOR || technicalTriggerWordBeforeMask.at(_techTrigsOR.at(ttr));
854  }
855  if (_techTrigsNOT.size() == 0)
856  bTechTriggersNOT = false;
857  else
858  for (unsigned ttr = 0; ttr != _techTrigsNOT.size(); ttr++) {
859  bTechTriggersNOT = bTechTriggersNOT || technicalTriggerWordBeforeMask.at(_techTrigsNOT.at(ttr));
860  }
861  }
862  else
863  {
864  bTechTriggersAND = true;
865  bTechTriggersOR = true;
866  bTechTriggersNOT = false;
867  }
868 
869  if (_techTrigsAND.size()==0)
870  bTechTriggersAND = true;
871  if (_techTrigsOR.size()==0)
872  bTechTriggersOR = true;
873  if (_techTrigsNOT.size()==0)
874  bTechTriggersNOT = false;
875 
876  bTechTriggers = bTechTriggersAND && bTechTriggersOR && !bTechTriggersNOT;
877 
878  // ==========================================================
879  // Reconstructed MET Information - fill MonitorElements
880 
881  bool bHcalNoise = bHcalNoiseFilter;
882  bool bBeamHaloID = bBeamHaloIDLoosePass;
883  bool bJetID = bJetIDMinimal;
884 
885  bool bPhysicsDeclared = true;
886  if(_doHLTPhysicsOn) bPhysicsDeclared =_trig_PhysDec;
887 
888  if (_tightHcalFiltering) bHcalNoise = bHcalNoiseFilterTight;
889  if (_tightBHFiltering) bBeamHaloID = bBeamHaloIDTightPass;
890 
891  if (_tightJetIDFiltering==1) bJetID = bJetIDMinimal;
892  else if (_tightJetIDFiltering==2) bJetID = bJetIDLoose;
893  else if (_tightJetIDFiltering==3) bJetID = bJetIDTight;
894  else if (_tightJetIDFiltering==-1) bJetID = true;
895 
896  bool bBasicCleanup = bTechTriggers && bPrimaryVertex && bPhysicsDeclared;
897  bool bExtraCleanup = bBasicCleanup && bHcalNoise && bJetID && bBeamHaloID;
898 
899  //std::string DirName = "JetMET/MET/"+_source;
900 
901  for (std::vector<std::string>::const_iterator ic = _FolderNames.begin();
902  ic != _FolderNames.end(); ic++){
903  if (*ic=="All") fillMESet(iEvent, DirName+"/"+*ic, *calomet);
904  if (DCSFilter->filter(iEvent, iSetup)) {
905  if (_cleanupSelection){
906  if (*ic=="BasicCleanup" && bBasicCleanup) fillMESet(iEvent, DirName+"/"+*ic, *calomet);
907  if (*ic=="ExtraCleanup" && bExtraCleanup) fillMESet(iEvent, DirName+"/"+*ic, *calomet);
908  }
909  if (_allSelection) {
910  if (*ic=="HcalNoiseFilter" && bHcalNoiseFilter ) fillMESet(iEvent, DirName+"/"+*ic, *calomet);
911  if (*ic=="HcalNoiseFilterTight" && bHcalNoiseFilterTight ) fillMESet(iEvent, DirName+"/"+*ic, *calomet);
912  if (*ic=="JetIDMinimal" && bJetIDMinimal) fillMESet(iEvent, DirName+"/"+*ic, *calomet);
913  if (*ic=="JetIDLoose" && bJetIDLoose) fillMESet(iEvent, DirName+"/"+*ic, *calomet);
914  if (*ic=="JetIDTight" && bJetIDTight) fillMESet(iEvent, DirName+"/"+*ic, *calomet);
915  if (*ic=="BeamHaloIDTightPass" && bBeamHaloIDTightPass) fillMESet(iEvent, DirName+"/"+*ic, *calomet);
916  if (*ic=="BeamHaloIDLoosePass" && bBeamHaloIDLoosePass) fillMESet(iEvent, DirName+"/"+*ic, *calomet);
917  if (*ic=="Triggers" && bTechTriggers) fillMESet(iEvent, DirName+"/"+*ic, *calomet);
918  if (*ic=="PV" && bPrimaryVertex) fillMESet(iEvent, DirName+"/"+*ic, *calomet);
919  }
920  } // DCS
921  }
922 }
923 
924 // ***********************************************************
926 {
927 
928  edm::View<reco::Candidate>::const_iterator towerCand = towers->begin();
929 
930  double sum_em_et = 0.0;
931  double sum_em_ex = 0.0;
932  double sum_em_ey = 0.0;
933  double sum_em_ez = 0.0;
934 
935  double sum_ha_et = 0.0;
936  double sum_ha_ex = 0.0;
937  double sum_ha_ey = 0.0;
938  double sum_ha_ez = 0.0;
939 
940  for ( ; towerCand != towers->end(); towerCand++)
941  {
942  const reco::Candidate* candidate = &(*towerCand);
943  if (candidate)
944  {
945  const CaloTower* calotower = dynamic_cast<const CaloTower*> (candidate);
946  if (calotower){
947  double Tower_ET = calotower->et();
948  if (Tower_ET>0.3) {
949 
950  double phi = candidate->phi();
951  double theta = candidate->theta();
952  //double e = candidate->energy();
953  double e_em = calotower->emEnergy();
954  double e_ha = calotower->hadEnergy();
955  double et_em = e_em*sin(theta);
956  double et_ha = e_ha*sin(theta);
957 
958  sum_em_ez += e_em*cos(theta);
959  sum_em_et += et_em;
960  sum_em_ex += et_em*cos(phi);
961  sum_em_ey += et_em*sin(phi);
962 
963  sum_ha_ez += e_ha*cos(theta);
964  sum_ha_et += et_ha;
965  sum_ha_ex += et_ha*cos(phi);
966  sum_ha_ey += et_ha*sin(phi);
967 
968  } // Et>0.5
969  } // calotower
970  } // candidate
971  } // loop
972 
973  //
974  _EmMEx = -sum_em_ex;
975  _EmMEy = -sum_em_ey;
976  _EmMET = pow(_EmMEx*_EmMEx+_EmMEy*_EmMEy,0.5);
977  _EmCaloEz = sum_em_ez;
978  _EmSumEt = sum_em_et;
979  _EmMetPhi = atan2( _EmMEy, _EmMEx );
980  //
981  _HaMEx = -sum_ha_ex;
982  _HaMEy = -sum_ha_ey;
983  _HaMET = pow(_HaMEx*_HaMEx+_HaMEy*_HaMEy,0.5);
984  _HaCaloEz = sum_ha_ez;
985  _HaSumEt = sum_ha_et;
986  _HaMetPhi = atan2( _HaMEy, _HaMEx );
987 
988 }
989 // ***********************************************************
992 {
993 
994  edm::View<reco::Candidate>::const_iterator towerCand = towers->begin();
995 
996  double sum_et = 0.0;
997  double sum_ex = 0.0;
998  double sum_ey = 0.0;
999  double sum_ez = 0.0;
1000 
1001  for ( ; towerCand != towers->end(); towerCand++)
1002  {
1003  const reco::Candidate* candidate = &(*towerCand);
1004  if (candidate)
1005  {
1006  const CaloTower* calotower = dynamic_cast<const CaloTower*> (candidate);
1007  if (calotower){
1008  double Tower_ET = calotower->et();
1009  if (Tower_ET>0.3) {
1010 
1011  double phi = candidate->phi();
1012  double theta = candidate->theta();
1013  double e = candidate->energy();
1014  double et = e*sin(theta);
1015  sum_ez += e*cos(theta);
1016  sum_et += et;
1017  sum_ex += et*cos(phi);
1018  sum_ey += et*sin(phi);
1019 
1020  } // Et>0.5
1021  } // calotower
1022  } // candidate
1023  } // loop
1024 
1025  double Mex = -sum_ex;
1026  double Mey = -sum_ey;
1027  //double Mez = -sum_ez;
1028  double Met = sqrt( sum_ex*sum_ex + sum_ey*sum_ey );
1029  double Sumet = sum_et;
1030  //double MetPhi = atan2( -sum_ey, -sum_ex ); // since MET is now a candidate,
1031 
1032  if (_verbose){
1033  if (Sumet!=calomet.sumEt() || Mex!=calomet.px() || Mey!=calomet.py() || Met!=calomet.pt() ){
1034  std::cout << _source << std::endl;
1035  std::cout << "SUMET" << Sumet << " METBlock" << calomet.sumEt() << std::endl;
1036  std::cout << "MEX" << Mex << " METBlock" << calomet.px() << std::endl;
1037  std::cout << "MEY" << Mey << " METBlock" << calomet.py() << std::endl;
1038  std::cout << "MET" << Met << " METBlock" << calomet.pt() << std::endl;
1039  }
1040  }
1041 
1042  if (_print){
1043  std::cout << "SUMET = " << calomet.sumEt() << " (GeV) "
1044  << "MEX" << calomet.px() << " (GeV) "
1045  << "MEY" << calomet.py() << " (GeV) "
1046  << "MET" << calomet.pt() << " (GeV) " << std::endl;
1047  }
1048 
1049 }
1050 
1051 // ***********************************************************
1053  const reco::CaloMET& calomet)
1054 {
1055 
1056  _dbe->setCurrentFolder(DirName);
1057 
1058  bool bLumiSecPlot=false;
1059  if (DirName.find("All")) bLumiSecPlot=true;
1060 
1061  if (_trig_JetMB) fillMonitorElement(iEvent,DirName,"",calomet, bLumiSecPlot);
1062  //if (_hlt_HighPtJet.size() && _trig_HighPtJet)
1063  if (_trig_HighPtJet)
1064  fillMonitorElement(iEvent,DirName,"HighPtJet",calomet,false);
1065  //if (_hlt_LowPtJet.size() && _trig_LowPtJet)
1066  if (_trig_LowPtJet)
1067  fillMonitorElement(iEvent,DirName,"LowPtJet",calomet,false);
1068  //if (_hlt_MinBias.size() && _trig_MinBias)
1069  if (_trig_MinBias)
1070  fillMonitorElement(iEvent,DirName,"MinBias",calomet,false);
1071  //if (_hlt_HighMET.size() && _trig_HighMET)
1072  if (_trig_HighMET)
1073  fillMonitorElement(iEvent,DirName,"HighMET",calomet,false);
1074  //if (_hlt_LowMET.size() && _trig_LowMET)
1075  if (_trig_LowMET)
1076  fillMonitorElement(iEvent,DirName,"LowMET",calomet,false);
1077  //if (_hlt_Ele.size() && _trig_Ele)
1078  if (_trig_Ele)
1079  fillMonitorElement(iEvent,DirName,"Ele",calomet,false);
1080  //if (_hlt_Muon.size() && _trig_Muon)
1081  if (_trig_Muon)
1082  fillMonitorElement(iEvent,DirName,"Muon",calomet,false);
1083 
1084 }
1085 
1086 // ***********************************************************
1088  std::string TriggerTypeName,
1089  const reco::CaloMET& calomet, bool bLumiSecPlot)
1090 {
1091 
1092  if (TriggerTypeName=="HighPtJet") {
1093  if (!selectHighPtJetEvent(iEvent)) return;
1094  }
1095  else if (TriggerTypeName=="LowPtJet") {
1096  if (!selectLowPtJetEvent(iEvent)) return;
1097  }
1098  else if (TriggerTypeName=="HighMET") {
1099  if (calomet.pt()<_highMETThreshold) return;
1100  }
1101  else if (TriggerTypeName=="LowMET") {
1102  if (calomet.pt()<_lowMETThreshold) return;
1103  }
1104  else if (TriggerTypeName=="Ele") {
1105  if (!selectWElectronEvent(iEvent)) return;
1106  }
1107  else if (TriggerTypeName=="Muon") {
1108  if (!selectWMuonEvent(iEvent)) return;
1109  }
1110 
1111  double caloSumET = calomet.sumEt();
1112  double caloMETSig = calomet.mEtSig();
1113  double caloEz = calomet.e_longitudinal();
1114  double caloMET = calomet.pt();
1115  double caloMEx = calomet.px();
1116  double caloMEy = calomet.py();
1117  double caloMETPhi = calomet.phi();
1118 
1119  if (_verbose) std::cout << _source << " " << caloMET << std::endl;
1120 
1121  double caloEtFractionHadronic = calomet.etFractionHadronic();
1122  double caloEmEtFraction = calomet.emEtFraction();
1123 
1124  double caloMaxEtInEMTowers = calomet.maxEtInEmTowers();
1125  double caloMaxEtInHadTowers = calomet.maxEtInHadTowers();
1126 
1127  double caloHadEtInHB = calomet.hadEtInHB();
1128  double caloHadEtInHO = calomet.hadEtInHO();
1129  double caloHadEtInHE = calomet.hadEtInHE();
1130  double caloHadEtInHF = calomet.hadEtInHF();
1131  double caloEmEtInEB = calomet.emEtInEB();
1132  double caloEmEtInEE = calomet.emEtInEE();
1133  double caloEmEtInHF = calomet.emEtInHF();
1134 
1135  //
1136  int myLuminosityBlock;
1137  // myLuminosityBlock = (evtCounter++)/1000;
1138  myLuminosityBlock = iEvent.luminosityBlock();
1139  //
1140 
1141  if (TriggerTypeName!="") DirName = DirName +"/"+TriggerTypeName;
1142 
1143  if (_verbose) std::cout << "_etThreshold = " << _etThreshold << std::endl;
1144  if (caloSumET>_etThreshold){
1145 
1146  hCaloMEx = _dbe->get(DirName+"/"+"METTask_CaloMEx"); if (hCaloMEx && hCaloMEx->getRootObject() ) hCaloMEx->Fill(caloMEx);
1147  hCaloMEy = _dbe->get(DirName+"/"+"METTask_CaloMEy"); if (hCaloMEy && hCaloMEy->getRootObject() ) hCaloMEy->Fill(caloMEy);
1148  hCaloMET = _dbe->get(DirName+"/"+"METTask_CaloMET"); if (hCaloMET && hCaloMET->getRootObject() ) hCaloMET->Fill(caloMET);
1149  hCaloMETPhi = _dbe->get(DirName+"/"+"METTask_CaloMETPhi"); if (hCaloMETPhi && hCaloMETPhi->getRootObject() ) hCaloMETPhi->Fill(caloMETPhi);
1150  hCaloSumET = _dbe->get(DirName+"/"+"METTask_CaloSumET"); if (hCaloSumET && hCaloSumET->getRootObject() ) hCaloSumET->Fill(caloSumET);
1151  hCaloMETSig = _dbe->get(DirName+"/"+"METTask_CaloMETSig"); if (hCaloMETSig && hCaloMETSig->getRootObject() ) hCaloMETSig->Fill(caloMETSig);
1152  hCaloEz = _dbe->get(DirName+"/"+"METTask_CaloEz"); if (hCaloEz && hCaloEz->getRootObject() ) hCaloEz->Fill(caloEz);
1153 
1154  hCaloMET_logx = _dbe->get(DirName+"/"+"METTask_CaloMET_logx"); if (hCaloMET_logx && hCaloMET_logx->getRootObject() ) hCaloMET_logx->Fill(log10(caloMET));
1155  hCaloSumET_logx = _dbe->get(DirName+"/"+"METTask_CaloSumET_logx"); if (hCaloSumET_logx && hCaloSumET_logx->getRootObject() ) hCaloSumET_logx->Fill(log10(caloSumET));
1156 
1157  hCaloMETIonFeedbck = _dbe->get(DirName+"/"+"METTask_CaloMETIonFeedbck"); if (hCaloMETIonFeedbck && hCaloMETIonFeedbck->getRootObject() ) hCaloMETIonFeedbck->Fill(caloMET);
1158  hCaloMETHPDNoise = _dbe->get(DirName+"/"+"METTask_CaloMETHPDNoise"); if (hCaloMETHPDNoise && hCaloMETHPDNoise->getRootObject() ) hCaloMETHPDNoise->Fill(caloMET);
1159 
1160  hCaloMETPhi002 = _dbe->get(DirName+"/"+"METTask_CaloMETPhi002"); if (caloMET> 2. && hCaloMETPhi002 && hCaloMETPhi002->getRootObject()) { hCaloMETPhi002->Fill(caloMETPhi);}
1161  hCaloMETPhi010 = _dbe->get(DirName+"/"+"METTask_CaloMETPhi010"); if (caloMET> 10. && hCaloMETPhi010 && hCaloMETPhi010->getRootObject()) { hCaloMETPhi010->Fill(caloMETPhi);}
1162  hCaloMETPhi020 = _dbe->get(DirName+"/"+"METTask_CaloMETPhi020"); if (caloMET> 20. && hCaloMETPhi020 && hCaloMETPhi020->getRootObject()) { hCaloMETPhi020->Fill(caloMETPhi);}
1163 
1164  if (_allhist){
1165  if (bLumiSecPlot){
1166  hCaloMExLS = _dbe->get(DirName+"/"+"METTask_CaloMExLS"); if (hCaloMExLS && hCaloMExLS->getRootObject()) hCaloMExLS->Fill(caloMEx,myLuminosityBlock);
1167  hCaloMEyLS = _dbe->get(DirName+"/"+"METTask_CaloMEyLS"); if (hCaloMEyLS && hCaloMEyLS->getRootObject()) hCaloMEyLS->Fill(caloMEy,myLuminosityBlock);
1168  }
1169 
1170  hCaloEtFractionHadronic = _dbe->get(DirName+"/"+"METTask_CaloEtFractionHadronic"); if (hCaloEtFractionHadronic && hCaloEtFractionHadronic->getRootObject()) hCaloEtFractionHadronic->Fill(caloEtFractionHadronic);
1171  hCaloEmEtFraction = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction"); if (hCaloEmEtFraction && hCaloEmEtFraction->getRootObject()) hCaloEmEtFraction->Fill(caloEmEtFraction);
1172 
1173  hCaloEmEtFraction002 = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction002"); if (caloMET> 2. && hCaloEmEtFraction002 && hCaloEmEtFraction002->getRootObject()) hCaloEmEtFraction002->Fill(caloEmEtFraction);
1174  hCaloEmEtFraction010 = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction010"); if (caloMET> 10. && hCaloEmEtFraction010 && hCaloEmEtFraction010->getRootObject()) hCaloEmEtFraction010->Fill(caloEmEtFraction);
1175  hCaloEmEtFraction020 = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction020"); if (caloMET> 20. && hCaloEmEtFraction020 && hCaloEmEtFraction020->getRootObject()) hCaloEmEtFraction020->Fill(caloEmEtFraction);
1176 
1177  hCaloMaxEtInEmTowers = _dbe->get(DirName+"/"+"METTask_CaloMaxEtInEmTowers"); if (hCaloMaxEtInEmTowers && hCaloMaxEtInEmTowers->getRootObject()) hCaloMaxEtInEmTowers->Fill(caloMaxEtInEMTowers);
1178  hCaloMaxEtInHadTowers = _dbe->get(DirName+"/"+"METTask_CaloMaxEtInHadTowers"); if (hCaloMaxEtInHadTowers && hCaloMaxEtInHadTowers->getRootObject()) hCaloMaxEtInHadTowers->Fill(caloMaxEtInHadTowers);
1179 
1180  hCaloHadEtInHB = _dbe->get(DirName+"/"+"METTask_CaloHadEtInHB"); if (hCaloHadEtInHB && hCaloHadEtInHB->getRootObject()) hCaloHadEtInHB->Fill(caloHadEtInHB);
1181  hCaloHadEtInHO = _dbe->get(DirName+"/"+"METTask_CaloHadEtInHO"); if (hCaloHadEtInHO && hCaloHadEtInHO->getRootObject()) hCaloHadEtInHO->Fill(caloHadEtInHO);
1182  hCaloHadEtInHE = _dbe->get(DirName+"/"+"METTask_CaloHadEtInHE"); if (hCaloHadEtInHE && hCaloHadEtInHE->getRootObject()) hCaloHadEtInHE->Fill(caloHadEtInHE);
1183  hCaloHadEtInHF = _dbe->get(DirName+"/"+"METTask_CaloHadEtInHF"); if (hCaloHadEtInHF && hCaloHadEtInHF->getRootObject()) hCaloHadEtInHF->Fill(caloHadEtInHF);
1184  hCaloEmEtInEB = _dbe->get(DirName+"/"+"METTask_CaloEmEtInEB"); if (hCaloEmEtInEB && hCaloEmEtInEB->getRootObject()) hCaloEmEtInEB->Fill(caloEmEtInEB);
1185  hCaloEmEtInEE = _dbe->get(DirName+"/"+"METTask_CaloEmEtInEE"); if (hCaloEmEtInEE && hCaloEmEtInEE->getRootObject()) hCaloEmEtInEE->Fill(caloEmEtInEE);
1186  hCaloEmEtInHF = _dbe->get(DirName+"/"+"METTask_CaloEmEtInHF"); if (hCaloEmEtInHF && hCaloEmEtInHF->getRootObject()) hCaloEmEtInHF->Fill(caloEmEtInHF);
1187 
1188  hCaloEmMEx = _dbe->get(DirName+"/"+"METTask_CaloEmMEx"); if (hCaloEmMEx && hCaloEmMEx->getRootObject()) hCaloEmMEx->Fill(_EmMEx);
1189  hCaloEmMEy = _dbe->get(DirName+"/"+"METTask_CaloEmMEy"); if (hCaloEmMEy && hCaloEmMEy->getRootObject()) hCaloEmMEy->Fill(_EmMEy);
1190  hCaloEmEz = _dbe->get(DirName+"/"+"METTask_CaloEmEz"); if (hCaloEmEz && hCaloEmEz->getRootObject()) hCaloEmEz->Fill(_EmCaloEz);
1191  hCaloEmMET = _dbe->get(DirName+"/"+"METTask_CaloEmMET"); if (hCaloEmMET && hCaloEmMET->getRootObject()) hCaloEmMET->Fill(_EmMET);
1192  hCaloEmMETPhi = _dbe->get(DirName+"/"+"METTask_CaloEmMETPhi"); if (hCaloEmMETPhi && hCaloEmMETPhi->getRootObject()) hCaloEmMETPhi->Fill(_EmMetPhi);
1193  hCaloEmSumET = _dbe->get(DirName+"/"+"METTask_CaloEmSumET"); if (hCaloEmSumET && hCaloEmSumET->getRootObject()) hCaloEmSumET->Fill(_EmSumEt);
1194 
1195  hCaloHaMEx = _dbe->get(DirName+"/"+"METTask_CaloHaMEx"); if (hCaloHaMEx && hCaloHaMEx->getRootObject()) hCaloHaMEx->Fill(_HaMEx);
1196  hCaloHaMEy = _dbe->get(DirName+"/"+"METTask_CaloHaMEy"); if (hCaloHaMEy && hCaloHaMEy->getRootObject()) hCaloHaMEy->Fill(_HaMEy);
1197  hCaloHaEz = _dbe->get(DirName+"/"+"METTask_CaloHaEz"); if (hCaloHaEz && hCaloHaEz->getRootObject()) hCaloHaEz->Fill(_HaCaloEz);
1198  hCaloHaMET = _dbe->get(DirName+"/"+"METTask_CaloHaMET"); if (hCaloHaMET && hCaloHaMET->getRootObject()) hCaloHaMET->Fill(_HaMET);
1199  hCaloHaMETPhi = _dbe->get(DirName+"/"+"METTask_CaloHaMETPhi"); if (hCaloHaMETPhi && hCaloHaMETPhi->getRootObject()) hCaloHaMETPhi->Fill(_HaMetPhi);
1200  hCaloHaSumET = _dbe->get(DirName+"/"+"METTask_CaloHaSumET"); if (hCaloHaSumET && hCaloHaSumET->getRootObject()) hCaloHaSumET->Fill(_HaSumEt);
1201 
1202  } // _allhist
1203 
1204  if (theCaloMETCollectionLabel.label() == "corMetGlobalMuons" ) {
1205 
1206  for( reco::MuonCollection::const_iterator muonit = muon_h->begin(); muonit != muon_h->end(); muonit++ ) {
1207  const reco::TrackRef siTrack = muonit->innerTrack();
1208  hCalomuPt = _dbe->get(DirName+"/"+"METTask_CalomuPt"); if (hCalomuPt && hCalomuPt->getRootObject()) hCalomuPt->Fill( muonit->p4().pt() );
1209  hCalomuEta = _dbe->get(DirName+"/"+"METTask_CalomuEta"); if (hCalomuEta && hCalomuEta->getRootObject()) hCalomuEta->Fill( muonit->p4().eta() );
1210  hCalomuNhits = _dbe->get(DirName+"/"+"METTask_CalomuNhits"); if (hCalomuNhits && hCalomuNhits->getRootObject()) hCalomuNhits->Fill( siTrack.isNonnull() ? siTrack->numberOfValidHits() : -999 );
1211  hCalomuChi2 = _dbe->get(DirName+"/"+"METTask_CalomuChi2"); if (hCalomuChi2 && hCalomuChi2->getRootObject()) hCalomuChi2->Fill( siTrack.isNonnull() ? siTrack->chi2()/siTrack->ndof() : -999 );
1212  double d0 = siTrack.isNonnull() ? -1 * siTrack->dxy( bspot) : -999;
1213  hCalomuD0 = _dbe->get(DirName+"/"+"METTask_CalomuD0"); if (hCalomuD0 && hCalomuD0->getRootObject()) hCalomuD0->Fill( d0 );
1214  }
1215 
1216  const unsigned int nMuons = muon_h->size();
1217  for( unsigned int mus = 0; mus < nMuons; mus++ ) {
1218  reco::MuonRef muref( muon_h, mus);
1219  reco::MuonMETCorrectionData muCorrData = (*corMetGlobalMuons_ValueMap_Handle)[muref];
1220  hCaloMExCorrection = _dbe->get(DirName+"/"+"METTask_CaloMExCorrection"); if (hCaloMExCorrection && hCaloMExCorrection->getRootObject()) hCaloMExCorrection-> Fill(muCorrData.corrY());
1221  hCaloMEyCorrection = _dbe->get(DirName+"/"+"METTask_CaloMEyCorrection"); if (hCaloMEyCorrection && hCaloMEyCorrection->getRootObject()) hCaloMEyCorrection-> Fill(muCorrData.corrX());
1222  hCaloMuonCorrectionFlag = _dbe->get(DirName+"/"+"METTask_CaloMuonCorrectionFlag"); if (hCaloMuonCorrectionFlag && hCaloMuonCorrectionFlag->getRootObject()) hCaloMuonCorrectionFlag-> Fill(muCorrData.type());
1223  }
1224  }
1225  } // et threshold cut
1226 
1227 }
1228 
1229 // ***********************************************************
1231 
1232  bool return_value=false;
1233 
1235  iEvent.getByLabel(theJetCollectionLabel, caloJets);
1236  if (!caloJets.isValid()) {
1237  LogDebug("") << "CaloMETAnalyzer: Could not find jet product" << std::endl;
1238  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find jet product" << std::endl;
1239  }
1240 
1241  for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
1242  cal!=caloJets->end(); ++cal){
1243  if (cal->pt()>_highPtJetThreshold){
1244  return_value=true;
1245  }
1246  }
1247 
1248  return return_value;
1249 
1250 }
1251 
1252 // ***********************************************************
1254 
1255  bool return_value=false;
1256 
1258  iEvent.getByLabel(theJetCollectionLabel, caloJets);
1259  if (!caloJets.isValid()) {
1260  LogDebug("") << "CaloMETAnalyzer: Could not find jet product" << std::endl;
1261  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find jet product" << std::endl;
1262  }
1263 
1264  for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
1265  cal!=caloJets->end(); ++cal){
1266  if (cal->pt()>_lowPtJetThreshold){
1267  return_value=true;
1268  }
1269  }
1270 
1271  return return_value;
1272 
1273 }
1274 
1275 // ***********************************************************
1277 
1278  bool return_value=true;
1279 
1280  /*
1281  W-electron event selection comes here
1282  */
1283 
1284  return return_value;
1285 
1286 }
1287 
1288 // ***********************************************************
1290 
1291  bool return_value=true;
1292 
1293  /*
1294  W-muon event selection comes here
1295  */
1296 
1297  return return_value;
1298 
1299 }
1300 
#define LogDebug(id)
const double Pi
const bool EcalTightHaloId() const
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
double e_longitudinal() const
Definition: MET.h:55
int i
Definition: DBlmapReader.cc:9
double hadEtInHE() const
Definition: CaloMET.h:51
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:208
virtual double energy() const =0
energy
bool selectLowPtJetEvent(const edm::Event &)
double hadEtInHF() const
Definition: CaloMET.h:53
const bool HcalTightHaloId() const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:519
const bool GlobalLooseHaloId() const
void endJob()
Finish up a job.
tuple d0
Definition: debug_cff.py:3
const std::string metname
void fillMESet(const edm::Event &, std::string, const reco::CaloMET &)
bool selectWElectronEvent(const edm::Event &)
double maxEtInHadTowers() const
Definition: CaloMET.h:40
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
bool accept() const
Has at least one path accepted the event?
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
Geom::Theta< T > theta() const
void computeEmHaMET(edm::Handle< edm::View< reco::Candidate > >)
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
Strings::size_type size() const
Definition: TriggerNames.cc:39
const bool GlobalTightHaloId() const
double maxEtInEmTowers() const
Definition: CaloMET.h:38
void bookMonitorElement(std::string, bool)
const bool HcalLooseHaloId() const
const bool CSCTightHaloId() const
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:248
double mEtSig() const
Definition: MET.h:50
int iEvent
Definition: GenABIO.cc:243
double sumEt() const
Definition: MET.h:48
bool selectWMuonEvent(const edm::Event &)
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:32
double emEnergy() const
Definition: CaloTower.h:79
virtual double theta() const =0
momentum polar angle
void makeRatePlot(std::string, double)
T sqrt(T t)
Definition: SSEVec.h:28
unsigned int size() const
Get number of paths stored.
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
double emEtInEB() const
Definition: CaloMET.h:55
void fillMonitorElement(const edm::Event &, std::string, std::string, const reco::CaloMET &, bool)
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
#define LogTrace(id)
CaloMETAnalyzer(const edm::ParameterSet &)
Constructor.
double hadEtInHO() const
Definition: CaloMET.h:49
double hadEnergy() const
Definition: CaloTower.h:80
TObject * getRootObject(void) const
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
bool selectHighPtJetEvent(const edm::Event &)
double etFractionHadronic() const
Definition: CaloMET.h:42
void beginRun(const edm::Run &, const edm::EventSetup &)
Initialize run-based parameters.
virtual double px() const
x coordinate of momentum vector
virtual double pt() const
transverse momentum
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
TH1F * getTH1F(void) const
T const * product() const
Definition: Handle.h:74
void validateMET(const reco::CaloMET &, edm::Handle< edm::View< reco::Candidate > >)
double emEtInEE() const
Definition: CaloMET.h:57
virtual ~CaloMETAnalyzer()
Destructor.
const bool CSCLooseHaloId() const
edm::EventID id() const
Definition: EventBase.h:56
double emEtInHF() const
Definition: CaloMET.h:59
tuple cout
Definition: gather_cfg.py:41
double et(double vtxZ) const
Definition: CaloTower.h:101
const_iterator end() const
void endRun(const edm::Run &iRun, const edm::EventSetup &iSetup, DQMStore *dbe)
Finish up a run.
void bookMESet(std::string)
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:239
virtual double phi() const
momentum azimuthal angle
void analyze(const edm::Event &, const edm::EventSetup &, const edm::TriggerResults &)
Get the analysis.
const bool EcalLooseHaloId() const
double hadEtInHB() const
Definition: CaloMET.h:47
mathSSE::Vec4< T > v
virtual double py() const
y coordinate of momentum vector
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
double emEtFraction() const
Definition: CaloMET.h:45
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
Definition: Run.h:31
virtual double phi() const =0
momentum azimuthal angle
Definition: DDAxes.h:10