CMS 3D CMS Logo

PATMHTProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: PATMHTProducer
4 // Class: PATMHTProducer
5 //
13 //
14 // Original Author: Xin Shi & Freya Blekman, Cornell University
15 // Created: Fri Sep 12 17:58:29 CEST 2008
16 //
17 //
18 
37 
38 namespace pat {
40  public:
41  explicit PATMHTProducer(const edm::ParameterSet&);
42  ~PATMHTProducer() override;
43 
44  private:
45  void produce(edm::Event&, const edm::EventSetup&) override;
46 
47  double getJets(edm::Event&, const edm::EventSetup&);
48  double getElectrons(edm::Event&, const edm::EventSetup&);
49  double getMuons(edm::Event&, const edm::EventSetup&);
50  void getTowers(edm::Event&, const edm::EventSetup&);
51 
52  // ----------member data ---------------------------
53 
54  double verbose_;
55 
56  // input tags.
63 
64  std::vector<metsig::SigInputObj> physobjvector_;
65 
66  double uncertaintyScaleFactor_; // scale factor for the uncertainty parameters.
67  bool controlledUncertainty_; // use controlled uncertainty parameters.
68 
69  //--- test the uncertainty parameters ---//
70 
72  public:
73  std::unique_ptr<TF1> etUncertainty;
74  std::unique_ptr<TF1> phiUncertainty;
75  };
76 
77  void setUncertaintyParameters(); // fills the following uncertaintyFunctions objects:
84 
90 
91  //--- tags and parameters ---//
92 
94  bool useJets_;
96  bool useMuons_;
97  std::set<CaloTowerDetId> s_clusteredTowers;
98 
99  bool noHF_;
100 
101  double jetPtMin_;
102  double jetEtaMax_;
104 
105  double elePtMin_;
106  double eleEtaMax_;
107 
108  double muonPtMin_;
109  double muonEtaMax_;
113  double muonDPtMax_;
115 
116  // double uncertaintyScaleFactor_; // scale factor for the uncertainty parameters.
117 
121 
125 
128 
131 
140 
141  //--- For Muon Calo Deposits ---//
142  //TrackDetectorAssociator trackAssociator_;
143  //TrackAssociatorParameters trackAssociatorParameters_;
144 
146  bool useHO_;
147  };
148  //define this as a plug-in
149 
150 } // namespace pat
151 
152 #include <memory>
153 
155  // Initialize the configurables
156  verbose_ = iConfig.getParameter<double>("verbose");
157 
158  jetToken_ = consumes<edm::View<pat::Jet> >(iConfig.getUntrackedParameter<edm::InputTag>("jetTag"));
159  eleToken_ = consumes<edm::View<pat::Electron> >(iConfig.getUntrackedParameter<edm::InputTag>("electronTag"));
160  muoToken_ = consumes<edm::View<pat::Muon> >(iConfig.getUntrackedParameter<edm::InputTag>("muonTag"));
161  tauToken_ = consumes<edm::View<pat::Tau> >(iConfig.getUntrackedParameter<edm::InputTag>("tauTag"));
162  phoToken_ = consumes<edm::View<pat::Photon> >(iConfig.getUntrackedParameter<edm::InputTag>("photonTag"));
163 
164  uncertaintyScaleFactor_ = iConfig.getParameter<double>("uncertaintyScaleFactor");
165  controlledUncertainty_ = iConfig.getParameter<bool>("controlledUncertainty");
166 
167  jetPtMin_ = iConfig.getParameter<double>("jetPtMin");
168  jetEtaMax_ = iConfig.getParameter<double>("jetEtaMax");
169  jetEMfracMax_ = iConfig.getParameter<double>("jetEMfracMax");
170  elePtMin_ = iConfig.getParameter<double>("elePtMin");
171  eleEtaMax_ = iConfig.getParameter<double>("eleEtaMax");
172  muonPtMin_ = iConfig.getParameter<double>("muonPtMin");
173  muonEtaMax_ = iConfig.getParameter<double>("muonEtaMax");
174 
175  jetEtUncertaintyParameter0_ = iConfig.getParameter<double>("jetEtUncertaintyParameter0");
176  jetEtUncertaintyParameter1_ = iConfig.getParameter<double>("jetEtUncertaintyParameter1");
177  jetEtUncertaintyParameter2_ = iConfig.getParameter<double>("jetEtUncertaintyParameter2");
178  jetPhiUncertaintyParameter0_ = iConfig.getParameter<double>("jetPhiUncertaintyParameter0");
179  jetPhiUncertaintyParameter1_ = iConfig.getParameter<double>("jetPhiUncertaintyParameter1");
180  jetPhiUncertaintyParameter2_ = iConfig.getParameter<double>("jetPhiUncertaintyParameter2");
181 
182  eleEtUncertaintyParameter0_ = iConfig.getParameter<double>("eleEtUncertaintyParameter0");
183  elePhiUncertaintyParameter0_ = iConfig.getParameter<double>("elePhiUncertaintyParameter0");
184 
185  muonEtUncertaintyParameter0_ = iConfig.getParameter<double>("muonEtUncertaintyParameter0");
186  muonPhiUncertaintyParameter0_ = iConfig.getParameter<double>("muonPhiUncertaintyParameter0");
187 
188  CaloTowerTag_ = iConfig.getParameter<edm::InputTag>("CaloTowerTag");
189  noHF_ = iConfig.getParameter<bool>("noHF");
190 
191  // muonCalo_ = iConfig.getParameter<bool>("muonCalo");
192  towerEtThreshold_ = iConfig.getParameter<double>("towerEtThreshold");
193  useHO_ = iConfig.getParameter<bool>("useHO");
194 
196 
197  produces<pat::MHTCollection>();
198 }
199 
201 
203  // make sure the SigInputObj container is empty
204  while (!physobjvector_.empty()) {
205  physobjvector_.erase(physobjvector_.begin(), physobjvector_.end());
206  }
207 
208  // Clean the clustered towers
209  s_clusteredTowers.clear();
210 
211  double number_of_jets = getJets(iEvent, iSetup);
212 
213  double number_of_electrons = getElectrons(iEvent, iSetup);
214 
215  double number_of_muons = getMuons(iEvent, iSetup);
216 
217  if (verbose_ == 1.) {
218  std::cout << ">>>---> Number of jets: " << number_of_jets << std::endl;
219  std::cout << ">>>---> Number of electrons: " << number_of_jets << std::endl;
220  std::cout << ">>>---> Number of muons: " << number_of_muons << std::endl;
221  }
222 
223  double met_x = 0;
224  double met_y = 0;
225  double met_et = 0;
226  double met_phi = 0;
227  double met_set = 0;
228 
229  auto themetsigcoll = std::make_unique<pat::MHTCollection>();
230 
231  if (!physobjvector_.empty()) { // Only when the vector is not empty
232 
233  // calculate the MHT significance
234 
235  metsig::significanceAlgo signifAlgo;
236  signifAlgo.addObjects(physobjvector_);
237  double significance = signifAlgo.significance(met_et, met_phi, met_set);
238 
239  met_x = met_et * cos(met_phi);
240  met_y = met_et * sin(met_phi);
241 
242  if (verbose_ == 1.) {
243  std::cout << ">>>----> MHT Sgificance = " << significance << std::endl;
244  }
245 
246  pat::MHT themetsigobj(reco::Particle::LorentzVector(met_x, met_y, 0, met_et), met_set, significance);
247 
248  // Store the number of jets, electrons, muons
249  themetsigobj.setNumberOfJets(number_of_jets);
250  themetsigobj.setNumberOfElectrons(number_of_electrons);
251  themetsigobj.setNumberOfMuons(number_of_muons);
252 
253  themetsigcoll->push_back(themetsigobj);
254 
255  } // If the vector is empty, just put empty product.
256 
257  iEvent.put(std::move(themetsigcoll));
258 }
259 
260 // --------------------------------------------------
261 // Fill Input Vector with Jets
262 // --------------------------------------------------
264  std::string objectname = "jet";
265 
266  double number_of_jets_ = 0.0;
267 
269  iEvent.getByToken(jetToken_, jetHandle);
270  edm::View<pat::Jet> jets = *jetHandle;
271 
272  // Fill Input Vector with Jets
273  for (edm::View<pat::Jet>::const_iterator jet_iter = jets.begin(); jet_iter != jets.end(); ++jet_iter) {
274  if ((jet_iter->pt() < jetPtMin_) || (TMath::Abs(jet_iter->eta()) > jetEtaMax_) ||
275  (jet_iter->emEnergyFraction() > jetEMfracMax_))
276  continue;
277 
278  double jet_et = jet_iter->et();
279  double jet_phi = jet_iter->phi();
280 
281  if (verbose_ == 3.) {
282  std::cout << "jet pt : " << jet_iter->pt() << " eta : " << jet_iter->eta()
283  << " EMF: " << jet_iter->emEnergyFraction() << std::endl;
284  }
285 
286  double sigma_et, sigma_phi;
287 
288  if (controlledUncertainty_) {
289  sigma_et = jetUncertainty.etUncertainty->Eval(jet_et);
290  sigma_phi = jetUncertainty.phiUncertainty->Eval(jet_et);
291  } else {
292  sigma_et = 0.0; // jet_iter->resolutionEt();
293  sigma_phi = 0.0; //jet_iter->resolutionPhi();
294  }
295 
296  if (verbose_ == 3.) {
297  std::cout << "jet sigma_et : " << sigma_et << ", jet sigma_phi : " << sigma_phi << std::endl;
298  }
299 
300  if (sigma_et <= 0 || sigma_phi <= 0)
301  edm::LogWarning("PATMHTProducer") << " uncertainties for " << objectname << " are (et, phi): " << sigma_et << ","
302  << sigma_phi << " (et,phi): " << jet_et << "," << jet_phi;
303  // try to read out the jet resolution from the root file at PatUtils
304  //-- Store jet for Significance Calculation --//
305 
306  if (uncertaintyScaleFactor_ != 1.0) {
307  sigma_et = sigma_et * uncertaintyScaleFactor_;
308  sigma_phi = sigma_phi * uncertaintyScaleFactor_;
309  // edm::LogWarning("PATMHTProducer") << " using uncertainty scale factor: " << uncertaintyScaleFactor_ <<
310  //" , uncertainties for " << objectname <<" changed to (et, phi): " << sigma_et << "," << sigma_phi;
311  }
312 
313  if (verbose_ == 101.) { // Study the Jets behavior
314 
315  std::cout << "v101> " << number_of_jets_ << " " << jet_et << " " << sigma_et << " " << jet_phi << " "
316  << sigma_phi << std::endl;
317  }
318 
319  metsig::SigInputObj tmp_jet(objectname, jet_et, jet_phi, sigma_et, sigma_phi);
320  physobjvector_.push_back(tmp_jet);
321  number_of_jets_++;
322 
323  //-- Store tower DetId's to be removed from Calo Tower sum later --//
324  std::vector<CaloTowerPtr> v_towers = jet_iter->getCaloConstituents();
325  //std::cout << "tower size = " << v_towers.size() << std::endl;
326 
327  for (unsigned int ii = 0; ii < v_towers.size(); ii++) {
328  s_clusteredTowers.insert((*v_towers.at(ii)).id());
329  //std::cout << "tower id = " << (*v_towers.at(ii)).id() << std::endl;
330  }
331  }
332 
333  if (verbose_ == 101.) { // Study the Jets behavior - seperate events
334  std::cout << "v101> --------------------------------------------" << std::endl;
335  }
336 
337  return number_of_jets_;
338 }
339 
340 // --------------------------------------------------
341 // Fill Input Vector with Electrons
342 // --------------------------------------------------
344  std::string objectname = "electron";
345 
346  double number_of_electrons_ = 0.0;
347 
348  // edm::ESHandle<CaloTowerConstituentsMap> cttopo;
349  // iSetup.get<HcalRecNumberingRecord>().get(cttopo);
350  // const CaloTowerConstituentsMap* caloTowerMap = cttopo.product();
351 
352  edm::Handle<edm::View<pat::Electron> > electronHandle;
353  iEvent.getByToken(eleToken_, electronHandle);
354  edm::View<pat::Electron> electrons = *electronHandle;
355 
356  // Fill Input Vector with Electrons
357  for (edm::View<pat::Electron>::const_iterator electron_iter = electrons.begin(); electron_iter != electrons.end();
358  ++electron_iter) {
359  // Select electrons
360  if (electron_iter->et() < elePtMin_ || TMath::Abs(electron_iter->eta()) > eleEtaMax_)
361  continue;
362 
363  if (verbose_ == 3.) {
364  std::cout << "electron pt = " << electron_iter->pt() << " eta : " << electron_iter->eta() << std::endl;
365  }
366 
367  double electron_et = electron_iter->et();
368  double electron_phi = electron_iter->phi();
369 
370  double sigma_et, sigma_phi;
371 
372  if (controlledUncertainty_) {
373  sigma_et = eleUncertainty.etUncertainty->Eval(electron_et);
374  sigma_phi = eleUncertainty.phiUncertainty->Eval(electron_et);
375  } else {
376  sigma_et = 0.0; //electron_iter->resolutionEt();
377  sigma_phi = 0.0; // electron_iter->resolutionPhi();
378  }
379 
380  if (verbose_ == 3.) {
381  std::cout << "electron sigma_et : " << sigma_et << ", electron sigma_phi : " << sigma_phi << std::endl;
382  }
383 
384  if (sigma_et < 0 || sigma_phi < 0)
385  edm::LogWarning("PATMHTProducer") << " uncertainties for " << objectname << " are (et, phi): " << sigma_et << ","
386  << sigma_phi << " (et,phi): " << electron_et << "," << electron_phi;
387 
388  if (uncertaintyScaleFactor_ != 1.0) {
389  sigma_et = sigma_et * uncertaintyScaleFactor_;
390  sigma_phi = sigma_phi * uncertaintyScaleFactor_;
391  }
392 
393  metsig::SigInputObj tmp_electron(objectname, electron_et, electron_phi, sigma_et, sigma_phi);
394  physobjvector_.push_back(tmp_electron);
395  number_of_electrons_++;
396 
397  //-- Store tower DetId's to be removed from Calo Tower sum later --//
398  /*
399  const reco::SuperCluster& eleSC = *( electron_iter->superCluster() );
400 
401  std::vector<DetId> v_eleDetIds = eleSC.getHitsByDetId();
402 
403  //-- Convert cells to calo towers and add to set --//
404  for( std::vector<DetId>::iterator cellId = v_eleDetIds.begin();
405  cellId != v_eleDetIds.end();
406  cellId++) {
407 
408  CaloTowerDetId towerId = caloTowerMap->towerOf(*cellId);
409  if (towerId != nullDetId) {
410  //std::cout << ">>> electron towerId: " << towerId << std::endl;
411  std::pair<std::_Rb_tree_const_iterator<CaloTowerDetId>,bool> p1 = s_clusteredTowers.insert(towerId);
412  }
413  else
414  std::cerr<<"No matching tower found for electron cell!\n";
415  }
416 
417  */
418  }
419 
420  return number_of_electrons_;
421 }
422 
423 // --------------------------------------------------
424 // Fill Input Vector with Muons
425 // --------------------------------------------------
426 
428  std::string objectname = "muon";
430  iEvent.getByToken(muoToken_, muonHandle);
431  edm::View<pat::Muon> muons = *muonHandle;
432 
433  if (!muonHandle.isValid()) {
434  std::cout << ">>> PATMHTSelector not valid muon Handle!" << std::endl;
435  return 0.0;
436  }
437 
438  double number_of_muons_ = 0.0;
439 
440  for (edm::View<pat::Muon>::const_iterator muon_iter = muons.begin(); muon_iter != muons.end(); ++muon_iter) {
441  if (muon_iter->pt() < muonPtMin_ || TMath::Abs(muon_iter->eta()) > muonEtaMax_)
442  continue;
443 
444  if (verbose_ == 3.) {
445  std::cout << "muon pt = " << muon_iter->pt() << " eta : " << muon_iter->eta() << std::endl;
446  }
447 
448  double muon_pt = muon_iter->pt();
449  double muon_phi = muon_iter->phi();
450 
451  double sigma_et, sigma_phi;
452 
453  if (controlledUncertainty_) {
454  sigma_et = muonUncertainty.etUncertainty->Eval(muon_pt);
455  sigma_phi = muonUncertainty.phiUncertainty->Eval(muon_pt);
456  } else {
457  sigma_et = 0.0; //muon_iter->resolutionEt();
458  sigma_phi = 0.0; // muon_iter->resolutionPhi();
459  }
460 
461  if (verbose_ == 3.) {
462  std::cout << "muon sigma_et : " << sigma_et << ", muon sigma_phi : " << sigma_phi << std::endl;
463  }
464 
465  if (sigma_et < 0 || sigma_phi < 0)
466  edm::LogWarning("PATMHTProducer") << " uncertainties for " << objectname << " are (et, phi): " << sigma_et << ","
467  << sigma_phi << " (pt,phi): " << muon_pt << "," << muon_phi;
468 
469  if (uncertaintyScaleFactor_ != 1.0) {
470  sigma_et = sigma_et * uncertaintyScaleFactor_;
471  sigma_phi = sigma_phi * uncertaintyScaleFactor_;
472  }
473 
474  metsig::SigInputObj tmp_muon(objectname, muon_pt, muon_phi, sigma_et, sigma_phi);
475  physobjvector_.push_back(tmp_muon);
476  number_of_muons_++;
477 
478  } // end Muon loop
479 
480  return number_of_muons_;
481 }
482 
483 //=== Uncertainty Functions ===============================================
485  // set the various functions here:
486 
487  //-- For Et functions, [0]= par_n, [1]=par_s, [2]= par_c ---//
488  //-- Ecal Uncertainty Functions ------------------------------------//
489  //-- From: FastSimulation/Calorimetry/data/HcalResponse.cfi --//
490  //-- Ecal Barrel --//
491  ecalEBUncertainty.etUncertainty =
492  std::make_unique<TF1>("ecalEBEtFunc", "x*sqrt(([0]*[0]/(x*x))+([1]*[1]/x)+([2]*[2]))", 3);
493  ecalEBUncertainty.etUncertainty->SetParameter(0, 0.2);
494  ecalEBUncertainty.etUncertainty->SetParameter(1, 0.03);
495  ecalEBUncertainty.etUncertainty->SetParameter(2, 0.005);
496 
497  ecalEBUncertainty.phiUncertainty = std::make_unique<TF1>("ecalEBphiFunc", "[0]*x", 1);
498  ecalEBUncertainty.phiUncertainty->SetParameter(0, 0.0174);
499 
500  //-- Ecal Endcap --//
501  ecalEEUncertainty.etUncertainty =
502  std::make_unique<TF1>("ecalEEEtFunc", "x*sqrt(([0]*[0]/(x*x))+([1]*[1]/x)+([2]*[2]))", 3);
503  ecalEEUncertainty.etUncertainty->SetParameter(0, 0.2);
504  ecalEEUncertainty.etUncertainty->SetParameter(1, 0.03);
505  ecalEEUncertainty.etUncertainty->SetParameter(2, 0.005);
506 
507  ecalEEUncertainty.phiUncertainty = std::make_unique<TF1>("ecalEEphiFunc", "[0]*x", 1);
508  ecalEEUncertainty.phiUncertainty->SetParameter(0, 0.087);
509 
510  //-- Hcal Uncertainty Functions --------------------------------------//
511  //-- From: FastSimulation/Calorimetry/data/HcalResponse.cfi --//
512  //-- Hcal Barrel --//
513  hcalHBUncertainty.etUncertainty =
514  std::make_unique<TF1>("hcalHBEtFunc", "x*sqrt(([0]*[0]/(x*x))+([1]*[1]/x)+([2]*[2]))", 3);
515  hcalHBUncertainty.etUncertainty->SetParameter(0, 0.);
516  hcalHBUncertainty.etUncertainty->SetParameter(1, 1.22);
517  hcalHBUncertainty.etUncertainty->SetParameter(2, 0.05);
518 
519  hcalHBUncertainty.phiUncertainty = std::make_unique<TF1>("ecalHBphiFunc", "[0]*x", 1);
520  hcalHBUncertainty.phiUncertainty->SetParameter(0, 0.087);
521 
522  //-- Hcal Endcap --//
523  hcalHEUncertainty.etUncertainty =
524  std::make_unique<TF1>("hcalHEEtFunc", "x*sqrt(([0]*[0]/(x*x))+([1]*[1]/x)+([2]*[2]))", 3);
525  hcalHEUncertainty.etUncertainty->SetParameter(0, 0.);
526  hcalHEUncertainty.etUncertainty->SetParameter(1, 1.3);
527  hcalHEUncertainty.etUncertainty->SetParameter(2, 0.05);
528 
529  hcalHEUncertainty.phiUncertainty = std::make_unique<TF1>("ecalHEphiFunc", "[0]*x", 1);
530  hcalHEUncertainty.phiUncertainty->SetParameter(0, 0.087);
531 
532  //-- Hcal Outer --//
533  hcalHOUncertainty.etUncertainty =
534  std::make_unique<TF1>("hcalHOEtFunc", "x*sqrt(([0]*[0]/(x*x))+([1]*[1]/x)+([2]*[2]))", 3);
535  hcalHOUncertainty.etUncertainty->SetParameter(0, 0.);
536  hcalHOUncertainty.etUncertainty->SetParameter(1, 1.82);
537  hcalHOUncertainty.etUncertainty->SetParameter(2, 0.09);
538 
539  hcalHOUncertainty.phiUncertainty = std::make_unique<TF1>("ecalHOphiFunc", "[0]*x", 1);
540  hcalHOUncertainty.phiUncertainty->SetParameter(0, 0.087);
541 
542  //-- Hcal Forward --//
543  hcalHFUncertainty.etUncertainty =
544  std::make_unique<TF1>("hcalHFEtFunc", "x*sqrt(([0]*[0]/(x*x))+([1]*[1]/x)+([2]*[2]))", 3);
545  hcalHFUncertainty.etUncertainty->SetParameter(0, 0.);
546  hcalHFUncertainty.etUncertainty->SetParameter(1, 1.82);
547  hcalHFUncertainty.etUncertainty->SetParameter(2, 0.09);
548 
549  hcalHFUncertainty.phiUncertainty = std::make_unique<TF1>("ecalHFphiFunc", "[0]*x", 1);
550  hcalHFUncertainty.phiUncertainty->SetParameter(0, 0.174);
551 
552  //--- Jet Uncertainty Functions --------------------------------------//
553  jetUncertainty.etUncertainty = std::make_unique<TF1>("jetEtFunc", "x*sqrt(([0]*[0]/(x*x))+([1]*[1]/x)+([2]*[2]))", 3);
554  //-- values from PTDR 1, ch 11.4 --//
555  jetUncertainty.etUncertainty->SetParameter(0, jetEtUncertaintyParameter0_);
556  jetUncertainty.etUncertainty->SetParameter(1, jetEtUncertaintyParameter1_);
557  jetUncertainty.etUncertainty->SetParameter(2, jetEtUncertaintyParameter2_);
558 
559  //-- phi value from our own fits --//
560  //jetUncertainty.phiUncertainty.reset( new TF1("jetPhiFunc","[0]*x",1) );
561  //jetUncertainty.phiUncertainty->SetParameter(0, jetPhiUncertaintyParameter0_);
562 
563  //-- phi Functions and values from
564  // http://indico.cern.ch/getFile.py/access?contribId=9&sessionId=0&resId=0&materialId=slides&confId=46394
565  jetUncertainty.phiUncertainty =
566  std::make_unique<TF1>("jetPhiFunc", "x*sqrt(([0]*[0]/(x*x))+([1]*[1]/x)+([2]*[2]))", 3);
567  jetUncertainty.phiUncertainty->SetParameter(0, jetPhiUncertaintyParameter0_);
568  jetUncertainty.phiUncertainty->SetParameter(1, jetPhiUncertaintyParameter1_);
569  jetUncertainty.phiUncertainty->SetParameter(2, jetPhiUncertaintyParameter2_);
570 
571  //-- Jet corrections are assumed not to have an error --//
572  /*jetCorrUncertainty.etUncertainty.reset( new TF1("jetCorrEtFunc","[0]*x",1) );
573  jetCorrUncertainty.etUncertainty->SetParameter(0,0.0);
574  jetCorrUncertainty.phiUncertainty.reset( new TF1("jetCorrPhiFunc","[0]*x",1) );
575  jetCorrUncertainty.phiUncertainty->SetParameter(0,0.0*(3.14159/180.));*/
576 
577  //--- Electron Uncertainty Functions ---------------------------------//
578  // completely ambiguious values for electron-like jets...
579  // the egamma group keeps track of these here:
580  // https://twiki.cern.ch/twiki/bin/view/CMS/EgammaCMSSWVal
581  // electron resolution in energy is around 3.4%, measured for 10 < pT < 50 at realistic events with pile-up.
582 
583  eleUncertainty.etUncertainty = std::make_unique<TF1>("eleEtFunc", "[0] * x", 1);
584  // eleUncertainty.etUncertainty->SetParameter(0,0.034);
585  eleUncertainty.etUncertainty->SetParameter(0, eleEtUncertaintyParameter0_);
586 
587  eleUncertainty.phiUncertainty = std::make_unique<TF1>("elePhiFunc", "[0] * x", 1);
588  // eleUncertainty.phiUncertainty->SetParameter(0,1*(3.14159/180.));
589  eleUncertainty.phiUncertainty->SetParameter(0, elePhiUncertaintyParameter0_);
590 
591  //--- Muon Uncertainty Functions ------------------------------------//
592  // and ambiguious values for the muons...
593 
594  muonUncertainty.etUncertainty = std::make_unique<TF1>("muonEtFunc", "[0] * x", 1);
595  // muonUncertainty.etUncertainty->SetParameter(0,0.01);
596  muonUncertainty.etUncertainty->SetParameter(0, muonEtUncertaintyParameter0_);
597  muonUncertainty.phiUncertainty = std::make_unique<TF1>("muonPhiFunc", "[0] * x", 1);
598  // muonUncertainty.phiUncertainty->SetParameter(0,1*(3.14159/180.));
599  muonUncertainty.phiUncertainty->SetParameter(0, muonPhiUncertaintyParameter0_);
600 
601  //-- Muon calo deposites are assumed not to have an error --//
602  /*muonCorrUncertainty.etUncertainty.reset( new TF1("muonCorrEtFunc","[0] * x",1) );
603  muonCorrUncertainty.etUncertainty->SetParameter(0,0.0);
604  muonCorrUncertainty.phiUncertainty.reset( new TF1("muonCorrPhiFunc","[0] * x",1) );
605  muonCorrUncertainty.phiUncertainty->SetParameter(0,0.0*(3.14159/180.)); */
606 }
607 
609 using namespace pat;
const void addObjects(const std::vector< metsig::SigInputObj > &EventVec)
edm::EDGetTokenT< edm::View< pat::Photon > > phoToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
double eleEtUncertaintyParameter0_
uncertaintyFunctions hcalHEUncertainty
void setNumberOfMuons(const double &numberOfMuons)
Definition: MHT.cc:3
edm::InputTag CorJetAlgorithmTag_
~PATMHTProducer() override
double getJets(edm::Event &, const edm::EventSetup &)
double muonPhiUncertaintyParameter0_
const double significance(double &met_r, double &met_phi, double &met_set)
void setNumberOfJets(const double &numberOfJets)
Definition: MHT.cc:7
edm::EDGetTokenT< edm::View< pat::Muon > > muoToken_
uncertaintyFunctions muonUncertainty
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
uncertaintyFunctions ecalEEUncertainty
uncertaintyFunctions jetUncertainty
double jetEtUncertaintyParameter1_
double elePhiUncertaintyParameter0_
double jetEtUncertaintyParameter2_
Definition: MHT.h:9
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
Definition: DiMuonV_cfg.py:214
double jetPhiUncertaintyParameter2_
uncertaintyFunctions hcalHBUncertainty
Definition: HeavyIon.h:7
T getUntrackedParameter(std::string const &, T const &) const
double getMuons(edm::Event &, const edm::EventSetup &)
int iEvent
Definition: GenABIO.cc:224
edm::InputTag mhtLabel_
edm::EDGetTokenT< edm::View< pat::Tau > > tauToken_
double muonEtUncertaintyParameter0_
PATMHTProducer(const edm::ParameterSet &)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::string metCollectionLabel_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::InputTag CaloJetAlgorithmTag_
ii
Definition: cuy.py:589
uncertaintyFunctions muonCorrUncertainty
double getElectrons(edm::Event &, const edm::EventSetup &)
std::string significanceLabel_
uncertaintyFunctions hcalHFUncertainty
std::vector< metsig::SigInputObj > physobjvector_
void getTowers(edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< edm::View< pat::Electron > > eleToken_
std::string JetCorrectionService_
edm::InputTag ElectronTag_
edm::InputTag MuonTag_
edm::InputTag CaloTowerTag_
bool isValid() const
Definition: HandleBase.h:70
double jetPhiUncertaintyParameter1_
significance
Definition: met_cff.py:20
void produce(edm::Event &, const edm::EventSetup &) override
double jetPhiUncertaintyParameter0_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:88
edm::EDGetTokenT< edm::View< pat::Jet > > jetToken_
uncertaintyFunctions jetCorrUncertainty
uncertaintyFunctions ecalEBUncertainty
double jetEtUncertaintyParameter0_
Log< level::Warning, false > LogWarning
uncertaintyFunctions hcalHOUncertainty
void setNumberOfElectrons(const double &numberOfElectrons)
Definition: MHT.cc:11
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21
def move(src, dest)
Definition: eostools.py:511
uncertaintyFunctions eleUncertainty
std::set< CaloTowerDetId > s_clusteredTowers