CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloMETAnalyzer.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * $Date: 2012/05/20 13:12:05 $
5  * $Revision: 1.72 $
6  * \author F. Chlebana - Fermilab
7  * K. Hatakeyama - Rockefeller University
8  */
9 
12 
15 
20 
22 
26 
27 #include "TLorentzVector.h"
28 
29 #include <string>
30 using namespace edm;
31 
32 // ***********************************************************
34 
35  parameters = pSet;
36 
37  edm::ParameterSet highptjetparms = parameters.getParameter<edm::ParameterSet>("highPtJetTrigger");
38  edm::ParameterSet lowptjetparms = parameters.getParameter<edm::ParameterSet>("lowPtJetTrigger" );
39  edm::ParameterSet minbiasparms = parameters.getParameter<edm::ParameterSet>("minBiasTrigger" );
40  edm::ParameterSet highmetparms = parameters.getParameter<edm::ParameterSet>("highMETTrigger" );
41  // edm::ParameterSet lowmetparms = parameters.getParameter<edm::ParameterSet>("lowMETTrigger" );
42  edm::ParameterSet eleparms = parameters.getParameter<edm::ParameterSet>("eleTrigger" );
43  edm::ParameterSet muonparms = parameters.getParameter<edm::ParameterSet>("muonTrigger" );
44 
45  //genericTriggerEventFlag_( new GenericTriggerEventFlag( conf_ ) );
46  _HighPtJetEventFlag = new GenericTriggerEventFlag( highptjetparms );
47  _LowPtJetEventFlag = new GenericTriggerEventFlag( lowptjetparms );
48  _MinBiasEventFlag = new GenericTriggerEventFlag( minbiasparms );
49  _HighMETEventFlag = new GenericTriggerEventFlag( highmetparms );
50  // _LowMETEventFlag = new GenericTriggerEventFlag( lowmetparms );
51  _EleEventFlag = new GenericTriggerEventFlag( eleparms );
52  _MuonEventFlag = new GenericTriggerEventFlag( muonparms );
53 
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");
57  // lowMETExpr_ = lowmetparms .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");
61 
62 }
63 
64 // ***********************************************************
66 
67  delete _HighPtJetEventFlag;
68  delete _LowPtJetEventFlag;
69  delete _MinBiasEventFlag;
70  delete _HighMETEventFlag;
71  // delete _LowMETEventFlag;
72  delete _EleEventFlag;
73  delete _MuonEventFlag;
74 
75 }
76 
77 // ***********************************************************
79 
80  evtCounter = 0;
81  metname = "caloMETAnalyzer";
82 
83  // trigger information
84  HLTPathsJetMBByName_ = parameters.getParameter<std::vector<std::string > >("HLTPathsJetMB");
85 
86  theCleaningParameters = parameters.getParameter<ParameterSet>("CleaningParameters"),
87 
88  //Trigger parameters
89  gtTag = theCleaningParameters.getParameter<edm::InputTag>("gtLabel");
90  _techTrigsAND = theCleaningParameters.getParameter<std::vector<unsigned > >("techTrigsAND");
91  _techTrigsOR = theCleaningParameters.getParameter<std::vector<unsigned > >("techTrigsOR");
92  _techTrigsNOT = theCleaningParameters.getParameter<std::vector<unsigned > >("techTrigsNOT");
93 
94  _doHLTPhysicsOn = theCleaningParameters.getParameter<bool>("doHLTPhysicsOn");
95  _hlt_PhysDec = theCleaningParameters.getParameter<std::string>("HLT_PhysDec");
96 
97  _tightBHFiltering = theCleaningParameters.getParameter<bool>("tightBHFiltering");
98  _tightJetIDFiltering = theCleaningParameters.getParameter<int>("tightJetIDFiltering");
99 
100  // ==========================================================
101  //DCS information
102  // ==========================================================
103  DCSFilter = new JetMETDQMDCSFilter(parameters.getParameter<ParameterSet>("DCSFilter"));
104 
105  //Vertex requirements
106  _doPVCheck = theCleaningParameters.getParameter<bool>("doPrimaryVertexCheck");
107  vertexTag = theCleaningParameters.getParameter<edm::InputTag>("vertexLabel");
108 
109  if (_doPVCheck) {
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");
115  }
116 
117 
118  // CaloMET information
119  theCaloMETCollectionLabel = parameters.getParameter<edm::InputTag>("METCollectionLabel");
120  _source = parameters.getParameter<std::string>("Source");
121 
122  if (theCaloMETCollectionLabel.label() == "corMetGlobalMuons" ) {
123  inputBeamSpotLabel = parameters.getParameter<edm::InputTag>("InputBeamSpotLabel");
124  }
125 
126  // Other data collections
127  theCaloTowersLabel = parameters.getParameter<edm::InputTag>("CaloTowersLabel");
128  theJetCollectionLabel = parameters.getParameter<edm::InputTag>("JetCollectionLabel");
129  HcalNoiseRBXCollectionTag = parameters.getParameter<edm::InputTag>("HcalNoiseRBXCollection");
130  BeamHaloSummaryTag = parameters.getParameter<edm::InputTag>("BeamHaloSummaryLabel");
131  HBHENoiseFilterResultTag = parameters.getParameter<edm::InputTag>("HBHENoiseFilterResultLabel");
132 
133  // misc
134  _verbose = parameters.getParameter<int>("verbose");
135  _print = parameters.getParameter<int>("printOut");
136  _etThreshold = parameters.getParameter<double>("etThreshold"); // MET threshold
137  _allhist = parameters.getParameter<bool>("allHist"); // Full set of monitoring histograms
138  _allSelection= parameters.getParameter<bool>("allSelection"); // Plot with all sets of event selection
139  _cleanupSelection= parameters.getParameter<bool>("cleanupSelection"); // Plot with all sets of event selection
140 
141  _highPtJetThreshold = parameters.getParameter<double>("HighPtJetThreshold"); // High Pt Jet threshold
142  _lowPtJetThreshold = parameters.getParameter<double>("LowPtJetThreshold"); // Low Pt Jet threshold
143  _highMETThreshold = parameters.getParameter<double>("HighMETThreshold"); // High MET threshold
144  // _lowMETThreshold = parameters.getParameter<double>("LowMETThreshold"); // Low MET threshold
145 
146  //
147  jetID = new reco::helper::JetIDHelper(parameters.getParameter<ParameterSet>("JetIDParams"));
148 
149  // DQStore stuff
150  LogTrace(metname)<<"[CaloMETAnalyzer] Parameters initialization";
151  std::string DirName = "JetMET/MET/"+_source;
152  dbe->setCurrentFolder(DirName);
153 
154  hmetME = dbe->book1D("metReco", "metReco", 4, 1, 5);
155  hmetME->setBinLabel(1,"CaloMET",1);
156 
157  _dbe = dbe;
158 
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");
170 
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);
177  }
178  if (_allSelection){
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);
187  }
188  }
189 }
190 
191 
192 // ***********************************************************
194 
195  delete jetID;
196  delete DCSFilter;
197 
198 }
199 
200 
201 // ***********************************************************
203 {
204  bool bLumiSecPlot=false;
205  if (DirName.find("All")!=std::string::npos) bLumiSecPlot=true;
206 
207  bookMonitorElement(DirName,bLumiSecPlot);
208 
209  if ( _HighPtJetEventFlag->on() ) {
210  bookMonitorElementTriggered(DirName+"/"+"HighPtJet",false);
211  hTriggerName_HighPtJet = _dbe->bookString("triggerName_HighPtJet", highPtJetExpr_[0]);
212  }
213 
214  if ( _LowPtJetEventFlag->on() ) {
215  bookMonitorElementTriggered(DirName+"/"+"LowPtJet",false);
216  hTriggerName_LowPtJet = _dbe->bookString("triggerName_LowPtJet", lowPtJetExpr_[0]);
217  }
218 
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";
223  }
224 
225  if ( _HighMETEventFlag->on() ) {
226  bookMonitorElementTriggered(DirName+"/"+"HighMET",false);
227  hTriggerName_HighMET = _dbe->bookString("triggerName_HighMET", highMETExpr_[0]);
228  }
229 
230  // if ( _LowMETEventFlag->on() ) {
231  // bookMonitorElementTriggered(DirName+"/"+"LowMET",false);
232  // hTriggerName_LowMET = _dbe->bookString("triggerName_LowMET", lowMETExpr_[0]);
233  // }
234 
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";
239  }
240 
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";
245  }
246 }
247 
248 // ***********************************************************
250 {
251  if (_verbose) std::cout << "bookMonitorElement " << DirName << std::endl;
252 
253  _dbe->setCurrentFolder(DirName);
254 
255  bookMonitorElementTriggered(DirName, bLumiSecPlot);
256 
257 
258  if (_allhist) {
259 
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);
264 
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);
279 
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);
288 
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);
297  }
298 }
299 
300 
301 // ***********************************************************
303 {
304  if (_verbose) std::cout << "bookMonitorElementTriggered " << DirName << std::endl;
305 
306  _dbe->setCurrentFolder(DirName);
307 
308 
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);
320 
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);
332 
333 
334  // Book NPV profiles
335  //----------------------------------------------------------------------------
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);
341 
342 
343  // Set NPV profiles x-axis title
344  //----------------------------------------------------------------------------
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);
350 
351 
352  if (_allhist){
353  if (bLumiSecPlot){
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);
360  }
361 
362  //hCaloMaxEtInEmTowers = _dbe->book1D("METTask_CaloMaxEtInEmTowers", "METTask_CaloMaxEtInEmTowers" ,100,0,2000);
363  //hCaloMaxEtInEmTowers->setAxisTitle("Et(Max) in EM Tower [GeV]",1);
364  //hCaloMaxEtInHadTowers = _dbe->book1D("METTask_CaloMaxEtInHadTowers", "METTask_CaloMaxEtInHadTowers" ,100,0,2000);
365  //hCaloMaxEtInHadTowers->setAxisTitle("Et(Max) in Had Tower [GeV]",1);
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);
370 
371  //hCaloEmEtFraction002 = _dbe->book1D("METTask_CaloEmEtFraction002", "METTask_CaloEmEtFraction002" ,100,0,1);
372  //hCaloEmEtFraction002->setAxisTitle("EM Et Fraction (MET>2 GeV)",1);
373  //hCaloEmEtFraction010 = _dbe->book1D("METTask_CaloEmEtFraction010", "METTask_CaloEmEtFraction010" ,100,0,1);
374  //hCaloEmEtFraction010->setAxisTitle("EM Et Fraction (MET>10 GeV)",1);
375  hCaloEmEtFraction020 = _dbe->book1D("METTask_CaloEmEtFraction020", "METTask_CaloEmEtFraction020" ,100,0,1);
376  hCaloEmEtFraction020->setAxisTitle("EM Et Fraction (MET>20 GeV)",1);
377  }
378 
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);
388  }
389 
390 }
391 
392 // ***********************************************************
393 void CaloMETAnalyzer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup)
394 {
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 );
399  // if ( _LowMETEventFlag ->on() ) _LowMETEventFlag ->initRun( iRun, iSetup );
400  if ( _EleEventFlag ->on() ) _EleEventFlag ->initRun( iRun, iSetup );
401  if ( _MuonEventFlag ->on() ) _MuonEventFlag ->initRun( iRun, iSetup );
402 
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);
409  // if (_LowMETEventFlag->on() && _LowMETEventFlag->expressionsFromDB(_LowMETEventFlag->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
410  // lowMETExpr_ = _LowMETEventFlag->expressionsFromDB(_LowMETEventFlag->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);
417 
418 }
419 
420 
421 // ***********************************************************
422 void CaloMETAnalyzer::endRun(const edm::Run& iRun, const edm::EventSetup& iSetup, DQMStore * dbe)
423 {
424 
425  //
426  //--- Check the time length of the Run from the lumi section plots
427 
428  std::string dirName = "JetMET/MET/"+_source+"/";
429  _dbe->setCurrentFolder(dirName);
430 
431  TH1F* tlumisec;
432 
433  MonitorElement *meLumiSec = _dbe->get("aaa");
434  meLumiSec = _dbe->get("JetMET/lumisec");
435 
436  int totlsec=0;
437  double totltime=0.;
438  if ( meLumiSec->getRootObject() ) {
439  tlumisec = meLumiSec->getTH1F();
440  for (int i=0; i<500; i++){
441  if (tlumisec->GetBinContent(i+1)) totlsec++;
442  }
443  totltime = double(totlsec*90); // one lumi sec ~ 90 (sec)
444  }
445 
446  if (totltime==0.) totltime=1.;
447 
448  //
449  //--- Make the integrated plots with rate (Hz)
450 
451  for (std::vector<std::string>::const_iterator ic = _FolderNames.begin(); ic != _FolderNames.end(); ic++)
452  {
453 
455  DirName = dirName+*ic;
456 
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);
466  // if ( _LowMETEventFlag->on() )
467  // makeRatePlot(DirName+"/"+"triggerName_LowMET",totltime);
468  if ( _EleEventFlag->on() )
469  makeRatePlot(DirName+"/"+"triggerName_Ele",totltime);
470  if ( _MuonEventFlag->on() )
471  makeRatePlot(DirName+"/"+"triggerName_Muon",totltime);
472  }
473 }
474 
475 
476 // ***********************************************************
478 {
479 
480  _dbe->setCurrentFolder(DirName);
481  MonitorElement *meCaloMET = _dbe->get(DirName+"/"+"METTask_CaloMET");
482 
483  TH1F* tCaloMET;
484  TH1F* tCaloMETRate;
485 
486  if ( meCaloMET )
487  if ( meCaloMET->getRootObject() ) {
488  tCaloMET = meCaloMET->getTH1F();
489 
490  // Integral plot & convert number of events to rate (hz)
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));
494  }
495  for (int i = 0; i<tCaloMETRate->GetNbinsX(); i++){
496  tCaloMETRate->SetBinContent(i+1,tCaloMETRate->GetBinContent(i+1)/double(totltime));
497  }
498 
499  tCaloMETRate->SetName("METTask_CaloMETRate");
500  tCaloMETRate->SetTitle("METTask_CaloMETRate");
501  hCaloMETRate = _dbe->book1D("METTask_CaloMETRate",tCaloMETRate);
502  hCaloMETRate->setAxisTitle("MET Threshold [GeV]",1);
503  }
504 }
505 
506 
507 // ***********************************************************
510 
511  if (_verbose) std::cout << "CaloMETAnalyzer analyze" << std::endl;
512 
513  std::string DirName = "JetMET/MET/"+_source;
514  if (_print){
515  std::cout << " " << std::endl;
516  std::cout << "Event = " << iEvent.id().event() << std::endl;
517  }
518 
519  LogTrace(metname)<<"[CaloMETAnalyzer] Analyze CaloMET";
520 
521  hmetME->Fill(1);
522 
523  // ==========================================================
524  // Trigger information
525  //
526  _trig_JetMB=0;
527  _trig_HighPtJet=0;
528  _trig_LowPtJet=0;
529  _trig_MinBias=0;
530  _trig_HighMET=0;
531  // _trig_LowMET=0;
532  _trig_Ele=0;
533  _trig_Muon=0;
534  _trig_PhysDec=0;
535  if(&triggerResults) {
536 
538 
539  //
540  //
541  // Check how many HLT triggers are in triggerResults
542  int ntrigs = triggerResults.size();
543  if (_verbose) std::cout << "ntrigs=" << ntrigs << std::endl;
544 
545  //
546  //
547  // If index=ntrigs, this HLT trigger doesn't exist in the HLT table for this data.
548  const edm::TriggerNames & triggerNames = iEvent.triggerNames(triggerResults);
549 
550  //
551  //
552  const unsigned int nTrig(triggerNames.size());
553  for (unsigned int i=0;i<nTrig;++i)
554  {
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))
558  _trig_LowPtJet=true;
559  else if (triggerNames.triggerName(i).find(highMETExpr_[0].substr(0,highMETExpr_[0].rfind("_v")+2))!=std::string::npos && triggerResults.accept(i))
560  _trig_HighMET=true;
561  // else if (triggerNames.triggerName(i).find(lowMETExpr_[0].substr(0,lowMETExpr_[0].rfind("_v")+2))!=std::string::npos && triggerResults.accept(i))
562  // _trig_LowMET=true;
563  else if (triggerNames.triggerName(i).find(muonExpr_[0].substr(0,muonExpr_[0].rfind("_v")+2))!=std::string::npos && triggerResults.accept(i))
564  _trig_Muon=true;
565  else if (triggerNames.triggerName(i).find(elecExpr_[0].substr(0,elecExpr_[0].rfind("_v")+2))!=std::string::npos && triggerResults.accept(i))
566  _trig_Ele=true;
567  else if (triggerNames.triggerName(i).find(minbiasExpr_[0].substr(0,minbiasExpr_[0].rfind("_v")+2))!=std::string::npos && triggerResults.accept(i))
568  _trig_MinBias=true;
569  }
570 
571  // count number of requested Jet or MB HLT paths which have fired
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)) {
576  _trig_JetMB++;
577  }
578  }
579  }
580  // for empty input vectors (n==0), take all HLT triggers!
581  if (HLTPathsJetMBByName_.size()==0) _trig_JetMB=triggerResults.size()-1;
582 
583  /*
584  if ( _HighPtJetEventFlag->on() && _HighPtJetEventFlag->accept( iEvent, iSetup) )
585  _trig_HighPtJet=1;
586 
587  if ( _LowPtJetEventFlag->on() && _LowPtJetEventFlag->accept( iEvent, iSetup) )
588  _trig_LowPtJet=1;
589 
590  if ( _MinBiasEventFlag->on() && _MinBiasEventFlag->accept( iEvent, iSetup) )
591  _trig_MinBias=1;
592 
593  if ( _HighMETEventFlag->on() && _HighMETEventFlag->accept( iEvent, iSetup) )
594  _trig_HighMET=1;
595 
596  if ( _LowMETEventFlag->on() && _LowMETEventFlag->accept( iEvent, iSetup) )
597  _trig_LowMET=1;
598 
599  if ( _EleEventFlag->on() && _EleEventFlag->accept( iEvent, iSetup) )
600  _trig_Ele=1;
601 
602  if ( _MuonEventFlag->on() && _MuonEventFlag->accept( iEvent, iSetup) )
603  _trig_Muon=1;
604  */
605 
606  if (triggerNames.triggerIndex(_hlt_PhysDec) != triggerNames.size() &&
607  triggerResults.accept(triggerNames.triggerIndex(_hlt_PhysDec))) _trig_PhysDec=1;
608  } else {
609 
610  edm::LogInfo("CaloMetAnalyzer") << "TriggerResults::HLT not found, "
611  "automatically select events";
612  //
613  // TriggerResults object not found. Look at all events.
614  _trig_JetMB=1;
615 
616  }
617 
618  // ==========================================================
619  // CaloMET information
620 
621  // **** Get the MET container
623  iEvent.getByLabel(theCaloMETCollectionLabel, calometcoll);
624 
625  if(!calometcoll.isValid()) {
626  std::cout<<"Unable to find MET results for CaloMET collection "<<theCaloMETCollectionLabel<<std::endl;
627  return;
628  }
629 
630  const reco::CaloMETCollection *calometcol = calometcoll.product();
631  const reco::CaloMET *calomet;
632  calomet = &(calometcol->front());
633 
634  LogTrace(metname)<<"[CaloMETAnalyzer] Call to the CaloMET analyzer";
635 
636  // **** Get the MET no HF container
637  edm::Handle<reco::CaloMETCollection> calometnohfcoll;
638  iEvent.getByLabel("metNoHF", calometnohfcoll);
639 
640  if(!calometnohfcoll.isValid()) {
641  std::cout<<"Unable to find MET results for CaloMETNoHF collection metNoHF"<<std::endl;
642  return;
643  }
644 
645  const reco::CaloMETCollection *calometnohfcol = calometnohfcoll.product();
646  const reco::CaloMET *calometnohf;
647  calometnohf = &(calometnohfcol->front());
648 
649  //LogTrace(metname)<<"[CaloMETAnalyzer] Call to the CaloMET analyzer";
650 
651  //Only for corMetGlobalMuons
652  if (theCaloMETCollectionLabel.label() == "corMetGlobalMuons" ) {
653 
654  iEvent.getByLabel("muonMETValueMapProducer" , "muCorrData", corMetGlobalMuons_ValueMap_Handle);
655  iEvent.getByLabel("muons", muon_h);
656  iEvent.getByLabel(inputBeamSpotLabel, beamSpot_h);
657 
658  if(!beamSpot_h.isValid()) edm::LogInfo("OutputInfo") << "falied to retrieve beam spot data require by MET Task";
659 
660  bspot = ( beamSpot_h.isValid() ) ? beamSpot_h->position() : math::XYZPoint(0, 0, 0);
661 
662  }
663 
664 
665  // ==========================================================
666  //
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;
672  }
673 
674 
675  edm::Handle<bool> HBHENoiseFilterResultHandle;
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;
681  }
682 
683 
685  iEvent.getByLabel(theJetCollectionLabel, caloJets);
686  if (!caloJets.isValid()) {
687  LogDebug("") << "CaloMETAnalyzer: Could not find jet product" << std::endl;
688  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find jet product" << std::endl;
689  }
690 
692  iEvent.getByLabel(theCaloTowersLabel, towers);
693  if (!towers.isValid()) {
694  LogDebug("") << "CaloMETAnalyzer: Could not find caltower product" << std::endl;
695  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find caltower product" << std::endl;
696  }
697 
698  // ==========================================================
699  // CaloMET sanity check
700 
701  if (_source=="CaloMET") validateMET(*calomet,towers);
702 
703  // ==========================================================
704 
705  if (_allhist) computeEmHaMET(towers);
706 
707  // ==========================================================
708  // JetID
709 
710  if (_verbose) std::cout << "JetID starts" << std::endl;
711 
712  //
713  // --- Minimal cuts
714  //
715  bool bJetIDMinimal=true;
716  int nj=0;
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;
724  nj++;
725  if (cal->pt()>10.){
726  if (fabs(cal->eta())<=2.6 &&
727  cal->emEnergyFraction()<=0.01) bJetIDMinimal=false;
728  }
729  }
730 
731  //
732  // --- Loose cuts
733  //
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;
741  if (cal->pt()>10.){
742  //
743  // for all regions
744  if (jetID->n90Hits()<2) bJetIDLoose=false;
745  if (jetID->fHPD()>=0.98) bJetIDLoose=false;
746  //
747  // for non-forward
748  if (fabs(cal->eta())<2.55){
749  if (cal->emEnergyFraction()<=0.01) bJetIDLoose=false;
750  }
751  // for forward
752  else {
753  if (cal->emEnergyFraction()<=-0.9) bJetIDLoose=false;
754  if (cal->pt()>80.){
755  if (cal->emEnergyFraction()>= 1.0) bJetIDLoose=false;
756  }
757  } // forward vs non-forward
758  } // pt>10 GeV/c
759  } // calor-jets loop
760 
761  //
762  // --- Tight cuts
763  //
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);
769  if (cal->pt()>25.){
770  //
771  // for all regions
772  if (jetID->fHPD()>=0.95) bJetIDTight=false;
773  //
774  // for 1.0<|eta|<1.75
775  if (fabs(cal->eta())>=1.00 && fabs(cal->eta())<1.75){
776  if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=false;
777  }
778  //
779  // for 1.75<|eta|<2.55
780  else if (fabs(cal->eta())>=1.75 && fabs(cal->eta())<2.55){
781  if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=false;
782  }
783  //
784  // for 2.55<|eta|<3.25
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;
791  }
792  //
793  // for 3.25<|eta|
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;
801  }
802  } // pt>10 GeV/c
803  } // calor-jets loop
804 
805  if (_verbose) std::cout << "JetID ends" << std::endl;
806 
807  // ==========================================================
808  // HCAL Noise filter
809 
810  bool bHcalNoiseFilter = HBHENoiseFilterResult;
811 
812  // ==========================================================
813  // Get BeamHaloSummary
814  edm::Handle<reco::BeamHaloSummary> TheBeamHaloSummary ;
815  iEvent.getByLabel(BeamHaloSummaryTag, TheBeamHaloSummary) ;
816 
817  bool bBeamHaloIDTightPass = true;
818  bool bBeamHaloIDLoosePass = true;
819 
820  if(TheBeamHaloSummary.isValid()) {
821 
822  const reco::BeamHaloSummary TheSummary = (*TheBeamHaloSummary.product() );
823 
824  // std::cout << TheSummary.EcalLooseHaloId() << " "
825  // << TheSummary.HcalLooseHaloId() << " "
826  // << TheSummary.CSCLooseHaloId() << " "
827  // << TheSummary.GlobalLooseHaloId() << std::endl;
828 
829  if( TheSummary.EcalLooseHaloId() || TheSummary.HcalLooseHaloId() ||
830  TheSummary.CSCLooseHaloId() || TheSummary.GlobalLooseHaloId() )
831  bBeamHaloIDLoosePass = false;
832 
833  if( TheSummary.EcalTightHaloId() || TheSummary.HcalTightHaloId() ||
834  TheSummary.CSCTightHaloId() || TheSummary.GlobalTightHaloId() )
835  bBeamHaloIDTightPass = false;
836 
837  }
838 
839  if (_verbose) std::cout << "BeamHaloSummary ends" << std::endl;
840 
841  // ==========================================================
842  //Vertex information
843 
844  _numPV = 0;
845  bool bPrimaryVertex = true;
846  if(_doPVCheck){
847  bPrimaryVertex = false;
848  Handle<reco::VertexCollection> vertexHandle;
849 
850  iEvent.getByLabel(vertexTag, vertexHandle);
851 
852  if (!vertexHandle.isValid()) {
853  LogDebug("") << "CaloMETAnalyzer: Could not find vertex collection" << std::endl;
854  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find vertex collection" << std::endl;
855  }
856 
857  if ( vertexHandle.isValid() ){
858  reco::VertexCollection vertexCollection = *(vertexHandle.product());
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();
866 
867  if ( !fakeVtx
868  && vertex_number>=_nvtx_min
869  && vertex_ndof >_vtxndof_min
870  && vertex_chi2 <_vtxchi2_max
871  && fabs(vertex_Z)<_vtxz_max ) {
872  bPrimaryVertex = true;
873  ++_numPV;
874  }
875  }
876  }
877  }
878  // ==========================================================
879 
881  iEvent.getByLabel( gtTag, gtReadoutRecord);
882 
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;
886  }
887 
888  bool bTechTriggers = true;
889  bool bTechTriggersAND = true;
890  bool bTechTriggersOR = false;
891  bool bTechTriggersNOT = false;
892 
893  if (gtReadoutRecord.isValid()) {
894  const TechnicalTriggerWord& technicalTriggerWordBeforeMask = gtReadoutRecord->technicalTriggerWord();
895 
896  if (_techTrigsAND.size() == 0)
897  bTechTriggersAND = true;
898  else
899  for (unsigned ttr = 0; ttr != _techTrigsAND.size(); ttr++) {
900  bTechTriggersAND = bTechTriggersAND && technicalTriggerWordBeforeMask.at(_techTrigsAND.at(ttr));
901  }
902 
903  if (_techTrigsAND.size() == 0)
904  bTechTriggersOR = true;
905  else
906  for (unsigned ttr = 0; ttr != _techTrigsOR.size(); ttr++) {
907  bTechTriggersOR = bTechTriggersOR || technicalTriggerWordBeforeMask.at(_techTrigsOR.at(ttr));
908  }
909  if (_techTrigsNOT.size() == 0)
910  bTechTriggersNOT = false;
911  else
912  for (unsigned ttr = 0; ttr != _techTrigsNOT.size(); ttr++) {
913  bTechTriggersNOT = bTechTriggersNOT || technicalTriggerWordBeforeMask.at(_techTrigsNOT.at(ttr));
914  }
915  }
916  else
917  {
918  bTechTriggersAND = true;
919  bTechTriggersOR = true;
920  bTechTriggersNOT = false;
921  }
922 
923  if (_techTrigsAND.size()==0)
924  bTechTriggersAND = true;
925  if (_techTrigsOR.size()==0)
926  bTechTriggersOR = true;
927  if (_techTrigsNOT.size()==0)
928  bTechTriggersNOT = false;
929 
930  bTechTriggers = bTechTriggersAND && bTechTriggersOR && !bTechTriggersNOT;
931 
932  // ==========================================================
933  // Reconstructed MET Information - fill MonitorElements
934 
935  bool bHcalNoise = bHcalNoiseFilter;
936  bool bBeamHaloID = bBeamHaloIDLoosePass;
937  bool bJetID = bJetIDMinimal;
938 
939  bool bPhysicsDeclared = true;
940  if(_doHLTPhysicsOn) bPhysicsDeclared =_trig_PhysDec;
941 
942  if (_tightBHFiltering) bBeamHaloID = bBeamHaloIDTightPass;
943 
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;
948 
949  bool bBasicCleanup = bTechTriggers && bPrimaryVertex && bPhysicsDeclared;
950  bool bExtraCleanup = bBasicCleanup && bHcalNoise && bJetID && bBeamHaloID;
951 
952  //std::string DirName = "JetMET/MET/"+_source;
953 
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);
961  }
962  if (_allSelection) {
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);
971  }
972  } // DCS
973  }
974 } // CaloMETAnalyzer::analyze
975 
976 // ***********************************************************
978 {
979 
980  edm::View<reco::Candidate>::const_iterator towerCand = towers->begin();
981 
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;
986 
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;
991 
992  for ( ; towerCand != towers->end(); towerCand++)
993  {
994  const reco::Candidate* candidate = &(*towerCand);
995  if (candidate)
996  {
997  const CaloTower* calotower = dynamic_cast<const CaloTower*> (candidate);
998  if (calotower){
999  double Tower_ET = calotower->et();
1000  if (Tower_ET>0.3) {
1001 
1002  double phi = candidate->phi();
1003  double theta = candidate->theta();
1004  //double e = candidate->energy();
1005  double e_em = calotower->emEnergy();
1006  double e_ha = calotower->hadEnergy();
1007  double et_em = e_em*sin(theta);
1008  double et_ha = e_ha*sin(theta);
1009 
1010  sum_em_ez += e_em*cos(theta);
1011  sum_em_et += et_em;
1012  sum_em_ex += et_em*cos(phi);
1013  sum_em_ey += et_em*sin(phi);
1014 
1015  sum_ha_ez += e_ha*cos(theta);
1016  sum_ha_et += et_ha;
1017  sum_ha_ex += et_ha*cos(phi);
1018  sum_ha_ey += et_ha*sin(phi);
1019 
1020  } // Et>0.5
1021  } // calotower
1022  } // candidate
1023  } // loop
1024 
1025  //
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 );
1032  //
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 );
1039 
1040 }
1041 // ***********************************************************
1044 {
1045 
1046  edm::View<reco::Candidate>::const_iterator towerCand = towers->begin();
1047 
1048  double sum_et = 0.0;
1049  double sum_ex = 0.0;
1050  double sum_ey = 0.0;
1051  double sum_ez = 0.0;
1052 
1053  for ( ; towerCand != towers->end(); towerCand++)
1054  {
1055  const reco::Candidate* candidate = &(*towerCand);
1056  if (candidate)
1057  {
1058  const CaloTower* calotower = dynamic_cast<const CaloTower*> (candidate);
1059  if (calotower){
1060  double Tower_ET = calotower->et();
1061  if (Tower_ET>0.3) {
1062 
1063  double phi = candidate->phi();
1064  double theta = candidate->theta();
1065  double e = candidate->energy();
1066  double et = e*sin(theta);
1067  sum_ez += e*cos(theta);
1068  sum_et += et;
1069  sum_ex += et*cos(phi);
1070  sum_ey += et*sin(phi);
1071 
1072  } // Et>0.5
1073  } // calotower
1074  } // candidate
1075  } // loop
1076 
1077  double Mex = -sum_ex;
1078  double Mey = -sum_ey;
1079  //double Mez = -sum_ez;
1080  double Met = sqrt( sum_ex*sum_ex + sum_ey*sum_ey );
1081  double Sumet = sum_et;
1082  //double MetPhi = atan2( -sum_ey, -sum_ex ); // since MET is now a candidate,
1083 
1084  if (_verbose){
1085  if (Sumet!=calomet.sumEt() || Mex!=calomet.px() || Mey!=calomet.py() || Met!=calomet.pt() ){
1086  std::cout << _source << std::endl;
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;
1091  }
1092  }
1093 
1094  if (_print){
1095  std::cout << "SUMET = " << calomet.sumEt() << " (GeV) "
1096  << "MEX" << calomet.px() << " (GeV) "
1097  << "MEY" << calomet.py() << " (GeV) "
1098  << "MET" << calomet.pt() << " (GeV) " << std::endl;
1099  }
1100 
1101 }
1102 
1103 // ***********************************************************
1105  const reco::CaloMET& calomet,
1106  const reco::CaloMET& calometnohf)
1107 {
1108 
1109  _dbe->setCurrentFolder(DirName);
1110 
1111  bool bLumiSecPlot=false;
1112  if (DirName.find("All")) bLumiSecPlot=true;
1113 
1114  if (_trig_JetMB)
1115  fillMonitorElement(iEvent,DirName,"",calomet,calometnohf, bLumiSecPlot);
1116  if (_trig_HighPtJet)
1117  fillMonitorElementTriggered(iEvent,DirName,"HighPtJet",calomet,calometnohf,false);
1118  if (_trig_LowPtJet)
1119  fillMonitorElementTriggered(iEvent,DirName,"LowPtJet",calomet,calometnohf,false);
1120  if (_trig_MinBias)
1121  fillMonitorElementTriggered(iEvent,DirName,"MinBias",calomet,calometnohf,false);
1122  if (_trig_HighMET)
1123  fillMonitorElementTriggered(iEvent,DirName,"HighMET",calomet,calometnohf,false);
1124  // if (_trig_LowMET)
1125  // fillMonitorElementTriggered(iEvent,DirName,"LowMET",calomet,calometnohf,false);
1126  if (_trig_Ele)
1127  fillMonitorElementTriggered(iEvent,DirName,"Ele",calomet,calometnohf,false);
1128  if (_trig_Muon) {
1129  fillMonitorElementTriggered(iEvent,DirName,"Muon",calomet,calometnohf,false);
1130  }
1131 }
1132 
1133 // ***********************************************************
1135  std::string TriggerTypeName,
1136  const reco::CaloMET& calomet,
1137  const reco::CaloMET& calometnohf,
1138  bool bLumiSecPlot)
1139 {
1140  fillMonitorElementTriggered(iEvent, DirName, TriggerTypeName, calomet, calometnohf, bLumiSecPlot);
1141 
1142  double caloSumET = calomet.sumEt();
1143 
1144  /*
1145  double caloMETSig = calomet.mEtSig();
1146  //double caloEz = calomet.e_longitudinal();
1147  double caloMET = calomet.pt();
1148  double caloMEx = calomet.px();
1149  double caloMEy = calomet.py();
1150  double caloMETPhi = calomet.phi();
1151 
1152  double caloMETNoHF = calometnohf.pt();
1153  //double caloMETNoHFPhi = calometnohf.phi();
1154 
1155  if (_verbose) std::cout << _source << " " << caloMET << std::endl;
1156 
1157  double caloEtFractionHadronic = calomet.etFractionHadronic();
1158  double caloEmEtFraction = calomet.emEtFraction();
1159  */
1160  double caloMaxEtInEMTowers = calomet.maxEtInEmTowers();
1161  double caloMaxEtInHadTowers = calomet.maxEtInHadTowers();
1162 
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();
1170  //
1171  // int myLuminosityBlock;
1172  // myLuminosityBlock = (evtCounter++)/1000;
1173  // myLuminosityBlock = iEvent.luminosityBlock();
1174  //
1175 
1176  if (TriggerTypeName!="") DirName = DirName +"/"+TriggerTypeName;
1177 
1178  if (_verbose) std::cout << "_etThreshold = " << _etThreshold << std::endl;
1179  if (caloSumET>_etThreshold){
1180  /*
1181  hCaloMEx = _dbe->get(DirName+"/"+"METTask_CaloMEx"); if (hCaloMEx && hCaloMEx->getRootObject() ) hCaloMEx->Fill(caloMEx);
1182  hCaloMEy = _dbe->get(DirName+"/"+"METTask_CaloMEy"); if (hCaloMEy && hCaloMEy->getRootObject() ) hCaloMEy->Fill(caloMEy);
1183  hCaloMET = _dbe->get(DirName+"/"+"METTask_CaloMET"); if (hCaloMET && hCaloMET->getRootObject() ) hCaloMET->Fill(caloMET);
1184  hCaloMET1 = _dbe->get(DirName+"/"+"METTask_CaloMET1"); if (hCaloMET1 && hCaloMET1->getRootObject() ) hCaloMET1->Fill(caloMET);
1185  hCaloMETPhi = _dbe->get(DirName+"/"+"METTask_CaloMETPhi"); if (hCaloMETPhi && hCaloMETPhi->getRootObject() ) hCaloMETPhi->Fill(caloMETPhi);
1186  hCaloSumET = _dbe->get(DirName+"/"+"METTask_CaloSumET"); if (hCaloSumET && hCaloSumET->getRootObject() ) hCaloSumET->Fill(caloSumET);
1187  hCaloMETSig = _dbe->get(DirName+"/"+"METTask_CaloMETSig"); if (hCaloMETSig && hCaloMETSig->getRootObject() ) hCaloMETSig->Fill(caloMETSig);
1188  //hCaloEz = _dbe->get(DirName+"/"+"METTask_CaloEz"); if (hCaloEz && hCaloEz->getRootObject() ) hCaloEz->Fill(caloEz);
1189 
1190  hCaloMETNoHF = _dbe->get(DirName+"/"+"METTask_CaloMETNoHF"); if (hCaloMETNoHF && hCaloMETNoHF->getRootObject() ) hCaloMETNoHF->Fill(caloMETNoHF);
1191 
1192  hCaloMET_logx = _dbe->get(DirName+"/"+"METTask_CaloMET_logx"); if (hCaloMET_logx && hCaloMET_logx->getRootObject() ) hCaloMET_logx->Fill(log10(caloMET));
1193  hCaloSumET_logx = _dbe->get(DirName+"/"+"METTask_CaloSumET_logx"); if (hCaloSumET_logx && hCaloSumET_logx->getRootObject() ) hCaloSumET_logx->Fill(log10(caloSumET));
1194 
1195  // hCaloMETIonFeedbck = _dbe->get(DirName+"/"+"METTask_CaloMETIonFeedbck"); if (hCaloMETIonFeedbck && hCaloMETIonFeedbck->getRootObject() ) hCaloMETIonFeedbck->Fill(caloMET);
1196  // hCaloMETHPDNoise = _dbe->get(DirName+"/"+"METTask_CaloMETHPDNoise"); if (hCaloMETHPDNoise && hCaloMETHPDNoise->getRootObject() ) hCaloMETHPDNoise->Fill(caloMET);
1197 
1198  //hCaloMETPhi002 = _dbe->get(DirName+"/"+"METTask_CaloMETPhi002"); if (caloMET> 2. && hCaloMETPhi002 && hCaloMETPhi002->getRootObject()) { hCaloMETPhi002->Fill(caloMETPhi);}
1199  //hCaloMETPhi010 = _dbe->get(DirName+"/"+"METTask_CaloMETPhi010"); if (caloMET> 10. && hCaloMETPhi010 && hCaloMETPhi010->getRootObject()) { hCaloMETPhi010->Fill(caloMETPhi);}
1200  hCaloMETPhi020 = _dbe->get(DirName+"/"+"METTask_CaloMETPhi020"); if (caloMET> 20. && hCaloMETPhi020 && hCaloMETPhi020->getRootObject()) { hCaloMETPhi020->Fill(caloMETPhi);}
1201  */
1202 
1203  if (_allhist){
1204  /*
1205  if (bLumiSecPlot){
1206  hCaloMExLS = _dbe->get(DirName+"/"+"METTask_CaloMEx_LS"); if (hCaloMExLS && hCaloMExLS->getRootObject()) hCaloMExLS->Fill(caloMEx,myLuminosityBlock);
1207  hCaloMEyLS = _dbe->get(DirName+"/"+"METTask_CaloMEy_LS"); if (hCaloMEyLS && hCaloMEyLS->getRootObject()) hCaloMEyLS->Fill(caloMEy,myLuminosityBlock);
1208  }
1209  hCaloEtFractionHadronic = _dbe->get(DirName+"/"+"METTask_CaloEtFractionHadronic"); if (hCaloEtFractionHadronic && hCaloEtFractionHadronic->getRootObject()) hCaloEtFractionHadronic->Fill(caloEtFractionHadronic);
1210  hCaloEmEtFraction = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction"); if (hCaloEmEtFraction && hCaloEmEtFraction->getRootObject()) hCaloEmEtFraction->Fill(caloEmEtFraction);
1211 
1212  //hCaloEmEtFraction002 = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction002"); if (caloMET> 2. && hCaloEmEtFraction002 && hCaloEmEtFraction002->getRootObject()) hCaloEmEtFraction002->Fill(caloEmEtFraction);
1213  //hCaloEmEtFraction010 = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction010"); if (caloMET> 10. && hCaloEmEtFraction010 && hCaloEmEtFraction010->getRootObject()) hCaloEmEtFraction010->Fill(caloEmEtFraction);
1214  hCaloEmEtFraction020 = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction020"); if (caloMET> 20. && hCaloEmEtFraction020 && hCaloEmEtFraction020->getRootObject()) hCaloEmEtFraction020->Fill(caloEmEtFraction);
1215  */
1216 
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);
1219 
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);
1227 
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);
1230  //hCaloEmEz = _dbe->get(DirName+"/"+"METTask_CaloEmEz"); if (hCaloEmEz && hCaloEmEz->getRootObject()) hCaloEmEz->Fill(_EmCaloEz);
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);
1233  //hCaloEmSumET = _dbe->get(DirName+"/"+"METTask_CaloEmSumET"); if (hCaloEmSumET && hCaloEmSumET->getRootObject()) hCaloEmSumET->Fill(_EmSumEt);
1234 
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);
1237  //hCaloHaEz = _dbe->get(DirName+"/"+"METTask_CaloHaEz"); if (hCaloHaEz && hCaloHaEz->getRootObject()) hCaloHaEz->Fill(_HaCaloEz);
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);
1240  //hCaloHaSumET = _dbe->get(DirName+"/"+"METTask_CaloHaSumET"); if (hCaloHaSumET && hCaloHaSumET->getRootObject()) hCaloHaSumET->Fill(_HaSumEt);
1241 
1242  } // _allhist
1243  /*
1244  if (theCaloMETCollectionLabel.label() == "corMetGlobalMuons" ) {
1245 
1246  for( reco::MuonCollection::const_iterator muonit = muon_h->begin(); muonit != muon_h->end(); muonit++ ) {
1247  const reco::TrackRef siTrack = muonit->innerTrack();
1248  hCalomuPt = _dbe->get(DirName+"/"+"METTask_CalomuPt"); if (hCalomuPt && hCalomuPt->getRootObject()) hCalomuPt->Fill( muonit->p4().pt() );
1249  hCalomuEta = _dbe->get(DirName+"/"+"METTask_CalomuEta"); if (hCalomuEta && hCalomuEta->getRootObject()) hCalomuEta->Fill( muonit->p4().eta() );
1250  hCalomuNhits = _dbe->get(DirName+"/"+"METTask_CalomuNhits"); if (hCalomuNhits && hCalomuNhits->getRootObject()) hCalomuNhits->Fill( siTrack.isNonnull() ? siTrack->numberOfValidHits() : -999 );
1251  hCalomuChi2 = _dbe->get(DirName+"/"+"METTask_CalomuChi2"); if (hCalomuChi2 && hCalomuChi2->getRootObject()) hCalomuChi2->Fill( siTrack.isNonnull() ? siTrack->chi2()/siTrack->ndof() : -999 );
1252  double d0 = siTrack.isNonnull() ? -1 * siTrack->dxy( bspot) : -999;
1253  hCalomuD0 = _dbe->get(DirName+"/"+"METTask_CalomuD0"); if (hCalomuD0 && hCalomuD0->getRootObject()) hCalomuD0->Fill( d0 );
1254  }
1255 
1256  const unsigned int nMuons = muon_h->size();
1257  for( unsigned int mus = 0; mus < nMuons; mus++ ) {
1258  reco::MuonRef muref( muon_h, mus);
1259  reco::MuonMETCorrectionData muCorrData = (*corMetGlobalMuons_ValueMap_Handle)[muref];
1260  hCaloMExCorrection = _dbe->get(DirName+"/"+"METTask_CaloMExCorrection"); if (hCaloMExCorrection && hCaloMExCorrection->getRootObject()) hCaloMExCorrection-> Fill(muCorrData.corrY());
1261  hCaloMEyCorrection = _dbe->get(DirName+"/"+"METTask_CaloMEyCorrection"); if (hCaloMEyCorrection && hCaloMEyCorrection->getRootObject()) hCaloMEyCorrection-> Fill(muCorrData.corrX());
1262  hCaloMuonCorrectionFlag = _dbe->get(DirName+"/"+"METTask_CaloMuonCorrectionFlag"); if (hCaloMuonCorrectionFlag && hCaloMuonCorrectionFlag->getRootObject()) hCaloMuonCorrectionFlag-> Fill(muCorrData.type());
1263  }
1264  }
1265  */
1266  } // et threshold cut
1267 
1268 }
1269 
1270 // ***********************************************************
1272  std::string TriggerTypeName,
1273  const reco::CaloMET& calomet,
1274  const reco::CaloMET& calometnohf,
1275  bool bLumiSecPlot)
1276 {
1277 
1278  if (TriggerTypeName=="HighPtJet") {
1279  if (!selectHighPtJetEvent(iEvent)) return;
1280  }
1281  else if (TriggerTypeName=="LowPtJet") {
1282  if (!selectLowPtJetEvent(iEvent)) return;
1283  }
1284  else if (TriggerTypeName=="HighMET") {
1285  if (calomet.pt()<_highMETThreshold) return;
1286  }
1287  // else if (TriggerTypeName=="LowMET") {
1288  // if (calomet.pt()<_lowMETThreshold) return;
1289  // }
1290  else if (TriggerTypeName=="Ele") {
1291  if (!selectWElectronEvent(iEvent)) return;
1292  }
1293  else if (TriggerTypeName=="Muon") {
1294  if (!selectWMuonEvent(iEvent)) return;
1295  }
1296 
1297  double caloSumET = calomet.sumEt();
1298  double caloMETSig = calomet.mEtSig();
1299  //double caloEz = calomet.e_longitudinal();
1300  double caloMET = calomet.pt();
1301  double caloMEx = calomet.px();
1302  double caloMEy = calomet.py();
1303  double caloMETPhi = calomet.phi();
1304 
1305  double caloMETNoHF = calometnohf.pt();
1306  //double caloMETNoHFPhi = calometnohf.phi();
1307 
1308  if (_verbose) std::cout << _source << " " << caloMET << std::endl;
1309 
1310  double caloEtFractionHadronic = calomet.etFractionHadronic();
1311  double caloEmEtFraction = calomet.emEtFraction();
1312 
1313  //double caloMaxEtInEMTowers = calomet.maxEtInEmTowers();
1314  //double caloMaxEtInHadTowers = calomet.maxEtInHadTowers();
1315 
1316  //double caloHadEtInHB = calomet.hadEtInHB();
1317  //double caloHadEtInHO = calomet.hadEtInHO();
1318  //double caloHadEtInHE = calomet.hadEtInHE();
1319  //double caloHadEtInHF = calomet.hadEtInHF();
1320  //double caloEmEtInEB = calomet.emEtInEB();
1321  //double caloEmEtInEE = calomet.emEtInEE();
1322  //double caloEmEtInHF = calomet.emEtInHF();
1323 
1324  //
1325  int myLuminosityBlock;
1326  // myLuminosityBlock = (evtCounter++)/1000;
1327  myLuminosityBlock = iEvent.luminosityBlock();
1328  //
1329 
1330  if (TriggerTypeName!="") DirName = DirName +"/"+TriggerTypeName;
1331 
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);
1341  //hCaloEz = _dbe->get(DirName+"/"+"METTask_CaloEz"); if (hCaloEz && hCaloEz->getRootObject() ) hCaloEz->Fill(caloEz);
1342 
1343  hCaloMETNoHF = _dbe->get(DirName+"/"+"METTask_CaloMETNoHF"); if (hCaloMETNoHF && hCaloMETNoHF->getRootObject() ) hCaloMETNoHF->Fill(caloMETNoHF);
1344 
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));
1347 
1348 
1349  // Fill NPV profiles
1350  //--------------------------------------------------------------------------
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");
1356 
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);
1362 
1363 
1364  //hCaloEz = _dbe->get(DirName+"/"+"METTask_CaloEz_profile"); if (hCaloEz && hCaloEz_profile->getRootObject() ) hCaloEz_profile->Fill(caloEz);
1365  // hCaloMETIonFeedbck = _dbe->get(DirName+"/"+"METTask_CaloMETIonFeedbck"); if (hCaloMETIonFeedbck && hCaloMETIonFeedbck->getRootObject() ) hCaloMETIonFeedbck->Fill(caloMET);
1366  // haloMETHPDNoise = _dbe->get(DirName+"/"+"METTask_CaloMETHPDNoise"); if (hCaloMETHPDNoise && hCaloMETHPDNoise->getRootObject() ) hCaloMETHPDNoise->Fill(caloMET);
1367 
1368  //hCaloMETPhi002 = _dbe->get(DirName+"/"+"METTask_CaloMETPhi002"); if (caloMET> 2. && hCaloMETPhi002 && hCaloMETPhi002->getRootObject()) { hCaloMETPhi002->Fill(caloMETPhi);}
1369  //hCaloMETPhi010 = _dbe->get(DirName+"/"+"METTask_CaloMETPhi010"); if (caloMET> 10. && hCaloMETPhi010 && hCaloMETPhi010->getRootObject()) { hCaloMETPhi010->Fill(caloMETPhi);}
1370  hCaloMETPhi020 = _dbe->get(DirName+"/"+"METTask_CaloMETPhi020"); if (caloMET> 20. && hCaloMETPhi020 && hCaloMETPhi020->getRootObject()) { hCaloMETPhi020->Fill(caloMETPhi);}
1371 
1372  if (_allhist){
1373  if (bLumiSecPlot){
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);
1376  }
1377 
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);
1380 
1381  //hCaloEmEtFraction002 = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction002"); if (caloMET> 2. && hCaloEmEtFraction002 && hCaloEmEtFraction002->getRootObject()) hCaloEmEtFraction002->Fill(caloEmEtFraction);
1382  //hCaloEmEtFraction010 = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction010"); if (caloMET> 10. && hCaloEmEtFraction010 && hCaloEmEtFraction010->getRootObject()) hCaloEmEtFraction010->Fill(caloEmEtFraction);
1383  hCaloEmEtFraction020 = _dbe->get(DirName+"/"+"METTask_CaloEmEtFraction020"); if (caloMET> 20. && hCaloEmEtFraction020 && hCaloEmEtFraction020->getRootObject()) hCaloEmEtFraction020->Fill(caloEmEtFraction);
1384 
1385  //hCaloMaxEtInEmTowers = _dbe->get(DirName+"/"+"METTask_CaloMaxEtInEmTowers"); if (hCaloMaxEtInEmTowers && hCaloMaxEtInEmTowers->getRootObject()) hCaloMaxEtInEmTowers->Fill(caloMaxEtInEMTowers);
1386  //hCaloMaxEtInHadTowers = _dbe->get(DirName+"/"+"METTask_CaloMaxEtInHadTowers"); if (hCaloMaxEtInHadTowers && hCaloMaxEtInHadTowers->getRootObject()) hCaloMaxEtInHadTowers->Fill(caloMaxEtInHadTowers);
1387  //
1388  //hCaloHadEtInHB = _dbe->get(DirName+"/"+"METTask_CaloHadEtInHB"); if (hCaloHadEtInHB && hCaloHadEtInHB->getRootObject()) hCaloHadEtInHB->Fill(caloHadEtInHB);
1389  //hCaloHadEtInHO = _dbe->get(DirName+"/"+"METTask_CaloHadEtInHO"); if (hCaloHadEtInHO && hCaloHadEtInHO->getRootObject()) hCaloHadEtInHO->Fill(caloHadEtInHO);
1390  //hCaloHadEtInHE = _dbe->get(DirName+"/"+"METTask_CaloHadEtInHE"); if (hCaloHadEtInHE && hCaloHadEtInHE->getRootObject()) hCaloHadEtInHE->Fill(caloHadEtInHE);
1391  //hCaloHadEtInHF = _dbe->get(DirName+"/"+"METTask_CaloHadEtInHF"); if (hCaloHadEtInHF && hCaloHadEtInHF->getRootObject()) hCaloHadEtInHF->Fill(caloHadEtInHF);
1392  //hCaloEmEtInEB = _dbe->get(DirName+"/"+"METTask_CaloEmEtInEB"); if (hCaloEmEtInEB && hCaloEmEtInEB->getRootObject()) hCaloEmEtInEB->Fill(caloEmEtInEB);
1393  //hCaloEmEtInEE = _dbe->get(DirName+"/"+"METTask_CaloEmEtInEE"); if (hCaloEmEtInEE && hCaloEmEtInEE->getRootObject()) hCaloEmEtInEE->Fill(caloEmEtInEE);
1394  //hCaloEmEtInHF = _dbe->get(DirName+"/"+"METTask_CaloEmEtInHF"); if (hCaloEmEtInHF && hCaloEmEtInHF->getRootObject()) hCaloEmEtInHF->Fill(caloEmEtInHF);
1395  //
1396  //hCaloEmMEx = _dbe->get(DirName+"/"+"METTask_CaloEmMEx"); if (hCaloEmMEx && hCaloEmMEx->getRootObject()) hCaloEmMEx->Fill(_EmMEx);
1397  //hCaloEmMEy = _dbe->get(DirName+"/"+"METTask_CaloEmMEy"); if (hCaloEmMEy && hCaloEmMEy->getRootObject()) hCaloEmMEy->Fill(_EmMEy);
1399  //hCaloEmMET = _dbe->get(DirName+"/"+"METTask_CaloEmMET"); if (hCaloEmMET && hCaloEmMET->getRootObject()) hCaloEmMET->Fill(_EmMET);
1400  //hCaloEmMETPhi = _dbe->get(DirName+"/"+"METTask_CaloEmMETPhi"); if (hCaloEmMETPhi && hCaloEmMETPhi->getRootObject()) hCaloEmMETPhi->Fill(_EmMetPhi);
1402  //
1403  //hCaloHaMEx = _dbe->get(DirName+"/"+"METTask_CaloHaMEx"); if (hCaloHaMEx && hCaloHaMEx->getRootObject()) hCaloHaMEx->Fill(_HaMEx);
1404  //hCaloHaMEy = _dbe->get(DirName+"/"+"METTask_CaloHaMEy"); if (hCaloHaMEy && hCaloHaMEy->getRootObject()) hCaloHaMEy->Fill(_HaMEy);
1406  //hCaloHaMET = _dbe->get(DirName+"/"+"METTask_CaloHaMET"); if (hCaloHaMET && hCaloHaMET->getRootObject()) hCaloHaMET->Fill(_HaMET);
1407  //hCaloHaMETPhi = _dbe->get(DirName+"/"+"METTask_CaloHaMETPhi"); if (hCaloHaMETPhi && hCaloHaMETPhi->getRootObject()) hCaloHaMETPhi->Fill(_HaMetPhi);
1409 
1410  } // _allhist
1411  if (theCaloMETCollectionLabel.label() == "corMetGlobalMuons" ) {
1412 
1413  for( reco::MuonCollection::const_iterator muonit = muon_h->begin(); muonit != muon_h->end(); muonit++ ) {
1414  const reco::TrackRef siTrack = muonit->innerTrack();
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 );
1421  }
1422 
1423  const unsigned int nMuons = muon_h->size();
1424  for( unsigned int mus = 0; mus < nMuons; mus++ ) {
1425  reco::MuonRef muref( muon_h, mus);
1426  reco::MuonMETCorrectionData muCorrData = (*corMetGlobalMuons_ValueMap_Handle)[muref];
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());
1430  }
1431  }
1432  } // et threshold cut
1433 
1434 }
1435 
1436 // ***********************************************************
1438 
1439  bool return_value=false;
1440 
1442  iEvent.getByLabel(theJetCollectionLabel, caloJets);
1443  if (!caloJets.isValid()) {
1444  LogDebug("") << "CaloMETAnalyzer: Could not find jet product" << std::endl;
1445  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find jet product" << std::endl;
1446  }
1447 
1448  for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
1449  cal!=caloJets->end(); ++cal){
1450  if (cal->pt()>_highPtJetThreshold){
1451  return_value=true;
1452  }
1453  }
1454 
1455  return return_value;
1456 
1457 }
1458 
1459 // ***********************************************************
1461 
1462  bool return_value=false;
1463 
1465  iEvent.getByLabel(theJetCollectionLabel, caloJets);
1466  if (!caloJets.isValid()) {
1467  LogDebug("") << "CaloMETAnalyzer: Could not find jet product" << std::endl;
1468  if (_verbose) std::cout << "CaloMETAnalyzer: Could not find jet product" << std::endl;
1469  }
1470 
1471  for (reco::CaloJetCollection::const_iterator cal = caloJets->begin();
1472  cal!=caloJets->end(); ++cal){
1473  if (cal->pt()>_lowPtJetThreshold){
1474  return_value=true;
1475  }
1476  }
1477 
1478  return return_value;
1479 
1480 }
1481 
1482 // ***********************************************************
1484 
1485  bool return_value=true;
1486 
1487  /*
1488  W-electron event selection comes here
1489  */
1490 
1491  return return_value;
1492 
1493 }
1494 
1495 // ***********************************************************
1497 
1498  bool return_value=true;
1499 
1500  /*
1501  W-muon event selection comes here
1502  */
1503 
1504  return return_value;
1505 
1506 }
1507 
#define LogDebug(id)
const bool EcalTightHaloId() const
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
int i
Definition: DBlmapReader.cc:9
dictionary parameters
Definition: Parameters.py:2
double hadEtInHE() const
Definition: CaloMET.h:51
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:207
virtual double energy() const =0
energy
bool selectLowPtJetEvent(const edm::Event &)
double hadEtInHF() const
Definition: CaloMET.h:53
const bool HcalTightHaloId() const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
const bool GlobalLooseHaloId() const
void endJob()
Finish up a job.
const std::string metname
bool selectWElectronEvent(const edm::Event &)
void fillMESet(const edm::Event &, std::string, const reco::CaloMET &, const reco::CaloMET &)
double maxEtInHadTowers() const
Definition: CaloMET.h:40
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
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
Definition: EventBase.h:59
virtual float phi() const =0
momentum azimuthal angle
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
void computeEmHaMET(edm::Handle< edm::View< reco::Candidate > >)
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
Strings::size_type size() const
Definition: TriggerNames.cc:39
const bool GlobalTightHaloId() const
double maxEtInEmTowers() const
Definition: CaloMET.h:38
tuple vertexCollection
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
const int nbinsPV
void bookMonitorElement(std::string, bool)
const bool HcalLooseHaloId() const
const bool CSCTightHaloId() const
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
const double PVup
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
double mEtSig() const
Definition: MET.h:50
int iEvent
Definition: GenABIO.cc:243
double sumEt() const
Definition: MET.h:48
bool selectWMuonEvent(const edm::Event &)
void fillMonitorElementTriggered(const edm::Event &, std::string, std::string, const reco::CaloMET &, const reco::CaloMET &, bool)
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:32
double emEnergy() const
Definition: CaloTower.h:79
virtual double theta() const =0
momentum polar angle
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
void makeRatePlot(std::string, double)
T sqrt(T t)
Definition: SSEVec.h:48
unsigned int size() const
Get number of paths stored.
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
double emEtInEB() const
Definition: CaloMET.h:55
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
#define LogTrace(id)
const double PVlow
CaloMETAnalyzer(const edm::ParameterSet &)
Constructor.
double hadEtInHO() const
Definition: CaloMET.h:49
double hadEnergy() const
Definition: CaloTower.h:80
TObject * getRootObject(void) const
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
bool selectHighPtJetEvent(const edm::Event &)
double etFractionHadronic() const
Definition: CaloMET.h:42
void beginRun(const edm::Run &, const edm::EventSetup &)
Initialize run-based parameters.
void bookMonitorElementTriggered(std::string, bool)
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
TH1F * getTH1F(void) const
void fillMonitorElement(const edm::Event &, std::string, std::string, const reco::CaloMET &, const reco::CaloMET &, bool)
T const * product() const
Definition: Handle.h:74
void validateMET(const reco::CaloMET &, edm::Handle< edm::View< reco::Candidate > >)
double emEtInEE() const
Definition: CaloMET.h:57
virtual ~CaloMETAnalyzer()
Destructor.
const bool CSCLooseHaloId() const
edm::EventID id() const
Definition: EventBase.h:56
double emEtInHF() const
Definition: CaloMET.h:59
tuple cout
Definition: gather_cfg.py:121
double et(double vtxZ) const
Definition: CaloTower.h:101
const_iterator end() const
void endRun(const edm::Run &iRun, const edm::EventSetup &iSetup, DQMStore *dbe)
Finish up a run.
void bookMESet(std::string)
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
virtual float pt() const GCC11_FINAL
transverse momentum
void analyze(const edm::Event &, const edm::EventSetup &, const edm::TriggerResults &)
Get the analysis.
const bool EcalLooseHaloId() const
double hadEtInHB() const
Definition: CaloMET.h:47
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
double emEtFraction() const
Definition: CaloMET.h:45
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
Definition: Run.h:36
Definition: DDAxes.h:10