39 std::string inputMETCollectionLabel(inputMETLabel_.label());
45 pvToken_ = consumes<std::vector<reco::Vertex> >(
edm::InputTag(
"offlinePrimaryVertices"));
46 if (isCaloMET) caloMETsToken_ = consumes<reco::CaloMETCollection> (inputMETLabel_);
47 if (isPFMET) pfMETsToken_ = consumes<reco::PFMETCollection> (inputMETLabel_);
48 if (isGenMET) genMETsToken_ = consumes<reco::GenMETCollection> (inputMETLabel_);
49 genMETsTrueToken_ = consumes<reco::GenMETCollection> (
edm::InputTag(
"genMetTrue"));
50 genMETsCaloToken_ = consumes<reco::GenMETCollection> (
edm::InputTag(
"genMetCalo"));
63 mMETDifference_GenMETTrue = 0;
64 mMETDeltaPhi_GenMETTrue = 0;
65 mMETDifference_GenMETCalo = 0;
66 mMETDeltaPhi_GenMETCalo = 0;
69 mCaloMaxEtInEmTowers = 0;
70 mCaloMaxEtInHadTowers = 0;
71 mCaloEtFractionHadronic = 0;
72 mCaloEmEtFraction = 0;
85 mNeutralEMEtFraction=0;
86 mNeutralHadEtFraction=0;
87 mChargedEMEtFraction=0;
88 mChargedHadEtFraction=0;
90 mInvisibleEtFraction=0;
95 mMETDifference_GenMETTrue_MET0to20=0;
96 mMETDifference_GenMETTrue_MET20to40=0;
97 mMETDifference_GenMETTrue_MET40to60=0;
98 mMETDifference_GenMETTrue_MET60to80=0;
99 mMETDifference_GenMETTrue_MET80to100=0;
100 mMETDifference_GenMETTrue_MET100to150=0;
101 mMETDifference_GenMETTrue_MET150to200=0;
102 mMETDifference_GenMETTrue_MET200to300=0;
103 mMETDifference_GenMETTrue_MET300to400=0;
104 mMETDifference_GenMETTrue_MET400to500=0;
105 mMETDifference_GenMETTrue_METResolution=0;
110 mMuonCorrectionFlag=0;
146 mNvertex = ibooker.
book1D(
"Nvertex",
"Nvertex",80,0,80);
147 mMEx = ibooker.
book1D(
"MEx",
"MEx",160,-800,800);
148 mMEy = ibooker.
book1D(
"MEy",
"MEy",160,-800,800);
149 mMETSig = ibooker.
book1D(
"METSig",
"METSig",25,0,24.5);
150 mMET = ibooker.
book1D(
"MET",
"MET (20 GeV binning)" , 100,0,2000);
151 mMETFine = ibooker.
book1D(
"METFine",
"MET (2 GeV binning)" , 1000,0,2000);
152 mMET_Nvtx = ibooker.
bookProfile(
"MET_Nvtx",
"MET vs. nvtx", 60, 0., 60., 0., 2000.,
" ");
153 mMETPhi = ibooker.
book1D(
"METPhi",
"METPhi",80,-4,4);
154 mSumET = ibooker.
book1D(
"SumET" ,
"SumET" , 200,0,4000);
155 mMETDifference_GenMETTrue = ibooker.
book1D(
"METDifference_GenMETTrue",
"METDifference_GenMETTrue", 500,-500,500);
156 mMETDeltaPhi_GenMETTrue = ibooker.
book1D(
"METDeltaPhi_GenMETTrue",
"METDeltaPhi_GenMETTrue", 80,0,4);
157 mMETDifference_GenMETCalo = ibooker.
book1D(
"METDifference_GenMETCalo",
"METDifference_GenMETCalo", 500,-500,500);
158 mMETDeltaPhi_GenMETCalo = ibooker.
book1D(
"METDeltaPhi_GenMETCalo",
"METDeltaPhi_GenMETCalo", 80,0,4);
160 mMETDifference_GenMETTrue_MET0to20 = ibooker.
book1D(
"METResolution_GenMETTrue_MET0to20" ,
"METResolution_GenMETTrue_MET0to20" , 500,-500,500);
161 mMETDifference_GenMETTrue_MET20to40 = ibooker.
book1D(
"METResolution_GenMETTrue_MET20to40" ,
"METResolution_GenMETTrue_MET20to40" , 500,-500,500);
162 mMETDifference_GenMETTrue_MET40to60 = ibooker.
book1D(
"METResolution_GenMETTrue_MET40to60" ,
"METResolution_GenMETTrue_MET40to60" , 500,-500,500);
163 mMETDifference_GenMETTrue_MET60to80 = ibooker.
book1D(
"METResolution_GenMETTrue_MET60to80" ,
"METResolution_GenMETTrue_MET60to80" , 500,-500,500);
164 mMETDifference_GenMETTrue_MET80to100 = ibooker.
book1D(
"METResolution_GenMETTrue_MET80to100" ,
"METResolution_GenMETTrue_MET80to100" , 500,-500,500);
165 mMETDifference_GenMETTrue_MET100to150 = ibooker.
book1D(
"METResolution_GenMETTrue_MET100to150",
"METResolution_GenMETTrue_MET100to150", 500,-500,500);
166 mMETDifference_GenMETTrue_MET150to200 = ibooker.
book1D(
"METResolution_GenMETTrue_MET150to200",
"METResolution_GenMETTrue_MET150to200", 500,-500,500);
167 mMETDifference_GenMETTrue_MET200to300 = ibooker.
book1D(
"METResolution_GenMETTrue_MET200to300",
"METResolution_GenMETTrue_MET200to300", 500,-500,500);
168 mMETDifference_GenMETTrue_MET300to400 = ibooker.
book1D(
"METResolution_GenMETTrue_MET300to400",
"METResolution_GenMETTrue_MET300to400", 500,-500,500);
169 mMETDifference_GenMETTrue_MET400to500 = ibooker.
book1D(
"METResolution_GenMETTrue_MET400to500",
"METResolution_GenMETTrue_MET400to500", 500,-500,500);
172 float bins[] = {0.,20.,40.,60.,80.,100.,150.,200.,300.,400.,500.};
173 mMETDifference_GenMETTrue_METResolution = ibooker.
book1D(
"METResolution_GenMETTrue_InMETBins",
"METResolution_GenMETTrue_InMETBins",nBins, bins);
176 mCaloMaxEtInEmTowers = ibooker.
book1D(
"CaloMaxEtInEmTowers",
"CaloMaxEtInEmTowers",300,0,1500);
177 mCaloMaxEtInHadTowers = ibooker.
book1D(
"CaloMaxEtInHadTowers",
"CaloMaxEtInHadTowers",300,0,1500);
178 mCaloEtFractionHadronic = ibooker.
book1D(
"CaloEtFractionHadronic",
"CaloEtFractionHadronic",100,0,1);
179 mCaloEmEtFraction = ibooker.
book1D(
"CaloEmEtFraction",
"CaloEmEtFraction",100,0,1);
180 mCaloHadEtInHB = ibooker.
book1D(
"CaloHadEtInHB",
"CaloHadEtInHB", 200, 0, 2000);
181 mCaloHadEtInHE = ibooker.
book1D(
"CaloHadEtInHE",
"CaloHadEtInHE", 100, 0, 500);
182 mCaloHadEtInHO = ibooker.
book1D(
"CaloHadEtInHO",
"CaloHadEtInHO", 100, 0, 200);
183 mCaloHadEtInHF = ibooker.
book1D(
"CaloHadEtInHF",
"CaloHadEtInHF", 100, 0, 200);
184 mCaloSETInpHF = ibooker.
book1D(
"CaloSETInpHF",
"CaloSETInpHF",100, 0, 500);
185 mCaloSETInmHF = ibooker.
book1D(
"CaloSETInmHF",
"CaloSETInmHF",100, 0, 500);
186 mCaloEmEtInEE = ibooker.
book1D(
"CaloEmEtInEE",
"CaloEmEtInEE",100, 0, 500);
187 mCaloEmEtInEB = ibooker.
book1D(
"CaloEmEtInEB",
"CaloEmEtInEB",100, 0, 500);
188 mCaloEmEtInHF = ibooker.
book1D(
"CaloEmEtInHF",
"CaloEmEtInHF",100, 0, 500);
192 mNeutralEMEtFraction = ibooker.
book1D(
"GenNeutralEMEtFraction",
"GenNeutralEMEtFraction", 120, 0.0, 1.2 );
193 mNeutralHadEtFraction = ibooker.
book1D(
"GenNeutralHadEtFraction",
"GenNeutralHadEtFraction", 120, 0.0, 1.2 );
194 mChargedEMEtFraction = ibooker.
book1D(
"GenChargedEMEtFraction",
"GenChargedEMEtFraction", 120, 0.0, 1.2);
195 mChargedHadEtFraction = ibooker.
book1D(
"GenChargedHadEtFraction",
"GenChargedHadEtFraction", 120, 0.0,1.2);
196 mMuonEtFraction = ibooker.
book1D(
"GenMuonEtFraction",
"GenMuonEtFraction", 120, 0.0, 1.2 );
197 mInvisibleEtFraction = ibooker.
book1D(
"GenInvisibleEtFraction",
"GenInvisibleEtFraction", 120, 0.0, 1.2 );
201 mPFphotonEtFraction = ibooker.
book1D(
"photonEtFraction",
"photonEtFraction", 100, 0, 1);
202 mPFphotonEt = ibooker.
book1D(
"photonEt",
"photonEt", 100, 0, 1000);
203 mPFneutralHadronEtFraction = ibooker.
book1D(
"neutralHadronEtFraction",
"neutralHadronEtFraction", 100, 0, 1);
204 mPFneutralHadronEt = ibooker.
book1D(
"neutralHadronEt",
"neutralHadronEt", 100, 0, 1000);
205 mPFelectronEtFraction = ibooker.
book1D(
"electronEtFraction",
"electronEtFraction", 100, 0, 1);
206 mPFelectronEt = ibooker.
book1D(
"electronEt",
"electronEt", 100, 0, 1000);
207 mPFchargedHadronEtFraction = ibooker.
book1D(
"chargedHadronEtFraction",
"chargedHadronEtFraction", 100, 0, 1);
208 mPFchargedHadronEt = ibooker.
book1D(
"chargedHadronEt",
"chargedHadronEt", 100, 0, 1000);
209 mPFmuonEtFraction = ibooker.
book1D(
"muonEtFraction",
"muonEtFraction", 100, 0, 1);
210 mPFmuonEt = ibooker.
book1D(
"muonEt",
"muonEt", 100, 0, 1000);
211 mPFHFHadronEtFraction = ibooker.
book1D(
"HFHadronEtFraction",
"HFHadronEtFraction", 100, 0, 1);
212 mPFHFHadronEt = ibooker.
book1D(
"HFHadronEt",
"HFHadronEt", 100, 0, 500);
213 mPFHFEMEtFraction = ibooker.
book1D(
"HFEMEtFraction",
"HFEMEtFraction", 100, 0, 1);
214 mPFHFEMEt = ibooker.
book1D(
"HFEMEt",
"HFEMEt", 100, 0, 300);
226 std::cout << __FUNCTION__ <<
":" << __LINE__ <<
":pvHandle handle not found!" << std::endl;
229 const int nvtx = pvHandle->size();
230 mNvertex->Fill(nvtx);
237 if (isCaloMET) iEvent.
getByToken(caloMETsToken_, caloMETs);
238 if (isPFMET) iEvent.
getByToken(pfMETsToken_, pfMETs);
239 if (isGenMET) iEvent.
getByToken(genMETsToken_, genMETs);
240 if ((isCaloMET) and !caloMETs.
isValid())
return;
241 if ((isPFMET) and !pfMETs.
isValid())
return;
242 if ((isGenMET) and !genMETs.
isValid())
return;
245 if (isCaloMET) { met = caloMETs->front();}
246 if (isPFMET) { met = pfMETs->front() ;}
247 if (isGenMET) { met = genMETs->front() ;}
249 const double SumET = met.
sumEt();
250 const double METSig = met.
mEtSig();
251 const double MET = met.
pt();
252 const double MEx = met.
px();
253 const double MEy = met.
py();
254 const double METPhi = met.
phi();
259 mMET_Nvtx->Fill((
double)nvtx, MET);
260 mMETPhi->Fill(METPhi);
262 mMETSig->Fill(METSig);
266 iEvent.
getByToken(genMETsTrueToken_, genTrue);
270 double genMET = genMetTrue->
pt();
271 double genMETPhi = genMetTrue->
phi();
273 mMETDifference_GenMETTrue->Fill( MET - genMET );
274 mMETDeltaPhi_GenMETTrue->Fill( TMath::ACos( TMath::Cos( METPhi - genMETPhi ) ) );
277 if (MET > 0 && MET < 20) mMETDifference_GenMETTrue_MET0to20->Fill( MET - genMET );
278 else if (MET > 20 && MET < 40) mMETDifference_GenMETTrue_MET20to40->Fill( MET - genMET );
279 else if (MET > 40 && MET < 60) mMETDifference_GenMETTrue_MET40to60->Fill( MET - genMET );
280 else if (MET > 60 && MET < 80) mMETDifference_GenMETTrue_MET60to80->Fill( MET - genMET );
281 else if (MET > 80 && MET <100) mMETDifference_GenMETTrue_MET80to100->Fill( MET - genMET );
282 else if (MET >100 && MET <150) mMETDifference_GenMETTrue_MET100to150->Fill( MET - genMET );
283 else if (MET >150 && MET <200) mMETDifference_GenMETTrue_MET150to200->Fill( MET - genMET );
284 else if (MET >200 && MET <300) mMETDifference_GenMETTrue_MET200to300->Fill( MET - genMET );
285 else if (MET >300 && MET <400) mMETDifference_GenMETTrue_MET300to400->Fill( MET - genMET );
286 else if (MET >400 && MET <500) mMETDifference_GenMETTrue_MET400to500->Fill( MET - genMET );
289 edm::LogInfo(
"OutputInfo") <<
" failed to retrieve data required by MET Task: genMetTrue";
292 iEvent.
getByToken(genMETsCaloToken_, genCalo);
296 const double genMET = genMetCalo->
pt();
297 const double genMETPhi = genMetCalo->
phi();
299 mMETDifference_GenMETCalo->Fill( MET - genMET );
300 mMETDeltaPhi_GenMETCalo->Fill( TMath::ACos( TMath::Cos( METPhi - genMETPhi ) ) );
302 edm::LogInfo(
"OutputInfo") <<
" failed to retrieve data required by MET Task: genMetCalo";
312 const double caloEmEtFraction = calomet->
emEtFraction();
313 const double caloHadEtInHB = calomet->
hadEtInHB();
314 const double caloHadEtInHO = calomet->
hadEtInHO();
315 const double caloHadEtInHE = calomet->
hadEtInHE();
316 const double caloHadEtInHF = calomet->
hadEtInHF();
317 const double caloEmEtInEB = calomet->
emEtInEB();
318 const double caloEmEtInEE = calomet->
emEtInEE();
319 const double caloEmEtInHF = calomet->
emEtInHF();
323 mCaloMaxEtInEmTowers->Fill(caloMaxEtInEMTowers);
324 mCaloMaxEtInHadTowers->Fill(caloMaxEtInHadTowers);
325 mCaloEtFractionHadronic->Fill(caloEtFractionHadronic);
326 mCaloEmEtFraction->Fill(caloEmEtFraction);
327 mCaloHadEtInHB->Fill(caloHadEtInHB);
328 mCaloHadEtInHO->Fill(caloHadEtInHO);
329 mCaloHadEtInHE->Fill(caloHadEtInHE);
330 mCaloHadEtInHF->Fill(caloHadEtInHF);
331 mCaloEmEtInEB->Fill(caloEmEtInEB);
332 mCaloEmEtInEE->Fill(caloEmEtInEE);
333 mCaloEmEtInHF->Fill(caloEmEtInHF);
334 mCaloSETInpHF->Fill(caloSETInpHF);
335 mCaloSETInmHF->Fill(caloSETInmHF);
341 genmet = &(genMETs->front());
350 mNeutralEMEtFraction->Fill( NeutralEMEtFraction );
351 mNeutralHadEtFraction->Fill( NeutralHadEtFraction );
352 mChargedEMEtFraction->Fill( ChargedEMEtFraction );
353 mChargedHadEtFraction->Fill( ChargedHadEtFraction );
354 mMuonEtFraction->Fill( MuonEtFraction );
355 mInvisibleEtFraction->Fill( InvisibleEtFraction );
361 mPFphotonEt->Fill(pfmet->
photonEt());
369 mPFmuonEt->Fill(pfmet->
muonEt());
373 mPFHFEMEt->Fill(pfmet->
HFEMEt());
385 mMETDifference_GenMETTrue_METResolution->setBinContent(1, mMETDifference_GenMETTrue_MET0to20->getMean());
386 mMETDifference_GenMETTrue_METResolution->setBinContent(2, mMETDifference_GenMETTrue_MET20to40->getMean());
387 mMETDifference_GenMETTrue_METResolution->setBinContent(3, mMETDifference_GenMETTrue_MET40to60->getMean());
388 mMETDifference_GenMETTrue_METResolution->setBinContent(4, mMETDifference_GenMETTrue_MET60to80->getMean());
389 mMETDifference_GenMETTrue_METResolution->setBinContent(5, mMETDifference_GenMETTrue_MET80to100->getMean());
390 mMETDifference_GenMETTrue_METResolution->setBinContent(6, mMETDifference_GenMETTrue_MET100to150->getMean());
391 mMETDifference_GenMETTrue_METResolution->setBinContent(7, mMETDifference_GenMETTrue_MET150to200->getMean());
392 mMETDifference_GenMETTrue_METResolution->setBinContent(8, mMETDifference_GenMETTrue_MET200to300->getMean());
393 mMETDifference_GenMETTrue_METResolution->setBinContent(9, mMETDifference_GenMETTrue_MET300to400->getMean());
394 mMETDifference_GenMETTrue_METResolution->setBinContent(10, mMETDifference_GenMETTrue_MET400to500->getMean());
397 mMETDifference_GenMETTrue_METResolution->setBinError(1, mMETDifference_GenMETTrue_MET0to20->getRMS());
398 mMETDifference_GenMETTrue_METResolution->setBinError(2, mMETDifference_GenMETTrue_MET20to40->getRMS());
399 mMETDifference_GenMETTrue_METResolution->setBinError(3, mMETDifference_GenMETTrue_MET40to60->getRMS());
400 mMETDifference_GenMETTrue_METResolution->setBinError(4, mMETDifference_GenMETTrue_MET60to80->getRMS());
401 mMETDifference_GenMETTrue_METResolution->setBinError(5, mMETDifference_GenMETTrue_MET80to100->getRMS());
402 mMETDifference_GenMETTrue_METResolution->setBinError(6, mMETDifference_GenMETTrue_MET100to150->getRMS());
403 mMETDifference_GenMETTrue_METResolution->setBinError(7, mMETDifference_GenMETTrue_MET150to200->getRMS());
404 mMETDifference_GenMETTrue_METResolution->setBinError(8, mMETDifference_GenMETTrue_MET200to300->getRMS());
405 mMETDifference_GenMETTrue_METResolution->setBinError(9, mMETDifference_GenMETTrue_MET300to400->getRMS());
406 mMETDifference_GenMETTrue_METResolution->setBinError(10, mMETDifference_GenMETTrue_MET400to500->getRMS());
413 if( fabs( d0corr ) > maxd0_ )
return false;
414 if( track->numberOfValidHits() < minhits_ )
return false;
415 if( track->normalizedChi2() > maxchi2_ )
return false;
416 if( fabs( track->eta() ) > maxeta_ )
return false;
417 if( track->pt() > maxpt_ )
return false;
418 if( (track->ptError() / track->pt()) > maxPtErr_ )
return false;
421 for(
unsigned int i = 0;
i < trkQuality_.size();
i++ ) {
423 cut |= (1 << trkQuality_.at(
i));
426 if( !( ( track->qualityMask() &
cut ) == cut ) )
return false;
428 bool isGoodAlgo =
false;
429 if( trkAlgos_.size() == 0 ) isGoodAlgo =
true;
430 for(
unsigned int i = 0;
i < trkAlgos_.size();
i++ ) {
432 if( track->algo() == trkAlgos_.at(
i) ) isGoodAlgo =
true;
435 if( !isGoodAlgo )
return false;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
tuple met
____________________________________________________________________________||
double HFEMEtFraction() const
virtual float pt() const
transverse momentum
virtual void analyze(const edm::Event &, const edm::EventSetup &)
double CaloSETInmHF() const
MonitorElement * bookProfile(Args &&...args)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual float phi() const
momentum azimuthal angle
double maxEtInHadTowers() const
double neutralHadronEtFraction() const
tuple genMetCalo
____________________________________________________________________________||
double MuonEtFraction() const
double maxEtInEmTowers() const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
double HFHadronEtFraction() const
double muonEtFraction() const
double HFHadronEt() const
double photonEtFraction() const
double ChargedEMEtFraction() const
MonitorElement * book1D(Args &&...args)
double CaloSETInpHF() const
double InvisibleEtFraction() const
double electronEt() const
void setCurrentFolder(const std::string &fullpath)
double etFractionHadronic() const
virtual double px() const
x coordinate of momentum vector
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 double py() const
y coordinate of momentum vector
double emEtFraction() const
double chargedHadronEt() const