ATLAS Offline Software
METSystematicsTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "TFile.h"
7 #include "TEnv.h"
8 #include "TSystem.h"
9 #include "TH3.h"
10 #include "TH2.h"
11 
12 #include <iostream>
15 
16 // xAOD includes
17 #include "xAODCore/ShallowCopy.h"
21 #include "xAODJet/Jet.h"
22 
23 namespace met {
24 
25  using namespace xAOD;
26 
28  static const SG::AuxElement::ConstAccessor< std::vector<iplink_t > > acc_constitObjLinks("ConstitObjectLinks");
29  static const SG::AuxElement::ConstAccessor< iplink_t > acc_originalObject("originalObjectLink");
30 
32  : asg::AsgTool::AsgTool(name)
33  {
34  ATH_MSG_DEBUG (__PRETTY_FUNCTION__ );
35 
37  }
38 
40  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__ );
41 
42  if(!m_configSoftTrkFile.empty()){
43  if( !(addAffectingSystematic( softTrkAffSyst::MET_SoftTrk_ScaleUp , true /*recommended */ ) &&
44  addAffectingSystematic( softTrkAffSyst::MET_SoftTrk_ScaleDown, true /*recommended */ ) &&
45  addAffectingSystematic( softTrkAffSyst::MET_SoftTrk_ResoPara , true /*recommended */ ) &&
46  addAffectingSystematic( softTrkAffSyst::MET_SoftTrk_ResoPerp , true /*recommended */ ) &&
47  addAffectingSystematic( softTrkAffSyst::MET_SoftTrk_ResoCorr , false /*not recommended */) ) ) {
48  ATH_MSG_ERROR("failed to properly add softTrk affecting systematics " );
49  return StatusCode::FAILURE;
50  }
51  }
52  if(!m_configSoftCaloFile.empty()){
53  if( !(addAffectingSystematic( softCaloAffSyst::MET_SoftCalo_ScaleUp , true ) &&
54  addAffectingSystematic( softCaloAffSyst::MET_SoftCalo_ScaleDown, true ) &&
55  addAffectingSystematic( softCaloAffSyst::MET_SoftCalo_ResoPara , true ) &&
56  addAffectingSystematic( softCaloAffSyst::MET_SoftCalo_ResoPerp , true ) &&
57  addAffectingSystematic( softCaloAffSyst::MET_SoftCalo_ResoCorr , false )) ) {
58  ATH_MSG_ERROR("failed to properly add softCalo affecting systematics " );
59  return StatusCode::FAILURE;
60  }
61  }
62  if(!m_configJetTrkFile.empty()){
63  if( !(addAffectingSystematic( jetTrkAffSyst::MET_JetTrk_ScaleUp , true /*recommended */ ) &&
64  addAffectingSystematic( jetTrkAffSyst::MET_JetTrk_ScaleDown, true /*recommended */ ) ) ){
65  ATH_MSG_ERROR("failed to properly add jetTrk affecting systematics " );
66  return StatusCode::FAILURE;
67  }
68  }
69 
70  ATH_MSG_INFO( "AffectingSystematics are:" );
71  for(const auto& syst : m_affectingSystematics) {
72  ATH_MSG_INFO( syst.name() );
73  }
74 
75  ATH_MSG_DEBUG("These systematics are set based on your config files: " );
76  ATH_MSG_DEBUG("ConfigSoftTrkFile: " << m_configSoftTrkFile );
77  ATH_MSG_DEBUG("ConfigSoftCaloFile: "<< m_configSoftCaloFile);
78  ATH_MSG_DEBUG("ConfigSoftJetFile: " << m_configJetTrkFile );
79 
80  return StatusCode::SUCCESS;
81  }
82 
84  {
85  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__ );
86  // ReadHandleKey(s)
87 
88  ATH_CHECK( m_VertexContKey.initialize() );
89  ATH_CHECK( m_TruthContKey.initialize() );
91 
92  const char lastchar = m_configPrefix.value().back();
93  if (lastchar != '/') {
94  m_configPrefix = m_configPrefix.value() + "/";
95  }
96 
97  if(m_configSoftTrkFile.empty() &&
98  m_configSoftCaloFile.empty() &&
99  m_configJetTrkFile.empty() ) ATH_MSG_WARNING("you have initialized the METSystematicsTool with no configuration file. The tool will do nothing. Please set the configuration file properties.");
100 
104 
106  }
107 
109  {
110  ATH_MSG_INFO("Doing SoftCalo systematics initialization. THIS IS FOR SOFTWARE DEVELOPMENT ONLY.");
111  ATH_MSG_INFO("CST IS NOT YET RECOMMENDED OR SUPPORTED BY THE MET GROUP.");
112 
113  std::string histfile = "";
114  std::string systpath = "";
115  std::string histpath = "";
116  std::string suffix = "";
117 
118  ATH_CHECK( extractHistoPath(histfile,systpath,histpath,suffix,SOFTCALO) );//properly sets the paths
119 
120  TFile infile(histpath.c_str());
121  m_calo_resoperp_pthard_njet_mu.reset(dynamic_cast<TH3D*>( infile.Get((systpath+"/resoperp_"+suffix).c_str()) ));
122  m_calo_resopara_pthard_njet_mu.reset(dynamic_cast<TH3D*>( infile.Get((systpath+"/resopara_"+suffix).c_str()) ));
123  m_calo_shiftpara_pthard_njet_mu.reset(dynamic_cast<TH3D*>( infile.Get((systpath+"/shiftpara_"+suffix).c_str())));
124 
128  ATH_MSG_ERROR("Could not get all calo histos from the config file:" << histfile );
129  return StatusCode::FAILURE;
130  }
131 
132  m_calo_resoperp_pthard_njet_mu ->SetDirectory(nullptr);
133  m_calo_resopara_pthard_njet_mu ->SetDirectory(nullptr);
134  m_calo_shiftpara_pthard_njet_mu->SetDirectory(nullptr);
135 
136  ATH_MSG_VERBOSE( __PRETTY_FUNCTION__ << " DONE!!" );
137  return StatusCode::SUCCESS;
138  }
139 
140 
142  {
143  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__);
144 
145  std::string histfile = "";
146  std::string gsystpath = "";
147  std::string configdir = "";
148  std::string blank = "";
149 
150  ATH_CHECK( extractHistoPath(histfile,gsystpath, configdir,blank , JETTRK) );//properly sets the paths
151 
152  TFile infile((configdir).c_str());
153 
154  m_jet_systRpt_pt_eta.reset(dynamic_cast<TH2D*>( infile.Get("jet_systRpt_pt_eta")));
155 
156  if( !m_jet_systRpt_pt_eta) {
157  ATH_MSG_ERROR("Could not get jet track histo from the config file:" << histfile);
158  return StatusCode::FAILURE;
159  }
160 
161  m_jet_systRpt_pt_eta->SetDirectory(nullptr);
162 
163  ATH_MSG_VERBOSE( __PRETTY_FUNCTION__ << " DONE!!");
164  return StatusCode::SUCCESS;
165  }
166 
167 
169  {
170 
171  std::string histfile = "";
172  std::string psystpath = "";
173  std::string histpath = "";
174  std::string suffix = "";
175 
176  ATH_CHECK( extractHistoPath(histfile,psystpath,histpath, suffix, SOFTTRK) );//properly sets the paths
177 
178  TFile infile(histpath.c_str());
179 
180  m_trk_resoperp_pthard_njet_mu.reset(dynamic_cast<TH3D*>( infile.Get((psystpath+"/resoperp_"+suffix).c_str()) ));
181  m_trk_resopara_pthard_njet_mu.reset(dynamic_cast<TH3D*>( infile.Get((psystpath+"/resopara_"+suffix).c_str()) ));
182  m_trk_shiftpara_pthard_njet_mu.reset(dynamic_cast<TH3D*>( infile.Get((psystpath+"/shiftpara_"+suffix).c_str())));
183 
187  ATH_MSG_ERROR("Could not get all track histos from the config file:" << histfile );
188  return StatusCode::FAILURE;
189  }
190 
191  m_trk_resoperp_pthard_njet_mu ->SetDirectory(nullptr);
192  m_trk_resopara_pthard_njet_mu ->SetDirectory(nullptr);
193  m_trk_shiftpara_pthard_njet_mu->SetDirectory(nullptr);
194 
195  ATH_MSG_VERBOSE( __PRETTY_FUNCTION__ <<" DONE!!");
196  return StatusCode::SUCCESS;
197  }
198 
199  StatusCode METSystematicsTool::sysApplySystematicVariation(const CP::SystematicSet& systSet){//this should already be filtered for MET systematics
200  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__ );
201  // Only a single systematic can be applied at a time:
202  // If at some point we can deal with multiple systematics, we will check here that the combination we are given will work
203 
205  if( systSet.empty() ) {
206  ATH_MSG_DEBUG("No affecting systematics received.");
207  return StatusCode::SUCCESS;
208  } else if( systSet.size() > 1 ) {
209  ATH_MSG_WARNING("Tool does not support multiple systematics, returning unsupported" );
210  return StatusCode::FAILURE;
211  }
212  CP::SystematicVariation systVar = *systSet.begin();
213  if ( systVar == CP::SystematicVariation("") ) m_appliedSystEnum = NONE ;
214  else if( systVar == softTrkAffSyst::MET_SoftTrk_ScaleUp) m_appliedSystEnum = MET_SOFTTRK_SCALEUP ;
215  else if( systVar == softTrkAffSyst::MET_SoftTrk_ScaleDown) m_appliedSystEnum = MET_SOFTTRK_SCALEDOWN ;
216  else if( systVar == softTrkAffSyst::MET_SoftTrk_ResoPara) m_appliedSystEnum = MET_SOFTTRK_RESOPARA ;
217  else if( systVar == softTrkAffSyst::MET_SoftTrk_ResoPerp) m_appliedSystEnum = MET_SOFTTRK_RESOPERP ;
218  else if( systVar == softTrkAffSyst::MET_SoftTrk_ResoCorr) m_appliedSystEnum = MET_SOFTTRK_RESOCORR ;
219  else if( systVar == softCaloAffSyst::MET_SoftCalo_ScaleUp) m_appliedSystEnum = MET_SOFTCALO_SCALEUP ;
220  else if( systVar == softCaloAffSyst::MET_SoftCalo_ScaleDown) m_appliedSystEnum = MET_SOFTCALO_SCALEDOWN;
221  else if( systVar == softCaloAffSyst::MET_SoftCalo_ResoPara) m_appliedSystEnum = MET_SOFTCALO_RESOPARA ;
222  else if( systVar == softCaloAffSyst::MET_SoftCalo_ResoPerp) m_appliedSystEnum = MET_SOFTCALO_RESOPERP ;
223  else if( systVar == softCaloAffSyst::MET_SoftCalo_ResoCorr) m_appliedSystEnum = MET_SOFTCALO_RESOCORR ;
224  else if( systVar == jetTrkAffSyst::MET_JetTrk_ScaleUp) m_appliedSystEnum = MET_JETTRK_SCALEUP ;
225  else if( systVar == jetTrkAffSyst::MET_JetTrk_ScaleDown) m_appliedSystEnum = MET_JETTRK_SCALEDOWN ;
226  else{
227  ATH_MSG_WARNING("unsupported systematic applied " );
228  return StatusCode::FAILURE;
229  }
230 
231  ATH_MSG_DEBUG("applied systematic is " << m_appliedSystEnum );
232 
233  return StatusCode::SUCCESS;
234  }
235 
238 
239  //if asking for jet track systematics, the user needs to give a met association helper (with a map) as well
240  //if using a different jetContainer, you can give it as an option to applyCorrection
241  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__ );
242 
243  if( getDefaultEventInfo() == nullptr) {
244  ATH_MSG_WARNING("event info is empty, returning without applying correction");
246  }
247 
249  ATH_MSG_WARNING("This tool should be applied to MC only. Return without changing the input MET object");
251  }
252 
253  if( MissingETBase::Source::isSoftTerm(inputMet.source())){
254 
255  xAOD::MissingETContainer const * METcont = dynamic_cast<xAOD::MissingETContainer const*>(inputMet.container());
256  if(METcont == nullptr){
257  ATH_MSG_WARNING("MissingET object not owned by a container. Returning without applying correction" );
259  }
260 
261  return internalSoftTermApplyCorrection(inputMet, METcont, *getDefaultEventInfo());
262  }
263 
265  ){
266  if( helper.map() == nullptr) {
267  ATH_MSG_WARNING("The MissingETAssociationMap for the given MissingETAssociationHelper is null. Returning without applying correction ");
269  }
270 
271  return getCorrectedJetTrackMET(inputMet, helper);
272  }
273 
274  ATH_MSG_WARNING("METSystematicsTool received a MissingET object it can't correct. You should only pass soft MET terms or jet track MET terms.");
276  }
277 
278 
281  { ATH_MSG_VERBOSE (__PRETTY_FUNCTION__ );
282  xAOD::MissingET * copy = nullptr;
283 
284  if(outputmet != nullptr ){
285  ATH_MSG_WARNING("Please pass a nullptr to the 2nd argument of correctedCopy to fill the output pointer");
286  ATH_MSG_WARNING("Returning without making a correctedCopy");
288  }
289 
290  if( getDefaultEventInfo() == nullptr) {
291  ATH_MSG_WARNING("event info is empty, return a nullptr");
292  outputmet = nullptr;
294  }
295 
297  ATH_MSG_WARNING("This tool should be applied to MC only. Return without changing the input MET object");
298  outputmet = nullptr;
300  }
301 
302  if( MissingETBase::Source::isSoftTerm(met.source())){
303  xAOD::MissingETContainer const * METcont = dynamic_cast<xAOD::MissingETContainer const*>(met.container());
304  if(METcont == nullptr){
305  ATH_MSG_WARNING("MissingET object not owned by a container. Unable to apply correction, returning output MET object as null" );
306  outputmet = nullptr;
308  }
309  copy = new xAOD::MissingET(met);
310 
312  outputmet = nullptr; delete copy;
314  }
315  }//soft term source
316  if( //MissingETBase::Source::isTrackTerm(met.source()) &&
318  if( helper.map() == nullptr) {
319  ATH_MSG_WARNING("MissingETAssociationHelper contained a null MissingETAssociationMap pointer");
320  outputmet = nullptr; delete copy;
322  }
323  delete copy;
324  copy = new xAOD::MissingET(met);
326  outputmet = nullptr; delete copy;
328  }
329  }//jet track term source
330 
331  outputmet = copy;
332  return CP::CorrectionCode::Ok;
333  }
334 
336  xAOD::MissingETContainer const * METcont,
337  xAOD::EventInfo const & eInfo
338  ) const{ //this is equivalent of "getSoftTerms"
339 
340  ATH_MSG_VERBOSE( __PRETTY_FUNCTION__ );
341 
342 
343  if( ! MissingETBase::Source::isSoftTerm(softMet.source()) ){
344  ATH_MSG_ERROR("not soft met, cannot apply soft term correction to this MET");
346  }
347 
348  bool doSyst = false;
349  if( MissingETBase::Source::isTrackTerm(softMet.source()) ) {
351  ATH_MSG_VERBOSE("Track soft term " << softMet.name()
352  << ", met = " << softMet.met()
353  << ", applied systematic is " << m_appliedSystEnum
354  << ", do syst? " << doSyst);
355  } else {
357  ATH_MSG_VERBOSE("Calo soft term " << softMet.name()
358  << ", met = " << softMet.met()
359  << ", applied systematic is " << m_appliedSystEnum
360  << ", do syst? " << doSyst);
361  }
362 
363  if(!doSyst) {
364  ATH_MSG_DEBUG("Ignore irrelevant systematic.");
365  return CP::CorrectionCode::Ok;
366  }
367 
368  //this is for speed
369  //we avoid creating met private stores here
370  missingEt softMetStruct;
371  softMetStruct.mpx = softMet.mpx();
372  softMetStruct.mpy = softMet.mpy();
373  softMetStruct.sumet = softMet.sumet();
374  softMetStruct.name = softMet.name();
375  softMetStruct.source = softMet.source();
376 
377  if(METcont == nullptr){
378  ATH_MSG_WARNING("failed to retrieve MET container from passed object");
380  }
381 
382  missingEt const ptHard = calcPtHard(METcont);
383  double const ptHardMet = std::sqrt( ptHard.mpx * ptHard.mpx +
384  ptHard.mpy * ptHard.mpy ) ;
385 
386  const xAOD::MissingET* jetterm = *METcont->find( MissingETBase::Source::jet() );
387  size_t njet = (jetterm==nullptr) ? 0 : acc_constitObjLinks(*jetterm ).size();
388 
389  const std::unique_ptr<TH3D>* shiftHist = (MissingETBase::Source::isTrackTerm(softMetStruct.source) ? &m_trk_shiftpara_pthard_njet_mu : &m_calo_shiftpara_pthard_njet_mu);
390 
391  int phbin = std::as_const(*shiftHist)->GetXaxis()->FindBin( ptHardMet ) ;
392  if(phbin>(*shiftHist)->GetNbinsX()) phbin = (*shiftHist)->GetNbinsX();
393 
394  int const jetbin = std::as_const(*shiftHist)->GetYaxis()->FindBin(njet);
395  int const mubin = std::as_const(*shiftHist)->GetZaxis()->FindBin(eInfo.actualInteractionsPerCrossing() );
396  double const scalePara = (*shiftHist)->GetBinContent(phbin,jetbin,mubin);
397 
398  double const randGaus = getTLSRandomGen()->Gaus(0.,1.);
399  double smearPara(0), smearPerp(0);
400 
401  ATH_MSG_DEBUG("About to apply systematic " << appliedSystematicsString() );
402 
403  //now we need to know what soft term systematics we are doing
404  //m_appliedSystEnum was cached by the applySystematicVariation method
405  switch( m_appliedSystEnum ){
406  case MET_SOFTTRK_SCALEUP:
408  softMetStruct = variedSoftTerm(softMetStruct, ptHard, scalePara, 0.);
409  break;
412  softMetStruct = variedSoftTerm(softMetStruct, ptHard, -1.*scalePara, 0.);
413  break;
415  smearPara = m_trk_resopara_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
416  softMetStruct = variedSoftTerm(softMetStruct, ptHard, smearPara, 0.);
417  break;
419  smearPerp = m_trk_resoperp_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
420  softMetStruct = variedSoftTerm(softMetStruct, ptHard, 0., smearPerp);
421  break;
423  smearPara = m_trk_resopara_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
424  smearPerp = m_trk_resoperp_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
425  softMetStruct = variedSoftTerm(softMetStruct, ptHard, smearPara, smearPerp);
426  break;
428  smearPara = m_calo_resopara_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
429  softMetStruct = variedSoftTerm(softMetStruct, ptHard, smearPara, 0.);
430  break;
432  smearPerp = m_calo_resoperp_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
433  softMetStruct = variedSoftTerm(softMetStruct, ptHard, 0., smearPerp);
434  break;
436  smearPara = m_calo_resopara_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
437  smearPerp = m_calo_resoperp_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
438  softMetStruct = variedSoftTerm(softMetStruct, ptHard, smearPara, smearPerp);
439  break;
440  default:
441  ATH_MSG_DEBUG("No systematic applied, returning nominal MET term");
442  }
443 
444  //fill the softMet back with the struct values to return
445  softMet.setMpx( softMetStruct.mpx);
446  softMet.setMpy( softMetStruct.mpy);
447  softMet.setSumet( softMetStruct.sumet);
448  softMet.setName( softMetStruct.name);
449  softMet.setSource( softMetStruct.source);
450 
451  ATH_MSG_VERBOSE("Output soft term " << softMet.name()
452  << ", met = " << softMet.met() );
453 
454  return CP::CorrectionCode::Ok;
455  }
456 
459  const xAOD::Jet* jet) const {
460  ATH_MSG_VERBOSE(__PRETTY_FUNCTION__);
461 
462  if( m_jet_systRpt_pt_eta == nullptr ) {
463  ATH_MSG_ERROR("jet track systematics histogram not initialized properly.") ;
465  }
466 
470 
471  int phbin = std::as_const(m_jet_systRpt_pt_eta)->GetXaxis()->FindBin(jet->pt()/1e3);
472  if(phbin>m_jet_systRpt_pt_eta->GetNbinsX()) phbin = m_jet_systRpt_pt_eta->GetNbinsX();
473 
474  int etabin = std::as_const(m_jet_systRpt_pt_eta)->GetYaxis()->FindBin(std::abs( jet->eta() ));
475  if(etabin>m_jet_systRpt_pt_eta->GetNbinsY()) etabin = m_jet_systRpt_pt_eta->GetNbinsY();
476 
477  double uncert = 0.;
478  switch( m_appliedSystEnum ){
479  case MET_JETTRK_SCALEUP : {
480  uncert = m_jet_systRpt_pt_eta->GetBinContent(phbin,etabin);
481  break;
482  }
483  case MET_JETTRK_SCALEDOWN : {
484  uncert = -1.*m_jet_systRpt_pt_eta->GetBinContent(phbin,etabin);
485  break;
486  }
487  default:
488  break;
489  }
490 
491  ATH_MSG_VERBOSE("Uncertainty on this jet is " << uncert);
492 
493  jettrkmet.setMpx ( jettrkmet.mpx() - trkvec.cpx() * uncert);
494  jettrkmet.setMpy ( jettrkmet.mpy() - trkvec.cpy() * uncert);
495  } else { ATH_MSG_VERBOSE("No jet track systematics applied"); }
496 
497  return CP::CorrectionCode::Ok;
498  }
499 
502  ATH_MSG_VERBOSE(__PRETTY_FUNCTION__);
503 
504  if( m_jet_systRpt_pt_eta == nullptr ) {
505  ATH_MSG_ERROR("jet track systematics histogram not initialized properly.") ;
507  }
508 
510  return CP::CorrectionCode::Ok;
511 
512  double uncert = 0.;
513  int jetCount=0;
514 
515  std::vector<const xAOD::Jet*> jets;
516  for(const iplink_t& jetlink : acc_constitObjLinks(jettrkmet)) {
517  if((*jetlink)->type()!=xAOD::Type::Jet) {
518  ATH_MSG_ERROR("Invalid object of type " << (*jetlink)->type() << " in jet term");
520  }
521  jets.push_back(static_cast<const xAOD::Jet*>(*jetlink));
522  }
523  bool originalInputs = jets.empty() ? false : !acc_originalObject.isAvailable(*jets.front());
524  for(const xAOD::Jet *jet : jets) {
525  const MissingETAssociation* assoc = nullptr;
526  const MissingETAssociationMap* map = helper.map();
527  if(originalInputs) {
529  } else {
530  const IParticle* orig = *acc_originalObject(*jet);
531  assoc = MissingETComposition::getAssociation(map,static_cast<const xAOD::Jet*>(orig));
532  }
534  if(std::abs(jet->eta())<=2.5){
535  jetCount++;
536  int phbin = std::as_const(m_jet_systRpt_pt_eta)->GetXaxis()->FindBin(jet->pt()/1e3);
537  if(phbin>m_jet_systRpt_pt_eta->GetNbinsX()) phbin = m_jet_systRpt_pt_eta->GetNbinsX();
538 
539  int etabin = std::as_const(m_jet_systRpt_pt_eta)->GetYaxis()->FindBin(std::abs( jet->eta() ));
540  if(etabin>m_jet_systRpt_pt_eta->GetNbinsY()) etabin = m_jet_systRpt_pt_eta->GetNbinsY();
541  float uncert_frac=(trkvec.sumpt())*(m_jet_systRpt_pt_eta->GetBinContent(phbin, etabin));
542 
543  ATH_MSG_VERBOSE("Sumpt: "<< trkvec.sumpt());
544  ATH_MSG_VERBOSE("jet uncert: "<< m_jet_systRpt_pt_eta->GetBinContent(phbin, etabin));
545  uncert = std::sqrt(uncert*uncert+uncert_frac*uncert_frac);
546  }
547  }
548 
549  ATH_MSG_VERBOSE("Uncertainty: "<< uncert);
550  ATH_MSG_VERBOSE("Jet Counting: "<< jetCount);
551 
552  // Flip sign for down variation
553  if(m_appliedSystEnum == MET_JETTRK_SCALEDOWN) uncert *= -1.;
554 
555  jettrkmet.setMpx ( jettrkmet.mpx()*(1 + uncert/(std::abs(jettrkmet.mpx())*std::sqrt(2))));
556  jettrkmet.setMpy ( jettrkmet.mpy()*(1 + uncert/(std::abs(jettrkmet.mpy())*std::sqrt(2))));
557  jettrkmet.setSumet( jettrkmet.sumet() + uncert);
558 
559  return CP::CorrectionCode::Ok;
560  }
561 
564  ) const {
565 
566  const MissingETAssociationMap* map = helper.map();
567  if(!map) {
568  ATH_MSG_ERROR("MissingETAssociationMap null, error calculating jet track systematics.");
570  }
571 
573  ATH_MSG_ERROR("Failed to calculate jet track systematics.");
575  }
576  return CP::CorrectionCode::Ok;
577  }
578 
580  missingEt const &ptHard,
581  double const varPara,
582  double const varPerp) const{
583 
584  missingEt projection = projectST(softTerms,ptHard);
585  projection.mpx += varPara;
586  projection.mpy += varPerp;
587 
588  return projectST(projection, ptHard);
589  }
590 
591  missingEt METSystematicsTool::projectST(missingEt const &softTerms, missingEt const &ptHard) const
592  {
593  double const ptHardMet = std::sqrt( ptHard.mpx * ptHard.mpx +
594  ptHard.mpy * ptHard.mpy );
595 
596  double const ux = ptHard.mpx/ptHardMet;
597  double const uy = ptHard.mpy/ptHardMet;
598  double const projL = ux*softTerms.mpx + uy*softTerms.mpy;
599  double const projT = uy*softTerms.mpx - ux*softTerms.mpy;
600  missingEt proj(projL,projT,softTerms.sumet,
601  softTerms.name,softTerms.source);
602 
603  return proj;
604  }
605 
607  {
608  ATH_MSG_VERBOSE(__PRETTY_FUNCTION__ );
609 
610  //get truth container
612  if (!truthCont.isValid()) {
613 
614  ATH_MSG_ERROR( m_TruthContKey.key() << " container empty or doesn't exist, calcPtHard returning zero.");
615  return {};
616  }
617 
619  if(truthiter == truthCont->end()){
620  ATH_MSG_ERROR( "NonInt is not in " << m_TruthContKey.key() << ". calcPtHard returing zero." );
621  return {};
622  }
623  const xAOD::MissingET& truthmet = **truthiter;
624 
625  missingEt ptHard;
626  ptHard.mpx = truthmet.mpx();
627  ptHard.mpy = truthmet.mpy();
628  ptHard.sumet = truthmet.sumet();
629  ptHard.name = truthmet.name();
630  ptHard.source = truthmet.source();
631 
632  //loop over all non soft or total terms
633  for(xAOD::MissingETContainer::const_iterator iMET=cont->begin();iMET!=cont->end(); ++iMET ) {
634  if( !( MissingETBase::Source::isSoftTerm( (*iMET)->source() ) ||
635  MissingETBase::Source::isTotalTerm( (*iMET)->source() ) ) ) {
636  ptHard.mpx -= (*iMET)->mpx();
637  ptHard.mpy -= (*iMET)->mpy();
638  ptHard.sumet += (*iMET)->sumet();
639  }
640  }
641 
642  if( ptHard.sumet < 0 ) {
643  ATH_MSG_ERROR("PtHard has a negative sumet, returning ptHart = 0");
644  return {};
645  }
646 
647  ptHard.mpx *= 1./(double(m_units)) ;
648  ptHard.mpy *= 1./(double(m_units)) ;
649  ptHard.sumet*= 1./(double(m_units)) ;
650 
651  // protect from zero pthard. protects against an empty pthard for the soft term systematic
652  if(ptHard.sumet<1.0e-6){
653  ptHard.sumet=1.0e-6;
654  ptHard.mpx=1.0e-6;
655  ptHard.mpy=0.0;
656  }
657 
658  return ptHard;
659  }
660 
662  std::string & systpath ,
663  std::string & histpath,
664  std::string & suffix ,
665  SystType const & type
666  ){
667  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__);
668  TEnv reader;
669 
670  std::string configpath = "";
671  std::string configfile = "";
672  if(m_useDevArea) { configpath += "dev/"; }
673 
674  switch(type){
675  case SOFTCALO : configfile += m_configSoftCaloFile.value();
676  configpath = PathResolverFindCalibFile(m_configPrefix.value()+m_configSoftCaloFile.value());
677  break;
678  case SOFTTRK : configfile += m_configSoftTrkFile.value();
679  configpath = PathResolverFindCalibFile(m_configPrefix.value()+m_configSoftTrkFile.value());
680  break;
681  case JETTRK : configfile += m_configJetTrkFile.value();
682  configpath = PathResolverFindCalibFile(m_configPrefix.value()+m_configJetTrkFile.value());
683  break;
684  default : configpath = "";
685  }
686 
687  ATH_MSG_INFO( "Searching for configFile: " << configfile);
688  ATH_MSG_DEBUG( "PWD: " << gSystem->Getenv("PWD") ) ;
689  ATH_MSG_DEBUG( "CALIBPATH: " << gSystem->Getenv("CALIBPATH") );
690 
691  if(configpath.empty() || configfile.empty() ){
692  ATH_MSG_ERROR( "Path Resolver couldn't find config file");
693  return StatusCode::FAILURE;
694  }
695 
696  if( reader.ReadFile(configpath.c_str(),EEnvLevel(0)) < 0) {
697  ATH_MSG_ERROR( "Couldn't read the track config file!" );
698  return StatusCode::FAILURE;
699  }
700 
701  ATH_MSG_INFO( "Configuring from file : " << configpath );
702 
703 
704  switch(type){
705  case SOFTCALO:
706  histfile = reader.GetValue( "Conf.InputFile" , "");
707  systpath = reader.GetValue( "GlobalSyst.sourcedir" , "" );
708  break;
709  case SOFTTRK:
710  histfile = reader.GetValue( "Conf.InputFile" , "");
711  systpath = reader.GetValue( "PtHardSyst.sourcedir" , "" );
712  suffix = reader.GetValue( "PtHardSyst.suffix" , "" );
713  break;
714  case JETTRK:
715  histfile = reader.GetValue( "JetTrkSyst.InputFile" , "");
717  systpath = "/";
718  break;
719  default:
720  break;
721  }
722  if(m_useDevArea) histfile = "dev/"+histfile;
723 
724  std::string const units_string = reader.GetValue( "Units", "" );
725 
726  //check if we already set the units in another config file
727  if(m_units == 1000){
728  if(units_string != "GeV"){
729  ATH_MSG_ERROR("initialized the different systematics using two config files that conflict on units");
730  return StatusCode::FAILURE;
731  }
732  }
733  if(m_units == 1){
734  if( (!units_string.empty()) && (units_string != "MeV")){
735  ATH_MSG_ERROR("initialized the different systematics using two config files that conflict on units");
736  return StatusCode::FAILURE;
737  }
738  }
739 
740  //set the units again
741  if( (units_string.empty()) || (units_string == "MeV") ){
742  m_units = 1;
743  }else if(units_string == "GeV"){
744  m_units = 1000;
745  }else{
746  ATH_MSG_ERROR("You specified an incorrect 'Units' value. Please specify MeV , GeV , or leave it blank for MeV");
747  return StatusCode::FAILURE;
748  }
749 
750  ATH_MSG_INFO( "Will read histograms from : " << histfile );
751  ATH_MSG_DEBUG( "Systpath :" << systpath ) ;
753  ATH_MSG_INFO("Extracted histogram path : " << histpath);
754 
755  if(histfile.empty() || systpath.empty() || histpath.empty() ){
756  ATH_MSG_ERROR("Failed to correctly set histfile path, or path to histograms inside of the histfile" );
757  return StatusCode::FAILURE;
758  }
759 
760 
761  if( (m_units != 1) && (m_units != 1000) && (m_units != -1)){
762  ATH_MSG_ERROR("Something is wrong with your units initialization. Please contact the developers (you should never get here).");
763  return StatusCode::FAILURE;
764  }
765 
766  return StatusCode::SUCCESS;
767  }
768 
769 
770  //stolen from JetUncertainties
772  {
773 
775  if (!eInfoConst.isValid()) {
776 
777  ATH_MSG_ERROR("Failed to retrieve default EventInfo object");
778  }
779  return &*eInfoConst;
780  }
781 
784 
785  if (!vertices.isValid()) {
786 
787  ATH_MSG_ERROR("Failed to retrieve default NPV value from PrimaryVertices");
788  return 0;
789  }
790 
791  int NPV = 0;
793  for (itr = vertices->begin(); itr != vertices->end(); ++itr)
794  if ( (*itr)->vertexType() != xAOD::VxType::NoVtx) NPV++;
795 
796  return NPV;
797  }
798 
800  TRandom3* random = m_rand_tls.get();
801  if (!random) {
802  random = new TRandom3();
803  m_rand_tls.reset(random);
804  }
805  return random;
806  }
807 
808  void METSystematicsTool::setRandomSeed(unsigned long seed) const {
809  getTLSRandomGen()->SetSeed(seed);
810  }
811 }
ShallowCopy.h
met::METSystematicsTool::internalSoftTermApplyCorrection
CP::CorrectionCode internalSoftTermApplyCorrection(xAOD::MissingET &softMet, xAOD::MissingETContainer const *METcont, xAOD::EventInfo const &eInfo) const
Definition: METSystematicsTool.cxx:335
Jet.h
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
met::METSystematicsTool::m_configJetTrkFile
Gaudi::Property< std::string > m_configJetTrkFile
Definition: METSystematicsTool.h:153
hotSpotInTAG.suffix
string suffix
Definition: hotSpotInTAG.py:185
checkCorrelInHIST.histpath
histpath
Definition: checkCorrelInHIST.py:400
run.infile
string infile
Definition: run.py:13
xAOD::MissingET_v1::setSumet
void setSumet(float value)
Set .
met::MET_SOFTCALO_RESOPERP
@ MET_SOFTCALO_RESOPERP
Definition: METSystematicsTool.h:78
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
met::METSystematicsTool::jetTrkSystInitialize
StatusCode jetTrkSystInitialize()
Definition: METSystematicsTool.cxx:141
xAOD::MissingETAssociation_v1
MET association descriptor contains object links and corresponding parameters.
Definition: MissingETAssociation_v1.h:25
met::missingEt::mpy
double mpy
Definition: METSystematicsTool.h:60
met::METSystematicsTool::m_calo_resopara_pthard_njet_mu
std::unique_ptr< TH3D > m_calo_resopara_pthard_njet_mu
Definition: METSystematicsTool.h:161
met::METSystematicsTool::applySystematicVariation
StatusCode applySystematicVariation(const CP::SystematicSet &set)
effects: configure this tool for the given list of systematic variations.
Definition: METSystematicsTool.h:127
xAOD::MissingET_v1::sumet
float sumet() const
Returns.
met::MET_SOFTCALO_RESOPARA
@ MET_SOFTCALO_RESOPARA
Definition: METSystematicsTool.h:77
CP::SystematicSet::size
size_t size() const
returns: size of the set
Definition: SystematicSet.h:71
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
met::METSystematicsTool::softTrkSystInitialize
StatusCode softTrkSystInitialize()
Definition: METSystematicsTool.cxx:168
met::METSystematicsTool::initialize
StatusCode initialize()
Dummy implementation of the initialisation function.
Definition: METSystematicsTool.cxx:83
xAOD::MissingET_v1::setMpy
void setMpy(float value)
Set the component.
CP::SystematicSet::empty
bool empty() const
returns: whether the set is empty
Definition: SystematicSet.h:67
met::METSystematicsTool::getTLSRandomGen
TRandom3 * getTLSRandomGen() const
Definition: METSystematicsTool.cxx:799
MissingETBase::Source::isTotalTerm
static bool isTotalTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
Definition: MissingETBase.h:405
asg
Definition: DataHandleTestTool.h:28
met::METSystematicsTool::applyCorrection
CP::CorrectionCode applyCorrection(xAOD::MissingET &inputMet, const xAOD::MissingETAssociationHelper &helper) const
Definition: METSystematicsTool.cxx:236
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
defineDB.jets
jets
Definition: JetTagCalibration/share/defineDB.py:24
xAOD::MissingET
MissingET_v1 MissingET
Version control by type defintion.
Definition: Event/xAOD/xAODMissingET/xAODMissingET/MissingET.h:15
met::missingEt::source
MissingETBase::Types::bitmask_t source
Definition: METSystematicsTool.h:63
met::METSystematicsTool::m_configPrefix
Gaudi::Property< std::string > m_configPrefix
Definition: METSystematicsTool.h:151
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
met::MET_JETTRK_SCALEDOWN
@ MET_JETTRK_SCALEDOWN
Definition: METSystematicsTool.h:81
CP::SystematicsTool::m_affectingSystematics
SystematicSet m_affectingSystematics
description: members directly corresponding to accessors
Definition: SystematicsTool.h:146
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
met::METSystematicsTool::m_trk_resopara_pthard_njet_mu
std::unique_ptr< TH3D > m_trk_resopara_pthard_njet_mu
Definition: METSystematicsTool.h:158
met::JETTRK
@ JETTRK
Definition: IMETSystematicsTool.h:52
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
CP::SystematicVariation
Definition: SystematicVariation.h:47
met::METSystematicsTool::m_trk_shiftpara_pthard_njet_mu
std::unique_ptr< TH3D > m_trk_shiftpara_pthard_njet_mu
Definition: METSystematicsTool.h:157
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
MissingETBase::Source::isTrackTerm
static bool isTrackTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
Definition: MissingETBase.h:404
xAOD::EventInfo_v1::IS_SIMULATION
@ IS_SIMULATION
true: simulation, false: data
Definition: EventInfo_v1.h:151
xAOD::MissingET_v1::setSource
void setSource(MissingETBase::Types::bitmask_t src)
Set the source of the MET object.
met::METSystematicsTool::variedSoftTerm
missingEt variedSoftTerm(missingEt const &softTerms, missingEt const &ptHard, double varPara, double varPerp) const
Definition: METSystematicsTool.cxx:579
xAOD::VxType::NoVtx
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.
Definition: TrackingPrimitives.h:571
MissingETBase::Source::isJetTerm
static bool isJetTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
Definition: MissingETBase.h:402
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
xAOD::MissingETAssociation_v1::ConstVec
Vector sum of constituents for subtractive overlap removal.
Definition: MissingETAssociation_v1.h:32
xAOD::MissingETAssociationMap_v1
Definition: MissingETAssociationMap_v1.h:29
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:115
met::METSystematicsTool::m_configSoftCaloFile
Gaudi::Property< std::string > m_configSoftCaloFile
Definition: METSystematicsTool.h:154
met::NONE
@ NONE
Definition: METSystematicsTool.h:69
met::METSystematicsTool::m_appliedSystEnum
SystApplied m_appliedSystEnum
Definition: METSystematicsTool.h:138
met::METSystematicsTool::addMETAffectingSystematics
StatusCode addMETAffectingSystematics()
Definition: METSystematicsTool.cxx:39
xAOD::MissingET_v1::setName
void setName(const std::string &name)
Set the name of the MET object.
met::MET_SOFTCALO_SCALEUP
@ MET_SOFTCALO_SCALEUP
Definition: METSystematicsTool.h:75
xAOD::MissingETContainer_v1::find
const_iterator find(const std::string &name) const
Find non-modifiable MET object by name.
Definition: MissingETContainer_v1.cxx:52
met::MET_SOFTTRK_RESOPARA
@ MET_SOFTTRK_RESOPARA
Definition: METSystematicsTool.h:72
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
met::METSystematicsTool::m_rand_tls
boost::thread_specific_ptr< TRandom3 > m_rand_tls
Definition: METSystematicsTool.h:165
met
Definition: IMETSignificance.h:24
met::METSystematicsTool::setRandomSeed
void setRandomSeed(unsigned long seed) const
Definition: METSystematicsTool.cxx:808
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
met::MET_SOFTTRK_RESOCORR
@ MET_SOFTTRK_RESOCORR
Definition: METSystematicsTool.h:74
met::METSystematicsTool::m_calo_shiftpara_pthard_njet_mu
std::unique_ptr< TH3D > m_calo_shiftpara_pthard_njet_mu
Definition: METSystematicsTool.h:160
met::METSystematicsTool::calcPtHard
missingEt calcPtHard(xAOD::MissingETContainer const *const cont) const
Definition: METSystematicsTool.cxx:606
MissingETBase::Source::jet
static Types::bitmask_t jet(Region reg=Region::FullAcceptance)
Standard MET term from reconstructed jets.
Definition: MissingETBase.h:257
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MissingETAuxContainer.h
xAOD::MissingETAssociation_v1::ConstVec::cpy
float cpy() const
Returns .
xAOD::MissingETAssociation_v1::ConstVec::sumpt
float sumpt() const
Returns sum of component pt.
met::METSystematicsTool::m_units
int m_units
Definition: METSystematicsTool.h:168
met::missingEt::name
std::string name
Definition: METSystematicsTool.h:62
xAOD::MissingET_v1
Principal data object for Missing ET.
Definition: MissingET_v1.h:25
xAOD::MissingET_v1::mpx
float mpx() const
Returns .
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
met::METSystematicsTool::getDefaultEventInfo
xAOD::EventInfo const * getDefaultEventInfo() const
Definition: METSystematicsTool.cxx:771
CP::SystematicsTool::appliedSystematicsString
std::string appliedSystematicsString() const
returns: a string representation of appliedSystematics() guarantee: strong failures: out of memory II...
Definition: SystematicsTool.cxx:67
met::METSystematicsTool::m_useDevArea
Gaudi::Property< bool > m_useDevArea
Definition: METSystematicsTool.h:155
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
met::METSystematicsTool::m_trk_resoperp_pthard_njet_mu
std::unique_ptr< TH3D > m_trk_resoperp_pthard_njet_mu
Definition: METSystematicsTool.h:159
met::METSystematicsTool::calcJetTrackMETWithSyst
CP::CorrectionCode calcJetTrackMETWithSyst(xAOD::MissingET &jettrkmet, const xAOD::MissingETAssociationHelper &helper) const
Definition: METSystematicsTool.cxx:500
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
xAOD::MissingET_v1::name
const std::string & name() const
Identifier getters.
make_coralServer_rep.proj
proj
Definition: make_coralServer_rep.py:48
xAOD::MissingET_v1::setMpx
void setMpx(float value)
Set the component.
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
met::METSystematicsTool::getNPV
int getNPV() const
Definition: METSystematicsTool.cxx:782
xAOD::MissingETAssociation_v1::jetTrkVec
ConstVec jetTrkVec() const
Get track constituent vector for the reference jet.
Definition: MissingETAssociation_v1.cxx:568
met::SOFTTRK
@ SOFTTRK
Definition: IMETSystematicsTool.h:51
met::METSystematicsTool::correctedCopy
CP::CorrectionCode correctedCopy(const xAOD::MissingET &met, xAOD::MissingET *&outputmet, const xAOD::MissingETAssociationHelper &helper) const
Definition: METSystematicsTool.cxx:279
xAOD::MissingETContainer_v1
Container for xAOD::MissingET_v1 objects.
Definition: MissingETContainer_v1.h:21
met::MET_SOFTCALO_SCALEDOWN
@ MET_SOFTCALO_SCALEDOWN
Definition: METSystematicsTool.h:76
met::missingEt::sumet
double sumet
Definition: METSystematicsTool.h:61
PathResolver.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
met::missingEt
Definition: METSystematicsTool.h:42
ReadHandle.h
Handle class for reading from StoreGate.
met::MET_SOFTCALO_RESOCORR
@ MET_SOFTCALO_RESOCORR
Definition: METSystematicsTool.h:79
xAOD::MissingET_v1::source
MissingETBase::Types::bitmask_t source() const
MET object source tag.
xAOD::MissingETComposition::getAssociation
static const MissingETAssociation * getAssociation(const MissingETAssociationMap *pMap, const Jet *pJet)
Definition: Event/xAOD/xAODMissingET/Root/MissingETComposition.cxx:415
xAOD::MissingETAssociationHelper
Definition: MissingETAssociationHelper.h:22
met::SOFTCALO
@ SOFTCALO
Definition: IMETSystematicsTool.h:50
xAOD::MissingETAssociation_v1::overlapTrkVec
ConstVec overlapTrkVec(const MissingETAssociationHelper &helper) const
Retrieve total track-based vector to be subtracted from the jet.
Definition: MissingETAssociation_v1.cxx:780
met::SystType
SystType
Definition: IMETSystematicsTool.h:48
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:321
met::METSystematicsTool::sysApplySystematicVariation
StatusCode sysApplySystematicVariation(const CP::SystematicSet &)
effects: configure this tool for the given list of systematic variations.
Definition: METSystematicsTool.cxx:199
met::MET_SOFTTRK_RESOPERP
@ MET_SOFTTRK_RESOPERP
Definition: METSystematicsTool.h:73
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition: CorrectionCode.h:38
met::METSystematicsTool::m_jet_systRpt_pt_eta
std::unique_ptr< TH2D > m_jet_systRpt_pt_eta
Definition: METSystematicsTool.h:163
met::METSystematicsTool::projectST
missingEt projectST(missingEt const &softTerms, missingEt const &ptHard) const
Definition: METSystematicsTool.cxx:591
python.CaloAddPedShiftConfig.default
default
Definition: CaloAddPedShiftConfig.py:43
VertexContainer.h
MissingETBase::Source::truthNonInt
static Types::bitmask_t truthNonInt()
Standard bit pattern indicating genuine true MET.
Definition: MissingETBase.h:321
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
METSystematicsTool.h
met::METSystematicsTool::m_VertexContKey
SG::ReadHandleKey< xAOD::VertexContainer > m_VertexContKey
Definition: METSystematicsTool.h:175
CP::SystematicSet::begin
const_iterator begin() const
description: const iterator to the beginning of the set
Definition: SystematicSet.h:55
met::missingEt::mpx
double mpx
Definition: METSystematicsTool.h:59
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
met::METSystematicsTool::m_configSoftTrkFile
Gaudi::Property< std::string > m_configSoftTrkFile
Definition: METSystematicsTool.h:152
CP::SystematicsTool::addAffectingSystematic
StatusCode addAffectingSystematic(const SystematicVariation &systematic, bool recommended)
effects: add a systematic to the list of registered systematics.
Definition: SystematicsTool.cxx:112
met::METSystematicsTool::m_TruthContKey
SG::ReadHandleKey< xAOD::MissingETContainer > m_TruthContKey
Definition: METSystematicsTool.h:176
met::MET_SOFTTRK_SCALEUP
@ MET_SOFTTRK_SCALEUP
Definition: METSystematicsTool.h:70
met::MET_JETTRK_SCALEUP
@ MET_JETTRK_SCALEUP
Definition: METSystematicsTool.h:80
met::METSystematicsTool::getCorrectedJetTrackMET
CP::CorrectionCode getCorrectedJetTrackMET(xAOD::MissingET &jettrkmet, const xAOD::MissingETAssociationHelper &helper) const
Definition: METSystematicsTool.cxx:562
calibdata.copy
bool copy
Definition: calibdata.py:26
SG::AuxElement::container
const SG::AuxVectorData * container() const
Return the container holding this element.
met::METSystematicsTool::METSystematicsTool
METSystematicsTool()
xAOD::MissingETAssociation_v1::ConstVec::cpx
float cpx() const
Returns .
collisions.reader
reader
read the goodrunslist xml file(s)
Definition: collisions.py:22
xAOD::MissingET_v1::mpy
float mpy() const
Returns .
met::METSystematicsTool::extractHistoPath
StatusCode extractHistoPath(std::string &histfile, std::string &systpath, std::string &configdir, std::string &suffix, SystType const &type)
Definition: METSystematicsTool.cxx:661
module_driven_slicing.histfile
histfile
Definition: module_driven_slicing.py:570
MissingETBase::Source::isSoftTerm
static bool isSoftTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
Definition: MissingETBase.h:403
met::METSystematicsTool::m_EventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKey
Definition: METSystematicsTool.h:177
met::METSystematicsTool::softCaloSystInitialize
StatusCode softCaloSystInitialize()
Definition: METSystematicsTool.cxx:108
MissingETComposition.h
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition: Event/xAOD/xAODJet/xAODJet/Jet.h:17
met::MET_SOFTTRK_SCALEDOWN
@ MET_SOFTTRK_SCALEDOWN
Definition: METSystematicsTool.h:71
xAOD::MissingET_v1::met
float met() const
Returns .
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
xAOD::EventInfo_v1::actualInteractionsPerCrossing
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.
Definition: EventInfo_v1.cxx:380
met::METSystematicsTool::m_calo_resoperp_pthard_njet_mu
std::unique_ptr< TH3D > m_calo_resoperp_pthard_njet_mu
Definition: METSystematicsTool.h:162