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 hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () 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 6 of file PATMHTProducer.cc.

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

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

52 {}

Member Function Documentation

◆ getElectrons()

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

Definition at line 195 of file PATMHTProducer.cc.

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

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

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

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

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

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

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

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

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

References tools::TF1.

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:279
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
tools.TF1
TF1
Definition: tools.py:23
edm::Handle
Definition: AssociativeIterator.h:50
pat::PATMHTProducer::ecalEEUncertainty
uncertaintyFunctions ecalEEUncertainty
Definition: PATMHTProducer.h:100
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:195
edm::LogWarning
Definition: MessageLogger.h:141
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:115
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
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
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::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:336
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:19
pat::PATMHTProducer::muonEtUncertaintyParameter0_
double muonEtUncertaintyParameter0_
Definition: PATMHTProducer.h:150
pat::PATMHTProducer::uncertaintyScaleFactor_
double uncertaintyScaleFactor_
Definition: PATMHTProducer.h:87