CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
pat::PATMHTProducer Class Reference

#include <PATMHTProducer.h>

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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 60 of file PATMHTProducer.h.

Constructor & Destructor Documentation

◆ PATMHTProducer()

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

Definition at line 8 of file PATMHTProducer.cc.

8  {
9  // Initialize the configurables
10  verbose_ = iConfig.getParameter<double>("verbose");
11 
12  jetToken_ = consumes<edm::View<pat::Jet> >(iConfig.getUntrackedParameter<edm::InputTag>("jetTag"));
13  eleToken_ = consumes<edm::View<pat::Electron> >(iConfig.getUntrackedParameter<edm::InputTag>("electronTag"));
14  muoToken_ = consumes<edm::View<pat::Muon> >(iConfig.getUntrackedParameter<edm::InputTag>("muonTag"));
15  tauToken_ = consumes<edm::View<pat::Tau> >(iConfig.getUntrackedParameter<edm::InputTag>("tauTag"));
16  phoToken_ = consumes<edm::View<pat::Photon> >(iConfig.getUntrackedParameter<edm::InputTag>("photonTag"));
17 
18  uncertaintyScaleFactor_ = iConfig.getParameter<double>("uncertaintyScaleFactor");
19  controlledUncertainty_ = iConfig.getParameter<bool>("controlledUncertainty");
20 
21  jetPtMin_ = iConfig.getParameter<double>("jetPtMin");
22  jetEtaMax_ = iConfig.getParameter<double>("jetEtaMax");
23  jetEMfracMax_ = iConfig.getParameter<double>("jetEMfracMax");
24  elePtMin_ = iConfig.getParameter<double>("elePtMin");
25  eleEtaMax_ = iConfig.getParameter<double>("eleEtaMax");
26  muonPtMin_ = iConfig.getParameter<double>("muonPtMin");
27  muonEtaMax_ = iConfig.getParameter<double>("muonEtaMax");
28 
29  jetEtUncertaintyParameter0_ = iConfig.getParameter<double>("jetEtUncertaintyParameter0");
30  jetEtUncertaintyParameter1_ = iConfig.getParameter<double>("jetEtUncertaintyParameter1");
31  jetEtUncertaintyParameter2_ = iConfig.getParameter<double>("jetEtUncertaintyParameter2");
32  jetPhiUncertaintyParameter0_ = iConfig.getParameter<double>("jetPhiUncertaintyParameter0");
33  jetPhiUncertaintyParameter1_ = iConfig.getParameter<double>("jetPhiUncertaintyParameter1");
34  jetPhiUncertaintyParameter2_ = iConfig.getParameter<double>("jetPhiUncertaintyParameter2");
35 
36  eleEtUncertaintyParameter0_ = iConfig.getParameter<double>("eleEtUncertaintyParameter0");
37  elePhiUncertaintyParameter0_ = iConfig.getParameter<double>("elePhiUncertaintyParameter0");
38 
39  muonEtUncertaintyParameter0_ = iConfig.getParameter<double>("muonEtUncertaintyParameter0");
40  muonPhiUncertaintyParameter0_ = iConfig.getParameter<double>("muonPhiUncertaintyParameter0");
41 
42  CaloTowerTag_ = iConfig.getParameter<edm::InputTag>("CaloTowerTag");
43  noHF_ = iConfig.getParameter<bool>("noHF");
44 
45  // muonCalo_ = iConfig.getParameter<bool>("muonCalo");
46  towerEtThreshold_ = iConfig.getParameter<double>("towerEtThreshold");
47  useHO_ = iConfig.getParameter<bool>("useHO");
48 
50 
51  produces<pat::MHTCollection>();
52 }

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_.

◆ ~PATMHTProducer()

PATMHTProducer::~PATMHTProducer ( )
override

Definition at line 54 of file PATMHTProducer.cc.

54 {}

Member Function Documentation

◆ getElectrons()

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

Definition at line 197 of file PATMHTProducer.cc.

197  {
198  std::string objectname = "electron";
199 
200  double number_of_electrons_ = 0.0;
201 
202  // edm::ESHandle<CaloTowerConstituentsMap> cttopo;
203  // iSetup.get<HcalRecNumberingRecord>().get(cttopo);
204  // const CaloTowerConstituentsMap* caloTowerMap = cttopo.product();
205 
206  edm::Handle<edm::View<pat::Electron> > electronHandle;
207  iEvent.getByToken(eleToken_, electronHandle);
208  edm::View<pat::Electron> electrons = *electronHandle;
209 
210  // Fill Input Vector with Electrons
211  for (edm::View<pat::Electron>::const_iterator electron_iter = electrons.begin(); electron_iter != electrons.end();
212  ++electron_iter) {
213  // Select electrons
214  if (electron_iter->et() < elePtMin_ || TMath::Abs(electron_iter->eta()) > eleEtaMax_)
215  continue;
216 
217  if (verbose_ == 3.) {
218  std::cout << "electron pt = " << electron_iter->pt() << " eta : " << electron_iter->eta() << std::endl;
219  }
220 
221  double electron_et = electron_iter->et();
222  double electron_phi = electron_iter->phi();
223 
224  double sigma_et, sigma_phi;
225 
227  sigma_et = eleUncertainty.etUncertainty->Eval(electron_et);
228  sigma_phi = eleUncertainty.phiUncertainty->Eval(electron_et);
229  } else {
230  sigma_et = 0.0; //electron_iter->resolutionEt();
231  sigma_phi = 0.0; // electron_iter->resolutionPhi();
232  }
233 
234  if (verbose_ == 3.) {
235  std::cout << "electron sigma_et : " << sigma_et << ", electron sigma_phi : " << sigma_phi << std::endl;
236  }
237 
238  if (sigma_et < 0 || sigma_phi < 0)
239  edm::LogWarning("PATMHTProducer") << " uncertainties for " << objectname << " are (et, phi): " << sigma_et << ","
240  << sigma_phi << " (et,phi): " << electron_et << "," << electron_phi;
241 
242  if (uncertaintyScaleFactor_ != 1.0) {
243  sigma_et = sigma_et * uncertaintyScaleFactor_;
244  sigma_phi = sigma_phi * uncertaintyScaleFactor_;
245  }
246 
247  metsig::SigInputObj tmp_electron(objectname, electron_et, electron_phi, sigma_et, sigma_phi);
248  physobjvector_.push_back(tmp_electron);
249  number_of_electrons_++;
250 
251  //-- Store tower DetId's to be removed from Calo Tower sum later --//
252  /*
253  const reco::SuperCluster& eleSC = *( electron_iter->superCluster() );
254 
255  std::vector<DetId> v_eleDetIds = eleSC.getHitsByDetId();
256 
257  //-- Convert cells to calo towers and add to set --//
258  for( std::vector<DetId>::iterator cellId = v_eleDetIds.begin();
259  cellId != v_eleDetIds.end();
260  cellId++) {
261 
262  CaloTowerDetId towerId = caloTowerMap->towerOf(*cellId);
263  if (towerId != nullDetId) {
264  //std::cout << ">>> electron towerId: " << towerId << std::endl;
265  std::pair<std::_Rb_tree_const_iterator<CaloTowerDetId>,bool> p1 = s_clusteredTowers.insert(towerId);
266  }
267  else
268  std::cerr<<"No matching tower found for electron cell!\n";
269  }
270 
271  */
272  }
273 
274  return number_of_electrons_;
275 }

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

◆ getJets()

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

Definition at line 117 of file PATMHTProducer.cc.

117  {
118  std::string objectname = "jet";
119 
120  double number_of_jets_ = 0.0;
121 
123  iEvent.getByToken(jetToken_, jetHandle);
124  edm::View<pat::Jet> jets = *jetHandle;
125 
126  // Fill Input Vector with Jets
127  for (edm::View<pat::Jet>::const_iterator jet_iter = jets.begin(); jet_iter != jets.end(); ++jet_iter) {
128  if ((jet_iter->pt() < jetPtMin_) || (TMath::Abs(jet_iter->eta()) > jetEtaMax_) ||
129  (jet_iter->emEnergyFraction() > jetEMfracMax_))
130  continue;
131 
132  double jet_et = jet_iter->et();
133  double jet_phi = jet_iter->phi();
134 
135  if (verbose_ == 3.) {
136  std::cout << "jet pt : " << jet_iter->pt() << " eta : " << jet_iter->eta()
137  << " EMF: " << jet_iter->emEnergyFraction() << std::endl;
138  }
139 
140  double sigma_et, sigma_phi;
141 
143  sigma_et = jetUncertainty.etUncertainty->Eval(jet_et);
144  sigma_phi = jetUncertainty.phiUncertainty->Eval(jet_et);
145  } else {
146  sigma_et = 0.0; // jet_iter->resolutionEt();
147  sigma_phi = 0.0; //jet_iter->resolutionPhi();
148  }
149 
150  if (verbose_ == 3.) {
151  std::cout << "jet sigma_et : " << sigma_et << ", jet sigma_phi : " << sigma_phi << std::endl;
152  }
153 
154  if (sigma_et <= 0 || sigma_phi <= 0)
155  edm::LogWarning("PATMHTProducer") << " uncertainties for " << objectname << " are (et, phi): " << sigma_et << ","
156  << sigma_phi << " (et,phi): " << jet_et << "," << jet_phi;
157  // try to read out the jet resolution from the root file at PatUtils
158  //-- Store jet for Significance Calculation --//
159 
160  if (uncertaintyScaleFactor_ != 1.0) {
161  sigma_et = sigma_et * uncertaintyScaleFactor_;
162  sigma_phi = sigma_phi * uncertaintyScaleFactor_;
163  // edm::LogWarning("PATMHTProducer") << " using uncertainty scale factor: " << uncertaintyScaleFactor_ <<
164  //" , uncertainties for " << objectname <<" changed to (et, phi): " << sigma_et << "," << sigma_phi;
165  }
166 
167  if (verbose_ == 101.) { // Study the Jets behavior
168 
169  std::cout << "v101> " << number_of_jets_ << " " << jet_et << " " << sigma_et << " " << jet_phi << " "
170  << sigma_phi << std::endl;
171  }
172 
173  metsig::SigInputObj tmp_jet(objectname, jet_et, jet_phi, sigma_et, sigma_phi);
174  physobjvector_.push_back(tmp_jet);
175  number_of_jets_++;
176 
177  //-- Store tower DetId's to be removed from Calo Tower sum later --//
178  std::vector<CaloTowerPtr> v_towers = jet_iter->getCaloConstituents();
179  //std::cout << "tower size = " << v_towers.size() << std::endl;
180 
181  for (unsigned int ii = 0; ii < v_towers.size(); ii++) {
182  s_clusteredTowers.insert((*v_towers.at(ii)).id());
183  //std::cout << "tower id = " << (*v_towers.at(ii)).id() << std::endl;
184  }
185  }
186 
187  if (verbose_ == 101.) { // Study the Jets behavior - seperate events
188  std::cout << "v101> --------------------------------------------" << std::endl;
189  }
190 
191  return number_of_jets_;
192 }

References Abs(), gather_cfg::cout, iEvent, cuy::ii, singleTopDQM_cfi::jets, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ getMuons()

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

Definition at line 281 of file PATMHTProducer.cc.

281  {
282  std::string objectname = "muon";
284  iEvent.getByToken(muoToken_, muonHandle);
285  edm::View<pat::Muon> muons = *muonHandle;
286 
287  if (!muonHandle.isValid()) {
288  std::cout << ">>> PATMHTSelector not valid muon Handle!" << std::endl;
289  return 0.0;
290  }
291 
292  double number_of_muons_ = 0.0;
293 
294  for (edm::View<pat::Muon>::const_iterator muon_iter = muons.begin(); muon_iter != muons.end(); ++muon_iter) {
295  if (muon_iter->pt() < muonPtMin_ || TMath::Abs(muon_iter->eta()) > muonEtaMax_)
296  continue;
297 
298  if (verbose_ == 3.) {
299  std::cout << "muon pt = " << muon_iter->pt() << " eta : " << muon_iter->eta() << std::endl;
300  }
301 
302  double muon_pt = muon_iter->pt();
303  double muon_phi = muon_iter->phi();
304 
305  double sigma_et, sigma_phi;
306 
308  sigma_et = muonUncertainty.etUncertainty->Eval(muon_pt);
309  sigma_phi = muonUncertainty.phiUncertainty->Eval(muon_pt);
310  } else {
311  sigma_et = 0.0; //muon_iter->resolutionEt();
312  sigma_phi = 0.0; // muon_iter->resolutionPhi();
313  }
314 
315  if (verbose_ == 3.) {
316  std::cout << "muon sigma_et : " << sigma_et << ", muon sigma_phi : " << sigma_phi << std::endl;
317  }
318 
319  if (sigma_et < 0 || sigma_phi < 0)
320  edm::LogWarning("PATMHTProducer") << " uncertainties for " << objectname << " are (et, phi): " << sigma_et << ","
321  << sigma_phi << " (pt,phi): " << muon_pt << "," << muon_phi;
322 
323  if (uncertaintyScaleFactor_ != 1.0) {
324  sigma_et = sigma_et * uncertaintyScaleFactor_;
325  sigma_phi = sigma_phi * uncertaintyScaleFactor_;
326  }
327 
328  metsig::SigInputObj tmp_muon(objectname, muon_pt, muon_phi, sigma_et, sigma_phi);
329  physobjvector_.push_back(tmp_muon);
330  number_of_muons_++;
331 
332  } // end Muon loop
333 
334  return number_of_muons_;
335 }

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

◆ 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 56 of file PATMHTProducer.cc.

56  {
57  // make sure the SigInputObj container is empty
58  while (!physobjvector_.empty()) {
59  physobjvector_.erase(physobjvector_.begin(), physobjvector_.end());
60  }
61 
62  // Clean the clustered towers
63  s_clusteredTowers.clear();
64 
65  double number_of_jets = getJets(iEvent, iSetup);
66 
67  double number_of_electrons = getElectrons(iEvent, iSetup);
68 
69  double number_of_muons = getMuons(iEvent, iSetup);
70 
71  if (verbose_ == 1.) {
72  std::cout << ">>>---> Number of jets: " << number_of_jets << std::endl;
73  std::cout << ">>>---> Number of electrons: " << number_of_jets << std::endl;
74  std::cout << ">>>---> Number of muons: " << number_of_muons << std::endl;
75  }
76 
77  double met_x = 0;
78  double met_y = 0;
79  double met_et = 0;
80  double met_phi = 0;
81  double met_set = 0;
82 
83  auto themetsigcoll = std::make_unique<pat::MHTCollection>();
84 
85  if (!physobjvector_.empty()) { // Only when the vector is not empty
86 
87  // calculate the MHT significance
88 
89  metsig::significanceAlgo signifAlgo;
90  signifAlgo.addObjects(physobjvector_);
91  double significance = signifAlgo.significance(met_et, met_phi, met_set);
92 
93  met_x = met_et * cos(met_phi);
94  met_y = met_et * sin(met_phi);
95 
96  if (verbose_ == 1.) {
97  std::cout << ">>>----> MHT Sgificance = " << significance << std::endl;
98  }
99 
100  pat::MHT themetsigobj(reco::Particle::LorentzVector(met_x, met_y, 0, met_et), met_set, significance);
101 
102  // Store the number of jets, electrons, muons
103  themetsigobj.setNumberOfJets(number_of_jets);
104  themetsigobj.setNumberOfElectrons(number_of_electrons);
105  themetsigobj.setNumberOfMuons(number_of_muons);
106 
107  themetsigcoll->push_back(themetsigobj);
108 
109  } // If the vector is empty, just put empty product.
110 
111  iEvent.put(std::move(themetsigcoll));
112 }

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().

◆ setUncertaintyParameters()

void PATMHTProducer::setUncertaintyParameters ( )
private

Definition at line 338 of file PATMHTProducer.cc.

338  {
339  // set the various functions here:
340 
341  //-- For Et functions, [0]= par_n, [1]=par_s, [2]= par_c ---//
342  //-- Ecal Uncertainty Functions ------------------------------------//
343  //-- From: FastSimulation/Calorimetry/data/HcalResponse.cfi --//
344  //-- Ecal Barrel --//
346  std::make_unique<TF1>("ecalEBEtFunc", "x*sqrt(([0]*[0]/(x*x))+([1]*[1]/x)+([2]*[2]))", 3);
347  ecalEBUncertainty.etUncertainty->SetParameter(0, 0.2);
348  ecalEBUncertainty.etUncertainty->SetParameter(1, 0.03);
349  ecalEBUncertainty.etUncertainty->SetParameter(2, 0.005);
350 
351  ecalEBUncertainty.phiUncertainty = std::make_unique<TF1>("ecalEBphiFunc", "[0]*x", 1);
352  ecalEBUncertainty.phiUncertainty->SetParameter(0, 0.0174);
353 
354  //-- Ecal Endcap --//
356  std::make_unique<TF1>("ecalEEEtFunc", "x*sqrt(([0]*[0]/(x*x))+([1]*[1]/x)+([2]*[2]))", 3);
357  ecalEEUncertainty.etUncertainty->SetParameter(0, 0.2);
358  ecalEEUncertainty.etUncertainty->SetParameter(1, 0.03);
359  ecalEEUncertainty.etUncertainty->SetParameter(2, 0.005);
360 
361  ecalEEUncertainty.phiUncertainty = std::make_unique<TF1>("ecalEEphiFunc", "[0]*x", 1);
362  ecalEEUncertainty.phiUncertainty->SetParameter(0, 0.087);
363 
364  //-- Hcal Uncertainty Functions --------------------------------------//
365  //-- From: FastSimulation/Calorimetry/data/HcalResponse.cfi --//
366  //-- Hcal Barrel --//
368  std::make_unique<TF1>("hcalHBEtFunc", "x*sqrt(([0]*[0]/(x*x))+([1]*[1]/x)+([2]*[2]))", 3);
369  hcalHBUncertainty.etUncertainty->SetParameter(0, 0.);
370  hcalHBUncertainty.etUncertainty->SetParameter(1, 1.22);
371  hcalHBUncertainty.etUncertainty->SetParameter(2, 0.05);
372 
373  hcalHBUncertainty.phiUncertainty = std::make_unique<TF1>("ecalHBphiFunc", "[0]*x", 1);
374  hcalHBUncertainty.phiUncertainty->SetParameter(0, 0.087);
375 
376  //-- Hcal Endcap --//
378  std::make_unique<TF1>("hcalHEEtFunc", "x*sqrt(([0]*[0]/(x*x))+([1]*[1]/x)+([2]*[2]))", 3);
379  hcalHEUncertainty.etUncertainty->SetParameter(0, 0.);
380  hcalHEUncertainty.etUncertainty->SetParameter(1, 1.3);
381  hcalHEUncertainty.etUncertainty->SetParameter(2, 0.05);
382 
383  hcalHEUncertainty.phiUncertainty = std::make_unique<TF1>("ecalHEphiFunc", "[0]*x", 1);
384  hcalHEUncertainty.phiUncertainty->SetParameter(0, 0.087);
385 
386  //-- Hcal Outer --//
388  std::make_unique<TF1>("hcalHOEtFunc", "x*sqrt(([0]*[0]/(x*x))+([1]*[1]/x)+([2]*[2]))", 3);
389  hcalHOUncertainty.etUncertainty->SetParameter(0, 0.);
390  hcalHOUncertainty.etUncertainty->SetParameter(1, 1.82);
391  hcalHOUncertainty.etUncertainty->SetParameter(2, 0.09);
392 
393  hcalHOUncertainty.phiUncertainty = std::make_unique<TF1>("ecalHOphiFunc", "[0]*x", 1);
394  hcalHOUncertainty.phiUncertainty->SetParameter(0, 0.087);
395 
396  //-- Hcal Forward --//
398  std::make_unique<TF1>("hcalHFEtFunc", "x*sqrt(([0]*[0]/(x*x))+([1]*[1]/x)+([2]*[2]))", 3);
399  hcalHFUncertainty.etUncertainty->SetParameter(0, 0.);
400  hcalHFUncertainty.etUncertainty->SetParameter(1, 1.82);
401  hcalHFUncertainty.etUncertainty->SetParameter(2, 0.09);
402 
403  hcalHFUncertainty.phiUncertainty = std::make_unique<TF1>("ecalHFphiFunc", "[0]*x", 1);
404  hcalHFUncertainty.phiUncertainty->SetParameter(0, 0.174);
405 
406  //--- Jet Uncertainty Functions --------------------------------------//
407  jetUncertainty.etUncertainty = std::make_unique<TF1>("jetEtFunc", "x*sqrt(([0]*[0]/(x*x))+([1]*[1]/x)+([2]*[2]))", 3);
408  //-- values from PTDR 1, ch 11.4 --//
412 
413  //-- phi value from our own fits --//
414  //jetUncertainty.phiUncertainty.reset( new TF1("jetPhiFunc","[0]*x",1) );
415  //jetUncertainty.phiUncertainty->SetParameter(0, jetPhiUncertaintyParameter0_);
416 
417  //-- phi Functions and values from
418  // http://indico.cern.ch/getFile.py/access?contribId=9&sessionId=0&resId=0&materialId=slides&confId=46394
420  std::make_unique<TF1>("jetPhiFunc", "x*sqrt(([0]*[0]/(x*x))+([1]*[1]/x)+([2]*[2]))", 3);
424 
425  //-- Jet corrections are assumed not to have an error --//
426  /*jetCorrUncertainty.etUncertainty.reset( new TF1("jetCorrEtFunc","[0]*x",1) );
427  jetCorrUncertainty.etUncertainty->SetParameter(0,0.0);
428  jetCorrUncertainty.phiUncertainty.reset( new TF1("jetCorrPhiFunc","[0]*x",1) );
429  jetCorrUncertainty.phiUncertainty->SetParameter(0,0.0*(3.14159/180.));*/
430 
431  //--- Electron Uncertainty Functions ---------------------------------//
432  // completely ambiguious values for electron-like jets...
433  // the egamma group keeps track of these here:
434  // https://twiki.cern.ch/twiki/bin/view/CMS/EgammaCMSSWVal
435  // electron resolution in energy is around 3.4%, measured for 10 < pT < 50 at realistic events with pile-up.
436 
437  eleUncertainty.etUncertainty = std::make_unique<TF1>("eleEtFunc", "[0] * x", 1);
438  // eleUncertainty.etUncertainty->SetParameter(0,0.034);
440 
441  eleUncertainty.phiUncertainty = std::make_unique<TF1>("elePhiFunc", "[0] * x", 1);
442  // eleUncertainty.phiUncertainty->SetParameter(0,1*(3.14159/180.));
444 
445  //--- Muon Uncertainty Functions ------------------------------------//
446  // and ambiguious values for the muons...
447 
448  muonUncertainty.etUncertainty = std::make_unique<TF1>("muonEtFunc", "[0] * x", 1);
449  // muonUncertainty.etUncertainty->SetParameter(0,0.01);
451  muonUncertainty.phiUncertainty = std::make_unique<TF1>("muonPhiFunc", "[0] * x", 1);
452  // muonUncertainty.phiUncertainty->SetParameter(0,1*(3.14159/180.));
454 
455  //-- Muon calo deposites are assumed not to have an error --//
456  /*muonCorrUncertainty.etUncertainty.reset( new TF1("muonCorrEtFunc","[0] * x",1) );
457  muonCorrUncertainty.etUncertainty->SetParameter(0,0.0);
458  muonCorrUncertainty.phiUncertainty.reset( new TF1("muonCorrPhiFunc","[0] * x",1) );
459  muonCorrUncertainty.phiUncertainty->SetParameter(0,0.0*(3.14159/180.)); */
460 }

Referenced by PATMHTProducer().

Member Data Documentation

◆ CaloJetAlgorithmTag_

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

Definition at line 153 of file PATMHTProducer.h.

◆ CaloTowerTag_

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

Definition at line 158 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ controlledUncertainty_

bool pat::PATMHTProducer::controlledUncertainty_
private

Definition at line 88 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ CorJetAlgorithmTag_

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

Definition at line 154 of file PATMHTProducer.h.

◆ ecalEBUncertainty

uncertaintyFunctions pat::PATMHTProducer::ecalEBUncertainty
private

Definition at line 99 of file PATMHTProducer.h.

◆ ecalEEUncertainty

uncertaintyFunctions pat::PATMHTProducer::ecalEEUncertainty
private

Definition at line 100 of file PATMHTProducer.h.

◆ ElectronTag_

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

Definition at line 157 of file PATMHTProducer.h.

◆ eleEtaMax_

double pat::PATMHTProducer::eleEtaMax_
private

Definition at line 127 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ eleEtUncertaintyParameter0_

double pat::PATMHTProducer::eleEtUncertaintyParameter0_
private

Definition at line 147 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ elePhiUncertaintyParameter0_

double pat::PATMHTProducer::elePhiUncertaintyParameter0_
private

Definition at line 148 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ elePtMin_

double pat::PATMHTProducer::elePtMin_
private

Definition at line 126 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ eleToken_

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

Definition at line 80 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ eleUncertainty

uncertaintyFunctions pat::PATMHTProducer::eleUncertainty
private

Definition at line 108 of file PATMHTProducer.h.

◆ hcalHBUncertainty

uncertaintyFunctions pat::PATMHTProducer::hcalHBUncertainty
private

Definition at line 101 of file PATMHTProducer.h.

◆ hcalHEUncertainty

uncertaintyFunctions pat::PATMHTProducer::hcalHEUncertainty
private

Definition at line 102 of file PATMHTProducer.h.

◆ hcalHFUncertainty

uncertaintyFunctions pat::PATMHTProducer::hcalHFUncertainty
private

Definition at line 104 of file PATMHTProducer.h.

◆ hcalHOUncertainty

uncertaintyFunctions pat::PATMHTProducer::hcalHOUncertainty
private

Definition at line 103 of file PATMHTProducer.h.

◆ JetCorrectionService_

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

Definition at line 155 of file PATMHTProducer.h.

◆ jetCorrUncertainty

uncertaintyFunctions pat::PATMHTProducer::jetCorrUncertainty
private

Definition at line 107 of file PATMHTProducer.h.

◆ jetEMfracMax_

double pat::PATMHTProducer::jetEMfracMax_
private

Definition at line 124 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ jetEtaMax_

double pat::PATMHTProducer::jetEtaMax_
private

Definition at line 123 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ jetEtUncertaintyParameter0_

double pat::PATMHTProducer::jetEtUncertaintyParameter0_
private

Definition at line 139 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ jetEtUncertaintyParameter1_

double pat::PATMHTProducer::jetEtUncertaintyParameter1_
private

Definition at line 140 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ jetEtUncertaintyParameter2_

double pat::PATMHTProducer::jetEtUncertaintyParameter2_
private

Definition at line 141 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ jetPhiUncertaintyParameter0_

double pat::PATMHTProducer::jetPhiUncertaintyParameter0_
private

Definition at line 143 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ jetPhiUncertaintyParameter1_

double pat::PATMHTProducer::jetPhiUncertaintyParameter1_
private

Definition at line 144 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ jetPhiUncertaintyParameter2_

double pat::PATMHTProducer::jetPhiUncertaintyParameter2_
private

Definition at line 145 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ jetPtMin_

double pat::PATMHTProducer::jetPtMin_
private

Definition at line 122 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ jetToken_

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

Definition at line 79 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ jetUncertainty

uncertaintyFunctions pat::PATMHTProducer::jetUncertainty
private

Definition at line 106 of file PATMHTProducer.h.

◆ metCollectionLabel_

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

Definition at line 159 of file PATMHTProducer.h.

◆ mhtLabel_

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

Definition at line 78 of file PATMHTProducer.h.

◆ muonChiSqMax_

double pat::PATMHTProducer::muonChiSqMax_
private

Definition at line 135 of file PATMHTProducer.h.

◆ muonCorrUncertainty

uncertaintyFunctions pat::PATMHTProducer::muonCorrUncertainty
private

Definition at line 110 of file PATMHTProducer.h.

◆ muonDPtMax_

double pat::PATMHTProducer::muonDPtMax_
private

Definition at line 134 of file PATMHTProducer.h.

◆ muonEtaMax_

double pat::PATMHTProducer::muonEtaMax_
private

Definition at line 130 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ muonEtUncertaintyParameter0_

double pat::PATMHTProducer::muonEtUncertaintyParameter0_
private

Definition at line 150 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ muonNHitsMin_

int pat::PATMHTProducer::muonNHitsMin_
private

Definition at line 133 of file PATMHTProducer.h.

◆ muonPhiUncertaintyParameter0_

double pat::PATMHTProducer::muonPhiUncertaintyParameter0_
private

Definition at line 151 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ muonPtMin_

double pat::PATMHTProducer::muonPtMin_
private

Definition at line 129 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ MuonTag_

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

Definition at line 156 of file PATMHTProducer.h.

◆ muonTrackD0Max_

double pat::PATMHTProducer::muonTrackD0Max_
private

Definition at line 131 of file PATMHTProducer.h.

◆ muonTrackDzMax_

double pat::PATMHTProducer::muonTrackDzMax_
private

Definition at line 132 of file PATMHTProducer.h.

◆ muonUncertainty

uncertaintyFunctions pat::PATMHTProducer::muonUncertainty
private

Definition at line 109 of file PATMHTProducer.h.

◆ muoToken_

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

Definition at line 81 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ noHF_

bool pat::PATMHTProducer::noHF_
private

Definition at line 120 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ phoToken_

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

Definition at line 83 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ physobjvector_

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

Definition at line 85 of file PATMHTProducer.h.

◆ s_clusteredTowers

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

Definition at line 118 of file PATMHTProducer.h.

◆ significanceLabel_

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

Definition at line 160 of file PATMHTProducer.h.

◆ tauToken_

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

Definition at line 82 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ towerEtThreshold_

double pat::PATMHTProducer::towerEtThreshold_
private

Definition at line 166 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ uncertaintyScaleFactor_

double pat::PATMHTProducer::uncertaintyScaleFactor_
private

Definition at line 87 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ useCaloTowers_

bool pat::PATMHTProducer::useCaloTowers_
private

Definition at line 114 of file PATMHTProducer.h.

◆ useElectrons_

bool pat::PATMHTProducer::useElectrons_
private

Definition at line 116 of file PATMHTProducer.h.

◆ useHO_

bool pat::PATMHTProducer::useHO_
private

Definition at line 167 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

◆ useJets_

bool pat::PATMHTProducer::useJets_
private

Definition at line 115 of file PATMHTProducer.h.

◆ useMuons_

bool pat::PATMHTProducer::useMuons_
private

Definition at line 117 of file PATMHTProducer.h.

◆ verbose_

double pat::PATMHTProducer::verbose_
private

Definition at line 75 of file PATMHTProducer.h.

Referenced by PATMHTProducer().

pat::PATMHTProducer::hcalHFUncertainty
uncertaintyFunctions hcalHFUncertainty
Definition: PATMHTProducer.h:104
pat::PATMHTProducer::eleToken_
edm::EDGetTokenT< edm::View< pat::Electron > > eleToken_
Definition: PATMHTProducer.h:80
pat::PATMHTProducer::controlledUncertainty_
bool controlledUncertainty_
Definition: PATMHTProducer.h:88
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
pat::PATMHTProducer::getMuons
double getMuons(edm::Event &, const edm::EventSetup &)
Definition: PATMHTProducer.cc:281
pat::PATMHTProducer::jetToken_
edm::EDGetTokenT< edm::View< pat::Jet > > jetToken_
Definition: PATMHTProducer.h:79
pat::PATMHTProducer::muonPtMin_
double muonPtMin_
Definition: PATMHTProducer.h:129
pat::PATMHTProducer::muonUncertainty
uncertaintyFunctions muonUncertainty
Definition: PATMHTProducer.h:109
pat::PATMHTProducer::jetEtUncertaintyParameter0_
double jetEtUncertaintyParameter0_
Definition: PATMHTProducer.h:139
pat::PATMHTProducer::jetUncertainty
uncertaintyFunctions jetUncertainty
Definition: PATMHTProducer.h:106
pat::PATMHTProducer::phoToken_
edm::EDGetTokenT< edm::View< pat::Photon > > phoToken_
Definition: PATMHTProducer.h:83
gather_cfg.cout
cout
Definition: gather_cfg.py:144
pat::PATMHTProducer::physobjvector_
std::vector< metsig::SigInputObj > physobjvector_
Definition: PATMHTProducer.h:85
pat::PATMHTProducer::useHO_
bool useHO_
Definition: PATMHTProducer.h:167
pat::PATMHTProducer::jetPhiUncertaintyParameter0_
double jetPhiUncertaintyParameter0_
Definition: PATMHTProducer.h:143
pat::PATMHTProducer::jetPtMin_
double jetPtMin_
Definition: PATMHTProducer.h:122
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
edm::Handle
Definition: AssociativeIterator.h:50
pat::PATMHTProducer::ecalEEUncertainty
uncertaintyFunctions ecalEEUncertainty
Definition: PATMHTProducer.h:100
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
pat::PATMHTProducer::towerEtThreshold_
double towerEtThreshold_
Definition: PATMHTProducer.h:166
pat::PATMHTProducer::jetEtUncertaintyParameter1_
double jetEtUncertaintyParameter1_
Definition: PATMHTProducer.h:140
pat::PATMHTProducer::elePhiUncertaintyParameter0_
double elePhiUncertaintyParameter0_
Definition: PATMHTProducer.h:148
reco::Particle::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
metsig::significanceAlgo::addObjects
const void addObjects(const std::vector< metsig::SigInputObj > &EventVec)
Definition: significanceAlgo.cc:109
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs
T Abs(T a)
Definition: MathUtil.h:49
pat::PATMHTProducer::uncertaintyFunctions::phiUncertainty
std::unique_ptr< TF1 > phiUncertainty
Definition: PATMHTProducer.h:95
pat::PATMHTProducer::jetPhiUncertaintyParameter2_
double jetPhiUncertaintyParameter2_
Definition: PATMHTProducer.h:145
pat::PATMHTProducer::eleUncertainty
uncertaintyFunctions eleUncertainty
Definition: PATMHTProducer.h:108
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
pat::PATMHTProducer::getElectrons
double getElectrons(edm::Event &, const edm::EventSetup &)
Definition: PATMHTProducer.cc:197
pat::PATMHTProducer::jetEtaMax_
double jetEtaMax_
Definition: PATMHTProducer.h:123
edm::View
Definition: CaloClusterFwd.h:14
pat::PATMHTProducer::verbose_
double verbose_
Definition: PATMHTProducer.h:75
pat::PATMHTProducer::muoToken_
edm::EDGetTokenT< edm::View< pat::Muon > > muoToken_
Definition: PATMHTProducer.h:81
pat::PATMHTProducer::elePtMin_
double elePtMin_
Definition: PATMHTProducer.h:126
pat::PATMHTProducer::getJets
double getJets(edm::Event &, const edm::EventSetup &)
Definition: PATMHTProducer.cc:117
pat::PATMHTProducer::hcalHEUncertainty
uncertaintyFunctions hcalHEUncertainty
Definition: PATMHTProducer.h:102
pat::PATMHTProducer::tauToken_
edm::EDGetTokenT< edm::View< pat::Tau > > tauToken_
Definition: PATMHTProducer.h:82
iEvent
int iEvent
Definition: GenABIO.cc:224
pat::PATMHTProducer::eleEtUncertaintyParameter0_
double eleEtUncertaintyParameter0_
Definition: PATMHTProducer.h:147
metsig::significanceAlgo::significance
const double significance(double &met_r, double &met_phi, double &met_set)
Definition: significanceAlgo.cc:139
pat::PATMHTProducer::s_clusteredTowers
std::set< CaloTowerDetId > s_clusteredTowers
Definition: PATMHTProducer.h:118
pat::PATMHTProducer::CaloTowerTag_
edm::InputTag CaloTowerTag_
Definition: PATMHTProducer.h:158
pat::PATMHTProducer::uncertaintyFunctions::etUncertainty
std::unique_ptr< TF1 > etUncertainty
Definition: PATMHTProducer.h:94
pat::PATMHTProducer::hcalHBUncertainty
uncertaintyFunctions hcalHBUncertainty
Definition: PATMHTProducer.h:101
pat::PATMHTProducer::jetEtUncertaintyParameter2_
double jetEtUncertaintyParameter2_
Definition: PATMHTProducer.h:141
eostools.move
def move(src, dest)
Definition: eostools.py:511
pwdgSkimBPark_cfi.electrons
electrons
Definition: pwdgSkimBPark_cfi.py:6
metsig::significanceAlgo
Definition: significanceAlgo.h:86
pat::PATMHTProducer::ecalEBUncertainty
uncertaintyFunctions ecalEBUncertainty
Definition: PATMHTProducer.h:99
pat::PATMHTProducer::hcalHOUncertainty
uncertaintyFunctions hcalHOUncertainty
Definition: PATMHTProducer.h:103
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
pat::PATMHTProducer::setUncertaintyParameters
void setUncertaintyParameters()
Definition: PATMHTProducer.cc:338
pat::PATMHTProducer::jetEMfracMax_
double jetEMfracMax_
Definition: PATMHTProducer.h:124
pat::PATMHTProducer::jetPhiUncertaintyParameter1_
double jetPhiUncertaintyParameter1_
Definition: PATMHTProducer.h:144
pat::MHT
Definition: MHT.h:9
pat::PATMHTProducer::muonPhiUncertaintyParameter0_
double muonPhiUncertaintyParameter0_
Definition: PATMHTProducer.h:151
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
pat::PATMHTProducer::muonEtaMax_
double muonEtaMax_
Definition: PATMHTProducer.h:130
cuy.ii
ii
Definition: cuy.py:590
edm::InputTag
Definition: InputTag.h:15
metsig::SigInputObj
Definition: SigInputObj.h:29
pat::PATMHTProducer::eleEtaMax_
double eleEtaMax_
Definition: PATMHTProducer.h:127
pat::PATMHTProducer::noHF_
bool noHF_
Definition: PATMHTProducer.h:120
met_cff.significance
significance
Definition: met_cff.py:18
pat::PATMHTProducer::muonEtUncertaintyParameter0_
double muonEtUncertaintyParameter0_
Definition: PATMHTProducer.h:150
pat::PATMHTProducer::uncertaintyScaleFactor_
double uncertaintyScaleFactor_
Definition: PATMHTProducer.h:87