CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
pat::PATMHTProducer Class Reference
Inheritance diagram for pat::PATMHTProducer:
edm::stream::EDProducer<>

Classes

class  uncertaintyFunctions
 

Public Member Functions

 PATMHTProducer (const edm::ParameterSet &)
 
 ~PATMHTProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

double getElectrons (edm::Event &, const edm::EventSetup &)
 
double getJets (edm::Event &, const edm::EventSetup &)
 
double getMuons (edm::Event &, const edm::EventSetup &)
 
void getTowers (edm::Event &, const edm::EventSetup &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
void setUncertaintyParameters ()
 

Private Attributes

edm::InputTag CaloJetAlgorithmTag_
 
edm::InputTag CaloTowerTag_
 
bool controlledUncertainty_
 
edm::InputTag CorJetAlgorithmTag_
 
uncertaintyFunctions ecalEBUncertainty
 
uncertaintyFunctions ecalEEUncertainty
 
edm::InputTag ElectronTag_
 
double eleEtaMax_
 
double eleEtUncertaintyParameter0_
 
double elePhiUncertaintyParameter0_
 
double elePtMin_
 
edm::EDGetTokenT< edm::View< pat::Electron > > eleToken_
 
uncertaintyFunctions eleUncertainty
 
uncertaintyFunctions hcalHBUncertainty
 
uncertaintyFunctions hcalHEUncertainty
 
uncertaintyFunctions hcalHFUncertainty
 
uncertaintyFunctions hcalHOUncertainty
 
std::string JetCorrectionService_
 
uncertaintyFunctions jetCorrUncertainty
 
double jetEMfracMax_
 
double jetEtaMax_
 
double jetEtUncertaintyParameter0_
 
double jetEtUncertaintyParameter1_
 
double jetEtUncertaintyParameter2_
 
double jetPhiUncertaintyParameter0_
 
double jetPhiUncertaintyParameter1_
 
double jetPhiUncertaintyParameter2_
 
double jetPtMin_
 
edm::EDGetTokenT< edm::View< pat::Jet > > jetToken_
 
uncertaintyFunctions jetUncertainty
 
std::string metCollectionLabel_
 
edm::InputTag mhtLabel_
 
double muonChiSqMax_
 
uncertaintyFunctions muonCorrUncertainty
 
double muonDPtMax_
 
double muonEtaMax_
 
double muonEtUncertaintyParameter0_
 
int muonNHitsMin_
 
double muonPhiUncertaintyParameter0_
 
double muonPtMin_
 
edm::InputTag MuonTag_
 
double muonTrackD0Max_
 
double muonTrackDzMax_
 
uncertaintyFunctions muonUncertainty
 
edm::EDGetTokenT< edm::View< pat::Muon > > muoToken_
 
bool noHF_
 
edm::EDGetTokenT< edm::View< pat::Photon > > phoToken_
 
std::vector< metsig::SigInputObjphysobjvector_
 
std::set< CaloTowerDetIds_clusteredTowers
 
std::string significanceLabel_
 
edm::EDGetTokenT< edm::View< pat::Tau > > tauToken_
 
double towerEtThreshold_
 
double uncertaintyScaleFactor_
 
bool useCaloTowers_
 
bool useElectrons_
 
bool useHO_
 
bool useJets_
 
bool useMuons_
 
double verbose_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 39 of file PATMHTProducer.cc.

Constructor & Destructor Documentation

◆ PATMHTProducer()

PATMHTProducer::PATMHTProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 154 of file PATMHTProducer.cc.

References CaloTowerTag_, controlledUncertainty_, eleEtaMax_, eleEtUncertaintyParameter0_, elePhiUncertaintyParameter0_, elePtMin_, eleToken_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), jetEMfracMax_, jetEtaMax_, jetEtUncertaintyParameter0_, jetEtUncertaintyParameter1_, jetEtUncertaintyParameter2_, jetPhiUncertaintyParameter0_, jetPhiUncertaintyParameter1_, jetPhiUncertaintyParameter2_, jetPtMin_, jetToken_, muonEtaMax_, muonEtUncertaintyParameter0_, muonPhiUncertaintyParameter0_, muonPtMin_, muoToken_, noHF_, phoToken_, setUncertaintyParameters(), tauToken_, towerEtThreshold_, uncertaintyScaleFactor_, useHO_, and verbose_.

154  {
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 }
edm::EDGetTokenT< edm::View< pat::Photon > > phoToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
double eleEtUncertaintyParameter0_
double muonPhiUncertaintyParameter0_
edm::EDGetTokenT< edm::View< pat::Muon > > muoToken_
double jetEtUncertaintyParameter1_
double elePhiUncertaintyParameter0_
double jetEtUncertaintyParameter2_
double jetPhiUncertaintyParameter2_
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::View< pat::Tau > > tauToken_
double muonEtUncertaintyParameter0_
edm::EDGetTokenT< edm::View< pat::Electron > > eleToken_
edm::InputTag CaloTowerTag_
double jetPhiUncertaintyParameter1_
double jetPhiUncertaintyParameter0_
edm::EDGetTokenT< edm::View< pat::Jet > > jetToken_
double jetEtUncertaintyParameter0_

◆ ~PATMHTProducer()

PATMHTProducer::~PATMHTProducer ( )
override

Definition at line 200 of file PATMHTProducer.cc.

200 {}

Member Function Documentation

◆ getElectrons()

double PATMHTProducer::getElectrons ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 343 of file PATMHTProducer.cc.

References gather_cfg::cout, pwdgSkimBPark_cfi::electrons, iEvent, and AlCaHLTBitMon_QueryRunRegistry::string.

343  {
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 
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 }
int iEvent
Definition: GenABIO.cc:224
std::vector< metsig::SigInputObj > physobjvector_
edm::EDGetTokenT< edm::View< pat::Electron > > eleToken_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
Log< level::Warning, false > LogWarning
uncertaintyFunctions eleUncertainty

◆ getJets()

double PATMHTProducer::getJets ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 263 of file PATMHTProducer.cc.

References gather_cfg::cout, iEvent, cuy::ii, PDWG_EXODelayedJetMET_cff::jets, and AlCaHLTBitMon_QueryRunRegistry::string.

263  {
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 
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 }
uncertaintyFunctions jetUncertainty
int iEvent
Definition: GenABIO.cc:224
ii
Definition: cuy.py:589
std::vector< metsig::SigInputObj > physobjvector_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
edm::EDGetTokenT< edm::View< pat::Jet > > jetToken_
Log< level::Warning, false > LogWarning
std::set< CaloTowerDetId > s_clusteredTowers

◆ getMuons()

double PATMHTProducer::getMuons ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 427 of file PATMHTProducer.cc.

References gather_cfg::cout, iEvent, edm::HandleBase::isValid(), PDWG_BPHSkim_cff::muons, and AlCaHLTBitMon_QueryRunRegistry::string.

427  {
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 
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 }
edm::EDGetTokenT< edm::View< pat::Muon > > muoToken_
uncertaintyFunctions muonUncertainty
int iEvent
Definition: GenABIO.cc:224
std::vector< metsig::SigInputObj > physobjvector_
bool isValid() const
Definition: HandleBase.h:70
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
Log< level::Warning, false > LogWarning

◆ getTowers()

void pat::PATMHTProducer::getTowers ( edm::Event ,
const edm::EventSetup  
)
private

◆ produce()

void PATMHTProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 202 of file PATMHTProducer.cc.

References metsig::significanceAlgo::addObjects(), funct::cos(), gather_cfg::cout, iEvent, eostools::move(), pat::MHT::setNumberOfElectrons(), pat::MHT::setNumberOfJets(), pat::MHT::setNumberOfMuons(), met_cff::significance, metsig::significanceAlgo::significance(), and funct::sin().

202  {
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 }
const void addObjects(const std::vector< metsig::SigInputObj > &EventVec)
double getJets(edm::Event &, const edm::EventSetup &)
const double significance(double &met_r, double &met_phi, double &met_set)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Definition: MHT.h:9
double getMuons(edm::Event &, const edm::EventSetup &)
int iEvent
Definition: GenABIO.cc:224
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double getElectrons(edm::Event &, const edm::EventSetup &)
std::vector< metsig::SigInputObj > physobjvector_
significance
Definition: met_cff.py:15
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21
def move(src, dest)
Definition: eostools.py:511
std::set< CaloTowerDetId > s_clusteredTowers

◆ setUncertaintyParameters()

void PATMHTProducer::setUncertaintyParameters ( )
private

Definition at line 484 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

484  {
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 --//
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 --//
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 --//
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 --//
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 --//
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 --//
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 --//
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
566  std::make_unique<TF1>("jetPhiFunc", "x*sqrt(([0]*[0]/(x*x))+([1]*[1]/x)+([2]*[2]))", 3);
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);
586 
587  eleUncertainty.phiUncertainty = std::make_unique<TF1>("elePhiFunc", "[0] * x", 1);
588  // eleUncertainty.phiUncertainty->SetParameter(0,1*(3.14159/180.));
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);
597  muonUncertainty.phiUncertainty = std::make_unique<TF1>("muonPhiFunc", "[0] * x", 1);
598  // muonUncertainty.phiUncertainty->SetParameter(0,1*(3.14159/180.));
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 }
double eleEtUncertaintyParameter0_
uncertaintyFunctions hcalHEUncertainty
double muonPhiUncertaintyParameter0_
uncertaintyFunctions muonUncertainty
uncertaintyFunctions ecalEEUncertainty
uncertaintyFunctions jetUncertainty
double jetEtUncertaintyParameter1_
double elePhiUncertaintyParameter0_
double jetEtUncertaintyParameter2_
double jetPhiUncertaintyParameter2_
uncertaintyFunctions hcalHBUncertainty
double muonEtUncertaintyParameter0_
uncertaintyFunctions hcalHFUncertainty
double jetPhiUncertaintyParameter1_
double jetPhiUncertaintyParameter0_
uncertaintyFunctions ecalEBUncertainty
double jetEtUncertaintyParameter0_
uncertaintyFunctions hcalHOUncertainty
uncertaintyFunctions eleUncertainty

Member Data Documentation

◆ CaloJetAlgorithmTag_

edm::InputTag pat::PATMHTProducer::CaloJetAlgorithmTag_
private

Definition at line 132 of file PATMHTProducer.cc.

◆ CaloTowerTag_

edm::InputTag pat::PATMHTProducer::CaloTowerTag_
private

Definition at line 137 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ controlledUncertainty_

bool pat::PATMHTProducer::controlledUncertainty_
private

Definition at line 67 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ CorJetAlgorithmTag_

edm::InputTag pat::PATMHTProducer::CorJetAlgorithmTag_
private

Definition at line 133 of file PATMHTProducer.cc.

◆ ecalEBUncertainty

uncertaintyFunctions pat::PATMHTProducer::ecalEBUncertainty
private

Definition at line 78 of file PATMHTProducer.cc.

◆ ecalEEUncertainty

uncertaintyFunctions pat::PATMHTProducer::ecalEEUncertainty
private

Definition at line 79 of file PATMHTProducer.cc.

◆ ElectronTag_

edm::InputTag pat::PATMHTProducer::ElectronTag_
private

Definition at line 136 of file PATMHTProducer.cc.

◆ eleEtaMax_

double pat::PATMHTProducer::eleEtaMax_
private

Definition at line 106 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ eleEtUncertaintyParameter0_

double pat::PATMHTProducer::eleEtUncertaintyParameter0_
private

Definition at line 126 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ elePhiUncertaintyParameter0_

double pat::PATMHTProducer::elePhiUncertaintyParameter0_
private

Definition at line 127 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ elePtMin_

double pat::PATMHTProducer::elePtMin_
private

Definition at line 105 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ eleToken_

edm::EDGetTokenT<edm::View<pat::Electron> > pat::PATMHTProducer::eleToken_
private

Definition at line 59 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ eleUncertainty

uncertaintyFunctions pat::PATMHTProducer::eleUncertainty
private

Definition at line 87 of file PATMHTProducer.cc.

◆ hcalHBUncertainty

uncertaintyFunctions pat::PATMHTProducer::hcalHBUncertainty
private

Definition at line 80 of file PATMHTProducer.cc.

◆ hcalHEUncertainty

uncertaintyFunctions pat::PATMHTProducer::hcalHEUncertainty
private

Definition at line 81 of file PATMHTProducer.cc.

◆ hcalHFUncertainty

uncertaintyFunctions pat::PATMHTProducer::hcalHFUncertainty
private

Definition at line 83 of file PATMHTProducer.cc.

◆ hcalHOUncertainty

uncertaintyFunctions pat::PATMHTProducer::hcalHOUncertainty
private

Definition at line 82 of file PATMHTProducer.cc.

◆ JetCorrectionService_

std::string pat::PATMHTProducer::JetCorrectionService_
private

Definition at line 134 of file PATMHTProducer.cc.

◆ jetCorrUncertainty

uncertaintyFunctions pat::PATMHTProducer::jetCorrUncertainty
private

Definition at line 86 of file PATMHTProducer.cc.

◆ jetEMfracMax_

double pat::PATMHTProducer::jetEMfracMax_
private

Definition at line 103 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ jetEtaMax_

double pat::PATMHTProducer::jetEtaMax_
private

Definition at line 102 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ jetEtUncertaintyParameter0_

double pat::PATMHTProducer::jetEtUncertaintyParameter0_
private

Definition at line 118 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ jetEtUncertaintyParameter1_

double pat::PATMHTProducer::jetEtUncertaintyParameter1_
private

Definition at line 119 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ jetEtUncertaintyParameter2_

double pat::PATMHTProducer::jetEtUncertaintyParameter2_
private

Definition at line 120 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ jetPhiUncertaintyParameter0_

double pat::PATMHTProducer::jetPhiUncertaintyParameter0_
private

Definition at line 122 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ jetPhiUncertaintyParameter1_

double pat::PATMHTProducer::jetPhiUncertaintyParameter1_
private

Definition at line 123 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ jetPhiUncertaintyParameter2_

double pat::PATMHTProducer::jetPhiUncertaintyParameter2_
private

Definition at line 124 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ jetPtMin_

double pat::PATMHTProducer::jetPtMin_
private

Definition at line 101 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ jetToken_

edm::EDGetTokenT<edm::View<pat::Jet> > pat::PATMHTProducer::jetToken_
private

Definition at line 58 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ jetUncertainty

uncertaintyFunctions pat::PATMHTProducer::jetUncertainty
private

Definition at line 85 of file PATMHTProducer.cc.

◆ metCollectionLabel_

std::string pat::PATMHTProducer::metCollectionLabel_
private

Definition at line 138 of file PATMHTProducer.cc.

◆ mhtLabel_

edm::InputTag pat::PATMHTProducer::mhtLabel_
private

Definition at line 57 of file PATMHTProducer.cc.

◆ muonChiSqMax_

double pat::PATMHTProducer::muonChiSqMax_
private

Definition at line 114 of file PATMHTProducer.cc.

◆ muonCorrUncertainty

uncertaintyFunctions pat::PATMHTProducer::muonCorrUncertainty
private

Definition at line 89 of file PATMHTProducer.cc.

◆ muonDPtMax_

double pat::PATMHTProducer::muonDPtMax_
private

Definition at line 113 of file PATMHTProducer.cc.

◆ muonEtaMax_

double pat::PATMHTProducer::muonEtaMax_
private

Definition at line 109 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ muonEtUncertaintyParameter0_

double pat::PATMHTProducer::muonEtUncertaintyParameter0_
private

Definition at line 129 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ muonNHitsMin_

int pat::PATMHTProducer::muonNHitsMin_
private

Definition at line 112 of file PATMHTProducer.cc.

◆ muonPhiUncertaintyParameter0_

double pat::PATMHTProducer::muonPhiUncertaintyParameter0_
private

Definition at line 130 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ muonPtMin_

double pat::PATMHTProducer::muonPtMin_
private

Definition at line 108 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ MuonTag_

edm::InputTag pat::PATMHTProducer::MuonTag_
private

Definition at line 135 of file PATMHTProducer.cc.

◆ muonTrackD0Max_

double pat::PATMHTProducer::muonTrackD0Max_
private

Definition at line 110 of file PATMHTProducer.cc.

◆ muonTrackDzMax_

double pat::PATMHTProducer::muonTrackDzMax_
private

Definition at line 111 of file PATMHTProducer.cc.

◆ muonUncertainty

uncertaintyFunctions pat::PATMHTProducer::muonUncertainty
private

Definition at line 88 of file PATMHTProducer.cc.

◆ muoToken_

edm::EDGetTokenT<edm::View<pat::Muon> > pat::PATMHTProducer::muoToken_
private

Definition at line 60 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ noHF_

bool pat::PATMHTProducer::noHF_
private

Definition at line 99 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ phoToken_

edm::EDGetTokenT<edm::View<pat::Photon> > pat::PATMHTProducer::phoToken_
private

Definition at line 62 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ physobjvector_

std::vector<metsig::SigInputObj> pat::PATMHTProducer::physobjvector_
private

Definition at line 64 of file PATMHTProducer.cc.

◆ s_clusteredTowers

std::set<CaloTowerDetId> pat::PATMHTProducer::s_clusteredTowers
private

Definition at line 97 of file PATMHTProducer.cc.

◆ significanceLabel_

std::string pat::PATMHTProducer::significanceLabel_
private

Definition at line 139 of file PATMHTProducer.cc.

◆ tauToken_

edm::EDGetTokenT<edm::View<pat::Tau> > pat::PATMHTProducer::tauToken_
private

Definition at line 61 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ towerEtThreshold_

double pat::PATMHTProducer::towerEtThreshold_
private

Definition at line 145 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ uncertaintyScaleFactor_

double pat::PATMHTProducer::uncertaintyScaleFactor_
private

Definition at line 66 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ useCaloTowers_

bool pat::PATMHTProducer::useCaloTowers_
private

Definition at line 93 of file PATMHTProducer.cc.

◆ useElectrons_

bool pat::PATMHTProducer::useElectrons_
private

Definition at line 95 of file PATMHTProducer.cc.

◆ useHO_

bool pat::PATMHTProducer::useHO_
private

Definition at line 146 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().

◆ useJets_

bool pat::PATMHTProducer::useJets_
private

Definition at line 94 of file PATMHTProducer.cc.

◆ useMuons_

bool pat::PATMHTProducer::useMuons_
private

Definition at line 96 of file PATMHTProducer.cc.

◆ verbose_

double pat::PATMHTProducer::verbose_
private

Definition at line 54 of file PATMHTProducer.cc.

Referenced by PATMHTProducer().