CMS 3D CMS Logo

METTester.cc
Go to the documentation of this file.
1 // author: Mike Schmitt, University of Florida
2 // first version 8/24/2006
3 // modification: Bobby Scurlock
4 // date: 03.11.2006
5 // note: added RMS(METx) vs SumET capability
6 // modification: Rick Cavanaugh
7 // date: 05.11.2006
8 // note: cleaned up constructor and beginJob, removed int conv. warning
9 // added configuration params
10 // modification: Mike Schmitt
11 // date: 02.28.2007
12 // note: code rewrite. Now uses STL map for monitoring element container.
13 // modification: Bobby Scurlock
14 // date: 04.03.2007
15 // note: Eliminated automated resolution fitting. This is now done in a ROOT script.
16 
17 // date: 02.04.2009
18 // note: Added option to use fine binning or course binning for histos
19 //
20 // modification: Samantha Hewamanage, Florida International University
21 // date: 01.30.2012
22 // note: Added few hists for various nvtx ranges to study PU effects.
23 // Cleaned up the code by making it readable and const'ing the
24 // variables that should be changed.
25 // Changed the number of bins from odd to even. Odd number of bins
26 // makes it impossible to rebin a hist.
27 #include "METTester.h"
28 using namespace reco;
29 using namespace std;
30 using namespace edm;
31 
33 {
34 
35  inputMETLabel_ =iConfig.getParameter<edm::InputTag>("InputMETLabel");
36  METType_ =iConfig.getUntrackedParameter<std::string>("METType");
37 
38  std::string inputMETCollectionLabel(inputMETLabel_.label());
39 
40  isCaloMET = (std::string("calo")==METType_);
41  isPFMET = (std::string("pf") ==METType_);
42  isGenMET = (std::string("gen") ==METType_);
43  isMiniAODMET = (std::string("miniaod") ==METType_);
44 
45  pvToken_ = consumes<std::vector<reco::Vertex> >(iConfig.getParameter<edm::InputTag>("PrimaryVertices"));
46  if (isCaloMET) caloMETsToken_ = consumes<reco::CaloMETCollection> (inputMETLabel_);
47  if (isPFMET) pfMETsToken_ = consumes<reco::PFMETCollection> (inputMETLabel_);
48  if(isMiniAODMET) patMETToken_ = consumes<pat::METCollection> (inputMETLabel_);
49  if (isGenMET) genMETsToken_ = consumes<reco::GenMETCollection> (inputMETLabel_);
50  if(!isMiniAODMET){
51  genMETsTrueToken_ = consumes<reco::GenMETCollection> (edm::InputTag("genMetTrue"));
52  genMETsCaloToken_ = consumes<reco::GenMETCollection> (edm::InputTag("genMetCalo"));
53  }
54 
55  //Events variables
56  mNvertex = 0;
57 
58  //Common variables
59  mMEx = 0;
60  mMEy = 0;
61  mMETSig = 0;
62  mMET = 0;
63  mMETFine = 0;
64  mMET_Nvtx = 0;
65  mMETPhi = 0;
66  mSumET = 0;
67  mMETDifference_GenMETTrue = 0;
68  mMETDeltaPhi_GenMETTrue = 0;
69  mMETDifference_GenMETCalo = 0;
70  mMETDeltaPhi_GenMETCalo = 0;
71 
72  // MET Uncertainities: Only for MiniAOD
73  mMETUnc_JetResUp = 0;
74  mMETUnc_JetResDown = 0;
75  mMETUnc_JetEnUp = 0;
76  mMETUnc_JetEnDown = 0;
77  mMETUnc_MuonEnUp = 0;
78  mMETUnc_MuonEnDown = 0;
79  mMETUnc_ElectronEnUp = 0;
80  mMETUnc_ElectronEnDown = 0;
81  mMETUnc_TauEnUp = 0;
82  mMETUnc_TauEnDown = 0;
83  mMETUnc_UnclusteredEnUp = 0;
84  mMETUnc_UnclusteredEnDown = 0;
85  mMETUnc_PhotonEnUp = 0;
86  mMETUnc_PhotonEnDown = 0;
87 
88 
89  //CaloMET variables
90  mCaloMaxEtInEmTowers = 0;
91  mCaloMaxEtInHadTowers = 0;
92  mCaloEtFractionHadronic = 0;
93  mCaloEmEtFraction = 0;
94  mCaloHadEtInHB = 0;
95  mCaloHadEtInHO = 0;
96  mCaloHadEtInHE = 0;
97  mCaloHadEtInHF = 0;
98  mCaloEmEtInHF = 0;
99  mCaloSETInpHF = 0;
100  mCaloSETInmHF = 0;
101  mCaloEmEtInEE = 0;
102  mCaloEmEtInEB = 0;
103 
104 
105  //GenMET variables
106  mNeutralEMEtFraction=0;
107  mNeutralHadEtFraction=0;
108  mChargedEMEtFraction=0;
109  mChargedHadEtFraction=0;
110  mMuonEtFraction=0;
111  mInvisibleEtFraction=0;
112 
113  //MET variables
114 
115  //PFMET variables
116  mMETDifference_GenMETTrue_MET0to20=0;
117  mMETDifference_GenMETTrue_MET20to40=0;
118  mMETDifference_GenMETTrue_MET40to60=0;
119  mMETDifference_GenMETTrue_MET60to80=0;
120  mMETDifference_GenMETTrue_MET80to100=0;
121  mMETDifference_GenMETTrue_MET100to150=0;
122  mMETDifference_GenMETTrue_MET150to200=0;
123  mMETDifference_GenMETTrue_MET200to300=0;
124  mMETDifference_GenMETTrue_MET300to400=0;
125  mMETDifference_GenMETTrue_MET400to500=0;
126  mMETDifference_GenMETTrue_MET500=0;
127 
128 
129 }
131  edm::Run const & iRun,
132  edm::EventSetup const & /* iSetup */)
133 {
134  ibooker.setCurrentFolder("JetMET/METValidation/"+inputMETLabel_.label()) ;
135 
136  mNvertex = ibooker.book1D("Nvertex","Nvertex",80,0,80);
137  mMEx = ibooker.book1D("MEx","MEx",160,-800,800);
138  mMEy = ibooker.book1D("MEy","MEy",160,-800,800);
139  mMETSig = ibooker.book1D("METSig","METSig",25,0,24.5);
140  mMET = ibooker.book1D("MET", "MET (20 GeV binning)" , 100,0,2000);
141  mMETFine = ibooker.book1D("METFine", "MET (2 GeV binning)" , 1000,0,2000);
142  mMET_Nvtx = ibooker.bookProfile("MET_Nvtx", "MET vs. nvtx", 60, 0., 60., 0., 2000., " ");
143  mMETPhi = ibooker.book1D("METPhi","METPhi",80,-4,4);
144  mSumET = ibooker.book1D("SumET" , "SumET" , 200,0,4000); //10GeV
145  mMETDifference_GenMETTrue = ibooker.book1D("METDifference_GenMETTrue","METDifference_GenMETTrue", 500,-500,500);
146  mMETDeltaPhi_GenMETTrue = ibooker.book1D("METDeltaPhi_GenMETTrue","METDeltaPhi_GenMETTrue", 80,0,4);
147 
148  if(isMiniAODMET){
149  mMETUnc_JetResUp = ibooker.book1D("METUnc_JetResUp", "METUnc_JetResUp", 200, -10, 10);
150  mMETUnc_JetResDown = ibooker.book1D("METUnc_JetResDown", "METUnc_JetResDown", 200, -10, 10);
151  mMETUnc_JetEnUp = ibooker.book1D("METUnc_JetEnUp", "METUnc_JetEnUp", 200, -10, 10);
152  mMETUnc_JetEnDown = ibooker.book1D("METUnc_JetEnDown", "METUnc_JetEnDown", 200, -10, 10);
153  mMETUnc_MuonEnUp = ibooker.book1D("METUnc_MuonEnUp", "METUnc_MuonEnUp", 200, -10, 10);
154  mMETUnc_MuonEnDown = ibooker.book1D("METUnc_MuonEnDown", "METUnc_MuonEnDown", 200, -10, 10);
155  mMETUnc_ElectronEnUp = ibooker.book1D("METUnc_ElectronEnUp", "METUnc_ElectronEnUp", 200, -10, 10);
156  mMETUnc_ElectronEnDown = ibooker.book1D("METUnc_ElectronEnDown", "METUnc_ElectronEnDown", 200, -10, 10);
157  mMETUnc_TauEnUp = ibooker.book1D("METUnc_TauEnUp", "METUnc_TauEnUp", 200, -10, 10);
158  mMETUnc_TauEnDown = ibooker.book1D("METUnc_TauEnDown", "METUnc_TauEnDown", 200, -10, 10);
159  mMETUnc_UnclusteredEnUp = ibooker.book1D("METUnc_UnclusteredEnUp", "METUnc_UnclusteredEnUp", 200, -10, 10);
160  mMETUnc_UnclusteredEnDown = ibooker.book1D("METUnc_UnclusteredEnDown", "METUnc_UnclusteredEnDown", 200, -10, 10);
161  mMETUnc_PhotonEnUp = ibooker.book1D("METUnc_UnclusteredEnDown", "METUnc_UnclusteredEnDown", 200, -10, 10);
162  mMETUnc_PhotonEnDown = ibooker.book1D("METUnc_PhotonEnDown", "METUnc_PhotonEnDown", 200, -10, 10);
163 
164  }
165  if(!isMiniAODMET){
166  mMETDifference_GenMETCalo = ibooker.book1D("METDifference_GenMETCalo","METDifference_GenMETCalo", 500,-500,500);
167  mMETDeltaPhi_GenMETCalo = ibooker.book1D("METDeltaPhi_GenMETCalo","METDeltaPhi_GenMETCalo", 80,0,4);
168  }
169  if(!isGenMET){
170  mMETDifference_GenMETTrue_MET0to20 = ibooker.book1D("METResolution_GenMETTrue_MET0to20" , "METResolution_GenMETTrue_MET0to20" , 500,-500,500);
171  mMETDifference_GenMETTrue_MET20to40 = ibooker.book1D("METResolution_GenMETTrue_MET20to40" , "METResolution_GenMETTrue_MET20to40" , 500,-500,500);
172  mMETDifference_GenMETTrue_MET40to60 = ibooker.book1D("METResolution_GenMETTrue_MET40to60" , "METResolution_GenMETTrue_MET40to60" , 500,-500,500);
173  mMETDifference_GenMETTrue_MET60to80 = ibooker.book1D("METResolution_GenMETTrue_MET60to80" , "METResolution_GenMETTrue_MET60to80" , 500,-500,500);
174  mMETDifference_GenMETTrue_MET80to100 = ibooker.book1D("METResolution_GenMETTrue_MET80to100" , "METResolution_GenMETTrue_MET80to100" , 500,-500,500);
175  mMETDifference_GenMETTrue_MET100to150 = ibooker.book1D("METResolution_GenMETTrue_MET100to150", "METResolution_GenMETTrue_MET100to150", 500,-500,500);
176  mMETDifference_GenMETTrue_MET150to200 = ibooker.book1D("METResolution_GenMETTrue_MET150to200", "METResolution_GenMETTrue_MET150to200", 500,-500,500);
177  mMETDifference_GenMETTrue_MET200to300 = ibooker.book1D("METResolution_GenMETTrue_MET200to300", "METResolution_GenMETTrue_MET200to300", 500,-500,500);
178  mMETDifference_GenMETTrue_MET300to400 = ibooker.book1D("METResolution_GenMETTrue_MET300to400", "METResolution_GenMETTrue_MET300to400", 500,-500,500);
179  mMETDifference_GenMETTrue_MET400to500 = ibooker.book1D("METResolution_GenMETTrue_MET400to500", "METResolution_GenMETTrue_MET400to500", 500,-500,500);
180  mMETDifference_GenMETTrue_MET500 = ibooker.book1D("METResolution_GenMETTrue_MET500", "METResolution_GenMETTrue_MET500", 500,-500,500);
181  }
182  if ( isCaloMET) {
183  mCaloMaxEtInEmTowers = ibooker.book1D("CaloMaxEtInEmTowers","CaloMaxEtInEmTowers",300,0,1500); //5GeV
184  mCaloMaxEtInHadTowers = ibooker.book1D("CaloMaxEtInHadTowers","CaloMaxEtInHadTowers",300,0,1500); //5GeV
185  mCaloEtFractionHadronic = ibooker.book1D("CaloEtFractionHadronic","CaloEtFractionHadronic",100,0,1);
186  mCaloEmEtFraction = ibooker.book1D("CaloEmEtFraction","CaloEmEtFraction",100,0,1);
187  mCaloHadEtInHB = ibooker.book1D("CaloHadEtInHB","CaloHadEtInHB", 200, 0, 2000); //5GeV
188  mCaloHadEtInHE = ibooker.book1D("CaloHadEtInHE","CaloHadEtInHE", 100, 0, 500); //5GeV
189  mCaloHadEtInHO = ibooker.book1D("CaloHadEtInHO","CaloHadEtInHO", 100, 0, 200); //5GeV
190  mCaloHadEtInHF = ibooker.book1D("CaloHadEtInHF","CaloHadEtInHF", 100, 0, 200); //5GeV
191  mCaloSETInpHF = ibooker.book1D("CaloSETInpHF","CaloSETInpHF",100, 0, 500);
192  mCaloSETInmHF = ibooker.book1D("CaloSETInmHF","CaloSETInmHF",100, 0, 500);
193  mCaloEmEtInEE = ibooker.book1D("CaloEmEtInEE","CaloEmEtInEE",100, 0, 500); //5GeV
194  mCaloEmEtInEB = ibooker.book1D("CaloEmEtInEB","CaloEmEtInEB",100, 0, 500); //5GeV
195  mCaloEmEtInHF = ibooker.book1D("CaloEmEtInHF","CaloEmEtInHF",100, 0, 500); //5GeV
196  }
197 
198  if(isGenMET){
199  mNeutralEMEtFraction = ibooker.book1D("GenNeutralEMEtFraction", "GenNeutralEMEtFraction", 120, 0.0, 1.2 );
200  mNeutralHadEtFraction = ibooker.book1D("GenNeutralHadEtFraction", "GenNeutralHadEtFraction", 120, 0.0, 1.2 );
201  mChargedEMEtFraction = ibooker.book1D("GenChargedEMEtFraction", "GenChargedEMEtFraction", 120, 0.0, 1.2);
202  mChargedHadEtFraction = ibooker.book1D("GenChargedHadEtFraction", "GenChargedHadEtFraction", 120, 0.0,1.2);
203  mMuonEtFraction = ibooker.book1D("GenMuonEtFraction", "GenMuonEtFraction", 120, 0.0, 1.2 );
204  mInvisibleEtFraction = ibooker.book1D("GenInvisibleEtFraction", "GenInvisibleEtFraction", 120, 0.0, 1.2 );
205  }
206 
207  if (isPFMET || isMiniAODMET){
208  mPFphotonEtFraction = ibooker.book1D("photonEtFraction", "photonEtFraction", 100, 0, 1);
209  mPFneutralHadronEtFraction = ibooker.book1D("neutralHadronEtFraction", "neutralHadronEtFraction", 100, 0, 1);
210  mPFelectronEtFraction = ibooker.book1D("electronEtFraction", "electronEtFraction", 100, 0, 1);
211  mPFchargedHadronEtFraction = ibooker.book1D("chargedHadronEtFraction", "chargedHadronEtFraction", 100, 0, 1);
212  mPFHFHadronEtFraction = ibooker.book1D("HFHadronEtFraction", "HFHadronEtFraction", 100, 0, 1);
213  mPFmuonEtFraction = ibooker.book1D("muonEtFraction", "muonEtFraction", 100, 0, 1);
214  mPFHFEMEtFraction = ibooker.book1D("HFEMEtFraction", "HFEMEtFraction", 100, 0, 1);
215 
216  if(!isMiniAODMET){
217  mPFphotonEt = ibooker.book1D("photonEt", "photonEt", 100, 0, 1000);
218  mPFneutralHadronEt = ibooker.book1D("neutralHadronEt", "neutralHadronEt", 100, 0, 1000);
219  mPFelectronEt = ibooker.book1D("electronEt", "electronEt", 100, 0, 1000);
220  mPFchargedHadronEt = ibooker.book1D("chargedHadronEt", "chargedHadronEt", 100, 0, 1000);
221  mPFmuonEt = ibooker.book1D("muonEt", "muonEt", 100, 0, 1000);
222  mPFHFHadronEt = ibooker.book1D("HFHadronEt", "HFHadronEt", 100, 0, 500);
223  mPFHFEMEt = ibooker.book1D("HFEMEt", "HFEMEt", 100, 0, 300);
224  }
225 
226  }
227 }
228 
229 
231 { //int counter(0);
232 
234  iEvent.getByToken(pvToken_, pvHandle);
235  if (! pvHandle.isValid())
236  {
237  std::cout << __FUNCTION__ << ":" << __LINE__ << ":pvHandle handle not found!" << std::endl;
238  assert(false);
239  }
240  const int nvtx = pvHandle->size();
241  mNvertex->Fill(nvtx);
242  //Collections for all MET collections
243 
248 
249  if (isCaloMET) iEvent.getByToken(caloMETsToken_, caloMETs);
250  if (isPFMET) iEvent.getByToken(pfMETsToken_, pfMETs);
251  if (isGenMET) iEvent.getByToken(genMETsToken_, genMETs);
252  if (isMiniAODMET) iEvent.getByToken(patMETToken_, patMET);
253  if ((isCaloMET) and !caloMETs.isValid()) return;
254  if ((isPFMET) and !pfMETs.isValid()) return;
255  if ((isGenMET) and !genMETs.isValid()) return;
256  if ((isMiniAODMET) and !patMET.isValid()) return;
257 
258  reco::MET met;
259  if (isCaloMET) { met = caloMETs->front();}
260  if (isPFMET) { met = pfMETs->front() ;}
261  if (isGenMET) { met = genMETs->front() ;}
262  if (isMiniAODMET) { met = patMET->front() ;}
263 
264  const double SumET = met.sumEt();
265  const double METSig = met.mEtSig();
266  const double MET = met.pt();
267  const double MEx = met.px();
268  const double MEy = met.py();
269  const double METPhi = met.phi();
270  mMEx->Fill(MEx);
271  mMEy->Fill(MEy);
272  mMET->Fill(MET);
273  mMETFine->Fill(MET);
274  mMET_Nvtx->Fill((double)nvtx, MET);
275  mMETPhi->Fill(METPhi);
276  mSumET->Fill(SumET);
277  mMETSig->Fill(METSig);
278 
279 
280  // Get Generated MET for Resolution plots
282  bool isvalidgenmet=false;
283 
284  if(!isMiniAODMET){
286  iEvent.getByToken(genMETsTrueToken_, genTrue);
287  if (genTrue.isValid()) {
288  isvalidgenmet=true;
289  const GenMETCollection *genmetcol = genTrue.product();
290  genMetTrue = &(genmetcol->front());
291  }
292  }else{
293  genMetTrue=patMET->front().genMET();
294  isvalidgenmet=true;
295  }
296 
297  if(isvalidgenmet){
298  double genMET = genMetTrue->pt();
299  double genMETPhi = genMetTrue->phi();
300 
301  mMETDifference_GenMETTrue->Fill( MET - genMET );
302  mMETDeltaPhi_GenMETTrue->Fill( TMath::ACos( TMath::Cos( METPhi - genMETPhi ) ) );
303 
304  if(!isGenMET){
305  //pfMET resolution in pfMET bins : Sam, Feb, 2012
306  if (MET > 0 && MET < 20) mMETDifference_GenMETTrue_MET0to20->Fill( MET - genMET );
307  else if (MET > 20 && MET < 40) mMETDifference_GenMETTrue_MET20to40->Fill( MET - genMET );
308  else if (MET > 40 && MET < 60) mMETDifference_GenMETTrue_MET40to60->Fill( MET - genMET );
309  else if (MET > 60 && MET < 80) mMETDifference_GenMETTrue_MET60to80->Fill( MET - genMET );
310  else if (MET > 80 && MET <100) mMETDifference_GenMETTrue_MET80to100->Fill( MET - genMET );
311  else if (MET >100 && MET <150) mMETDifference_GenMETTrue_MET100to150->Fill( MET - genMET );
312  else if (MET >150 && MET <200) mMETDifference_GenMETTrue_MET150to200->Fill( MET - genMET );
313  else if (MET >200 && MET <300) mMETDifference_GenMETTrue_MET200to300->Fill( MET - genMET );
314  else if (MET >300 && MET <400) mMETDifference_GenMETTrue_MET300to400->Fill( MET - genMET );
315  else if (MET >400 && MET <500) mMETDifference_GenMETTrue_MET400to500->Fill( MET - genMET );
316  else if (MET >500) mMETDifference_GenMETTrue_MET500->Fill( MET - genMET );
317 
318  } else {
319  edm::LogInfo("OutputInfo") << " failed to retrieve data required by MET Task: genMetTrue";
320  }
321  }
322  if(!isMiniAODMET){
324  iEvent.getByToken(genMETsCaloToken_, genCalo);
325  if (genCalo.isValid()) {
326  const GenMETCollection *genmetcol = genCalo.product();
327  const GenMET *genMetCalo = &(genmetcol->front());
328  const double genMET = genMetCalo->pt();
329  const double genMETPhi = genMetCalo->phi();
330 
331  mMETDifference_GenMETCalo->Fill( MET - genMET );
332  mMETDeltaPhi_GenMETCalo->Fill( TMath::ACos( TMath::Cos( METPhi - genMETPhi ) ) );
333  } else {
334  edm::LogInfo("OutputInfo") << " failed to retrieve data required by MET Task: genMetCalo";
335  }
336  }
337  if ( isCaloMET) {
338  const reco::CaloMET * calomet = &(caloMETs->front());
339  // ==========================================================
340  // Reconstructed MET Information
341  const double caloMaxEtInEMTowers = calomet->maxEtInEmTowers();
342  const double caloMaxEtInHadTowers = calomet->maxEtInHadTowers();
343  const double caloEtFractionHadronic = calomet->etFractionHadronic();
344  const double caloEmEtFraction = calomet->emEtFraction();
345  const double caloHadEtInHB = calomet->hadEtInHB();
346  const double caloHadEtInHO = calomet->hadEtInHO();
347  const double caloHadEtInHE = calomet->hadEtInHE();
348  const double caloHadEtInHF = calomet->hadEtInHF();
349  const double caloEmEtInEB = calomet->emEtInEB();
350  const double caloEmEtInEE = calomet->emEtInEE();
351  const double caloEmEtInHF = calomet->emEtInHF();
352  const double caloSETInpHF = calomet->CaloSETInpHF();
353  const double caloSETInmHF = calomet->CaloSETInmHF();
354 
355  mCaloMaxEtInEmTowers->Fill(caloMaxEtInEMTowers);
356  mCaloMaxEtInHadTowers->Fill(caloMaxEtInHadTowers);
357  mCaloEtFractionHadronic->Fill(caloEtFractionHadronic);
358  mCaloEmEtFraction->Fill(caloEmEtFraction);
359  mCaloHadEtInHB->Fill(caloHadEtInHB);
360  mCaloHadEtInHO->Fill(caloHadEtInHO);
361  mCaloHadEtInHE->Fill(caloHadEtInHE);
362  mCaloHadEtInHF->Fill(caloHadEtInHF);
363  mCaloEmEtInEB->Fill(caloEmEtInEB);
364  mCaloEmEtInEE->Fill(caloEmEtInEE);
365  mCaloEmEtInHF->Fill(caloEmEtInHF);
366  mCaloSETInpHF->Fill(caloSETInpHF);
367  mCaloSETInmHF->Fill(caloSETInmHF);
368  }
369  if (isGenMET)
370  {
371  const GenMET *genmet;
372  // Get Generated MET
373  genmet = &(genMETs->front());
374 
375  const double NeutralEMEtFraction = genmet->NeutralEMEtFraction() ;
376  const double NeutralHadEtFraction = genmet->NeutralHadEtFraction() ;
377  const double ChargedEMEtFraction = genmet->ChargedEMEtFraction () ;
378  const double ChargedHadEtFraction = genmet->ChargedHadEtFraction();
379  const double MuonEtFraction = genmet->MuonEtFraction() ;
380  const double InvisibleEtFraction = genmet->InvisibleEtFraction() ;
381 
382  mNeutralEMEtFraction->Fill( NeutralEMEtFraction );
383  mNeutralHadEtFraction->Fill( NeutralHadEtFraction );
384  mChargedEMEtFraction->Fill( ChargedEMEtFraction );
385  mChargedHadEtFraction->Fill( ChargedHadEtFraction );
386  mMuonEtFraction->Fill( MuonEtFraction );
387  mInvisibleEtFraction->Fill( InvisibleEtFraction );
388  }
389  if(isPFMET)
390  {
391  const reco::PFMET * pfmet = &(pfMETs->front());
392  mPFphotonEtFraction->Fill(pfmet->photonEtFraction());
393  mPFphotonEt->Fill(pfmet->photonEt());
394  mPFneutralHadronEtFraction->Fill(pfmet->neutralHadronEtFraction());
395  mPFneutralHadronEt->Fill(pfmet->neutralHadronEt());
396  mPFelectronEtFraction->Fill(pfmet->electronEtFraction());
397  mPFelectronEt->Fill(pfmet->electronEt());
398  mPFchargedHadronEtFraction->Fill(pfmet->chargedHadronEtFraction());
399  mPFchargedHadronEt->Fill(pfmet->chargedHadronEt());
400  mPFmuonEtFraction->Fill(pfmet->muonEtFraction());
401  mPFmuonEt->Fill(pfmet->muonEt());
402  mPFHFHadronEtFraction->Fill(pfmet->HFHadronEtFraction());
403  mPFHFHadronEt->Fill(pfmet->HFHadronEt());
404  mPFHFEMEtFraction->Fill(pfmet->HFEMEtFraction());
405  mPFHFEMEt->Fill(pfmet->HFEMEt());
406  // Reconstructed MET Information
407 
408  }
409  if(isMiniAODMET){
410  const pat::MET *patmet = &(patMET->front());
411  mMETUnc_JetResUp ->Fill(MET- patmet->shiftedPt(pat::MET::JetResUp)) ;
412  mMETUnc_JetResDown ->Fill(MET- patmet->shiftedPt(pat::MET::JetResDown));
413  mMETUnc_JetEnUp ->Fill(MET- patmet->shiftedPt(pat::MET::JetEnUp));
414  mMETUnc_JetEnDown ->Fill(MET- patmet->shiftedPt(pat::MET::JetEnDown));
415  mMETUnc_MuonEnUp ->Fill(MET- patmet->shiftedPt(pat::MET::MuonEnUp));
416  mMETUnc_MuonEnDown ->Fill(MET- patmet->shiftedPt(pat::MET::MuonEnDown));
417  mMETUnc_ElectronEnUp ->Fill(MET- patmet->shiftedPt(pat::MET::ElectronEnUp));
418  mMETUnc_ElectronEnDown ->Fill(MET- patmet->shiftedPt(pat::MET::ElectronEnDown));
419  mMETUnc_TauEnUp ->Fill(MET- patmet->shiftedPt(pat::MET::TauEnUp));
420  mMETUnc_TauEnDown ->Fill(MET- patmet->shiftedPt(pat::MET::TauEnDown));
421  mMETUnc_UnclusteredEnUp ->Fill(MET- patmet->shiftedPt(pat::MET::UnclusteredEnUp));
422  mMETUnc_UnclusteredEnDown ->Fill(MET- patmet->shiftedPt(pat::MET::UnclusteredEnDown));
423  mMETUnc_PhotonEnUp ->Fill(MET- patmet->shiftedPt(pat::MET::PhotonEnUp));
424  mMETUnc_PhotonEnDown ->Fill(MET- patmet->shiftedPt(pat::MET::PhotonEnDown));
425 
426 
427  if(patmet->isPFMET()){
428  mPFphotonEtFraction->Fill(patmet->NeutralEMFraction());
429  mPFneutralHadronEtFraction->Fill(patmet->NeutralHadEtFraction());
430  mPFelectronEtFraction->Fill(patmet->ChargedEMEtFraction());
431  mPFchargedHadronEtFraction->Fill(patmet->ChargedHadEtFraction());
432  mPFmuonEtFraction->Fill(patmet->MuonEtFraction());
433  mPFHFHadronEtFraction->Fill(patmet->Type6EtFraction());//HFHadrons
434  mPFHFEMEtFraction->Fill(patmet->Type7EtFraction());//HFEMEt
435  }
436  }
437 }
438 
439 
Analysis-level MET class.
Definition: MET.h:43
T getParameter(std::string const &) const
virtual double pt() const final
transverse momentum
T getUntrackedParameter(std::string const &, T const &) const
double hadEtInHE() const
Definition: CaloMET.h:51
Collection of Gen MET.
double HFEMEtFraction() const
Definition: PFMET.h:47
double hadEtInHF() const
Definition: CaloMET.h:53
double ChargedHadEtFraction() const
Definition: MET.h:141
double CaloSETInmHF() const
Definition: CaloMET.h:65
double MuonEtFraction() const
Definition: MET.h:142
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
double maxEtInHadTowers() const
Definition: CaloMET.h:40
double neutralHadronEtFraction() const
Definition: PFMET.h:32
genmet
do same things for GEN
double muonEt() const
Definition: PFMET.h:42
double MuonEtFraction() const
Definition: GenMET.h:57
#define NULL
Definition: scimark2.h:8
double NeutralEMFraction() const
Definition: MET.h:138
double ChargedEMEtFraction() const
Definition: MET.h:140
genMetCalo
____________________________________________________________________________||
double maxEtInEmTowers() const
Definition: CaloMET.h:38
double Type6EtFraction() const
Definition: MET.h:143
double Type7EtFraction() const
Definition: MET.h:144
double NeutralHadEtFraction() const
Definition: MET.h:139
bool isPFMET() const
True if this pat::MET was made from a reco::pfMET.
Definition: MET.h:90
virtual double phi() const final
momentum azimuthal angle
double mEtSig() const
Definition: MET.h:58
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: METTester.cc:130
double HFHadronEtFraction() const
Definition: PFMET.h:44
int iEvent
Definition: GenABIO.cc:230
double sumEt() const
Definition: MET.h:56
double muonEtFraction() const
Definition: PFMET.h:41
double HFHadronEt() const
Definition: PFMET.h:45
Definition: MET.h:42
virtual double px() const final
x coordinate of momentum vector
double photonEtFraction() const
Definition: PFMET.h:29
double ChargedEMEtFraction() const
Definition: GenMET.h:39
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
double emEtInEB() const
Definition: CaloMET.h:55
bool isValid() const
Definition: HandleBase.h:74
double CaloSETInpHF() const
Definition: CaloMET.h:63
double InvisibleEtFraction() const
Definition: GenMET.h:63
double HFEMEt() const
Definition: PFMET.h:48
double shiftedPt(METUncertainty shift, METCorrectionLevel level=Type1) const
Definition: MET.h:181
double hadEtInHO() const
Definition: CaloMET.h:49
double electronEt() const
Definition: PFMET.h:36
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
double etFractionHadronic() const
Definition: CaloMET.h:42
T const * product() const
Definition: Handle.h:81
double photonEt() const
Definition: PFMET.h:30
met
===> hadronic RAZOR
double NeutralEMEtFraction() const
Definition: GenMET.h:33
double emEtInEE() const
Definition: CaloMET.h:57
double electronEtFraction() const
Definition: PFMET.h:35
double chargedHadronEtFraction() const
Definition: PFMET.h:38
fixed size matrix
HLT enums.
genMetTrue
____________________________________________________________________________||
METTester(const edm::ParameterSet &)
Definition: METTester.cc:32
double NeutralHadEtFraction() const
Definition: GenMET.h:45
double emEtInHF() const
Definition: CaloMET.h:59
double neutralHadronEt() const
Definition: PFMET.h:33
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: METTester.cc:230
double ChargedHadEtFraction() const
Definition: GenMET.h:51
double hadEtInHB() const
Definition: CaloMET.h:47
virtual double py() const final
y coordinate of momentum vector
double emEtFraction() const
Definition: CaloMET.h:45
double chargedHadronEt() const
Definition: PFMET.h:39
Definition: Run.h:42