25 #include "TLorentzVector.h"
52 highPtJetExpr_ = highptjetparms.
getParameter<std::vector<std::string> >(
"hltPaths");
53 lowPtJetExpr_ = lowptjetparms .getParameter<std::vector<std::string> >(
"hltPaths");
54 highMETExpr_ = highmetparms .getParameter<std::vector<std::string> >(
"hltPaths");
56 muonExpr_ = muonparms .getParameter<std::vector<std::string> >(
"hltPaths");
57 elecExpr_ = eleparms .getParameter<std::vector<std::string> >(
"hltPaths");
58 minbiasExpr_ = minbiasparms .getParameter<std::vector<std::string> >(
"hltPaths");
65 delete _HighPtJetEventFlag;
66 delete _LowPtJetEventFlag;
67 delete _MinBiasEventFlag;
68 delete _HighMETEventFlag;
71 delete _MuonEventFlag;
82 HLTPathsJetMBByName_ =
parameters.getParameter<std::vector<std::string > >(
"HLTPathsJetMB");
88 _techTrigsAND = theCleaningParameters.getParameter<std::vector<unsigned > >(
"techTrigsAND");
89 _techTrigsOR = theCleaningParameters.getParameter<std::vector<unsigned > >(
"techTrigsOR");
90 _techTrigsNOT = theCleaningParameters.getParameter<std::vector<unsigned > >(
"techTrigsNOT");
92 _doHLTPhysicsOn = theCleaningParameters.getParameter<
bool>(
"doHLTPhysicsOn");
93 _hlt_PhysDec = theCleaningParameters.getParameter<
std::string>(
"HLT_PhysDec");
95 _tightBHFiltering = theCleaningParameters.getParameter<
bool>(
"tightBHFiltering");
96 _tightJetIDFiltering = theCleaningParameters.getParameter<
int>(
"tightJetIDFiltering");
104 _doPVCheck = theCleaningParameters.getParameter<
bool>(
"doPrimaryVertexCheck");
105 vertexTag = theCleaningParameters.getParameter<
edm::InputTag>(
"vertexLabel");
108 _nvtx_min = theCleaningParameters.getParameter<
int>(
"nvtx_min");
109 _nvtxtrks_min = theCleaningParameters.getParameter<
int>(
"nvtxtrks_min");
110 _vtxndof_min = theCleaningParameters.getParameter<
int>(
"vtxndof_min");
111 _vtxchi2_max = theCleaningParameters.getParameter<
double>(
"vtxchi2_max");
112 _vtxz_max = theCleaningParameters.getParameter<
double>(
"vtxz_max");
120 if (theCaloMETCollectionLabel.label() ==
"corMetGlobalMuons" ) {
132 _verbose =
parameters.getParameter<
int>(
"verbose");
133 _print =
parameters.getParameter<
int>(
"printOut");
134 _etThreshold =
parameters.getParameter<
double>(
"etThreshold");
135 _allhist =
parameters.getParameter<
bool>(
"allHist");
136 _allSelection=
parameters.getParameter<
bool>(
"allSelection");
137 _cleanupSelection=
parameters.getParameter<
bool>(
"cleanupSelection");
139 _highPtJetThreshold =
parameters.getParameter<
double>(
"HighPtJetThreshold");
140 _lowPtJetThreshold =
parameters.getParameter<
double>(
"LowPtJetThreshold");
141 _highMETThreshold =
parameters.getParameter<
double>(
"HighMETThreshold");
152 hmetME = dbe->
book1D(
"metReco",
"metReco", 4, 1, 5);
157 _FolderNames.push_back(
"All");
158 _FolderNames.push_back(
"BasicCleanup");
159 _FolderNames.push_back(
"ExtraCleanup");
160 _FolderNames.push_back(
"HcalNoiseFilter");
161 _FolderNames.push_back(
"JetIDMinimal");
162 _FolderNames.push_back(
"JetIDLoose");
163 _FolderNames.push_back(
"JetIDTight");
164 _FolderNames.push_back(
"BeamHaloIDTightPass");
165 _FolderNames.push_back(
"BeamHaloIDLoosePass");
166 _FolderNames.push_back(
"Triggers");
167 _FolderNames.push_back(
"PV");
169 for (std::vector<std::string>::const_iterator ic = _FolderNames.begin();
170 ic != _FolderNames.end(); ic++){
171 if (*ic==
"All") bookMESet(DirName+
"/"+*ic);
172 if (_cleanupSelection){
173 if (*ic==
"BasicCleanup") bookMESet(DirName+
"/"+*ic);
174 if (*ic==
"ExtraCleanup") bookMESet(DirName+
"/"+*ic);
177 if (*ic==
"HcalNoiseFilter") bookMESet(DirName+
"/"+*ic);
178 if (*ic==
"JetIDMinimal") bookMESet(DirName+
"/"+*ic);
179 if (*ic==
"JetIDLoose") bookMESet(DirName+
"/"+*ic);
180 if (*ic==
"JetIDTight") bookMESet(DirName+
"/"+*ic);
181 if (*ic==
"BeamHaloIDTightPass") bookMESet(DirName+
"/"+*ic);
182 if (*ic==
"BeamHaloIDLoosePass") bookMESet(DirName+
"/"+*ic);
183 if (*ic==
"Triggers") bookMESet(DirName+
"/"+*ic);
184 if (*ic==
"PV") bookMESet(DirName+
"/"+*ic);
202 bool bLumiSecPlot=
false;
203 if (DirName.find(
"All")!=std::string::npos) bLumiSecPlot=
true;
205 bookMonitorElement(DirName,bLumiSecPlot);
207 if ( _HighPtJetEventFlag->on() ) {
208 bookMonitorElementTriggered(DirName+
"/"+
"HighPtJet",
false);
209 hTriggerName_HighPtJet = _dbe->bookString(
"triggerName_HighPtJet", highPtJetExpr_[0]);
212 if ( _LowPtJetEventFlag->on() ) {
213 bookMonitorElementTriggered(DirName+
"/"+
"LowPtJet",
false);
214 hTriggerName_LowPtJet = _dbe->bookString(
"triggerName_LowPtJet", lowPtJetExpr_[0]);
217 if ( _MinBiasEventFlag->on() ) {
218 bookMonitorElementTriggered(DirName+
"/"+
"MinBias",
false);
219 hTriggerName_MinBias = _dbe->bookString(
"triggerName_MinBias", minbiasExpr_[0]);
220 if (_verbose)
std::cout <<
"_MinBiasEventFlag is on, folder created\n";
223 if ( _HighMETEventFlag->on() ) {
224 bookMonitorElementTriggered(DirName+
"/"+
"HighMET",
false);
225 hTriggerName_HighMET = _dbe->bookString(
"triggerName_HighMET", highMETExpr_[0]);
233 if ( _EleEventFlag->on() ) {
234 bookMonitorElementTriggered(DirName+
"/"+
"Ele",
false);
235 hTriggerName_Ele = _dbe->bookString(
"triggerName_Ele", elecExpr_[0]);
236 if (_verbose)
std::cout <<
"_EleEventFlag is on, folder created\n";
239 if ( _MuonEventFlag->on() ) {
240 bookMonitorElementTriggered(DirName+
"/"+
"Muon",
false);
241 hTriggerName_Muon = _dbe->bookString(
"triggerName_Muon", muonExpr_[0]);
242 if (_verbose)
std::cout <<
"_MuonEventFlag is on, folder created\n";
249 if (_verbose)
std::cout <<
"bookMonitorElement " << DirName << std::endl;
251 _dbe->setCurrentFolder(DirName);
253 bookMonitorElementTriggered(DirName, bLumiSecPlot);
258 hCaloMaxEtInEmTowers = _dbe->book1D(
"METTask_CaloMaxEtInEmTowers",
"METTask_CaloMaxEtInEmTowers" ,100,0,2000);
259 hCaloMaxEtInEmTowers->setAxisTitle(
"Et(Max) in EM Tower [GeV]",1);
260 hCaloMaxEtInHadTowers = _dbe->book1D(
"METTask_CaloMaxEtInHadTowers",
"METTask_CaloMaxEtInHadTowers" ,100,0,2000);
261 hCaloMaxEtInHadTowers->setAxisTitle(
"Et(Max) in Had Tower [GeV]",1);
263 hCaloHadEtInHB = _dbe->book1D(
"METTask_CaloHadEtInHB",
"METTask_CaloHadEtInHB",100,0,2000);
264 hCaloHadEtInHB->setAxisTitle(
"Had Et [GeV]",1);
265 hCaloHadEtInHO = _dbe->book1D(
"METTask_CaloHadEtInHO",
"METTask_CaloHadEtInHO",25,0,500);
266 hCaloHadEtInHO->setAxisTitle(
"Had Et [GeV]",1);
267 hCaloHadEtInHE = _dbe->book1D(
"METTask_CaloHadEtInHE",
"METTask_CaloHadEtInHE",100,0,2000);
268 hCaloHadEtInHE->setAxisTitle(
"Had Et [GeV]",1);
269 hCaloHadEtInHF = _dbe->book1D(
"METTask_CaloHadEtInHF",
"METTask_CaloHadEtInHF",50,0,1000);
270 hCaloHadEtInHF->setAxisTitle(
"Had Et [GeV]",1);
271 hCaloEmEtInHF = _dbe->book1D(
"METTask_CaloEmEtInHF" ,
"METTask_CaloEmEtInHF" ,25,0,500);
272 hCaloEmEtInHF->setAxisTitle(
"EM Et [GeV]",1);
273 hCaloEmEtInEE = _dbe->book1D(
"METTask_CaloEmEtInEE" ,
"METTask_CaloEmEtInEE" ,50,0,1000);
274 hCaloEmEtInEE->setAxisTitle(
"EM Et [GeV]",1);
275 hCaloEmEtInEB = _dbe->book1D(
"METTask_CaloEmEtInEB" ,
"METTask_CaloEmEtInEB" ,100,0,2000);
276 hCaloEmEtInEB->setAxisTitle(
"EM Et [GeV]",1);
278 hCaloEmMEx= _dbe->book1D(
"METTask_CaloEmMEx",
"METTask_CaloEmMEx",200,-500,500);
279 hCaloEmMEx->setAxisTitle(
"EM MEx [GeV]",1);
280 hCaloEmMEy= _dbe->book1D(
"METTask_CaloEmMEy",
"METTask_CaloEmMEy",200,-500,500);
281 hCaloEmMEy->setAxisTitle(
"EM MEy [GeV]",1);
282 hCaloEmMET= _dbe->book1D(
"METTask_CaloEmMET",
"METTask_CaloEmMET",200,0,1000);
283 hCaloEmMET->setAxisTitle(
"EM MET [GeV]",1);
284 hCaloEmMETPhi= _dbe->book1D(
"METTask_CaloEmMETPhi",
"METTask_CaloEmMETPhi", 60, -3.2, 3.2);
285 hCaloEmMETPhi->setAxisTitle(
"EM METPhi [rad]",1);
287 hCaloHaMEx= _dbe->book1D(
"METTask_CaloHaMEx",
"METTask_CaloHaMEx",200,-500,500);
288 hCaloHaMEx->setAxisTitle(
"HA MEx [GeV]",1);
289 hCaloHaMEy= _dbe->book1D(
"METTask_CaloHaMEy",
"METTask_CaloHaMEy",200,-500,500);
290 hCaloHaMEy->setAxisTitle(
"HA MEy [GeV]",1);
291 hCaloHaMET= _dbe->book1D(
"METTask_CaloHaMET",
"METTask_CaloHaMET",200,0,1000);
292 hCaloHaMET->setAxisTitle(
"HA MET [GeV]",1);
293 hCaloHaMETPhi= _dbe->book1D(
"METTask_CaloHaMETPhi",
"METTask_CaloHaMETPhi", 60, -3.2, 3.2);
294 hCaloHaMETPhi->setAxisTitle(
"HA METPhi [rad]",1);
302 if (_verbose)
std::cout <<
"bookMonitorElementTriggered " << DirName << std::endl;
304 _dbe->setCurrentFolder(DirName);
307 hCaloMEx = _dbe->book1D(
"METTask_CaloMEx",
"METTask_CaloMEx", 200, -500, 500);
308 hCaloMEy = _dbe->book1D(
"METTask_CaloMEy",
"METTask_CaloMEy", 200, -500, 500);
309 hCaloMET = _dbe->book1D(
"METTask_CaloMET",
"METTask_CaloMET", 200, 0, 1000);
310 hCaloMET1 = _dbe->book1D(
"METTask_CaloMET1",
"METTask_CaloMET1", 80, 0, 200);
311 hCaloMETNoHF = _dbe->book1D(
"METTask_CaloMETNoHF",
"METTask_CaloMETNoHF", 200, 0, 1000);
312 hCaloSumET = _dbe->book1D(
"METTask_CaloSumET",
"METTask_CaloSumET", 400, 0, 4000);
313 hCaloMETSig = _dbe->book1D(
"METTask_CaloMETSig",
"METTask_CaloMETSig", 51, 0, 51);
314 hCaloMETPhi = _dbe->book1D(
"METTask_CaloMETPhi",
"METTask_CaloMETPhi", 60, -3.2, 3.2);
315 hCaloMETPhi020 = _dbe->book1D(
"METTask_CaloMETPhi020",
"METTask_CaloMETPhi020", 60, -3.2, 3.2);
316 hCaloMET_logx = _dbe->book1D(
"METTask_CaloMET_logx",
"METTask_CaloMET_logx", 40, -1, 7);
317 hCaloSumET_logx = _dbe->book1D(
"METTask_CaloSumET_logx",
"METTask_CaloSumET_logx", 40, -1, 7);
319 hCaloMEx ->setAxisTitle(
"MEx [GeV]", 1);
320 hCaloMEy ->setAxisTitle(
"MEy [GeV]", 1);
321 hCaloMET ->setAxisTitle(
"MET [GeV]", 1);
322 hCaloMET1 ->setAxisTitle(
"MET [GeV]", 1);
323 hCaloMETNoHF ->setAxisTitle(
"MET (No HF) [GeV]", 1);
324 hCaloSumET ->setAxisTitle(
"SumET [GeV]", 1);
325 hCaloMETSig ->setAxisTitle(
"METSig", 1);
326 hCaloMETPhi ->setAxisTitle(
"METPhi [rad]", 1);
327 hCaloMETPhi020 ->setAxisTitle(
"METPhi [rad] (MET>20 GeV)", 1);
328 hCaloMET_logx ->setAxisTitle(
"log(MET) [GeV]", 1);
329 hCaloSumET_logx->setAxisTitle(
"log(SumET) [GeV]", 1);
334 hCaloMEx_profile = _dbe->bookProfile(
"METTask_CaloMEx_profile",
"MEx [GeV]",
nbinsPV,
PVlow,
PVup, 200, -500, 500);
335 hCaloMEy_profile = _dbe->bookProfile(
"METTask_CaloMEy_profile",
"MEy [GeV]",
nbinsPV,
PVlow,
PVup, 200, -500, 500);
336 hCaloMET_profile = _dbe->bookProfile(
"METTask_CaloMET_profile",
"MET [GeV]",
nbinsPV,
PVlow,
PVup, 200, 0, 1000);
337 hCaloMETNoHF_profile = _dbe->bookProfile(
"METTask_CaloMETNoHF_profile",
"METNoHF [GeV]",
nbinsPV,
PVlow,
PVup, 200, 0, 1000);
338 hCaloSumET_profile = _dbe->bookProfile(
"METTask_CaloSumET_profile",
"SumET [GeV]",
nbinsPV,
PVlow,
PVup, 400, 0, 4000);
343 hCaloMEx_profile ->setAxisTitle(
"nvtx", 1);
344 hCaloMEy_profile ->setAxisTitle(
"nvtx", 1);
345 hCaloMET_profile ->setAxisTitle(
"nvtx", 1);
346 hCaloMETNoHF_profile->setAxisTitle(
"nvtx", 1);
347 hCaloSumET_profile ->setAxisTitle(
"nvtx", 1);
352 hCaloMExLS = _dbe->book2D(
"METTask_CaloMEx_LS",
"METTask_CaloMEx_LS",200,-200,200,50,0.,500.);
353 hCaloMExLS->setAxisTitle(
"MEx [GeV]",1);
354 hCaloMExLS->setAxisTitle(
"Lumi Section",2);
355 hCaloMEyLS = _dbe->book2D(
"METTask_CaloMEy_LS",
"METTask_CaloMEy_LS",200,-200,200,50,0.,500.);
356 hCaloMEyLS->setAxisTitle(
"MEy [GeV]",1);
357 hCaloMEyLS->setAxisTitle(
"Lumi Section",2);
364 hCaloEtFractionHadronic = _dbe->book1D(
"METTask_CaloEtFractionHadronic",
"METTask_CaloEtFractionHadronic",100,0,1);
365 hCaloEtFractionHadronic->setAxisTitle(
"Hadronic Et Fraction",1);
366 hCaloEmEtFraction = _dbe->book1D(
"METTask_CaloEmEtFraction",
"METTask_CaloEmEtFraction" ,100,0,1);
367 hCaloEmEtFraction->setAxisTitle(
"EM Et Fraction",1);
373 hCaloEmEtFraction020 = _dbe->book1D(
"METTask_CaloEmEtFraction020",
"METTask_CaloEmEtFraction020" ,100,0,1);
374 hCaloEmEtFraction020->setAxisTitle(
"EM Et Fraction (MET>20 GeV)",1);
377 if (theCaloMETCollectionLabel.label() ==
"corMetGlobalMuons" ) {
378 hCalomuPt = _dbe->book1D(
"METTask_CalomuonPt",
"METTask_CalomuonPt", 50, 0, 500);
379 hCalomuEta = _dbe->book1D(
"METTask_CalomuonEta",
"METTask_CalomuonEta", 60, -3.0, 3.0);
380 hCalomuNhits = _dbe->book1D(
"METTask_CalomuonNhits",
"METTask_CalomuonNhits", 50, 0, 50);
381 hCalomuChi2 = _dbe->book1D(
"METTask_CalomuonNormalizedChi2",
"METTask_CalomuonNormalizedChi2", 20, 0, 20);
382 hCalomuD0 = _dbe->book1D(
"METTask_CalomuonD0",
"METTask_CalomuonD0", 50, -1, 1);
383 hCaloMExCorrection = _dbe->book1D(
"METTask_CaloMExCorrection",
"METTask_CaloMExCorrection", 100, -500.0,500.0);
384 hCaloMEyCorrection = _dbe->book1D(
"METTask_CaloMEyCorrection",
"METTask_CaloMEyCorrection", 100, -500.0,500.0);
385 hCaloMuonCorrectionFlag = _dbe->book1D(
"METTask_CaloCorrectionFlag",
"METTask_CaloCorrectionFlag", 5, -0.5, 4.5);
393 if ( _HighPtJetEventFlag->on() ) _HighPtJetEventFlag->initRun( iRun, iSetup );
394 if ( _LowPtJetEventFlag ->on() ) _LowPtJetEventFlag ->initRun( iRun, iSetup );
395 if ( _MinBiasEventFlag ->on() ) _MinBiasEventFlag ->initRun( iRun, iSetup );
396 if ( _HighMETEventFlag ->on() ) _HighMETEventFlag ->initRun( iRun, iSetup );
398 if ( _EleEventFlag ->on() ) _EleEventFlag ->initRun( iRun, iSetup );
399 if ( _MuonEventFlag ->on() ) _MuonEventFlag ->initRun( iRun, iSetup );
401 if (_HighPtJetEventFlag->on() && _HighPtJetEventFlag->expressionsFromDB(_HighPtJetEventFlag->hltDBKey(), iSetup)[0] !=
"CONFIG_ERROR")
402 highPtJetExpr_ = _HighPtJetEventFlag->expressionsFromDB(_HighPtJetEventFlag->hltDBKey(), iSetup);
403 if (_LowPtJetEventFlag->on() && _LowPtJetEventFlag->expressionsFromDB(_LowPtJetEventFlag->hltDBKey(), iSetup)[0] !=
"CONFIG_ERROR")
404 lowPtJetExpr_ = _LowPtJetEventFlag->expressionsFromDB(_LowPtJetEventFlag->hltDBKey(), iSetup);
405 if (_HighMETEventFlag->on() && _HighMETEventFlag->expressionsFromDB(_HighMETEventFlag->hltDBKey(), iSetup)[0] !=
"CONFIG_ERROR")
406 highMETExpr_ = _HighMETEventFlag->expressionsFromDB(_HighMETEventFlag->hltDBKey(), iSetup);
409 if (_MuonEventFlag->on() && _MuonEventFlag->expressionsFromDB(_MuonEventFlag->hltDBKey(), iSetup)[0] !=
"CONFIG_ERROR")
410 muonExpr_ = _MuonEventFlag->expressionsFromDB(_MuonEventFlag->hltDBKey(), iSetup);
411 if (_EleEventFlag->on() && _EleEventFlag->expressionsFromDB(_EleEventFlag->hltDBKey(), iSetup)[0] !=
"CONFIG_ERROR")
412 elecExpr_ = _EleEventFlag->expressionsFromDB(_EleEventFlag->hltDBKey(), iSetup);
413 if (_MinBiasEventFlag->on() && _MinBiasEventFlag->expressionsFromDB(_MinBiasEventFlag->hltDBKey(), iSetup)[0] !=
"CONFIG_ERROR")
414 minbiasExpr_ = _MinBiasEventFlag->expressionsFromDB(_MinBiasEventFlag->hltDBKey(), iSetup);
427 _dbe->setCurrentFolder(dirName);
432 meLumiSec = _dbe->get(
"JetMET/lumisec");
437 tlumisec = meLumiSec->
getTH1F();
438 for (
int i=0;
i<500;
i++){
439 if (tlumisec->GetBinContent(
i+1)) totlsec++;
441 totltime = double(totlsec*90);
444 if (totltime==0.) totltime=1.;
449 for (std::vector<std::string>::const_iterator ic = _FolderNames.begin(); ic != _FolderNames.end(); ic++)
453 DirName = dirName+*ic;
455 makeRatePlot(DirName,totltime);
456 if ( _HighPtJetEventFlag->on() )
457 makeRatePlot(DirName+
"/"+
"triggerName_HighJetPt",totltime);
458 if ( _LowPtJetEventFlag->on() )
459 makeRatePlot(DirName+
"/"+
"triggerName_LowJetPt",totltime);
460 if ( _MinBiasEventFlag->on() )
461 makeRatePlot(DirName+
"/"+
"triggerName_MinBias",totltime);
462 if ( _HighMETEventFlag->on() )
463 makeRatePlot(DirName+
"/"+
"triggerName_HighMET",totltime);
466 if ( _EleEventFlag->on() )
467 makeRatePlot(DirName+
"/"+
"triggerName_Ele",totltime);
468 if ( _MuonEventFlag->on() )
469 makeRatePlot(DirName+
"/"+
"triggerName_Muon",totltime);
478 _dbe->setCurrentFolder(DirName);
479 MonitorElement *meCaloMET = _dbe->get(DirName+
"/"+
"METTask_CaloMET");
486 tCaloMET = meCaloMET->
getTH1F();
489 tCaloMETRate = (TH1F*) tCaloMET->Clone(
"METTask_CaloMETRate");
490 for (
int i = tCaloMETRate->GetNbinsX()-1;
i>=0;
i--){
491 tCaloMETRate->SetBinContent(
i+1,tCaloMETRate->GetBinContent(
i+2)+tCaloMET->GetBinContent(
i+1));
493 for (
int i = 0;
i<tCaloMETRate->GetNbinsX();
i++){
494 tCaloMETRate->SetBinContent(
i+1,tCaloMETRate->GetBinContent(
i+1)/double(totltime));
497 tCaloMETRate->SetName(
"METTask_CaloMETRate");
498 tCaloMETRate->SetTitle(
"METTask_CaloMETRate");
499 hCaloMETRate = _dbe->book1D(
"METTask_CaloMETRate",tCaloMETRate);
500 hCaloMETRate->setAxisTitle(
"MET Threshold [GeV]",1);
509 if (_verbose)
std::cout <<
"CaloMETAnalyzer analyze" << std::endl;
533 if(&triggerResults) {
540 int ntrigs = triggerResults.
size();
541 if (_verbose)
std::cout <<
"ntrigs=" << ntrigs << std::endl;
550 const unsigned int nTrig(triggerNames.
size());
551 for (
unsigned int i=0;
i<nTrig;++
i)
553 if (triggerNames.
triggerName(
i).find(highPtJetExpr_[0].substr(0,highPtJetExpr_[0].rfind(
"_v")+2))!=std::string::npos && triggerResults.
accept(
i))
554 _trig_HighPtJet=
true;
555 else if (triggerNames.
triggerName(
i).find(lowPtJetExpr_[0].substr(0,lowPtJetExpr_[0].rfind(
"_v")+2))!=std::string::npos && triggerResults.
accept(
i))
557 else if (triggerNames.
triggerName(
i).find(highMETExpr_[0].substr(0,highMETExpr_[0].rfind(
"_v")+2))!=std::string::npos && triggerResults.
accept(
i))
561 else if (triggerNames.
triggerName(
i).find(muonExpr_[0].substr(0,muonExpr_[0].rfind(
"_v")+2))!=std::string::npos && triggerResults.
accept(
i))
563 else if (triggerNames.
triggerName(
i).find(elecExpr_[0].substr(0,elecExpr_[0].rfind(
"_v")+2))!=std::string::npos && triggerResults.
accept(
i))
565 else if (triggerNames.
triggerName(
i).find(minbiasExpr_[0].substr(0,minbiasExpr_[0].rfind(
"_v")+2))!=std::string::npos && triggerResults.
accept(
i))
570 for (
unsigned int i=0;
i!=HLTPathsJetMBByName_.size();
i++) {
571 unsigned int triggerIndex = triggerNames.
triggerIndex(HLTPathsJetMBByName_[
i]);
572 if (triggerIndex<triggerResults.
size()) {
573 if (triggerResults.
accept(triggerIndex)) {
579 if (HLTPathsJetMBByName_.size()==0) _trig_JetMB=triggerResults.
size()-1;
608 edm::LogInfo(
"CaloMetAnalyzer") <<
"TriggerResults::HLT not found, "
609 "automatically select events";
621 iEvent.
getByLabel(theCaloMETCollectionLabel, calometcoll);
624 std::cout<<
"Unable to find MET results for CaloMET collection "<<theCaloMETCollectionLabel<<std::endl;
630 calomet = &(calometcol->front());
636 iEvent.
getByLabel(
"metNoHF", calometnohfcoll);
638 if(!calometnohfcoll.
isValid()) {
639 std::cout<<
"Unable to find MET results for CaloMETNoHF collection metNoHF"<<std::endl;
645 calometnohf = &(calometnohfcol->front());
650 if (theCaloMETCollectionLabel.label() ==
"corMetGlobalMuons" ) {
652 iEvent.
getByLabel(
"muonMETValueMapProducer" ,
"muCorrData", corMetGlobalMuons_ValueMap_Handle);
654 iEvent.
getByLabel(inputBeamSpotLabel, beamSpot_h);
656 if(!beamSpot_h.isValid())
edm::LogInfo(
"OutputInfo") <<
"falied to retrieve beam spot data require by MET Task";
658 bspot = ( beamSpot_h.isValid() ) ? beamSpot_h->position() :
math::XYZPoint(0, 0, 0);
666 iEvent.
getByLabel(HcalNoiseRBXCollectionTag,HRBXCollection);
667 if (!HRBXCollection.
isValid()) {
668 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find HcalNoiseRBX Collection" << std::endl;
669 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find HcalNoiseRBX Collection" << std::endl;
674 iEvent.
getByLabel(HBHENoiseFilterResultTag, HBHENoiseFilterResultHandle);
675 bool HBHENoiseFilterResult = *HBHENoiseFilterResultHandle;
676 if (!HBHENoiseFilterResultHandle.
isValid()) {
677 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
678 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
683 iEvent.
getByLabel(theJetCollectionLabel, caloJets);
685 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find jet product" << std::endl;
686 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find jet product" << std::endl;
690 iEvent.
getByLabel(theCaloTowersLabel, towers);
692 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find caltower product" << std::endl;
693 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find caltower product" << std::endl;
699 if (_source==
"CaloMET") validateMET(*calomet,towers);
703 if (_allhist) computeEmHaMET(towers);
708 if (_verbose)
std::cout <<
"JetID starts" << std::endl;
713 bool bJetIDMinimal=
true;
715 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
716 cal!=caloJets->end(); ++cal){
717 jetID->calculate(iEvent, *cal);
718 if (_print && nj<=1)
std::cout <<
"Jet pT = " << cal->pt() <<
" (GeV) "
719 <<
" eta = " << cal->eta() <<
" "
720 <<
" phi = " << cal->phi() <<
" "
721 <<
" emf = " << cal->emEnergyFraction() << std::endl;
724 if (fabs(cal->eta())<=2.6 &&
725 cal->emEnergyFraction()<=0.01) bJetIDMinimal=
false;
732 bool bJetIDLoose=
true;
733 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
734 cal!=caloJets->end(); ++cal){
735 jetID->calculate(iEvent, *cal);
737 <<
jetID->restrictedEMF() <<
" "
738 << cal->pt() << std::endl;
742 if (
jetID->n90Hits()<2) bJetIDLoose=
false;
743 if (
jetID->fHPD()>=0.98) bJetIDLoose=
false;
746 if (fabs(cal->eta())<2.55){
747 if (cal->emEnergyFraction()<=0.01) bJetIDLoose=
false;
751 if (cal->emEnergyFraction()<=-0.9) bJetIDLoose=
false;
753 if (cal->emEnergyFraction()>= 1.0) bJetIDLoose=
false;
762 bool bJetIDTight=
true;
763 bJetIDTight=bJetIDLoose;
764 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
765 cal!=caloJets->end(); ++cal){
766 jetID->calculate(iEvent, *cal);
770 if (
jetID->fHPD()>=0.95) bJetIDTight=
false;
773 if (fabs(cal->eta())>=1.00 && fabs(cal->eta())<1.75){
774 if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=
false;
778 else if (fabs(cal->eta())>=1.75 && fabs(cal->eta())<2.55){
779 if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=
false;
783 else if (fabs(cal->eta())>=2.55 && fabs(cal->eta())<3.25){
784 if (cal->pt()< 50. && cal->emEnergyFraction()<=-0.3) bJetIDTight=
false;
785 if (cal->pt()>=50. && cal->pt()< 80. && cal->emEnergyFraction()<=-0.2) bJetIDTight=
false;
786 if (cal->pt()>=80. && cal->pt()<340. && cal->emEnergyFraction()<=-0.1) bJetIDTight=
false;
787 if (cal->pt()>=340. && cal->emEnergyFraction()<=-0.1
788 && cal->emEnergyFraction()>=0.95) bJetIDTight=
false;
792 else if (fabs(cal->eta())>=3.25){
793 if (cal->pt()< 50. && cal->emEnergyFraction()<=-0.3
794 && cal->emEnergyFraction()>=0.90) bJetIDTight=
false;
795 if (cal->pt()>=50. && cal->pt()<130. && cal->emEnergyFraction()<=-0.2
796 && cal->emEnergyFraction()>=0.80) bJetIDTight=
false;
797 if (cal->pt()>=130. && cal->emEnergyFraction()<=-0.1
798 && cal->emEnergyFraction()>=0.70) bJetIDTight=
false;
803 if (_verbose)
std::cout <<
"JetID ends" << std::endl;
808 bool bHcalNoiseFilter = HBHENoiseFilterResult;
813 iEvent.
getByLabel(BeamHaloSummaryTag, TheBeamHaloSummary) ;
815 bool bBeamHaloIDTightPass =
true;
816 bool bBeamHaloIDLoosePass =
true;
818 if(TheBeamHaloSummary.
isValid()) {
829 bBeamHaloIDLoosePass =
false;
833 bBeamHaloIDTightPass =
false;
837 if (_verbose)
std::cout <<
"BeamHaloSummary ends" << std::endl;
843 bool bPrimaryVertex =
true;
845 bPrimaryVertex =
false;
851 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find vertex collection" << std::endl;
852 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find vertex collection" << std::endl;
857 int vertex_number = vertexCollection.size();
858 reco::VertexCollection::const_iterator
v = vertexCollection.begin();
859 for ( ; v != vertexCollection.end(); ++
v) {
860 double vertex_chi2 = v->normalizedChi2();
861 double vertex_ndof = v->ndof();
862 bool fakeVtx = v->isFake();
863 double vertex_Z = v->z();
866 && vertex_number>=_nvtx_min
867 && vertex_ndof >_vtxndof_min
868 && vertex_chi2 <_vtxchi2_max
869 && fabs(vertex_Z)<_vtxz_max ) {
870 bPrimaryVertex =
true;
881 if (!gtReadoutRecord.
isValid()) {
882 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find GT readout record" << std::endl;
883 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find GT readout record product" << std::endl;
886 bool bTechTriggers =
true;
887 bool bTechTriggersAND =
true;
888 bool bTechTriggersOR =
false;
889 bool bTechTriggersNOT =
false;
891 if (gtReadoutRecord.
isValid()) {
892 const TechnicalTriggerWord& technicalTriggerWordBeforeMask = gtReadoutRecord->technicalTriggerWord();
894 if (_techTrigsAND.size() == 0)
895 bTechTriggersAND =
true;
897 for (
unsigned ttr = 0; ttr != _techTrigsAND.size(); ttr++) {
898 bTechTriggersAND = bTechTriggersAND && technicalTriggerWordBeforeMask.at(_techTrigsAND.at(ttr));
901 if (_techTrigsAND.size() == 0)
902 bTechTriggersOR =
true;
904 for (
unsigned ttr = 0; ttr != _techTrigsOR.size(); ttr++) {
905 bTechTriggersOR = bTechTriggersOR || technicalTriggerWordBeforeMask.at(_techTrigsOR.at(ttr));
907 if (_techTrigsNOT.size() == 0)
908 bTechTriggersNOT =
false;
910 for (
unsigned ttr = 0; ttr != _techTrigsNOT.size(); ttr++) {
911 bTechTriggersNOT = bTechTriggersNOT || technicalTriggerWordBeforeMask.at(_techTrigsNOT.at(ttr));
916 bTechTriggersAND =
true;
917 bTechTriggersOR =
true;
918 bTechTriggersNOT =
false;
921 if (_techTrigsAND.size()==0)
922 bTechTriggersAND =
true;
923 if (_techTrigsOR.size()==0)
924 bTechTriggersOR =
true;
925 if (_techTrigsNOT.size()==0)
926 bTechTriggersNOT =
false;
928 bTechTriggers = bTechTriggersAND && bTechTriggersOR && !bTechTriggersNOT;
933 bool bHcalNoise = bHcalNoiseFilter;
934 bool bBeamHaloID = bBeamHaloIDLoosePass;
935 bool bJetID = bJetIDMinimal;
937 bool bPhysicsDeclared =
true;
938 if(_doHLTPhysicsOn) bPhysicsDeclared =_trig_PhysDec;
940 if (_tightBHFiltering) bBeamHaloID = bBeamHaloIDTightPass;
942 if (_tightJetIDFiltering==1) bJetID = bJetIDMinimal;
943 else if (_tightJetIDFiltering==2) bJetID = bJetIDLoose;
944 else if (_tightJetIDFiltering==3) bJetID = bJetIDTight;
945 else if (_tightJetIDFiltering==-1) bJetID =
true;
947 bool bBasicCleanup = bTechTriggers && bPrimaryVertex && bPhysicsDeclared;
948 bool bExtraCleanup = bBasicCleanup && bHcalNoise && bJetID && bBeamHaloID;
952 for (std::vector<std::string>::const_iterator ic = _FolderNames.begin();
953 ic != _FolderNames.end(); ic++){
954 if (*ic==
"All") fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
955 if (DCSFilter->filter(iEvent, iSetup)) {
956 if (_cleanupSelection){
957 if (*ic==
"BasicCleanup" && bBasicCleanup) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
958 if (*ic==
"ExtraCleanup" && bExtraCleanup) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
961 if (*ic==
"HcalNoiseFilter" && bHcalNoiseFilter ) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
962 if (*ic==
"JetIDMinimal" && bJetIDMinimal) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
963 if (*ic==
"JetIDLoose" && bJetIDLoose) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
964 if (*ic==
"JetIDTight" && bJetIDTight) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
965 if (*ic==
"BeamHaloIDTightPass" && bBeamHaloIDTightPass) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
966 if (*ic==
"BeamHaloIDLoosePass" && bBeamHaloIDLoosePass) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
967 if (*ic==
"Triggers" && bTechTriggers) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
968 if (*ic==
"PV" && bPrimaryVertex) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
980 double sum_em_et = 0.0;
981 double sum_em_ex = 0.0;
982 double sum_em_ey = 0.0;
983 double sum_em_ez = 0.0;
985 double sum_ha_et = 0.0;
986 double sum_ha_ex = 0.0;
987 double sum_ha_ey = 0.0;
988 double sum_ha_ez = 0.0;
990 for ( ; towerCand != towers->
end(); towerCand++)
997 double Tower_ET = calotower->
et();
1000 double phi = candidate->
phi();
1003 double e_em = calotower->
emEnergy();
1005 double et_em = e_em*
sin(theta);
1006 double et_ha = e_ha*
sin(theta);
1008 sum_em_ez += e_em*
cos(theta);
1010 sum_em_ex += et_em*
cos(phi);
1011 sum_em_ey += et_em*
sin(phi);
1013 sum_ha_ez += e_ha*
cos(theta);
1015 sum_ha_ex += et_ha*
cos(phi);
1016 sum_ha_ey += et_ha*
sin(phi);
1024 _EmMEx = -sum_em_ex;
1025 _EmMEy = -sum_em_ey;
1026 _EmMET =
pow(_EmMEx*_EmMEx+_EmMEy*_EmMEy,0.5);
1027 _EmCaloEz = sum_em_ez;
1028 _EmSumEt = sum_em_et;
1029 _EmMetPhi = atan2( _EmMEy, _EmMEx );
1031 _HaMEx = -sum_ha_ex;
1032 _HaMEy = -sum_ha_ey;
1033 _HaMET =
pow(_HaMEx*_HaMEx+_HaMEy*_HaMEy,0.5);
1034 _HaCaloEz = sum_ha_ez;
1035 _HaSumEt = sum_ha_et;
1036 _HaMetPhi = atan2( _HaMEy, _HaMEx );
1046 double sum_et = 0.0;
1047 double sum_ex = 0.0;
1048 double sum_ey = 0.0;
1049 double sum_ez = 0.0;
1051 for ( ; towerCand != towers->
end(); towerCand++)
1058 double Tower_ET = calotower->
et();
1061 double phi = candidate->
phi();
1063 double e = candidate->
energy();
1064 double et = e*
sin(theta);
1065 sum_ez += e*
cos(theta);
1067 sum_ex += et*
cos(phi);
1068 sum_ey += et*
sin(phi);
1075 double Mex = -sum_ex;
1076 double Mey = -sum_ey;
1078 double Met =
sqrt( sum_ex*sum_ex + sum_ey*sum_ey );
1079 double Sumet = sum_et;
1083 if (Sumet!=calomet.
sumEt() || Mex!=calomet.
px() || Mey!=calomet.
py() || Met!=calomet.
pt() ){
1085 std::cout <<
"SUMET" << Sumet <<
" METBlock" << calomet.
sumEt() << std::endl;
1086 std::cout <<
"MEX" << Mex <<
" METBlock" << calomet.
px() << std::endl;
1087 std::cout <<
"MEY" << Mey <<
" METBlock" << calomet.
py() << std::endl;
1088 std::cout <<
"MET" << Met <<
" METBlock" << calomet.
pt() << std::endl;
1094 <<
"MEX" << calomet.
px() <<
" (GeV) "
1095 <<
"MEY" << calomet.
py() <<
" (GeV) "
1096 <<
"MET" << calomet.
pt() <<
" (GeV) " << std::endl;
1107 _dbe->setCurrentFolder(DirName);
1109 bool bLumiSecPlot=
false;
1110 if (DirName.find(
"All")) bLumiSecPlot=
true;
1113 fillMonitorElement(iEvent,DirName,
"",calomet,calometnohf, bLumiSecPlot);
1114 if (_trig_HighPtJet)
1115 fillMonitorElementTriggered(iEvent,DirName,
"HighPtJet",calomet,calometnohf,
false);
1117 fillMonitorElementTriggered(iEvent,DirName,
"LowPtJet",calomet,calometnohf,
false);
1119 fillMonitorElementTriggered(iEvent,DirName,
"MinBias",calomet,calometnohf,
false);
1121 fillMonitorElementTriggered(iEvent,DirName,
"HighMET",calomet,calometnohf,
false);
1125 fillMonitorElementTriggered(iEvent,DirName,
"Ele",calomet,calometnohf,
false);
1127 fillMonitorElementTriggered(iEvent,DirName,
"Muon",calomet,calometnohf,
false);
1138 fillMonitorElementTriggered(iEvent, DirName, TriggerTypeName, calomet, calometnohf, bLumiSecPlot);
1140 double caloSumET = calomet.
sumEt();
1161 double caloHadEtInHB = calomet.
hadEtInHB();
1162 double caloHadEtInHO = calomet.
hadEtInHO();
1163 double caloHadEtInHE = calomet.
hadEtInHE();
1164 double caloHadEtInHF = calomet.
hadEtInHF();
1165 double caloEmEtInEB = calomet.
emEtInEB();
1166 double caloEmEtInEE = calomet.
emEtInEE();
1167 double caloEmEtInHF = calomet.
emEtInHF();
1174 if (TriggerTypeName!=
"") DirName = DirName +
"/"+TriggerTypeName;
1176 if (_verbose)
std::cout <<
"_etThreshold = " << _etThreshold << std::endl;
1177 if (caloSumET>_etThreshold){
1215 hCaloMaxEtInEmTowers = _dbe->get(DirName+
"/"+
"METTask_CaloMaxEtInEmTowers");
if (hCaloMaxEtInEmTowers && hCaloMaxEtInEmTowers->getRootObject()) hCaloMaxEtInEmTowers->Fill(caloMaxEtInEMTowers);
1216 hCaloMaxEtInHadTowers = _dbe->get(DirName+
"/"+
"METTask_CaloMaxEtInHadTowers");
if (hCaloMaxEtInHadTowers && hCaloMaxEtInHadTowers->getRootObject()) hCaloMaxEtInHadTowers->Fill(caloMaxEtInHadTowers);
1218 hCaloHadEtInHB = _dbe->get(DirName+
"/"+
"METTask_CaloHadEtInHB");
if (hCaloHadEtInHB && hCaloHadEtInHB->getRootObject()) hCaloHadEtInHB->Fill(caloHadEtInHB);
1219 hCaloHadEtInHO = _dbe->get(DirName+
"/"+
"METTask_CaloHadEtInHO");
if (hCaloHadEtInHO && hCaloHadEtInHO->getRootObject()) hCaloHadEtInHO->Fill(caloHadEtInHO);
1220 hCaloHadEtInHE = _dbe->get(DirName+
"/"+
"METTask_CaloHadEtInHE");
if (hCaloHadEtInHE && hCaloHadEtInHE->getRootObject()) hCaloHadEtInHE->Fill(caloHadEtInHE);
1221 hCaloHadEtInHF = _dbe->get(DirName+
"/"+
"METTask_CaloHadEtInHF");
if (hCaloHadEtInHF && hCaloHadEtInHF->getRootObject()) hCaloHadEtInHF->Fill(caloHadEtInHF);
1222 hCaloEmEtInEB = _dbe->get(DirName+
"/"+
"METTask_CaloEmEtInEB");
if (hCaloEmEtInEB && hCaloEmEtInEB->getRootObject()) hCaloEmEtInEB->Fill(caloEmEtInEB);
1223 hCaloEmEtInEE = _dbe->get(DirName+
"/"+
"METTask_CaloEmEtInEE");
if (hCaloEmEtInEE && hCaloEmEtInEE->getRootObject()) hCaloEmEtInEE->Fill(caloEmEtInEE);
1224 hCaloEmEtInHF = _dbe->get(DirName+
"/"+
"METTask_CaloEmEtInHF");
if (hCaloEmEtInHF && hCaloEmEtInHF->getRootObject()) hCaloEmEtInHF->Fill(caloEmEtInHF);
1226 hCaloEmMEx = _dbe->get(DirName+
"/"+
"METTask_CaloEmMEx");
if (hCaloEmMEx && hCaloEmMEx->getRootObject()) hCaloEmMEx->Fill(_EmMEx);
1227 hCaloEmMEy = _dbe->get(DirName+
"/"+
"METTask_CaloEmMEy");
if (hCaloEmMEy && hCaloEmMEy->getRootObject()) hCaloEmMEy->Fill(_EmMEy);
1229 hCaloEmMET = _dbe->get(DirName+
"/"+
"METTask_CaloEmMET");
if (hCaloEmMET && hCaloEmMET->getRootObject()) hCaloEmMET->Fill(_EmMET);
1230 hCaloEmMETPhi = _dbe->get(DirName+
"/"+
"METTask_CaloEmMETPhi");
if (hCaloEmMETPhi && hCaloEmMETPhi->getRootObject()) hCaloEmMETPhi->Fill(_EmMetPhi);
1233 hCaloHaMEx = _dbe->get(DirName+
"/"+
"METTask_CaloHaMEx");
if (hCaloHaMEx && hCaloHaMEx->getRootObject()) hCaloHaMEx->Fill(_HaMEx);
1234 hCaloHaMEy = _dbe->get(DirName+
"/"+
"METTask_CaloHaMEy");
if (hCaloHaMEy && hCaloHaMEy->getRootObject()) hCaloHaMEy->Fill(_HaMEy);
1236 hCaloHaMET = _dbe->get(DirName+
"/"+
"METTask_CaloHaMET");
if (hCaloHaMET && hCaloHaMET->getRootObject()) hCaloHaMET->Fill(_HaMET);
1237 hCaloHaMETPhi = _dbe->get(DirName+
"/"+
"METTask_CaloHaMETPhi");
if (hCaloHaMETPhi && hCaloHaMETPhi->getRootObject()) hCaloHaMETPhi->Fill(_HaMetPhi);
1276 if (TriggerTypeName==
"HighPtJet") {
1277 if (!selectHighPtJetEvent(iEvent))
return;
1279 else if (TriggerTypeName==
"LowPtJet") {
1280 if (!selectLowPtJetEvent(iEvent))
return;
1282 else if (TriggerTypeName==
"HighMET") {
1283 if (calomet.
pt()<_highMETThreshold)
return;
1288 else if (TriggerTypeName==
"Ele") {
1289 if (!selectWElectronEvent(iEvent))
return;
1291 else if (TriggerTypeName==
"Muon") {
1292 if (!selectWMuonEvent(iEvent))
return;
1295 double caloSumET = calomet.
sumEt();
1296 double caloMETSig = calomet.
mEtSig();
1298 double caloMET = calomet.
pt();
1299 double caloMEx = calomet.
px();
1300 double caloMEy = calomet.
py();
1301 double caloMETPhi = calomet.
phi();
1303 double caloMETNoHF = calometnohf.
pt();
1306 if (_verbose)
std::cout << _source <<
" " << caloMET << std::endl;
1323 int myLuminosityBlock;
1328 if (TriggerTypeName!=
"") DirName = DirName +
"/"+TriggerTypeName;
1330 if (_verbose)
std::cout <<
"_etThreshold = " << _etThreshold << std::endl;
1331 if (caloSumET>_etThreshold){
1332 hCaloMEx = _dbe->get(DirName+
"/"+
"METTask_CaloMEx");
if (hCaloMEx && hCaloMEx->getRootObject() ) hCaloMEx->Fill(caloMEx);
1333 hCaloMEy = _dbe->get(DirName+
"/"+
"METTask_CaloMEy");
if (hCaloMEy && hCaloMEy->getRootObject() ) hCaloMEy->Fill(caloMEy);
1334 hCaloMET = _dbe->get(DirName+
"/"+
"METTask_CaloMET");
if (hCaloMET && hCaloMET->getRootObject() ) hCaloMET->Fill(caloMET);
1335 hCaloMET1 = _dbe->get(DirName+
"/"+
"METTask_CaloMET1");
if (hCaloMET1 && hCaloMET1->getRootObject() ) hCaloMET1->Fill(caloMET);
1336 hCaloMETPhi = _dbe->get(DirName+
"/"+
"METTask_CaloMETPhi");
if (hCaloMETPhi && hCaloMETPhi->getRootObject() ) hCaloMETPhi->Fill(caloMETPhi);
1337 hCaloSumET = _dbe->get(DirName+
"/"+
"METTask_CaloSumET");
if (hCaloSumET && hCaloSumET->getRootObject() ) hCaloSumET->Fill(caloSumET);
1338 hCaloMETSig = _dbe->get(DirName+
"/"+
"METTask_CaloMETSig");
if (hCaloMETSig && hCaloMETSig->getRootObject() ) hCaloMETSig->Fill(caloMETSig);
1341 hCaloMETNoHF = _dbe->get(DirName+
"/"+
"METTask_CaloMETNoHF");
if (hCaloMETNoHF && hCaloMETNoHF->getRootObject() ) hCaloMETNoHF->Fill(caloMETNoHF);
1343 hCaloMET_logx = _dbe->get(DirName+
"/"+
"METTask_CaloMET_logx");
if (hCaloMET_logx && hCaloMET_logx->getRootObject() ) hCaloMET_logx->Fill(log10(caloMET));
1344 hCaloSumET_logx = _dbe->get(DirName+
"/"+
"METTask_CaloSumET_logx");
if (hCaloSumET_logx && hCaloSumET_logx->getRootObject() ) hCaloSumET_logx->Fill(log10(caloSumET));
1349 hCaloMEx_profile = _dbe->get(DirName +
"/METTask_CaloMEx_profile");
1350 hCaloMEy_profile = _dbe->get(DirName +
"/METTask_CaloMEy_profile");
1351 hCaloMET_profile = _dbe->get(DirName +
"/METTask_CaloMET_profile");
1352 hCaloMETNoHF_profile = _dbe->get(DirName +
"/METTask_CaloMETNoHF_profile");
1353 hCaloSumET_profile = _dbe->get(DirName +
"/METTask_CaloSumET_profile");
1355 if (hCaloMEx_profile && hCaloMEx_profile ->getRootObject()) hCaloMEx_profile ->Fill(_numPV, caloMEx);
1356 if (hCaloMEy_profile && hCaloMEy_profile ->getRootObject()) hCaloMEy_profile ->Fill(_numPV, caloMEy);
1357 if (hCaloMET_profile && hCaloMET_profile ->getRootObject()) hCaloMET_profile ->Fill(_numPV, caloMET);
1358 if (hCaloMETNoHF_profile && hCaloMETNoHF_profile->getRootObject()) hCaloMETNoHF_profile->Fill(_numPV, caloMETNoHF);
1359 if (hCaloSumET_profile && hCaloSumET_profile ->getRootObject()) hCaloSumET_profile ->Fill(_numPV, caloSumET);
1368 hCaloMETPhi020 = _dbe->get(DirName+
"/"+
"METTask_CaloMETPhi020");
if (caloMET> 20. && hCaloMETPhi020 && hCaloMETPhi020->getRootObject()) { hCaloMETPhi020->Fill(caloMETPhi);}
1372 hCaloMExLS = _dbe->get(DirName+
"/"+
"METTask_CaloMEx_LS");
if (hCaloMExLS && hCaloMExLS->getRootObject()) hCaloMExLS->Fill(caloMEx,myLuminosityBlock);
1373 hCaloMEyLS = _dbe->get(DirName+
"/"+
"METTask_CaloMEy_LS");
if (hCaloMEyLS && hCaloMEyLS->getRootObject()) hCaloMEyLS->Fill(caloMEy,myLuminosityBlock);
1376 hCaloEtFractionHadronic = _dbe->get(DirName+
"/"+
"METTask_CaloEtFractionHadronic");
if (hCaloEtFractionHadronic && hCaloEtFractionHadronic->getRootObject()) hCaloEtFractionHadronic->Fill(caloEtFractionHadronic);
1377 hCaloEmEtFraction = _dbe->get(DirName+
"/"+
"METTask_CaloEmEtFraction");
if (hCaloEmEtFraction && hCaloEmEtFraction->getRootObject()) hCaloEmEtFraction->Fill(caloEmEtFraction);
1381 hCaloEmEtFraction020 = _dbe->get(DirName+
"/"+
"METTask_CaloEmEtFraction020");
if (caloMET> 20. && hCaloEmEtFraction020 && hCaloEmEtFraction020->getRootObject()) hCaloEmEtFraction020->Fill(caloEmEtFraction);
1409 if (theCaloMETCollectionLabel.label() ==
"corMetGlobalMuons" ) {
1411 for( reco::MuonCollection::const_iterator muonit = muon_h->begin(); muonit != muon_h->end(); muonit++ ) {
1413 hCalomuPt = _dbe->
get(DirName+
"/"+
"METTask_CalomuPt");
if (hCalomuPt && hCalomuPt->getRootObject()) hCalomuPt->Fill( muonit->p4().pt() );
1414 hCalomuEta = _dbe->get(DirName+
"/"+
"METTask_CalomuEta");
if (hCalomuEta && hCalomuEta->getRootObject()) hCalomuEta->Fill( muonit->p4().eta() );
1415 hCalomuNhits = _dbe->get(DirName+
"/"+
"METTask_CalomuNhits");
if (hCalomuNhits && hCalomuNhits->getRootObject()) hCalomuNhits->Fill( siTrack.
isNonnull() ? siTrack->numberOfValidHits() : -999 );
1416 hCalomuChi2 = _dbe->get(DirName+
"/"+
"METTask_CalomuChi2");
if (hCalomuChi2 && hCalomuChi2->getRootObject()) hCalomuChi2->Fill( siTrack.
isNonnull() ? siTrack->chi2()/siTrack->ndof() : -999 );
1417 double d0 = siTrack.
isNonnull() ? -1 * siTrack->dxy( bspot) : -999;
1418 hCalomuD0 = _dbe->
get(DirName+
"/"+
"METTask_CalomuD0");
if (hCalomuD0 && hCalomuD0->getRootObject()) hCalomuD0->Fill( d0 );
1421 const unsigned int nMuons = muon_h->size();
1422 for(
unsigned int mus = 0; mus < nMuons; mus++ ) {
1425 hCaloMExCorrection = _dbe->get(DirName+
"/"+
"METTask_CaloMExCorrection");
if (hCaloMExCorrection && hCaloMExCorrection->getRootObject()) hCaloMExCorrection->
Fill(muCorrData.
corrY());
1426 hCaloMEyCorrection = _dbe->get(DirName+
"/"+
"METTask_CaloMEyCorrection");
if (hCaloMEyCorrection && hCaloMEyCorrection->getRootObject()) hCaloMEyCorrection->
Fill(muCorrData.
corrX());
1427 hCaloMuonCorrectionFlag = _dbe->get(DirName+
"/"+
"METTask_CaloMuonCorrectionFlag");
if (hCaloMuonCorrectionFlag && hCaloMuonCorrectionFlag->getRootObject()) hCaloMuonCorrectionFlag->
Fill(muCorrData.
type());
1437 bool return_value=
false;
1440 iEvent.
getByLabel(theJetCollectionLabel, caloJets);
1442 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find jet product" << std::endl;
1443 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find jet product" << std::endl;
1446 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
1447 cal!=caloJets->end(); ++cal){
1448 if (cal->pt()>_highPtJetThreshold){
1453 return return_value;
1460 bool return_value=
false;
1463 iEvent.
getByLabel(theJetCollectionLabel, caloJets);
1465 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find jet product" << std::endl;
1466 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find jet product" << std::endl;
1469 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
1470 cal!=caloJets->end(); ++cal){
1471 if (cal->pt()>_lowPtJetThreshold){
1476 return return_value;
1483 bool return_value=
true;
1489 return return_value;
1496 bool return_value=
true;
1502 return return_value;
const bool EcalTightHaloId() const
T getParameter(std::string const &) const
EventNumber_t event() 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?
Geom::Theta< T > theta() const
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
virtual float phi() const =0
momentum azimuthal angle
std::vector< Vertex > VertexCollection
collection of Vertex objects
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
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
const bool HcalLooseHaloId() const
const bool CSCTightHaloId() const
bool isNonnull() const
Checks for non-null.
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
unsigned int triggerIndex(std::string const &name) const
virtual double theta() const =0
momentum polar angle
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
unsigned int size() const
Get number of paths stored.
Cos< T >::type cos(const T &t)
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
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
std::string const & triggerName(unsigned int index) const
XYZPointD XYZPoint
point in space with cartesian internal representation
static std::string const triggerResults("TriggerResults")
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 float pt() const GCC11_FINAL
transverse momentum
const bool EcalLooseHaloId() const
Power< A, B >::type pow(const A &a, const B &b)
double emEtFraction() const
void setCurrentFolder(const std::string &fullpath)