39 std::string inputMETCollectionLabel(inputMETLabel_.label());
59 trkQuality_ =iConfig.
getParameter<std::vector<int> >(
"trkQuality");
60 trkAlgos_ =iConfig.
getParameter<std::vector<int> >(
"trkAlgos");
64 pvToken_ = consumes<std::vector<reco::Vertex> >(
edm::InputTag(
"offlinePrimaryVertices"));
65 if (isCaloMET) caloMETsToken_ = consumes<reco::CaloMETCollection> (inputMETLabel_);
66 if (isTcMET) tcMETsToken_ = consumes<reco::METCollection> (inputMETLabel_);
67 if (isPFMET) pfMETsToken_ = consumes<reco::PFMETCollection> (inputMETLabel_);
68 if (isGenMET) genMETsToken_ = consumes<reco::GenMETCollection> (inputMETLabel_);
70 caloMETsToken_ = consumes<reco::CaloMETCollection> (inputCaloMETLabel_);
71 muonToken_ = consumes<reco::MuonCollection>(inputMuonLabel_);
72 trackToken_ = consumes<reco::TrackCollection>(inputTrackLabel_);
73 electronToken_ = consumes<edm::View<reco::GsfElectron > >(inputElectronLabel_);
74 beamSpotToken_ = consumes<reco::BeamSpot>(inputBeamSpotLabel_);
75 tcMet_ValueMap_Token_ = consumes<edm::ValueMap<reco::MuonMETCorrectionData> >(
edm::InputTag(
"muonTCMETValueMapProducer" ,
"muCorrData"));
76 met_ValueMap_Token_ = consumes<edm::ValueMap<reco::MuonMETCorrectionData> >(
edm::InputTag(
"muonMETValueMapProducer" ,
"muCorrData"));
78 genMETsTrueToken_ = consumes<reco::GenMETCollection> (
edm::InputTag(
"genMetTrue"));
79 genMETsCaloToken_ = consumes<reco::GenMETCollection> (
edm::InputTag(
"genMetCalo"));
92 mMETDifference_GenMETTrue = 0;
93 mMETDeltaPhi_GenMETTrue = 0;
94 mMETDifference_GenMETCalo = 0;
95 mMETDeltaPhi_GenMETCalo = 0;
98 mCaloMaxEtInEmTowers = 0;
99 mCaloMaxEtInHadTowers = 0;
100 mCaloEtFractionHadronic = 0;
101 mCaloEmEtFraction = 0;
114 mNeutralEMEtFraction=0;
115 mNeutralHadEtFraction=0;
116 mChargedEMEtFraction=0;
117 mChargedHadEtFraction=0;
119 mInvisibleEtFraction=0;
124 mMETDifference_GenMETTrue_MET0to20=0;
125 mMETDifference_GenMETTrue_MET20to40=0;
126 mMETDifference_GenMETTrue_MET40to60=0;
127 mMETDifference_GenMETTrue_MET60to80=0;
128 mMETDifference_GenMETTrue_MET80to100=0;
129 mMETDifference_GenMETTrue_MET100to150=0;
130 mMETDifference_GenMETTrue_MET150to200=0;
131 mMETDifference_GenMETTrue_MET200to300=0;
132 mMETDifference_GenMETTrue_MET300to400=0;
133 mMETDifference_GenMETTrue_MET400to500=0;
134 mMETDifference_GenMETTrue_METResolution=0;
139 mMuonCorrectionFlag=0;
175 mNvertex = dbe_->
book1D(
"Nvertex",
"Nvertex",80,0,80);
176 mMEx = dbe_->
book1D(
"MEx",
"MEx",160,-800,800);
177 mMEy = dbe_->
book1D(
"MEy",
"MEy",160,-800,800);
178 mMETSig = dbe_->
book1D(
"METSig",
"METSig",25,0,24.5);
179 mMET = dbe_->
book1D(
"MET",
"MET (20 GeV binning)" , 100,0,2000);
180 mMETFine = dbe_->
book1D(
"METFine",
"MET (2 GeV binning)" , 1000,0,2000);
181 mMET_Nvtx = dbe_->
bookProfile(
"MET_Nvtx",
"MET vs. nvtx", 60, 0., 60., 0., 2000.,
" ");
182 mMETPhi = dbe_->
book1D(
"METPhi",
"METPhi",80,-4,4);
183 mSumET = dbe_->
book1D(
"SumET" ,
"SumET" , 200,0,4000);
184 mMETDifference_GenMETTrue = dbe_->
book1D(
"METDifference_GenMETTrue",
"METDifference_GenMETTrue", 500,-500,500);
185 mMETDeltaPhi_GenMETTrue = dbe_->
book1D(
"METDeltaPhi_GenMETTrue",
"METDeltaPhi_GenMETTrue", 80,0,4);
186 mMETDifference_GenMETCalo = dbe_->
book1D(
"METDifference_GenMETCalo",
"METDifference_GenMETCalo", 500,-500,500);
187 mMETDeltaPhi_GenMETCalo = dbe_->
book1D(
"METDeltaPhi_GenMETCalo",
"METDeltaPhi_GenMETCalo", 80,0,4);
189 mMETDifference_GenMETTrue_MET0to20 = dbe_->
book1D(
"METResolution_GenMETTrue_MET0to20" ,
"METResolution_GenMETTrue_MET0to20" , 500,-500,500);
190 mMETDifference_GenMETTrue_MET20to40 = dbe_->
book1D(
"METResolution_GenMETTrue_MET20to40" ,
"METResolution_GenMETTrue_MET20to40" , 500,-500,500);
191 mMETDifference_GenMETTrue_MET40to60 = dbe_->
book1D(
"METResolution_GenMETTrue_MET40to60" ,
"METResolution_GenMETTrue_MET40to60" , 500,-500,500);
192 mMETDifference_GenMETTrue_MET60to80 = dbe_->
book1D(
"METResolution_GenMETTrue_MET60to80" ,
"METResolution_GenMETTrue_MET60to80" , 500,-500,500);
193 mMETDifference_GenMETTrue_MET80to100 = dbe_->
book1D(
"METResolution_GenMETTrue_MET80to100" ,
"METResolution_GenMETTrue_MET80to100" , 500,-500,500);
194 mMETDifference_GenMETTrue_MET100to150 = dbe_->
book1D(
"METResolution_GenMETTrue_MET100to150",
"METResolution_GenMETTrue_MET100to150", 500,-500,500);
195 mMETDifference_GenMETTrue_MET150to200 = dbe_->
book1D(
"METResolution_GenMETTrue_MET150to200",
"METResolution_GenMETTrue_MET150to200", 500,-500,500);
196 mMETDifference_GenMETTrue_MET200to300 = dbe_->
book1D(
"METResolution_GenMETTrue_MET200to300",
"METResolution_GenMETTrue_MET200to300", 500,-500,500);
197 mMETDifference_GenMETTrue_MET300to400 = dbe_->
book1D(
"METResolution_GenMETTrue_MET300to400",
"METResolution_GenMETTrue_MET300to400", 500,-500,500);
198 mMETDifference_GenMETTrue_MET400to500 = dbe_->
book1D(
"METResolution_GenMETTrue_MET400to500",
"METResolution_GenMETTrue_MET400to500", 500,-500,500);
201 float bins[] = {0.,20.,40.,60.,80.,100.,150.,200.,300.,400.,500.};
202 mMETDifference_GenMETTrue_METResolution = dbe_->
book1D(
"METResolution_GenMETTrue_InMETBins",
"METResolution_GenMETTrue_InMETBins",nBins, bins);
205 mCaloMaxEtInEmTowers = dbe_->
book1D(
"CaloMaxEtInEmTowers",
"CaloMaxEtInEmTowers",300,0,1500);
206 mCaloMaxEtInHadTowers = dbe_->
book1D(
"CaloMaxEtInHadTowers",
"CaloMaxEtInHadTowers",300,0,1500);
207 mCaloEtFractionHadronic = dbe_->
book1D(
"CaloEtFractionHadronic",
"CaloEtFractionHadronic",100,0,1);
208 mCaloEmEtFraction = dbe_->
book1D(
"CaloEmEtFraction",
"CaloEmEtFraction",100,0,1);
209 mCaloHadEtInHB = dbe_->
book1D(
"CaloHadEtInHB",
"CaloHadEtInHB", 200, 0, 2000);
210 mCaloHadEtInHE = dbe_->
book1D(
"CaloHadEtInHE",
"CaloHadEtInHE", 100, 0, 500);
211 mCaloHadEtInHO = dbe_->
book1D(
"CaloHadEtInHO",
"CaloHadEtInHO", 100, 0, 200);
212 mCaloHadEtInHF = dbe_->
book1D(
"CaloHadEtInHF",
"CaloHadEtInHF", 100, 0, 200);
213 mCaloSETInpHF = dbe_->
book1D(
"CaloSETInpHF",
"CaloSETInpHF",100, 0, 500);
214 mCaloSETInmHF = dbe_->
book1D(
"CaloSETInmHF",
"CaloSETInmHF",100, 0, 500);
215 mCaloEmEtInEE = dbe_->
book1D(
"CaloEmEtInEE",
"CaloEmEtInEE",100, 0, 500);
216 mCaloEmEtInEB = dbe_->
book1D(
"CaloEmEtInEB",
"CaloEmEtInEB",100, 0, 500);
217 mCaloEmEtInHF = dbe_->
book1D(
"CaloEmEtInHF",
"CaloEmEtInHF",100, 0, 500);
221 mNeutralEMEtFraction = dbe_->
book1D(
"GenNeutralEMEtFraction",
"GenNeutralEMEtFraction", 120, 0.0, 1.2 );
222 mNeutralHadEtFraction = dbe_->
book1D(
"GenNeutralHadEtFraction",
"GenNeutralHadEtFraction", 120, 0.0, 1.2 );
223 mChargedEMEtFraction = dbe_->
book1D(
"GenChargedEMEtFraction",
"GenChargedEMEtFraction", 120, 0.0, 1.2);
224 mChargedHadEtFraction = dbe_->
book1D(
"GenChargedHadEtFraction",
"GenChargedHadEtFraction", 120, 0.0,1.2);
225 mMuonEtFraction = dbe_->
book1D(
"GenMuonEtFraction",
"GenMuonEtFraction", 120, 0.0, 1.2 );
226 mInvisibleEtFraction = dbe_->
book1D(
"GenInvisibleEtFraction",
"GenInvisibleEtFraction", 120, 0.0, 1.2 );
230 mPFphotonEtFraction = dbe_->
book1D(
"photonEtFraction",
"photonEtFraction", 100, 0, 1);
231 mPFphotonEt = dbe_->
book1D(
"photonEt",
"photonEt", 100, 0, 1000);
232 mPFneutralHadronEtFraction = dbe_->
book1D(
"neutralHadronEtFraction",
"neutralHadronEtFraction", 100, 0, 1);
233 mPFneutralHadronEt = dbe_->
book1D(
"neutralHadronEt",
"neutralHadronEt", 100, 0, 1000);
234 mPFelectronEtFraction = dbe_->
book1D(
"electronEtFraction",
"electronEtFraction", 100, 0, 1);
235 mPFelectronEt = dbe_->
book1D(
"electronEt",
"electronEt", 100, 0, 1000);
236 mPFchargedHadronEtFraction = dbe_->
book1D(
"chargedHadronEtFraction",
"chargedHadronEtFraction", 100, 0, 1);
237 mPFchargedHadronEt = dbe_->
book1D(
"chargedHadronEt",
"chargedHadronEt", 100, 0, 1000);
238 mPFmuonEtFraction = dbe_->
book1D(
"muonEtFraction",
"muonEtFraction", 100, 0, 1);
239 mPFmuonEt = dbe_->
book1D(
"muonEt",
"muonEt", 100, 0, 1000);
240 mPFHFHadronEtFraction = dbe_->
book1D(
"HFHadronEtFraction",
"HFHadronEtFraction", 100, 0, 1);
241 mPFHFHadronEt = dbe_->
book1D(
"HFHadronEt",
"HFHadronEt", 100, 0, 500);
242 mPFHFEMEtFraction = dbe_->
book1D(
"HFEMEtFraction",
"HFEMEtFraction", 100, 0, 1);
243 mPFHFEMEt = dbe_->
book1D(
"HFEMEt",
"HFEMEt", 100, 0, 300);
250 mMExCorrection = dbe_->
book1D(
"MExCorrection",
"MExCorrection", 1000, -500.0,500.0);
251 mMEyCorrection = dbe_->
book1D(
"MEyCorrection",
"MEyCorrection", 1000, -500.0,500.0);
252 mMuonCorrectionFlag = dbe_->
book1D(
"CorrectionFlag",
"CorrectionFlag", 6, -0.5, 5.5);
255 mtrkPt = dbe_->
book1D(
"trackPt",
"trackPt", 50, 0, 500);
256 mtrkEta = dbe_->
book1D(
"trackEta",
"trackEta", 50, -2.5, 2.5);
257 mtrkNhits = dbe_->
book1D(
"trackNhits",
"trackNhits", 50, 0, 50);
258 mtrkChi2 = dbe_->
book1D(
"trackNormalizedChi2",
"trackNormalizedChi2", 20, 0, 20);
259 mtrkD0 = dbe_->
book1D(
"trackD0",
"trackd0", 50, -1, 1);
260 mtrkQuality = dbe_->
book1D(
"trackQuality",
"trackQuality", 30, -0.5, 29.5);
261 mtrkAlgo = dbe_->
book1D(
"trackAlgo",
"trackAlgo", 6, 3.5, 9.5);
262 mtrkPtErr = dbe_->
book1D(
"trackPtErr",
"trackPtErr", 200, 0, 2);
263 melePt = dbe_->
book1D(
"electronPt",
"electronPt", 50, 0, 500);
264 meleEta = dbe_->
book1D(
"electronEta",
"electronEta", 50, -2.5, 2.5);
265 meleHoE = dbe_->
book1D(
"electronHoverE",
"electronHoverE", 25, 0, 0.5);
266 mmuPt = dbe_->
book1D(
"muonPt",
"muonPt", 50, 0, 500);
267 mmuEta = dbe_->
book1D(
"muonEta",
"muonEta", 50, -2.5, 2.5);
268 mmuNhits = dbe_->
book1D(
"muonNhits",
"muonNhits", 50, 0, 50);
269 mmuChi2 = dbe_->
book1D(
"muonNormalizedChi2",
"muonNormalizedChi2", 20, 0, 20);
270 mmuD0 = dbe_->
book1D(
"muonD0",
"muonD0", 50, -1, 1);
271 mnMus = dbe_->
book1D(
"nMus",
"nMus", 5, -0.5, 4.5);
272 mnMusPis = dbe_->
book1D(
"nMusAsPis",
"nMusAsPis", 5, -0.5, 4.5);
273 mnEls = dbe_->
book1D(
"nEls",
"nEls", 5, -0.5, 4.5);
274 mfracTrks = dbe_->
book1D(
"fracTracks",
"fracTracks", 100, 0, 1);
275 mdMETx = dbe_->
book1D(
"dMETx",
"difference to caloMETx", 500, -250, 250);
276 mdMETy = dbe_->
book1D(
"dMETy",
"difference to caloMETy", 500, -250, 250);
277 mdMET = dbe_->
book1D(
"dMET",
"difference to caloMET", 500, -250, 250);
278 mdMUx = dbe_->
book1D(
"dMUx",
"dMUx", 500, -250, 250);
279 mdMUy = dbe_->
book1D(
"dMUy",
"dMUy", 500, -250, 250);
280 mMuonCorrectionFlag->
setBinLabel(1,
"Not Corrected");
281 mMuonCorrectionFlag->setBinLabel(2,
"Global Fit");
282 mMuonCorrectionFlag->setBinLabel(3,
"Tracker Fit");
283 mMuonCorrectionFlag->setBinLabel(4,
"SA Fit");
284 mMuonCorrectionFlag->setBinLabel(5,
"Treated as Pion");
285 mMuonCorrectionFlag->setBinLabel(6,
"Default fit");
303 edm::LogInfo(
"OutputInfo") <<
" METType not correctly specified!'";
306 if (mOutputFile.empty ())
308 LogInfo(
"OutputInfo") <<
" Histograms will NOT be saved";
312 LogInfo(
"OutputInfo") <<
" Histograms will be saved to file:" << mOutputFile;
328 std::cout << __FUNCTION__ <<
":" << __LINE__ <<
":pvHandle handle not found!" << std::endl;
331 const int nvtx = pvHandle->size();
332 mNvertex->Fill(nvtx);
341 if (isCaloMET
or isTcMET) iEvent.
getByToken(caloMETsToken_, caloMETs);
342 if (isTcMET) iEvent.
getByToken(tcMETsToken_, tcMETs);
343 if (isPFMET) iEvent.
getByToken(pfMETsToken_, pfMETs);
344 if (isGenMET) iEvent.
getByToken(genMETsToken_, genMETs);
345 if ((isCaloMET
or isTcMET) and !caloMETs.
isValid())
return;
346 if ((isTcMET) and !tcMETs.
isValid())
return;
348 if ((isPFMET) and !pfMETs.
isValid())
return;
349 if ((isGenMET) and !genMETs.
isValid())
return;
352 if (isCaloMET) { met = caloMETs->front();}
353 if (isTcMET) { met = tcMETs->front() ;}
355 if (isPFMET) { met = pfMETs->front() ;}
356 if (isGenMET) { met = genMETs->front() ;}
358 const double SumET = met.
sumEt();
359 const double METSig = met.
mEtSig();
360 const double MET = met.
pt();
361 const double MEx = met.
px();
362 const double MEy = met.
py();
363 const double METPhi = met.
phi();
368 mMET_Nvtx->Fill((
double)nvtx, MET);
369 mMETPhi->Fill(METPhi);
371 mMETSig->Fill(METSig);
375 iEvent.
getByToken(genMETsTrueToken_, genTrue);
379 double genMET = genMetTrue->
pt();
380 double genMETPhi = genMetTrue->
phi();
382 mMETDifference_GenMETTrue->Fill( MET - genMET );
383 mMETDeltaPhi_GenMETTrue->Fill( TMath::ACos( TMath::Cos( METPhi - genMETPhi ) ) );
386 if (MET > 0 && MET < 20) mMETDifference_GenMETTrue_MET0to20->Fill( MET - genMET );
387 else if (MET > 20 && MET < 40) mMETDifference_GenMETTrue_MET20to40->Fill( MET - genMET );
388 else if (MET > 40 && MET < 60) mMETDifference_GenMETTrue_MET40to60->Fill( MET - genMET );
389 else if (MET > 60 && MET < 80) mMETDifference_GenMETTrue_MET60to80->Fill( MET - genMET );
390 else if (MET > 80 && MET <100) mMETDifference_GenMETTrue_MET80to100->Fill( MET - genMET );
391 else if (MET >100 && MET <150) mMETDifference_GenMETTrue_MET100to150->Fill( MET - genMET );
392 else if (MET >150 && MET <200) mMETDifference_GenMETTrue_MET150to200->Fill( MET - genMET );
393 else if (MET >200 && MET <300) mMETDifference_GenMETTrue_MET200to300->Fill( MET - genMET );
394 else if (MET >300 && MET <400) mMETDifference_GenMETTrue_MET300to400->Fill( MET - genMET );
395 else if (MET >400 && MET <500) mMETDifference_GenMETTrue_MET400to500->Fill( MET - genMET );
398 edm::LogInfo(
"OutputInfo") <<
" failed to retrieve data required by MET Task: genMetTrue";
401 iEvent.
getByToken(genMETsCaloToken_, genCalo);
405 const double genMET = genMetCalo->
pt();
406 const double genMETPhi = genMetCalo->
phi();
408 mMETDifference_GenMETCalo->Fill( MET - genMET );
409 mMETDeltaPhi_GenMETCalo->Fill( TMath::ACos( TMath::Cos( METPhi - genMETPhi ) ) );
411 edm::LogInfo(
"OutputInfo") <<
" failed to retrieve data required by MET Task: genMetCalo";
421 const double caloEmEtFraction = calomet->
emEtFraction();
422 const double caloHadEtInHB = calomet->
hadEtInHB();
423 const double caloHadEtInHO = calomet->
hadEtInHO();
424 const double caloHadEtInHE = calomet->
hadEtInHE();
425 const double caloHadEtInHF = calomet->
hadEtInHF();
426 const double caloEmEtInEB = calomet->
emEtInEB();
427 const double caloEmEtInEE = calomet->
emEtInEE();
428 const double caloEmEtInHF = calomet->
emEtInHF();
432 mCaloMaxEtInEmTowers->Fill(caloMaxEtInEMTowers);
433 mCaloMaxEtInHadTowers->Fill(caloMaxEtInHadTowers);
434 mCaloEtFractionHadronic->Fill(caloEtFractionHadronic);
435 mCaloEmEtFraction->Fill(caloEmEtFraction);
436 mCaloHadEtInHB->Fill(caloHadEtInHB);
437 mCaloHadEtInHO->Fill(caloHadEtInHO);
438 mCaloHadEtInHE->Fill(caloHadEtInHE);
439 mCaloHadEtInHF->Fill(caloHadEtInHF);
440 mCaloEmEtInEB->Fill(caloEmEtInEB);
441 mCaloEmEtInEE->Fill(caloEmEtInEE);
442 mCaloEmEtInHF->Fill(caloEmEtInHF);
443 mCaloSETInpHF->Fill(caloSETInpHF);
444 mCaloSETInmHF->Fill(caloSETInmHF);
450 genmet = &(genMETs->front());
459 mNeutralEMEtFraction->Fill( NeutralEMEtFraction );
460 mNeutralHadEtFraction->Fill( NeutralHadEtFraction );
461 mChargedEMEtFraction->Fill( ChargedEMEtFraction );
462 mChargedHadEtFraction->Fill( ChargedHadEtFraction );
463 mMuonEtFraction->Fill( MuonEtFraction );
464 mInvisibleEtFraction->Fill( InvisibleEtFraction );
470 mPFphotonEt->Fill(pfmet->
photonEt());
478 mPFmuonEt->Fill(pfmet->
muonEt());
482 mPFHFEMEt->Fill(pfmet->
HFEMEt());
491 iEvent.
getByToken(caloMETsToken_, hcaloMetcol);
501 iEvent.
getByToken(electronToken_, electron_h);
504 iEvent.
getByToken(beamSpotToken_, beamSpot_h);
509 edm::LogInfo(
"OutputInfo") <<
"falied to retrieve data require by MET Task";
510 edm::LogInfo(
"OutputInfo") <<
"MET Taks cannot continue...!";
516 caloMet = &(caloMetcol->front());
520 edm::LogInfo(
"OutputInfo") <<
"falied to retrieve muon data require by MET Task";
521 edm::LogInfo(
"OutputInfo") <<
"MET Taks cannot continue...!";
526 edm::LogInfo(
"OutputInfo") <<
"falied to retrieve electron data require by MET Task";
527 edm::LogInfo(
"OutputInfo") <<
"MET Taks cannot continue...!";
532 edm::LogInfo(
"OutputInfo") <<
"falied to retrieve beam spot data require by MET Task";
533 edm::LogInfo(
"OutputInfo") <<
"MET Taks cannot continue...!";
542 iEvent.
getByToken(tcMet_ValueMap_Token_, tcMet_ValueMap_Handle);
547 for(
unsigned int mus = 0; mus < muon_h->size() ; mus++ ) {
550 if( muref->pt() < 20 )
continue;
555 if( type == 1 || type == 2 || type == 5 ) ++nM;
562 if( eleit->p4().pt() < 20 )
continue;
566 if( strcmp( sample_.c_str() ,
"zmm" ) == 0 && nM != 2 )
return;
568 if( strcmp( sample_.c_str() ,
"zee" ) == 0 && nE != 2 )
return;
570 if( strcmp( sample_.c_str() ,
"ttbar" ) == 0 && ( nE + nM ) == 0 )
return;
572 const double caloMET = caloMet->
pt();
573 const double caloMEx = caloMet->
px();
574 const double caloMEy = caloMet->
py();
576 mdMETx->Fill(caloMEx-tcMet->
px());
577 mdMETy->Fill(caloMEy-tcMet->
py());
578 mdMET->Fill(caloMET-tcMet->
pt());
580 const unsigned int nTracks = track_h->size();
581 unsigned int nCorrTracks = 0;
582 unsigned int trackCount = 0;
583 for( reco::TrackCollection::const_iterator trkit = track_h->begin(); trkit != track_h->end(); trkit++ ) {
584 mtrkPt->Fill( trkit->pt() );
585 mtrkEta->Fill( trkit->eta() );
586 mtrkNhits->Fill( trkit->numberOfValidHits() );
587 mtrkChi2->Fill( trkit->chi2() / trkit->ndof() );
589 double d0 = -1 * trkit->dxy( bspot );
593 mtrkQuality->Fill( trkit->qualityMask() );
594 mtrkAlgo->Fill( trkit->algo() );
595 mtrkPtErr->Fill( trkit->ptError() / trkit->pt() );
599 if( isGoodTrack( trkref, d0) ) ++nCorrTracks;
603 const float frac = (float)nCorrTracks / (
float)nTracks;
604 mfracTrks->Fill(frac);
609 melePt->Fill( eleit->p4().pt() );
610 meleEta->Fill( eleit->p4().eta() );
611 meleHoE->Fill( eleit->hadronicOverEm() );
615 unsigned int ele_idx = el_track.
isNonnull() ? el_track.
key() : 99999;
617 if( eleit->hadronicOverEm() < 0.1 && ele_idx < nTracks )
623 for( reco::MuonCollection::const_iterator muonit = muon_h->begin(); muonit != muon_h->end(); muonit++ ) {
627 mmuPt->Fill( muonit->p4().pt() );
628 mmuEta->Fill( muonit->p4().eta() );
629 mmuNhits->Fill( siTrack.
isNonnull() ? siTrack->numberOfValidHits() : -999 );
630 mmuChi2->Fill( siTrack.
isNonnull() ? siTrack->chi2()/siTrack->ndof() : -999 );
632 double d0 = siTrack.
isNonnull() ? -1 * siTrack->dxy( bspot) : -999;
641 iEvent.
getByToken(met_ValueMap_Token_, muon_ValueMap_Handle);
643 const unsigned int nMuons = muon_h->size();
649 for(
unsigned int mus = 0; mus < nMuons; mus++ )
655 mMExCorrection ->
Fill(muCorrData.
corrX());
656 mMEyCorrection ->
Fill(muCorrData.
corrY());
659 mMuonCorrectionFlag->
Fill(type);
661 if( type == 1 || type == 2 || type == 5 ) {
665 muDx += muonCorrData.
corrX() - muref->globalTrack()->px();
666 muDy += muonCorrData.
corrY() - muref->globalTrack()->py();
668 else if( type == 2 ) {
669 muDx += muonCorrData.
corrX() - muref->innerTrack()->px();
670 muDy += muonCorrData.
corrY() - muref->innerTrack()->py();
672 else if( type == 5 ) {
673 muDx += muonCorrData.
corrX() - muref->px();
674 muDy += muonCorrData.
corrY() - muref->py();
682 mnMusPis->Fill(nMusPis);
764 mMETDifference_GenMETTrue_METResolution->setBinContent(1, mMETDifference_GenMETTrue_MET0to20->getMean());
765 mMETDifference_GenMETTrue_METResolution->setBinContent(2, mMETDifference_GenMETTrue_MET20to40->getMean());
766 mMETDifference_GenMETTrue_METResolution->setBinContent(3, mMETDifference_GenMETTrue_MET40to60->getMean());
767 mMETDifference_GenMETTrue_METResolution->setBinContent(4, mMETDifference_GenMETTrue_MET60to80->getMean());
768 mMETDifference_GenMETTrue_METResolution->setBinContent(5, mMETDifference_GenMETTrue_MET80to100->getMean());
769 mMETDifference_GenMETTrue_METResolution->setBinContent(6, mMETDifference_GenMETTrue_MET100to150->getMean());
770 mMETDifference_GenMETTrue_METResolution->setBinContent(7, mMETDifference_GenMETTrue_MET150to200->getMean());
771 mMETDifference_GenMETTrue_METResolution->setBinContent(8, mMETDifference_GenMETTrue_MET200to300->getMean());
772 mMETDifference_GenMETTrue_METResolution->setBinContent(9, mMETDifference_GenMETTrue_MET300to400->getMean());
773 mMETDifference_GenMETTrue_METResolution->setBinContent(10, mMETDifference_GenMETTrue_MET400to500->getMean());
774 mMETDifference_GenMETTrue_METResolution->setBinError(1, mMETDifference_GenMETTrue_MET0to20->getRMS());
775 mMETDifference_GenMETTrue_METResolution->setBinError(2, mMETDifference_GenMETTrue_MET20to40->getRMS());
776 mMETDifference_GenMETTrue_METResolution->setBinError(3, mMETDifference_GenMETTrue_MET40to60->getRMS());
777 mMETDifference_GenMETTrue_METResolution->setBinError(4, mMETDifference_GenMETTrue_MET60to80->getRMS());
778 mMETDifference_GenMETTrue_METResolution->setBinError(5, mMETDifference_GenMETTrue_MET80to100->getRMS());
779 mMETDifference_GenMETTrue_METResolution->setBinError(6, mMETDifference_GenMETTrue_MET100to150->getRMS());
780 mMETDifference_GenMETTrue_METResolution->setBinError(7, mMETDifference_GenMETTrue_MET150to200->getRMS());
781 mMETDifference_GenMETTrue_METResolution->setBinError(8, mMETDifference_GenMETTrue_MET200to300->getRMS());
782 mMETDifference_GenMETTrue_METResolution->setBinError(9, mMETDifference_GenMETTrue_MET300to400->getRMS());
783 mMETDifference_GenMETTrue_METResolution->setBinError(10, mMETDifference_GenMETTrue_MET400to500->getRMS());
790 if( fabs( d0corr ) > maxd0_ )
return false;
791 if( track->numberOfValidHits() < minhits_ )
return false;
792 if( track->normalizedChi2() > maxchi2_ )
return false;
793 if( fabs( track->eta() ) > maxeta_ )
return false;
794 if( track->pt() > maxpt_ )
return false;
795 if( (track->ptError() / track->pt()) > maxPtErr_ )
return false;
798 for(
unsigned int i = 0;
i < trkQuality_.size();
i++ ) {
800 cut |= (1 << trkQuality_.at(
i));
803 if( !( ( track->qualityMask() &
cut ) == cut ) )
return false;
805 bool isGoodAlgo =
false;
806 if( trkAlgos_.size() == 0 ) isGoodAlgo =
true;
807 for(
unsigned int i = 0;
i < trkAlgos_.size();
i++ ) {
809 if( track->algo() == trkAlgos_.at(
i) ) isGoodAlgo =
true;
812 if( !isGoodAlgo )
return false;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
tuple met
____________________________________________________________________________||
double HFEMEtFraction() const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
double CaloSETInmHF() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double maxEtInHadTowers() const
double neutralHadronEtFraction() const
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
tuple genMetCalo
____________________________________________________________________________||
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)
double MuonEtFraction() const
double maxEtInEmTowers() const
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
bool isNonnull() const
Checks for non-null.
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
double HFHadronEtFraction() const
double muonEtFraction() const
double HFHadronEt() const
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
double photonEtFraction() const
double ChargedEMEtFraction() const
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
double CaloSETInpHF() const
double InvisibleEtFraction() const
double electronEt() const
double etFractionHadronic() const
XYZPointD XYZPoint
point in space with cartesian internal representation
tuple tcMet
____________________________________________________________________________||
key_type key() const
Accessor for product key.
T const * product() const
double NeutralEMEtFraction() const
double electronEtFraction() const
double chargedHadronEtFraction() const
METTester(const edm::ParameterSet &)
double NeutralHadEtFraction() const
bool isGoodTrack(const reco::TrackRef, float d0corr)
double neutralHadronEt() const
double ChargedHadEtFraction() const
virtual float pt() const GCC11_FINAL
transverse momentum
double emEtFraction() const
void setCurrentFolder(const std::string &fullpath)
double chargedHadronEt() const