27 #include "TLorentzVector.h"
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");
68 delete _HighPtJetEventFlag;
69 delete _LowPtJetEventFlag;
70 delete _MinBiasEventFlag;
71 delete _HighMETEventFlag;
72 delete _LowMETEventFlag;
74 delete _MuonEventFlag;
85 HLTPathsJetMBByName_ =
parameters.getParameter<std::vector<std::string > >(
"HLTPathsJetMB");
99 _techTrigsAND = theCleaningParameters.getParameter<std::vector<unsigned > >(
"techTrigsAND");
100 _techTrigsOR = theCleaningParameters.getParameter<std::vector<unsigned > >(
"techTrigsOR");
101 _techTrigsNOT = theCleaningParameters.getParameter<std::vector<unsigned > >(
"techTrigsNOT");
103 _doHLTPhysicsOn = theCleaningParameters.getParameter<
bool>(
"doHLTPhysicsOn");
104 _hlt_PhysDec = theCleaningParameters.getParameter<std::string>(
"HLT_PhysDec");
106 _tightBHFiltering = theCleaningParameters.getParameter<
bool>(
"tightBHFiltering");
107 _tightJetIDFiltering = theCleaningParameters.getParameter<
int>(
"tightJetIDFiltering");
108 _tightHcalFiltering = theCleaningParameters.getParameter<
bool>(
"tightHcalFiltering");
116 _doPVCheck = theCleaningParameters.getParameter<
bool>(
"doPrimaryVertexCheck");
117 vertexTag = theCleaningParameters.getParameter<
edm::InputTag>(
"vertexLabel");
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");
130 _source =
parameters.getParameter<std::string>(
"Source");
132 if (theCaloMETCollectionLabel.label() ==
"corMetGlobalMuons" ) {
144 _verbose =
parameters.getParameter<
int>(
"verbose");
145 _print =
parameters.getParameter<
int>(
"printOut");
146 _etThreshold =
parameters.getParameter<
double>(
"etThreshold");
147 _allhist =
parameters.getParameter<
bool>(
"allHist");
148 _allSelection=
parameters.getParameter<
bool>(
"allSelection");
149 _cleanupSelection=
parameters.getParameter<
bool>(
"cleanupSelection");
151 _highPtJetThreshold =
parameters.getParameter<
double>(
"HighPtJetThreshold");
152 _lowPtJetThreshold =
parameters.getParameter<
double>(
"LowPtJetThreshold");
153 _highMETThreshold =
parameters.getParameter<
double>(
"HighMETThreshold");
154 _lowMETThreshold =
parameters.getParameter<
double>(
"LowMETThreshold");
161 std::string
DirName =
"JetMET/MET/"+_source;
164 hmetME = dbe->
book1D(
"metReco",
"metReco", 4, 1, 5);
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");
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);
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);
216 bool bLumiSecPlot=
false;
217 if (DirName.find(
"All")!=std::string::npos) bLumiSecPlot=
true;
219 bookMonitorElement(DirName,bLumiSecPlot);
221 if ( _HighPtJetEventFlag->on() ) {
222 bookMonitorElement(DirName+
"/"+
"HighPtJet",
false);
223 hTriggerName_HighPtJet = _dbe->bookString(
"triggerName_HighPtJet", _hlt_HighPtJet);
226 if ( _LowPtJetEventFlag->on() ) {
227 bookMonitorElement(DirName+
"/"+
"LowPtJet",
false);
228 hTriggerName_LowPtJet = _dbe->bookString(
"triggerName_LowPtJet", _hlt_LowPtJet);
231 if ( _MinBiasEventFlag->on() ) {
232 bookMonitorElement(DirName+
"/"+
"MinBias",
false);
233 hTriggerName_MinBias = _dbe->bookString(
"triggerName_MinBias", _hlt_MinBias);
236 if ( _HighMETEventFlag->on() ) {
237 bookMonitorElement(DirName+
"/"+
"HighMET",
false);
238 hTriggerName_HighMET = _dbe->bookString(
"triggerName_HighMET", _hlt_HighMET);
241 if ( _LowMETEventFlag->on() ) {
242 bookMonitorElement(DirName+
"/"+
"LowMET",
false);
243 hTriggerName_LowMET = _dbe->bookString(
"triggerName_LowMET", _hlt_LowMET);
246 if ( _EleEventFlag->on() ) {
247 bookMonitorElement(DirName+
"/"+
"Ele",
false);
248 hTriggerName_Ele = _dbe->bookString(
"triggerName_Ele", _hlt_Ele);
251 if ( _MuonEventFlag->on() ) {
252 bookMonitorElement(DirName+
"/"+
"Muon",
false);
253 hTriggerName_Muon = _dbe->bookString(
"triggerName_Muon", _hlt_Muon);
261 if (_verbose)
std::cout <<
"bookMonitorElement " << DirName << std::endl;
262 _dbe->setCurrentFolder(DirName);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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 );
402 std::string
dirName =
"JetMET/MET/"+_source+
"/";
403 _dbe->setCurrentFolder(dirName);
408 meLumiSec = _dbe->get(
"JetMET/lumisec");
413 tlumisec = meLumiSec->
getTH1F();
414 for (
int i=0;
i<500;
i++){
415 if (tlumisec->GetBinContent(
i+1)) totlsec++;
417 totltime = double(totlsec*90);
420 if (totltime==0.) totltime=1.;
425 for (std::vector<std::string>::const_iterator ic = _FolderNames.begin(); ic != _FolderNames.end(); ic++)
429 DirName = dirName+*ic;
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);
454 _dbe->setCurrentFolder(DirName);
455 MonitorElement *meCaloMET = _dbe->get(DirName+
"/"+
"METTask_CaloMET");
462 tCaloMET = meCaloMET->
getTH1F();
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));
469 for (
int i = 0;
i<tCaloMETRate->GetNbinsX();
i++){
470 tCaloMETRate->SetBinContent(
i+1,tCaloMETRate->GetBinContent(
i+1)/double(totltime));
473 tCaloMETRate->SetName(
"METTask_CaloMETRate");
474 tCaloMETRate->SetTitle(
"METTask_CaloMETRate");
475 hCaloMETRate = _dbe->book1D(
"METTask_CaloMETRate",tCaloMETRate);
476 hCaloMETRate->setAxisTitle(
"MET Threshold [GeV]",1);
485 if (_verbose)
std::cout <<
"CaloMETAnalyzer analyze" << std::endl;
487 std::string
DirName =
"JetMET/MET/"+_source;
510 if(&triggerResults) {
517 int ntrigs = triggerResults.
size();
518 if (_verbose)
std::cout <<
"ntrigs=" << ntrigs << std::endl;
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)) {
537 if (HLTPathsJetMBByName_.size()==0) _trig_JetMB=triggerResults.
size()-1;
550 if ( _HighPtJetEventFlag->on() && _HighPtJetEventFlag->accept( iEvent, iSetup ) )
553 if ( _LowPtJetEventFlag->on() && _LowPtJetEventFlag->accept( iEvent, iSetup ) )
556 if ( _MinBiasEventFlag->on() && _MinBiasEventFlag->accept( iEvent, iSetup ) )
559 if ( _HighMETEventFlag->on() && _HighMETEventFlag->accept( iEvent, iSetup ) )
562 if ( _LowMETEventFlag->on() && _LowMETEventFlag->accept( iEvent, iSetup ) )
565 if ( _EleEventFlag->on() && _EleEventFlag->accept( iEvent, iSetup ) )
568 if ( _MuonEventFlag->on() && _MuonEventFlag->accept( iEvent, iSetup ) )
576 edm::LogInfo(
"CaloMetAnalyzer") <<
"TriggerResults::HLT not found, "
577 "automatically select events";
589 iEvent.
getByLabel(theCaloMETCollectionLabel, calometcoll);
592 std::cout<<
"Unable to find MET results for CaloMET collection "<<theCaloMETCollectionLabel<<std::endl;
598 calomet = &(calometcol->front());
603 if (theCaloMETCollectionLabel.label() ==
"corMetGlobalMuons" ) {
605 iEvent.
getByLabel(
"muonMETValueMapProducer" ,
"muCorrData", corMetGlobalMuons_ValueMap_Handle);
607 iEvent.
getByLabel(inputBeamSpotLabel, beamSpot_h);
609 if(!beamSpot_h.isValid())
edm::LogInfo(
"OutputInfo") <<
"falied to retrieve beam spot data require by MET Task";
611 bspot = ( beamSpot_h.isValid() ) ? beamSpot_h->position() :
math::XYZPoint(0, 0, 0);
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;
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;
633 iEvent.
getByLabel(theJetCollectionLabel, caloJets);
635 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find jet product" << std::endl;
636 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find jet product" << std::endl;
640 iEvent.
getByLabel(theCaloTowersLabel, towers);
642 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find caltower product" << std::endl;
643 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find caltower product" << std::endl;
649 if (_source==
"CaloMET") validateMET(*calomet,towers);
653 if (_allhist) computeEmHaMET(towers);
658 if (_verbose)
std::cout <<
"JetID starts" << std::endl;
663 bool bJetIDMinimal=
true;
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;
674 if (fabs(cal->eta())<=2.6 &&
675 cal->emEnergyFraction()<=0.01) bJetIDMinimal=
false;
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;
692 if (jetID->n90Hits()<2) bJetIDLoose=
false;
693 if (jetID->fHPD()>=0.98) bJetIDLoose=
false;
696 if (fabs(cal->eta())<2.55){
697 if (cal->emEnergyFraction()<=0.01) bJetIDLoose=
false;
701 if (cal->emEnergyFraction()<=-0.9) bJetIDLoose=
false;
703 if (cal->emEnergyFraction()>= 1.0) bJetIDLoose=
false;
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);
720 if (jetID->fHPD()>=0.95) bJetIDTight=
false;
723 if (fabs(cal->eta())>=1.00 && fabs(cal->eta())<1.75){
724 if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=
false;
728 else if (fabs(cal->eta())>=1.75 && fabs(cal->eta())<2.55){
729 if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=
false;
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;
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;
753 if (_verbose)
std::cout <<
"JetID ends" << std::endl;
758 bool bHcalNoiseFilter = HNoiseSummary->passLooseNoiseFilter();
759 bool bHcalNoiseFilterTight = HNoiseSummary->passTightNoiseFilter();
761 if (_verbose)
std::cout <<
"HcalNoiseFilter Summary ends" << std::endl;
766 iEvent.
getByLabel(BeamHaloSummaryTag, TheBeamHaloSummary) ;
768 bool bBeamHaloIDTightPass =
true;
769 bool bBeamHaloIDLoosePass =
true;
771 if(TheBeamHaloSummary.
isValid()) {
782 bBeamHaloIDLoosePass =
false;
786 bBeamHaloIDTightPass =
false;
790 if (_verbose)
std::cout <<
"BeamHaloSummary ends" << std::endl;
795 bool bPrimaryVertex =
true;
797 bPrimaryVertex =
false;
803 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find vertex collection" << std::endl;
804 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find vertex collection" << std::endl;
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();
817 && vertex_number>=_nvtx_min
818 && vertex_ndof >_vtxndof_min
819 && vertex_chi2 <_vtxchi2_max
820 && fabs(vertex_Z)<_vtxz_max )
821 bPrimaryVertex =
true;
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;
834 bool bTechTriggers =
true;
835 bool bTechTriggersAND =
true;
836 bool bTechTriggersOR =
false;
837 bool bTechTriggersNOT =
false;
839 if (gtReadoutRecord.
isValid()) {
840 const TechnicalTriggerWord& technicalTriggerWordBeforeMask = gtReadoutRecord->technicalTriggerWord();
842 if (_techTrigsAND.size() == 0)
843 bTechTriggersAND =
true;
845 for (
unsigned ttr = 0; ttr != _techTrigsAND.size(); ttr++) {
846 bTechTriggersAND = bTechTriggersAND && technicalTriggerWordBeforeMask.at(_techTrigsAND.at(ttr));
849 if (_techTrigsAND.size() == 0)
850 bTechTriggersOR =
true;
852 for (
unsigned ttr = 0; ttr != _techTrigsOR.size(); ttr++) {
853 bTechTriggersOR = bTechTriggersOR || technicalTriggerWordBeforeMask.at(_techTrigsOR.at(ttr));
855 if (_techTrigsNOT.size() == 0)
856 bTechTriggersNOT =
false;
858 for (
unsigned ttr = 0; ttr != _techTrigsNOT.size(); ttr++) {
859 bTechTriggersNOT = bTechTriggersNOT || technicalTriggerWordBeforeMask.at(_techTrigsNOT.at(ttr));
864 bTechTriggersAND =
true;
865 bTechTriggersOR =
true;
866 bTechTriggersNOT =
false;
869 if (_techTrigsAND.size()==0)
870 bTechTriggersAND =
true;
871 if (_techTrigsOR.size()==0)
872 bTechTriggersOR =
true;
873 if (_techTrigsNOT.size()==0)
874 bTechTriggersNOT =
false;
876 bTechTriggers = bTechTriggersAND && bTechTriggersOR && !bTechTriggersNOT;
881 bool bHcalNoise = bHcalNoiseFilter;
882 bool bBeamHaloID = bBeamHaloIDLoosePass;
883 bool bJetID = bJetIDMinimal;
885 bool bPhysicsDeclared =
true;
886 if(_doHLTPhysicsOn) bPhysicsDeclared =_trig_PhysDec;
888 if (_tightHcalFiltering) bHcalNoise = bHcalNoiseFilterTight;
889 if (_tightBHFiltering) bBeamHaloID = bBeamHaloIDTightPass;
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;
896 bool bBasicCleanup = bTechTriggers && bPrimaryVertex && bPhysicsDeclared;
897 bool bExtraCleanup = bBasicCleanup && bHcalNoise && bJetID && bBeamHaloID;
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);
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);
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;
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;
940 for ( ; towerCand != towers->
end(); towerCand++)
947 double Tower_ET = calotower->
et();
950 double phi = candidate->
phi();
953 double e_em = calotower->
emEnergy();
955 double et_em = e_em*
sin(theta);
956 double et_ha = e_ha*
sin(theta);
958 sum_em_ez += e_em*
cos(theta);
960 sum_em_ex += et_em*
cos(phi);
961 sum_em_ey += et_em*
sin(phi);
963 sum_ha_ez += e_ha*
cos(theta);
965 sum_ha_ex += et_ha*
cos(phi);
966 sum_ha_ey += et_ha*
sin(phi);
976 _EmMET =
pow(_EmMEx*_EmMEx+_EmMEy*_EmMEy,0.5);
977 _EmCaloEz = sum_em_ez;
978 _EmSumEt = sum_em_et;
979 _EmMetPhi = atan2( _EmMEy, _EmMEx );
983 _HaMET =
pow(_HaMEx*_HaMEx+_HaMEy*_HaMEy,0.5);
984 _HaCaloEz = sum_ha_ez;
985 _HaSumEt = sum_ha_et;
986 _HaMetPhi = atan2( _HaMEy, _HaMEx );
1001 for ( ; towerCand != towers->
end(); towerCand++)
1008 double Tower_ET = calotower->
et();
1011 double phi = candidate->
phi();
1013 double e = candidate->
energy();
1014 double et = e*
sin(theta);
1015 sum_ez += e*
cos(theta);
1017 sum_ex += et*
cos(phi);
1018 sum_ey += et*
sin(phi);
1025 double Mex = -sum_ex;
1026 double Mey = -sum_ey;
1028 double Met =
sqrt( sum_ex*sum_ex + sum_ey*sum_ey );
1029 double Sumet = sum_et;
1033 if (Sumet!=calomet.
sumEt() || Mex!=calomet.
px() || Mey!=calomet.
py() || Met!=calomet.
pt() ){
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;
1044 <<
"MEX" << calomet.
px() <<
" (GeV) "
1045 <<
"MEY" << calomet.
py() <<
" (GeV) "
1046 <<
"MET" << calomet.
pt() <<
" (GeV) " << std::endl;
1056 _dbe->setCurrentFolder(DirName);
1058 bool bLumiSecPlot=
false;
1059 if (DirName.find(
"All")) bLumiSecPlot=
true;
1061 if (_trig_JetMB) fillMonitorElement(iEvent,DirName,
"",calomet, bLumiSecPlot);
1063 if (_trig_HighPtJet)
1064 fillMonitorElement(iEvent,DirName,
"HighPtJet",calomet,
false);
1067 fillMonitorElement(iEvent,DirName,
"LowPtJet",calomet,
false);
1070 fillMonitorElement(iEvent,DirName,
"MinBias",calomet,
false);
1073 fillMonitorElement(iEvent,DirName,
"HighMET",calomet,
false);
1076 fillMonitorElement(iEvent,DirName,
"LowMET",calomet,
false);
1079 fillMonitorElement(iEvent,DirName,
"Ele",calomet,
false);
1082 fillMonitorElement(iEvent,DirName,
"Muon",calomet,
false);
1088 std::string TriggerTypeName,
1092 if (TriggerTypeName==
"HighPtJet") {
1093 if (!selectHighPtJetEvent(iEvent))
return;
1095 else if (TriggerTypeName==
"LowPtJet") {
1096 if (!selectLowPtJetEvent(iEvent))
return;
1098 else if (TriggerTypeName==
"HighMET") {
1099 if (calomet.
pt()<_highMETThreshold)
return;
1101 else if (TriggerTypeName==
"LowMET") {
1102 if (calomet.
pt()<_lowMETThreshold)
return;
1104 else if (TriggerTypeName==
"Ele") {
1105 if (!selectWElectronEvent(iEvent))
return;
1107 else if (TriggerTypeName==
"Muon") {
1108 if (!selectWMuonEvent(iEvent))
return;
1111 double caloSumET = calomet.
sumEt();
1112 double caloMETSig = calomet.
mEtSig();
1114 double caloMET = calomet.
pt();
1115 double caloMEx = calomet.
px();
1116 double caloMEy = calomet.
py();
1117 double caloMETPhi = calomet.
phi();
1119 if (_verbose)
std::cout << _source <<
" " << caloMET << std::endl;
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();
1136 int myLuminosityBlock;
1141 if (TriggerTypeName!=
"") DirName = DirName +
"/"+TriggerTypeName;
1143 if (_verbose)
std::cout <<
"_etThreshold = " << _etThreshold << std::endl;
1144 if (caloSumET>_etThreshold){
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);
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));
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);
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);}
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);
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);
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);
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);
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);
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);
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);
1204 if (theCaloMETCollectionLabel.label() ==
"corMetGlobalMuons" ) {
1206 for( reco::MuonCollection::const_iterator muonit = muon_h->begin(); muonit != muon_h->end(); muonit++ ) {
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 );
1216 const unsigned int nMuons = muon_h->size();
1217 for(
unsigned int mus = 0; mus < nMuons; mus++ ) {
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());
1232 bool return_value=
false;
1235 iEvent.
getByLabel(theJetCollectionLabel, caloJets);
1237 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find jet product" << std::endl;
1238 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find jet product" << std::endl;
1241 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
1242 cal!=caloJets->end(); ++cal){
1243 if (cal->pt()>_highPtJetThreshold){
1248 return return_value;
1255 bool return_value=
false;
1258 iEvent.
getByLabel(theJetCollectionLabel, caloJets);
1260 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find jet product" << std::endl;
1261 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find jet product" << std::endl;
1264 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
1265 cal!=caloJets->end(); ++cal){
1266 if (cal->pt()>_lowPtJetThreshold){
1271 return return_value;
1278 bool return_value=
true;
1284 return return_value;
1291 bool return_value=
true;
1297 return return_value;
const bool EcalTightHaloId() const
T getParameter(std::string const &) const
EventNumber_t event() const
double e_longitudinal() const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
virtual double energy() const =0
energy
const bool HcalTightHaloId() const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
const bool GlobalLooseHaloId() const
const std::string metname
double maxEtInHadTowers() const
Sin< T >::type sin(const T &t)
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
std::vector< Vertex > VertexCollection
collection of Vertex objects
Geom::Theta< T > theta() const
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
Strings::size_type size() const
const bool GlobalTightHaloId() const
double maxEtInEmTowers() const
const bool HcalLooseHaloId() const
const bool CSCTightHaloId() const
bool isNonnull() const
Checks for non-null.
unsigned int triggerIndex(std::string const &name) const
virtual double theta() const =0
momentum polar angle
unsigned int size() const
Get number of paths stored.
Cos< T >::type cos(const T &t)
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
TObject * getRootObject(void) const
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
double etFractionHadronic() const
virtual double px() const
x coordinate of momentum vector
virtual double pt() const
transverse momentum
XYZPointD XYZPoint
point in space with cartesian internal representation
TH1F * getTH1F(void) const
T const * product() const
const bool CSCLooseHaloId() const
double et(double vtxZ) const
const_iterator end() const
T const * get() const
Returns C++ pointer to the item.
virtual double phi() const
momentum azimuthal angle
const bool EcalLooseHaloId() const
virtual double py() const
y coordinate of momentum vector
Power< A, B >::type pow(const A &a, const B &b)
double emEtFraction() const
void setCurrentFolder(const std::string &fullpath)
virtual double phi() const =0
momentum azimuthal angle