27 #include "TLorentzVector.h"
54 highPtJetExpr_ = highptjetparms.
getParameter<std::vector<std::string> >(
"hltPaths");
55 lowPtJetExpr_ = lowptjetparms .getParameter<std::vector<std::string> >(
"hltPaths");
56 highMETExpr_ = highmetparms .getParameter<std::vector<std::string> >(
"hltPaths");
58 muonExpr_ = muonparms .getParameter<std::vector<std::string> >(
"hltPaths");
59 elecExpr_ = eleparms .getParameter<std::vector<std::string> >(
"hltPaths");
60 minbiasExpr_ = minbiasparms .getParameter<std::vector<std::string> >(
"hltPaths");
67 delete _HighPtJetEventFlag;
68 delete _LowPtJetEventFlag;
69 delete _MinBiasEventFlag;
70 delete _HighMETEventFlag;
73 delete _MuonEventFlag;
84 HLTPathsJetMBByName_ =
parameters.getParameter<std::vector<std::string > >(
"HLTPathsJetMB");
90 _techTrigsAND = theCleaningParameters.getParameter<std::vector<unsigned > >(
"techTrigsAND");
91 _techTrigsOR = theCleaningParameters.getParameter<std::vector<unsigned > >(
"techTrigsOR");
92 _techTrigsNOT = theCleaningParameters.getParameter<std::vector<unsigned > >(
"techTrigsNOT");
94 _doHLTPhysicsOn = theCleaningParameters.getParameter<
bool>(
"doHLTPhysicsOn");
95 _hlt_PhysDec = theCleaningParameters.getParameter<std::string>(
"HLT_PhysDec");
97 _tightBHFiltering = theCleaningParameters.getParameter<
bool>(
"tightBHFiltering");
98 _tightJetIDFiltering = theCleaningParameters.getParameter<
int>(
"tightJetIDFiltering");
106 _doPVCheck = theCleaningParameters.getParameter<
bool>(
"doPrimaryVertexCheck");
107 vertexTag = theCleaningParameters.getParameter<
edm::InputTag>(
"vertexLabel");
110 _nvtx_min = theCleaningParameters.getParameter<
int>(
"nvtx_min");
111 _nvtxtrks_min = theCleaningParameters.getParameter<
int>(
"nvtxtrks_min");
112 _vtxndof_min = theCleaningParameters.getParameter<
int>(
"vtxndof_min");
113 _vtxchi2_max = theCleaningParameters.getParameter<
double>(
"vtxchi2_max");
114 _vtxz_max = theCleaningParameters.getParameter<
double>(
"vtxz_max");
120 _source =
parameters.getParameter<std::string>(
"Source");
122 if (theCaloMETCollectionLabel.label() ==
"corMetGlobalMuons" ) {
134 _verbose =
parameters.getParameter<
int>(
"verbose");
135 _print =
parameters.getParameter<
int>(
"printOut");
136 _etThreshold =
parameters.getParameter<
double>(
"etThreshold");
137 _allhist =
parameters.getParameter<
bool>(
"allHist");
138 _allSelection=
parameters.getParameter<
bool>(
"allSelection");
139 _cleanupSelection=
parameters.getParameter<
bool>(
"cleanupSelection");
141 _highPtJetThreshold =
parameters.getParameter<
double>(
"HighPtJetThreshold");
142 _lowPtJetThreshold =
parameters.getParameter<
double>(
"LowPtJetThreshold");
143 _highMETThreshold =
parameters.getParameter<
double>(
"HighMETThreshold");
151 std::string
DirName =
"JetMET/MET/"+_source;
154 hmetME = dbe->
book1D(
"metReco",
"metReco", 4, 1, 5);
159 _FolderNames.push_back(
"All");
160 _FolderNames.push_back(
"BasicCleanup");
161 _FolderNames.push_back(
"ExtraCleanup");
162 _FolderNames.push_back(
"HcalNoiseFilter");
163 _FolderNames.push_back(
"JetIDMinimal");
164 _FolderNames.push_back(
"JetIDLoose");
165 _FolderNames.push_back(
"JetIDTight");
166 _FolderNames.push_back(
"BeamHaloIDTightPass");
167 _FolderNames.push_back(
"BeamHaloIDLoosePass");
168 _FolderNames.push_back(
"Triggers");
169 _FolderNames.push_back(
"PV");
171 for (std::vector<std::string>::const_iterator ic = _FolderNames.begin();
172 ic != _FolderNames.end(); ic++){
173 if (*ic==
"All") bookMESet(DirName+
"/"+*ic);
174 if (_cleanupSelection){
175 if (*ic==
"BasicCleanup") bookMESet(DirName+
"/"+*ic);
176 if (*ic==
"ExtraCleanup") bookMESet(DirName+
"/"+*ic);
179 if (*ic==
"HcalNoiseFilter") bookMESet(DirName+
"/"+*ic);
180 if (*ic==
"JetIDMinimal") bookMESet(DirName+
"/"+*ic);
181 if (*ic==
"JetIDLoose") bookMESet(DirName+
"/"+*ic);
182 if (*ic==
"JetIDTight") bookMESet(DirName+
"/"+*ic);
183 if (*ic==
"BeamHaloIDTightPass") bookMESet(DirName+
"/"+*ic);
184 if (*ic==
"BeamHaloIDLoosePass") bookMESet(DirName+
"/"+*ic);
185 if (*ic==
"Triggers") bookMESet(DirName+
"/"+*ic);
186 if (*ic==
"PV") bookMESet(DirName+
"/"+*ic);
204 bool bLumiSecPlot=
false;
205 if (DirName.find(
"All")!=std::string::npos) bLumiSecPlot=
true;
207 bookMonitorElement(DirName,bLumiSecPlot);
209 if ( _HighPtJetEventFlag->on() ) {
210 bookMonitorElementTriggered(DirName+
"/"+
"HighPtJet",
false);
211 hTriggerName_HighPtJet = _dbe->bookString(
"triggerName_HighPtJet", highPtJetExpr_[0]);
214 if ( _LowPtJetEventFlag->on() ) {
215 bookMonitorElementTriggered(DirName+
"/"+
"LowPtJet",
false);
216 hTriggerName_LowPtJet = _dbe->bookString(
"triggerName_LowPtJet", lowPtJetExpr_[0]);
219 if ( _MinBiasEventFlag->on() ) {
220 bookMonitorElementTriggered(DirName+
"/"+
"MinBias",
false);
221 hTriggerName_MinBias = _dbe->bookString(
"triggerName_MinBias", minbiasExpr_[0]);
222 if (_verbose)
std::cout <<
"_MinBiasEventFlag is on, folder created\n";
225 if ( _HighMETEventFlag->on() ) {
226 bookMonitorElementTriggered(DirName+
"/"+
"HighMET",
false);
227 hTriggerName_HighMET = _dbe->bookString(
"triggerName_HighMET", highMETExpr_[0]);
235 if ( _EleEventFlag->on() ) {
236 bookMonitorElementTriggered(DirName+
"/"+
"Ele",
false);
237 hTriggerName_Ele = _dbe->bookString(
"triggerName_Ele", elecExpr_[0]);
238 if (_verbose)
std::cout <<
"_EleEventFlag is on, folder created\n";
241 if ( _MuonEventFlag->on() ) {
242 bookMonitorElementTriggered(DirName+
"/"+
"Muon",
false);
243 hTriggerName_Muon = _dbe->bookString(
"triggerName_Muon", muonExpr_[0]);
244 if (_verbose)
std::cout <<
"_MuonEventFlag is on, folder created\n";
251 if (_verbose)
std::cout <<
"bookMonitorElement " << DirName << std::endl;
253 _dbe->setCurrentFolder(DirName);
255 bookMonitorElementTriggered(DirName, bLumiSecPlot);
260 hCaloMaxEtInEmTowers = _dbe->book1D(
"METTask_CaloMaxEtInEmTowers",
"METTask_CaloMaxEtInEmTowers" ,100,0,2000);
261 hCaloMaxEtInEmTowers->setAxisTitle(
"Et(Max) in EM Tower [GeV]",1);
262 hCaloMaxEtInHadTowers = _dbe->book1D(
"METTask_CaloMaxEtInHadTowers",
"METTask_CaloMaxEtInHadTowers" ,100,0,2000);
263 hCaloMaxEtInHadTowers->setAxisTitle(
"Et(Max) in Had Tower [GeV]",1);
265 hCaloHadEtInHB = _dbe->book1D(
"METTask_CaloHadEtInHB",
"METTask_CaloHadEtInHB",100,0,2000);
266 hCaloHadEtInHB->setAxisTitle(
"Had Et [GeV]",1);
267 hCaloHadEtInHO = _dbe->book1D(
"METTask_CaloHadEtInHO",
"METTask_CaloHadEtInHO",25,0,500);
268 hCaloHadEtInHO->setAxisTitle(
"Had Et [GeV]",1);
269 hCaloHadEtInHE = _dbe->book1D(
"METTask_CaloHadEtInHE",
"METTask_CaloHadEtInHE",100,0,2000);
270 hCaloHadEtInHE->setAxisTitle(
"Had Et [GeV]",1);
271 hCaloHadEtInHF = _dbe->book1D(
"METTask_CaloHadEtInHF",
"METTask_CaloHadEtInHF",50,0,1000);
272 hCaloHadEtInHF->setAxisTitle(
"Had Et [GeV]",1);
273 hCaloEmEtInHF = _dbe->book1D(
"METTask_CaloEmEtInHF" ,
"METTask_CaloEmEtInHF" ,25,0,500);
274 hCaloEmEtInHF->setAxisTitle(
"EM Et [GeV]",1);
275 hCaloEmEtInEE = _dbe->book1D(
"METTask_CaloEmEtInEE" ,
"METTask_CaloEmEtInEE" ,50,0,1000);
276 hCaloEmEtInEE->setAxisTitle(
"EM Et [GeV]",1);
277 hCaloEmEtInEB = _dbe->book1D(
"METTask_CaloEmEtInEB" ,
"METTask_CaloEmEtInEB" ,100,0,2000);
278 hCaloEmEtInEB->setAxisTitle(
"EM Et [GeV]",1);
280 hCaloEmMEx= _dbe->book1D(
"METTask_CaloEmMEx",
"METTask_CaloEmMEx",200,-500,500);
281 hCaloEmMEx->setAxisTitle(
"EM MEx [GeV]",1);
282 hCaloEmMEy= _dbe->book1D(
"METTask_CaloEmMEy",
"METTask_CaloEmMEy",200,-500,500);
283 hCaloEmMEy->setAxisTitle(
"EM MEy [GeV]",1);
284 hCaloEmMET= _dbe->book1D(
"METTask_CaloEmMET",
"METTask_CaloEmMET",200,0,1000);
285 hCaloEmMET->setAxisTitle(
"EM MET [GeV]",1);
286 hCaloEmMETPhi= _dbe->book1D(
"METTask_CaloEmMETPhi",
"METTask_CaloEmMETPhi", 60, -3.2, 3.2);
287 hCaloEmMETPhi->setAxisTitle(
"EM METPhi [rad]",1);
289 hCaloHaMEx= _dbe->book1D(
"METTask_CaloHaMEx",
"METTask_CaloHaMEx",200,-500,500);
290 hCaloHaMEx->setAxisTitle(
"HA MEx [GeV]",1);
291 hCaloHaMEy= _dbe->book1D(
"METTask_CaloHaMEy",
"METTask_CaloHaMEy",200,-500,500);
292 hCaloHaMEy->setAxisTitle(
"HA MEy [GeV]",1);
293 hCaloHaMET= _dbe->book1D(
"METTask_CaloHaMET",
"METTask_CaloHaMET",200,0,1000);
294 hCaloHaMET->setAxisTitle(
"HA MET [GeV]",1);
295 hCaloHaMETPhi= _dbe->book1D(
"METTask_CaloHaMETPhi",
"METTask_CaloHaMETPhi", 60, -3.2, 3.2);
296 hCaloHaMETPhi->setAxisTitle(
"HA METPhi [rad]",1);
304 if (_verbose)
std::cout <<
"bookMonitorElementTriggered " << DirName << std::endl;
306 _dbe->setCurrentFolder(DirName);
309 hCaloMEx = _dbe->book1D(
"METTask_CaloMEx",
"METTask_CaloMEx", 200, -500, 500);
310 hCaloMEy = _dbe->book1D(
"METTask_CaloMEy",
"METTask_CaloMEy", 200, -500, 500);
311 hCaloMET = _dbe->book1D(
"METTask_CaloMET",
"METTask_CaloMET", 200, 0, 1000);
312 hCaloMET1 = _dbe->book1D(
"METTask_CaloMET1",
"METTask_CaloMET1", 80, 0, 200);
313 hCaloMETNoHF = _dbe->book1D(
"METTask_CaloMETNoHF",
"METTask_CaloMETNoHF", 200, 0, 1000);
314 hCaloSumET = _dbe->book1D(
"METTask_CaloSumET",
"METTask_CaloSumET", 400, 0, 4000);
315 hCaloMETSig = _dbe->book1D(
"METTask_CaloMETSig",
"METTask_CaloMETSig", 51, 0, 51);
316 hCaloMETPhi = _dbe->book1D(
"METTask_CaloMETPhi",
"METTask_CaloMETPhi", 60, -3.2, 3.2);
317 hCaloMETPhi020 = _dbe->book1D(
"METTask_CaloMETPhi020",
"METTask_CaloMETPhi020", 60, -3.2, 3.2);
318 hCaloMET_logx = _dbe->book1D(
"METTask_CaloMET_logx",
"METTask_CaloMET_logx", 40, -1, 7);
319 hCaloSumET_logx = _dbe->book1D(
"METTask_CaloSumET_logx",
"METTask_CaloSumET_logx", 40, -1, 7);
321 hCaloMEx ->setAxisTitle(
"MEx [GeV]", 1);
322 hCaloMEy ->setAxisTitle(
"MEy [GeV]", 1);
323 hCaloMET ->setAxisTitle(
"MET [GeV]", 1);
324 hCaloMET1 ->setAxisTitle(
"MET [GeV]", 1);
325 hCaloMETNoHF ->setAxisTitle(
"MET (No HF) [GeV]", 1);
326 hCaloSumET ->setAxisTitle(
"SumET [GeV]", 1);
327 hCaloMETSig ->setAxisTitle(
"METSig", 1);
328 hCaloMETPhi ->setAxisTitle(
"METPhi [rad]", 1);
329 hCaloMETPhi020 ->setAxisTitle(
"METPhi [rad] (MET>20 GeV)", 1);
330 hCaloMET_logx ->setAxisTitle(
"log(MET) [GeV]", 1);
331 hCaloSumET_logx->setAxisTitle(
"log(SumET) [GeV]", 1);
336 hCaloMEx_profile = _dbe->bookProfile(
"METTask_CaloMEx_profile",
"MEx [GeV]",
nbinsPV,
PVlow,
PVup, 200, -500, 500);
337 hCaloMEy_profile = _dbe->bookProfile(
"METTask_CaloMEy_profile",
"MEy [GeV]",
nbinsPV,
PVlow,
PVup, 200, -500, 500);
338 hCaloMET_profile = _dbe->bookProfile(
"METTask_CaloMET_profile",
"MET [GeV]",
nbinsPV,
PVlow,
PVup, 200, 0, 1000);
339 hCaloMETNoHF_profile = _dbe->bookProfile(
"METTask_CaloMETNoHF_profile",
"METNoHF [GeV]",
nbinsPV,
PVlow,
PVup, 200, 0, 1000);
340 hCaloSumET_profile = _dbe->bookProfile(
"METTask_CaloSumET_profile",
"SumET [GeV]",
nbinsPV,
PVlow,
PVup, 400, 0, 4000);
345 hCaloMEx_profile ->setAxisTitle(
"nvtx", 1);
346 hCaloMEy_profile ->setAxisTitle(
"nvtx", 1);
347 hCaloMET_profile ->setAxisTitle(
"nvtx", 1);
348 hCaloMETNoHF_profile->setAxisTitle(
"nvtx", 1);
349 hCaloSumET_profile ->setAxisTitle(
"nvtx", 1);
354 hCaloMExLS = _dbe->book2D(
"METTask_CaloMEx_LS",
"METTask_CaloMEx_LS",200,-200,200,50,0.,500.);
355 hCaloMExLS->setAxisTitle(
"MEx [GeV]",1);
356 hCaloMExLS->setAxisTitle(
"Lumi Section",2);
357 hCaloMEyLS = _dbe->book2D(
"METTask_CaloMEy_LS",
"METTask_CaloMEy_LS",200,-200,200,50,0.,500.);
358 hCaloMEyLS->setAxisTitle(
"MEy [GeV]",1);
359 hCaloMEyLS->setAxisTitle(
"Lumi Section",2);
366 hCaloEtFractionHadronic = _dbe->book1D(
"METTask_CaloEtFractionHadronic",
"METTask_CaloEtFractionHadronic",100,0,1);
367 hCaloEtFractionHadronic->setAxisTitle(
"Hadronic Et Fraction",1);
368 hCaloEmEtFraction = _dbe->book1D(
"METTask_CaloEmEtFraction",
"METTask_CaloEmEtFraction" ,100,0,1);
369 hCaloEmEtFraction->setAxisTitle(
"EM Et Fraction",1);
375 hCaloEmEtFraction020 = _dbe->book1D(
"METTask_CaloEmEtFraction020",
"METTask_CaloEmEtFraction020" ,100,0,1);
376 hCaloEmEtFraction020->setAxisTitle(
"EM Et Fraction (MET>20 GeV)",1);
379 if (theCaloMETCollectionLabel.label() ==
"corMetGlobalMuons" ) {
380 hCalomuPt = _dbe->book1D(
"METTask_CalomuonPt",
"METTask_CalomuonPt", 50, 0, 500);
381 hCalomuEta = _dbe->book1D(
"METTask_CalomuonEta",
"METTask_CalomuonEta", 60, -3.0, 3.0);
382 hCalomuNhits = _dbe->book1D(
"METTask_CalomuonNhits",
"METTask_CalomuonNhits", 50, 0, 50);
383 hCalomuChi2 = _dbe->book1D(
"METTask_CalomuonNormalizedChi2",
"METTask_CalomuonNormalizedChi2", 20, 0, 20);
384 hCalomuD0 = _dbe->book1D(
"METTask_CalomuonD0",
"METTask_CalomuonD0", 50, -1, 1);
385 hCaloMExCorrection = _dbe->book1D(
"METTask_CaloMExCorrection",
"METTask_CaloMExCorrection", 100, -500.0,500.0);
386 hCaloMEyCorrection = _dbe->book1D(
"METTask_CaloMEyCorrection",
"METTask_CaloMEyCorrection", 100, -500.0,500.0);
387 hCaloMuonCorrectionFlag = _dbe->book1D(
"METTask_CaloCorrectionFlag",
"METTask_CaloCorrectionFlag", 5, -0.5, 4.5);
395 if ( _HighPtJetEventFlag->on() ) _HighPtJetEventFlag->initRun( iRun, iSetup );
396 if ( _LowPtJetEventFlag ->on() ) _LowPtJetEventFlag ->initRun( iRun, iSetup );
397 if ( _MinBiasEventFlag ->on() ) _MinBiasEventFlag ->initRun( iRun, iSetup );
398 if ( _HighMETEventFlag ->on() ) _HighMETEventFlag ->initRun( iRun, iSetup );
400 if ( _EleEventFlag ->on() ) _EleEventFlag ->initRun( iRun, iSetup );
401 if ( _MuonEventFlag ->on() ) _MuonEventFlag ->initRun( iRun, iSetup );
403 if (_HighPtJetEventFlag->on() && _HighPtJetEventFlag->expressionsFromDB(_HighPtJetEventFlag->hltDBKey(), iSetup)[0] !=
"CONFIG_ERROR")
404 highPtJetExpr_ = _HighPtJetEventFlag->expressionsFromDB(_HighPtJetEventFlag->hltDBKey(), iSetup);
405 if (_LowPtJetEventFlag->on() && _LowPtJetEventFlag->expressionsFromDB(_LowPtJetEventFlag->hltDBKey(), iSetup)[0] !=
"CONFIG_ERROR")
406 lowPtJetExpr_ = _LowPtJetEventFlag->expressionsFromDB(_LowPtJetEventFlag->hltDBKey(), iSetup);
407 if (_HighMETEventFlag->on() && _HighMETEventFlag->expressionsFromDB(_HighMETEventFlag->hltDBKey(), iSetup)[0] !=
"CONFIG_ERROR")
408 highMETExpr_ = _HighMETEventFlag->expressionsFromDB(_HighMETEventFlag->hltDBKey(), iSetup);
411 if (_MuonEventFlag->on() && _MuonEventFlag->expressionsFromDB(_MuonEventFlag->hltDBKey(), iSetup)[0] !=
"CONFIG_ERROR")
412 muonExpr_ = _MuonEventFlag->expressionsFromDB(_MuonEventFlag->hltDBKey(), iSetup);
413 if (_EleEventFlag->on() && _EleEventFlag->expressionsFromDB(_EleEventFlag->hltDBKey(), iSetup)[0] !=
"CONFIG_ERROR")
414 elecExpr_ = _EleEventFlag->expressionsFromDB(_EleEventFlag->hltDBKey(), iSetup);
415 if (_MinBiasEventFlag->on() && _MinBiasEventFlag->expressionsFromDB(_MinBiasEventFlag->hltDBKey(), iSetup)[0] !=
"CONFIG_ERROR")
416 minbiasExpr_ = _MinBiasEventFlag->expressionsFromDB(_MinBiasEventFlag->hltDBKey(), iSetup);
428 std::string
dirName =
"JetMET/MET/"+_source+
"/";
429 _dbe->setCurrentFolder(dirName);
434 meLumiSec = _dbe->get(
"JetMET/lumisec");
439 tlumisec = meLumiSec->
getTH1F();
440 for (
int i=0;
i<500;
i++){
441 if (tlumisec->GetBinContent(
i+1)) totlsec++;
443 totltime = double(totlsec*90);
446 if (totltime==0.) totltime=1.;
451 for (std::vector<std::string>::const_iterator ic = _FolderNames.begin(); ic != _FolderNames.end(); ic++)
455 DirName = dirName+*ic;
457 makeRatePlot(DirName,totltime);
458 if ( _HighPtJetEventFlag->on() )
459 makeRatePlot(DirName+
"/"+
"triggerName_HighJetPt",totltime);
460 if ( _LowPtJetEventFlag->on() )
461 makeRatePlot(DirName+
"/"+
"triggerName_LowJetPt",totltime);
462 if ( _MinBiasEventFlag->on() )
463 makeRatePlot(DirName+
"/"+
"triggerName_MinBias",totltime);
464 if ( _HighMETEventFlag->on() )
465 makeRatePlot(DirName+
"/"+
"triggerName_HighMET",totltime);
468 if ( _EleEventFlag->on() )
469 makeRatePlot(DirName+
"/"+
"triggerName_Ele",totltime);
470 if ( _MuonEventFlag->on() )
471 makeRatePlot(DirName+
"/"+
"triggerName_Muon",totltime);
480 _dbe->setCurrentFolder(DirName);
481 MonitorElement *meCaloMET = _dbe->get(DirName+
"/"+
"METTask_CaloMET");
488 tCaloMET = meCaloMET->
getTH1F();
491 tCaloMETRate = (TH1F*) tCaloMET->Clone(
"METTask_CaloMETRate");
492 for (
int i = tCaloMETRate->GetNbinsX()-1;
i>=0;
i--){
493 tCaloMETRate->SetBinContent(
i+1,tCaloMETRate->GetBinContent(
i+2)+tCaloMET->GetBinContent(
i+1));
495 for (
int i = 0;
i<tCaloMETRate->GetNbinsX();
i++){
496 tCaloMETRate->SetBinContent(
i+1,tCaloMETRate->GetBinContent(
i+1)/double(totltime));
499 tCaloMETRate->SetName(
"METTask_CaloMETRate");
500 tCaloMETRate->SetTitle(
"METTask_CaloMETRate");
501 hCaloMETRate = _dbe->book1D(
"METTask_CaloMETRate",tCaloMETRate);
502 hCaloMETRate->setAxisTitle(
"MET Threshold [GeV]",1);
511 if (_verbose)
std::cout <<
"CaloMETAnalyzer analyze" << std::endl;
513 std::string
DirName =
"JetMET/MET/"+_source;
535 if(&triggerResults) {
542 int ntrigs = triggerResults.
size();
543 if (_verbose)
std::cout <<
"ntrigs=" << ntrigs << std::endl;
552 const unsigned int nTrig(triggerNames.
size());
553 for (
unsigned int i=0;
i<nTrig;++
i)
555 if (triggerNames.
triggerName(
i).find(highPtJetExpr_[0].substr(0,highPtJetExpr_[0].rfind(
"_v")+2))!=std::string::npos && triggerResults.
accept(
i))
556 _trig_HighPtJet=
true;
557 else if (triggerNames.
triggerName(
i).find(lowPtJetExpr_[0].substr(0,lowPtJetExpr_[0].rfind(
"_v")+2))!=std::string::npos && triggerResults.
accept(
i))
559 else if (triggerNames.
triggerName(
i).find(highMETExpr_[0].substr(0,highMETExpr_[0].rfind(
"_v")+2))!=std::string::npos && triggerResults.
accept(
i))
563 else if (triggerNames.
triggerName(
i).find(muonExpr_[0].substr(0,muonExpr_[0].rfind(
"_v")+2))!=std::string::npos && triggerResults.
accept(
i))
565 else if (triggerNames.
triggerName(
i).find(elecExpr_[0].substr(0,elecExpr_[0].rfind(
"_v")+2))!=std::string::npos && triggerResults.
accept(
i))
567 else if (triggerNames.
triggerName(
i).find(minbiasExpr_[0].substr(0,minbiasExpr_[0].rfind(
"_v")+2))!=std::string::npos && triggerResults.
accept(
i))
572 for (
unsigned int i=0;
i!=HLTPathsJetMBByName_.size();
i++) {
573 unsigned int triggerIndex = triggerNames.
triggerIndex(HLTPathsJetMBByName_[
i]);
574 if (triggerIndex<triggerResults.
size()) {
575 if (triggerResults.
accept(triggerIndex)) {
581 if (HLTPathsJetMBByName_.size()==0) _trig_JetMB=triggerResults.
size()-1;
610 edm::LogInfo(
"CaloMetAnalyzer") <<
"TriggerResults::HLT not found, "
611 "automatically select events";
623 iEvent.
getByLabel(theCaloMETCollectionLabel, calometcoll);
626 std::cout<<
"Unable to find MET results for CaloMET collection "<<theCaloMETCollectionLabel<<std::endl;
632 calomet = &(calometcol->front());
638 iEvent.
getByLabel(
"metNoHF", calometnohfcoll);
640 if(!calometnohfcoll.
isValid()) {
641 std::cout<<
"Unable to find MET results for CaloMETNoHF collection metNoHF"<<std::endl;
647 calometnohf = &(calometnohfcol->front());
652 if (theCaloMETCollectionLabel.label() ==
"corMetGlobalMuons" ) {
654 iEvent.
getByLabel(
"muonMETValueMapProducer" ,
"muCorrData", corMetGlobalMuons_ValueMap_Handle);
656 iEvent.
getByLabel(inputBeamSpotLabel, beamSpot_h);
658 if(!beamSpot_h.isValid())
edm::LogInfo(
"OutputInfo") <<
"falied to retrieve beam spot data require by MET Task";
660 bspot = ( beamSpot_h.isValid() ) ? beamSpot_h->position() :
math::XYZPoint(0, 0, 0);
668 iEvent.
getByLabel(HcalNoiseRBXCollectionTag,HRBXCollection);
669 if (!HRBXCollection.
isValid()) {
670 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find HcalNoiseRBX Collection" << std::endl;
671 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find HcalNoiseRBX Collection" << std::endl;
676 iEvent.
getByLabel(HBHENoiseFilterResultTag, HBHENoiseFilterResultHandle);
677 bool HBHENoiseFilterResult = *HBHENoiseFilterResultHandle;
678 if (!HBHENoiseFilterResultHandle.
isValid()) {
679 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
680 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
685 iEvent.
getByLabel(theJetCollectionLabel, caloJets);
687 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find jet product" << std::endl;
688 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find jet product" << std::endl;
692 iEvent.
getByLabel(theCaloTowersLabel, towers);
694 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find caltower product" << std::endl;
695 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find caltower product" << std::endl;
701 if (_source==
"CaloMET") validateMET(*calomet,towers);
705 if (_allhist) computeEmHaMET(towers);
710 if (_verbose)
std::cout <<
"JetID starts" << std::endl;
715 bool bJetIDMinimal=
true;
717 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
718 cal!=caloJets->end(); ++cal){
719 jetID->calculate(iEvent, *cal);
720 if (_print && nj<=1)
std::cout <<
"Jet pT = " << cal->pt() <<
" (GeV) "
721 <<
" eta = " << cal->eta() <<
" "
722 <<
" phi = " << cal->phi() <<
" "
723 <<
" emf = " << cal->emEnergyFraction() << std::endl;
726 if (fabs(cal->eta())<=2.6 &&
727 cal->emEnergyFraction()<=0.01) bJetIDMinimal=
false;
734 bool bJetIDLoose=
true;
735 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
736 cal!=caloJets->end(); ++cal){
737 jetID->calculate(iEvent, *cal);
738 if (_verbose)
std::cout << jetID->n90Hits() <<
" "
739 << jetID->restrictedEMF() <<
" "
740 << cal->pt() << std::endl;
744 if (jetID->n90Hits()<2) bJetIDLoose=
false;
745 if (jetID->fHPD()>=0.98) bJetIDLoose=
false;
748 if (fabs(cal->eta())<2.55){
749 if (cal->emEnergyFraction()<=0.01) bJetIDLoose=
false;
753 if (cal->emEnergyFraction()<=-0.9) bJetIDLoose=
false;
755 if (cal->emEnergyFraction()>= 1.0) bJetIDLoose=
false;
764 bool bJetIDTight=
true;
765 bJetIDTight=bJetIDLoose;
766 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
767 cal!=caloJets->end(); ++cal){
768 jetID->calculate(iEvent, *cal);
772 if (jetID->fHPD()>=0.95) bJetIDTight=
false;
775 if (fabs(cal->eta())>=1.00 && fabs(cal->eta())<1.75){
776 if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=
false;
780 else if (fabs(cal->eta())>=1.75 && fabs(cal->eta())<2.55){
781 if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=
false;
785 else if (fabs(cal->eta())>=2.55 && fabs(cal->eta())<3.25){
786 if (cal->pt()< 50. && cal->emEnergyFraction()<=-0.3) bJetIDTight=
false;
787 if (cal->pt()>=50. && cal->pt()< 80. && cal->emEnergyFraction()<=-0.2) bJetIDTight=
false;
788 if (cal->pt()>=80. && cal->pt()<340. && cal->emEnergyFraction()<=-0.1) bJetIDTight=
false;
789 if (cal->pt()>=340. && cal->emEnergyFraction()<=-0.1
790 && cal->emEnergyFraction()>=0.95) bJetIDTight=
false;
794 else if (fabs(cal->eta())>=3.25){
795 if (cal->pt()< 50. && cal->emEnergyFraction()<=-0.3
796 && cal->emEnergyFraction()>=0.90) bJetIDTight=
false;
797 if (cal->pt()>=50. && cal->pt()<130. && cal->emEnergyFraction()<=-0.2
798 && cal->emEnergyFraction()>=0.80) bJetIDTight=
false;
799 if (cal->pt()>=130. && cal->emEnergyFraction()<=-0.1
800 && cal->emEnergyFraction()>=0.70) bJetIDTight=
false;
805 if (_verbose)
std::cout <<
"JetID ends" << std::endl;
810 bool bHcalNoiseFilter = HBHENoiseFilterResult;
815 iEvent.
getByLabel(BeamHaloSummaryTag, TheBeamHaloSummary) ;
817 bool bBeamHaloIDTightPass =
true;
818 bool bBeamHaloIDLoosePass =
true;
820 if(TheBeamHaloSummary.
isValid()) {
831 bBeamHaloIDLoosePass =
false;
835 bBeamHaloIDTightPass =
false;
839 if (_verbose)
std::cout <<
"BeamHaloSummary ends" << std::endl;
845 bool bPrimaryVertex =
true;
847 bPrimaryVertex =
false;
853 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find vertex collection" << std::endl;
854 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find vertex collection" << std::endl;
859 int vertex_number = vertexCollection.size();
860 reco::VertexCollection::const_iterator
v = vertexCollection.begin();
861 for ( ; v != vertexCollection.end(); ++
v) {
862 double vertex_chi2 = v->normalizedChi2();
863 double vertex_ndof = v->ndof();
864 bool fakeVtx = v->isFake();
865 double vertex_Z = v->z();
868 && vertex_number>=_nvtx_min
869 && vertex_ndof >_vtxndof_min
870 && vertex_chi2 <_vtxchi2_max
871 && fabs(vertex_Z)<_vtxz_max ) {
872 bPrimaryVertex =
true;
883 if (!gtReadoutRecord.
isValid()) {
884 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find GT readout record" << std::endl;
885 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find GT readout record product" << std::endl;
888 bool bTechTriggers =
true;
889 bool bTechTriggersAND =
true;
890 bool bTechTriggersOR =
false;
891 bool bTechTriggersNOT =
false;
893 if (gtReadoutRecord.
isValid()) {
894 const TechnicalTriggerWord& technicalTriggerWordBeforeMask = gtReadoutRecord->technicalTriggerWord();
896 if (_techTrigsAND.size() == 0)
897 bTechTriggersAND =
true;
899 for (
unsigned ttr = 0; ttr != _techTrigsAND.size(); ttr++) {
900 bTechTriggersAND = bTechTriggersAND && technicalTriggerWordBeforeMask.at(_techTrigsAND.at(ttr));
903 if (_techTrigsAND.size() == 0)
904 bTechTriggersOR =
true;
906 for (
unsigned ttr = 0; ttr != _techTrigsOR.size(); ttr++) {
907 bTechTriggersOR = bTechTriggersOR || technicalTriggerWordBeforeMask.at(_techTrigsOR.at(ttr));
909 if (_techTrigsNOT.size() == 0)
910 bTechTriggersNOT =
false;
912 for (
unsigned ttr = 0; ttr != _techTrigsNOT.size(); ttr++) {
913 bTechTriggersNOT = bTechTriggersNOT || technicalTriggerWordBeforeMask.at(_techTrigsNOT.at(ttr));
918 bTechTriggersAND =
true;
919 bTechTriggersOR =
true;
920 bTechTriggersNOT =
false;
923 if (_techTrigsAND.size()==0)
924 bTechTriggersAND =
true;
925 if (_techTrigsOR.size()==0)
926 bTechTriggersOR =
true;
927 if (_techTrigsNOT.size()==0)
928 bTechTriggersNOT =
false;
930 bTechTriggers = bTechTriggersAND && bTechTriggersOR && !bTechTriggersNOT;
935 bool bHcalNoise = bHcalNoiseFilter;
936 bool bBeamHaloID = bBeamHaloIDLoosePass;
937 bool bJetID = bJetIDMinimal;
939 bool bPhysicsDeclared =
true;
940 if(_doHLTPhysicsOn) bPhysicsDeclared =_trig_PhysDec;
942 if (_tightBHFiltering) bBeamHaloID = bBeamHaloIDTightPass;
944 if (_tightJetIDFiltering==1) bJetID = bJetIDMinimal;
945 else if (_tightJetIDFiltering==2) bJetID = bJetIDLoose;
946 else if (_tightJetIDFiltering==3) bJetID = bJetIDTight;
947 else if (_tightJetIDFiltering==-1) bJetID =
true;
949 bool bBasicCleanup = bTechTriggers && bPrimaryVertex && bPhysicsDeclared;
950 bool bExtraCleanup = bBasicCleanup && bHcalNoise && bJetID && bBeamHaloID;
954 for (std::vector<std::string>::const_iterator ic = _FolderNames.begin();
955 ic != _FolderNames.end(); ic++){
956 if (*ic==
"All") fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
957 if (DCSFilter->filter(iEvent, iSetup)) {
958 if (_cleanupSelection){
959 if (*ic==
"BasicCleanup" && bBasicCleanup) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
960 if (*ic==
"ExtraCleanup" && bExtraCleanup) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
963 if (*ic==
"HcalNoiseFilter" && bHcalNoiseFilter ) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
964 if (*ic==
"JetIDMinimal" && bJetIDMinimal) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
965 if (*ic==
"JetIDLoose" && bJetIDLoose) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
966 if (*ic==
"JetIDTight" && bJetIDTight) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
967 if (*ic==
"BeamHaloIDTightPass" && bBeamHaloIDTightPass) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
968 if (*ic==
"BeamHaloIDLoosePass" && bBeamHaloIDLoosePass) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
969 if (*ic==
"Triggers" && bTechTriggers) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
970 if (*ic==
"PV" && bPrimaryVertex) fillMESet(iEvent, DirName+
"/"+*ic, *calomet, *calometnohf);
982 double sum_em_et = 0.0;
983 double sum_em_ex = 0.0;
984 double sum_em_ey = 0.0;
985 double sum_em_ez = 0.0;
987 double sum_ha_et = 0.0;
988 double sum_ha_ex = 0.0;
989 double sum_ha_ey = 0.0;
990 double sum_ha_ez = 0.0;
992 for ( ; towerCand != towers->
end(); towerCand++)
999 double Tower_ET = calotower->
et();
1002 double phi = candidate->
phi();
1005 double e_em = calotower->
emEnergy();
1007 double et_em = e_em*
sin(theta);
1008 double et_ha = e_ha*
sin(theta);
1010 sum_em_ez += e_em*
cos(theta);
1012 sum_em_ex += et_em*
cos(phi);
1013 sum_em_ey += et_em*
sin(phi);
1015 sum_ha_ez += e_ha*
cos(theta);
1017 sum_ha_ex += et_ha*
cos(phi);
1018 sum_ha_ey += et_ha*
sin(phi);
1026 _EmMEx = -sum_em_ex;
1027 _EmMEy = -sum_em_ey;
1028 _EmMET =
pow(_EmMEx*_EmMEx+_EmMEy*_EmMEy,0.5);
1029 _EmCaloEz = sum_em_ez;
1030 _EmSumEt = sum_em_et;
1031 _EmMetPhi = atan2( _EmMEy, _EmMEx );
1033 _HaMEx = -sum_ha_ex;
1034 _HaMEy = -sum_ha_ey;
1035 _HaMET =
pow(_HaMEx*_HaMEx+_HaMEy*_HaMEy,0.5);
1036 _HaCaloEz = sum_ha_ez;
1037 _HaSumEt = sum_ha_et;
1038 _HaMetPhi = atan2( _HaMEy, _HaMEx );
1048 double sum_et = 0.0;
1049 double sum_ex = 0.0;
1050 double sum_ey = 0.0;
1051 double sum_ez = 0.0;
1053 for ( ; towerCand != towers->
end(); towerCand++)
1060 double Tower_ET = calotower->
et();
1063 double phi = candidate->
phi();
1065 double e = candidate->
energy();
1066 double et = e*
sin(theta);
1067 sum_ez += e*
cos(theta);
1069 sum_ex += et*
cos(phi);
1070 sum_ey += et*
sin(phi);
1077 double Mex = -sum_ex;
1078 double Mey = -sum_ey;
1080 double Met =
sqrt( sum_ex*sum_ex + sum_ey*sum_ey );
1081 double Sumet = sum_et;
1085 if (Sumet!=calomet.
sumEt() || Mex!=calomet.
px() || Mey!=calomet.
py() || Met!=calomet.
pt() ){
1087 std::cout <<
"SUMET" << Sumet <<
" METBlock" << calomet.
sumEt() << std::endl;
1088 std::cout <<
"MEX" << Mex <<
" METBlock" << calomet.
px() << std::endl;
1089 std::cout <<
"MEY" << Mey <<
" METBlock" << calomet.
py() << std::endl;
1090 std::cout <<
"MET" << Met <<
" METBlock" << calomet.
pt() << std::endl;
1096 <<
"MEX" << calomet.
px() <<
" (GeV) "
1097 <<
"MEY" << calomet.
py() <<
" (GeV) "
1098 <<
"MET" << calomet.
pt() <<
" (GeV) " << std::endl;
1109 _dbe->setCurrentFolder(DirName);
1111 bool bLumiSecPlot=
false;
1112 if (DirName.find(
"All")) bLumiSecPlot=
true;
1115 fillMonitorElement(iEvent,DirName,
"",calomet,calometnohf, bLumiSecPlot);
1116 if (_trig_HighPtJet)
1117 fillMonitorElementTriggered(iEvent,DirName,
"HighPtJet",calomet,calometnohf,
false);
1119 fillMonitorElementTriggered(iEvent,DirName,
"LowPtJet",calomet,calometnohf,
false);
1121 fillMonitorElementTriggered(iEvent,DirName,
"MinBias",calomet,calometnohf,
false);
1123 fillMonitorElementTriggered(iEvent,DirName,
"HighMET",calomet,calometnohf,
false);
1127 fillMonitorElementTriggered(iEvent,DirName,
"Ele",calomet,calometnohf,
false);
1129 fillMonitorElementTriggered(iEvent,DirName,
"Muon",calomet,calometnohf,
false);
1135 std::string TriggerTypeName,
1140 fillMonitorElementTriggered(iEvent, DirName, TriggerTypeName, calomet, calometnohf, bLumiSecPlot);
1142 double caloSumET = calomet.
sumEt();
1163 double caloHadEtInHB = calomet.
hadEtInHB();
1164 double caloHadEtInHO = calomet.
hadEtInHO();
1165 double caloHadEtInHE = calomet.
hadEtInHE();
1166 double caloHadEtInHF = calomet.
hadEtInHF();
1167 double caloEmEtInEB = calomet.
emEtInEB();
1168 double caloEmEtInEE = calomet.
emEtInEE();
1169 double caloEmEtInHF = calomet.
emEtInHF();
1176 if (TriggerTypeName!=
"") DirName = DirName +
"/"+TriggerTypeName;
1178 if (_verbose)
std::cout <<
"_etThreshold = " << _etThreshold << std::endl;
1179 if (caloSumET>_etThreshold){
1217 hCaloMaxEtInEmTowers = _dbe->get(DirName+
"/"+
"METTask_CaloMaxEtInEmTowers");
if (hCaloMaxEtInEmTowers && hCaloMaxEtInEmTowers->getRootObject()) hCaloMaxEtInEmTowers->Fill(caloMaxEtInEMTowers);
1218 hCaloMaxEtInHadTowers = _dbe->get(DirName+
"/"+
"METTask_CaloMaxEtInHadTowers");
if (hCaloMaxEtInHadTowers && hCaloMaxEtInHadTowers->getRootObject()) hCaloMaxEtInHadTowers->Fill(caloMaxEtInHadTowers);
1220 hCaloHadEtInHB = _dbe->get(DirName+
"/"+
"METTask_CaloHadEtInHB");
if (hCaloHadEtInHB && hCaloHadEtInHB->getRootObject()) hCaloHadEtInHB->Fill(caloHadEtInHB);
1221 hCaloHadEtInHO = _dbe->get(DirName+
"/"+
"METTask_CaloHadEtInHO");
if (hCaloHadEtInHO && hCaloHadEtInHO->getRootObject()) hCaloHadEtInHO->Fill(caloHadEtInHO);
1222 hCaloHadEtInHE = _dbe->get(DirName+
"/"+
"METTask_CaloHadEtInHE");
if (hCaloHadEtInHE && hCaloHadEtInHE->getRootObject()) hCaloHadEtInHE->Fill(caloHadEtInHE);
1223 hCaloHadEtInHF = _dbe->get(DirName+
"/"+
"METTask_CaloHadEtInHF");
if (hCaloHadEtInHF && hCaloHadEtInHF->getRootObject()) hCaloHadEtInHF->Fill(caloHadEtInHF);
1224 hCaloEmEtInEB = _dbe->get(DirName+
"/"+
"METTask_CaloEmEtInEB");
if (hCaloEmEtInEB && hCaloEmEtInEB->getRootObject()) hCaloEmEtInEB->Fill(caloEmEtInEB);
1225 hCaloEmEtInEE = _dbe->get(DirName+
"/"+
"METTask_CaloEmEtInEE");
if (hCaloEmEtInEE && hCaloEmEtInEE->getRootObject()) hCaloEmEtInEE->Fill(caloEmEtInEE);
1226 hCaloEmEtInHF = _dbe->get(DirName+
"/"+
"METTask_CaloEmEtInHF");
if (hCaloEmEtInHF && hCaloEmEtInHF->getRootObject()) hCaloEmEtInHF->Fill(caloEmEtInHF);
1228 hCaloEmMEx = _dbe->get(DirName+
"/"+
"METTask_CaloEmMEx");
if (hCaloEmMEx && hCaloEmMEx->getRootObject()) hCaloEmMEx->Fill(_EmMEx);
1229 hCaloEmMEy = _dbe->get(DirName+
"/"+
"METTask_CaloEmMEy");
if (hCaloEmMEy && hCaloEmMEy->getRootObject()) hCaloEmMEy->Fill(_EmMEy);
1231 hCaloEmMET = _dbe->get(DirName+
"/"+
"METTask_CaloEmMET");
if (hCaloEmMET && hCaloEmMET->getRootObject()) hCaloEmMET->Fill(_EmMET);
1232 hCaloEmMETPhi = _dbe->get(DirName+
"/"+
"METTask_CaloEmMETPhi");
if (hCaloEmMETPhi && hCaloEmMETPhi->getRootObject()) hCaloEmMETPhi->Fill(_EmMetPhi);
1235 hCaloHaMEx = _dbe->get(DirName+
"/"+
"METTask_CaloHaMEx");
if (hCaloHaMEx && hCaloHaMEx->getRootObject()) hCaloHaMEx->Fill(_HaMEx);
1236 hCaloHaMEy = _dbe->get(DirName+
"/"+
"METTask_CaloHaMEy");
if (hCaloHaMEy && hCaloHaMEy->getRootObject()) hCaloHaMEy->Fill(_HaMEy);
1238 hCaloHaMET = _dbe->get(DirName+
"/"+
"METTask_CaloHaMET");
if (hCaloHaMET && hCaloHaMET->getRootObject()) hCaloHaMET->Fill(_HaMET);
1239 hCaloHaMETPhi = _dbe->get(DirName+
"/"+
"METTask_CaloHaMETPhi");
if (hCaloHaMETPhi && hCaloHaMETPhi->getRootObject()) hCaloHaMETPhi->Fill(_HaMetPhi);
1272 std::string TriggerTypeName,
1278 if (TriggerTypeName==
"HighPtJet") {
1279 if (!selectHighPtJetEvent(iEvent))
return;
1281 else if (TriggerTypeName==
"LowPtJet") {
1282 if (!selectLowPtJetEvent(iEvent))
return;
1284 else if (TriggerTypeName==
"HighMET") {
1285 if (calomet.
pt()<_highMETThreshold)
return;
1290 else if (TriggerTypeName==
"Ele") {
1291 if (!selectWElectronEvent(iEvent))
return;
1293 else if (TriggerTypeName==
"Muon") {
1294 if (!selectWMuonEvent(iEvent))
return;
1297 double caloSumET = calomet.
sumEt();
1298 double caloMETSig = calomet.
mEtSig();
1300 double caloMET = calomet.
pt();
1301 double caloMEx = calomet.
px();
1302 double caloMEy = calomet.
py();
1303 double caloMETPhi = calomet.
phi();
1305 double caloMETNoHF = calometnohf.
pt();
1308 if (_verbose)
std::cout << _source <<
" " << caloMET << std::endl;
1325 int myLuminosityBlock;
1330 if (TriggerTypeName!=
"") DirName = DirName +
"/"+TriggerTypeName;
1332 if (_verbose)
std::cout <<
"_etThreshold = " << _etThreshold << std::endl;
1333 if (caloSumET>_etThreshold){
1334 hCaloMEx = _dbe->get(DirName+
"/"+
"METTask_CaloMEx");
if (hCaloMEx && hCaloMEx->getRootObject() ) hCaloMEx->Fill(caloMEx);
1335 hCaloMEy = _dbe->get(DirName+
"/"+
"METTask_CaloMEy");
if (hCaloMEy && hCaloMEy->getRootObject() ) hCaloMEy->Fill(caloMEy);
1336 hCaloMET = _dbe->get(DirName+
"/"+
"METTask_CaloMET");
if (hCaloMET && hCaloMET->getRootObject() ) hCaloMET->Fill(caloMET);
1337 hCaloMET1 = _dbe->get(DirName+
"/"+
"METTask_CaloMET1");
if (hCaloMET1 && hCaloMET1->getRootObject() ) hCaloMET1->Fill(caloMET);
1338 hCaloMETPhi = _dbe->get(DirName+
"/"+
"METTask_CaloMETPhi");
if (hCaloMETPhi && hCaloMETPhi->getRootObject() ) hCaloMETPhi->Fill(caloMETPhi);
1339 hCaloSumET = _dbe->get(DirName+
"/"+
"METTask_CaloSumET");
if (hCaloSumET && hCaloSumET->getRootObject() ) hCaloSumET->Fill(caloSumET);
1340 hCaloMETSig = _dbe->get(DirName+
"/"+
"METTask_CaloMETSig");
if (hCaloMETSig && hCaloMETSig->getRootObject() ) hCaloMETSig->Fill(caloMETSig);
1343 hCaloMETNoHF = _dbe->get(DirName+
"/"+
"METTask_CaloMETNoHF");
if (hCaloMETNoHF && hCaloMETNoHF->getRootObject() ) hCaloMETNoHF->Fill(caloMETNoHF);
1345 hCaloMET_logx = _dbe->get(DirName+
"/"+
"METTask_CaloMET_logx");
if (hCaloMET_logx && hCaloMET_logx->getRootObject() ) hCaloMET_logx->Fill(log10(caloMET));
1346 hCaloSumET_logx = _dbe->get(DirName+
"/"+
"METTask_CaloSumET_logx");
if (hCaloSumET_logx && hCaloSumET_logx->getRootObject() ) hCaloSumET_logx->Fill(log10(caloSumET));
1351 hCaloMEx_profile = _dbe->get(DirName +
"/METTask_CaloMEx_profile");
1352 hCaloMEy_profile = _dbe->get(DirName +
"/METTask_CaloMEy_profile");
1353 hCaloMET_profile = _dbe->get(DirName +
"/METTask_CaloMET_profile");
1354 hCaloMETNoHF_profile = _dbe->get(DirName +
"/METTask_CaloMETNoHF_profile");
1355 hCaloSumET_profile = _dbe->get(DirName +
"/METTask_CaloSumET_profile");
1357 if (hCaloMEx_profile && hCaloMEx_profile ->getRootObject()) hCaloMEx_profile ->Fill(_numPV, caloMEx);
1358 if (hCaloMEy_profile && hCaloMEy_profile ->getRootObject()) hCaloMEy_profile ->Fill(_numPV, caloMEy);
1359 if (hCaloMET_profile && hCaloMET_profile ->getRootObject()) hCaloMET_profile ->Fill(_numPV, caloMET);
1360 if (hCaloMETNoHF_profile && hCaloMETNoHF_profile->getRootObject()) hCaloMETNoHF_profile->Fill(_numPV, caloMETNoHF);
1361 if (hCaloSumET_profile && hCaloSumET_profile ->getRootObject()) hCaloSumET_profile ->Fill(_numPV, caloSumET);
1370 hCaloMETPhi020 = _dbe->get(DirName+
"/"+
"METTask_CaloMETPhi020");
if (caloMET> 20. && hCaloMETPhi020 && hCaloMETPhi020->getRootObject()) { hCaloMETPhi020->Fill(caloMETPhi);}
1374 hCaloMExLS = _dbe->get(DirName+
"/"+
"METTask_CaloMEx_LS");
if (hCaloMExLS && hCaloMExLS->getRootObject()) hCaloMExLS->Fill(caloMEx,myLuminosityBlock);
1375 hCaloMEyLS = _dbe->get(DirName+
"/"+
"METTask_CaloMEy_LS");
if (hCaloMEyLS && hCaloMEyLS->getRootObject()) hCaloMEyLS->Fill(caloMEy,myLuminosityBlock);
1378 hCaloEtFractionHadronic = _dbe->get(DirName+
"/"+
"METTask_CaloEtFractionHadronic");
if (hCaloEtFractionHadronic && hCaloEtFractionHadronic->getRootObject()) hCaloEtFractionHadronic->Fill(caloEtFractionHadronic);
1379 hCaloEmEtFraction = _dbe->get(DirName+
"/"+
"METTask_CaloEmEtFraction");
if (hCaloEmEtFraction && hCaloEmEtFraction->getRootObject()) hCaloEmEtFraction->Fill(caloEmEtFraction);
1383 hCaloEmEtFraction020 = _dbe->get(DirName+
"/"+
"METTask_CaloEmEtFraction020");
if (caloMET> 20. && hCaloEmEtFraction020 && hCaloEmEtFraction020->getRootObject()) hCaloEmEtFraction020->Fill(caloEmEtFraction);
1411 if (theCaloMETCollectionLabel.label() ==
"corMetGlobalMuons" ) {
1413 for( reco::MuonCollection::const_iterator muonit = muon_h->begin(); muonit != muon_h->end(); muonit++ ) {
1415 hCalomuPt = _dbe->
get(DirName+
"/"+
"METTask_CalomuPt");
if (hCalomuPt && hCalomuPt->getRootObject()) hCalomuPt->Fill( muonit->p4().pt() );
1416 hCalomuEta = _dbe->get(DirName+
"/"+
"METTask_CalomuEta");
if (hCalomuEta && hCalomuEta->getRootObject()) hCalomuEta->Fill( muonit->p4().eta() );
1417 hCalomuNhits = _dbe->get(DirName+
"/"+
"METTask_CalomuNhits");
if (hCalomuNhits && hCalomuNhits->getRootObject()) hCalomuNhits->Fill( siTrack.
isNonnull() ? siTrack->numberOfValidHits() : -999 );
1418 hCalomuChi2 = _dbe->get(DirName+
"/"+
"METTask_CalomuChi2");
if (hCalomuChi2 && hCalomuChi2->getRootObject()) hCalomuChi2->Fill( siTrack.
isNonnull() ? siTrack->chi2()/siTrack->ndof() : -999 );
1419 double d0 = siTrack.
isNonnull() ? -1 * siTrack->dxy( bspot) : -999;
1420 hCalomuD0 = _dbe->
get(DirName+
"/"+
"METTask_CalomuD0");
if (hCalomuD0 && hCalomuD0->getRootObject()) hCalomuD0->Fill( d0 );
1423 const unsigned int nMuons = muon_h->size();
1424 for(
unsigned int mus = 0; mus < nMuons; mus++ ) {
1427 hCaloMExCorrection = _dbe->get(DirName+
"/"+
"METTask_CaloMExCorrection");
if (hCaloMExCorrection && hCaloMExCorrection->getRootObject()) hCaloMExCorrection->
Fill(muCorrData.
corrY());
1428 hCaloMEyCorrection = _dbe->get(DirName+
"/"+
"METTask_CaloMEyCorrection");
if (hCaloMEyCorrection && hCaloMEyCorrection->getRootObject()) hCaloMEyCorrection->
Fill(muCorrData.
corrX());
1429 hCaloMuonCorrectionFlag = _dbe->get(DirName+
"/"+
"METTask_CaloMuonCorrectionFlag");
if (hCaloMuonCorrectionFlag && hCaloMuonCorrectionFlag->getRootObject()) hCaloMuonCorrectionFlag->
Fill(muCorrData.
type());
1439 bool return_value=
false;
1442 iEvent.
getByLabel(theJetCollectionLabel, caloJets);
1444 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find jet product" << std::endl;
1445 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find jet product" << std::endl;
1448 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
1449 cal!=caloJets->end(); ++cal){
1450 if (cal->pt()>_highPtJetThreshold){
1455 return return_value;
1462 bool return_value=
false;
1465 iEvent.
getByLabel(theJetCollectionLabel, caloJets);
1467 LogDebug(
"") <<
"CaloMETAnalyzer: Could not find jet product" << std::endl;
1468 if (_verbose)
std::cout <<
"CaloMETAnalyzer: Could not find jet product" << std::endl;
1471 for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
1472 cal!=caloJets->end(); ++cal){
1473 if (cal->pt()>_lowPtJetThreshold){
1478 return return_value;
1485 bool return_value=
true;
1491 return return_value;
1498 bool return_value=
true;
1504 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
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
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
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)
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
std::string const & triggerName(unsigned int index) const
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