ATLAS Offline Software
METSystematicsTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 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 
31  // const static MissingETBase::Types::bitmask_t invisSource = 0x100000; // doesn't overlap with any other
32 
34  : asg::AsgTool::AsgTool(name)
35  {
36  ATH_MSG_DEBUG (__PRETTY_FUNCTION__ );
37 
39  }
40 
42  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__ );
43 
44  if(!m_configSoftTrkFile.empty()){
45  if( !(addAffectingSystematic( softTrkAffSyst::MET_SoftTrk_ScaleUp , true /*recommended */ ) &&
46  addAffectingSystematic( softTrkAffSyst::MET_SoftTrk_ScaleDown, true /*recommended */ ) &&
47  addAffectingSystematic( softTrkAffSyst::MET_SoftTrk_ResoPara , true /*recommended */ ) &&
48  addAffectingSystematic( softTrkAffSyst::MET_SoftTrk_ResoPerp , true /*recommended */ ) &&
49  addAffectingSystematic( softTrkAffSyst::MET_SoftTrk_ResoCorr , false /*not recommended */) ) ) {
50  ATH_MSG_ERROR("failed to properly add softTrk affecting systematics " );
51  return StatusCode::FAILURE;
52  }
53  }
54  if(!m_configSoftCaloFile.empty()){
55  if( !(addAffectingSystematic( softCaloAffSyst::MET_SoftCalo_ScaleUp , true /*recommended */ ) &&
56  addAffectingSystematic( softCaloAffSyst::MET_SoftCalo_ScaleDown, true /*recommended */ ) &&
57  addAffectingSystematic( softCaloAffSyst::MET_SoftCalo_Reso , true /*recommended */ ) ) ) {
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_VERBOSE (__PRETTY_FUNCTION__);
111  ATH_MSG_INFO("Doing SoftCalo systematics initialization. THIS IS FOR SOFTWARE DEVELOPMENT ONLY.");
112  ATH_MSG_INFO("CST IS NOT YET RECOMMENDED OR SUPPORTED BY THE MET GROUP. YOU ARE USING A 2012 config file.");
113 
114  std::string histfile = "";
115  std::string gsystpath = "";
116  std::string histpath = "";
117  std::string blank = "";
118 
119  ATH_CHECK( extractHistoPath(histfile,gsystpath,histpath,blank ,SOFTCALO) );//properly sets the paths
120 
121  TFile infile(histpath.c_str());
122 
123  ATH_MSG_INFO( "METSystematics: Read calo uncertainties" );
124  m_h_calosyst_scale.reset(dynamic_cast<TH1D*>( infile.Get((gsystpath+"/globsyst_scale").c_str())));
125  m_h_calosyst_reso.reset(dynamic_cast<TH1D*>( infile.Get((gsystpath+"/globsyst_reso").c_str())));
126 
127  if( !(m_h_calosyst_scale &&
129  )
130  )
131  {
132  ATH_MSG_ERROR("Could not get all calo histos from the config file:" << histfile);
133  return StatusCode::FAILURE;
134  }
135 
136  m_h_calosyst_scale->SetDirectory(nullptr);
137  m_h_calosyst_reso ->SetDirectory(nullptr);
138 
139  ATH_MSG_VERBOSE( __PRETTY_FUNCTION__ << " DONE!!" );
140  return StatusCode::SUCCESS;
141  }
142 
143 
145  {
146  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__);
147 
148  std::string histfile = "";
149  std::string gsystpath = "";
150  std::string configdir = "";
151  std::string blank = "";
152 
153  ATH_CHECK( extractHistoPath(histfile,gsystpath, configdir,blank , JETTRK) );//properly sets the paths
154 
155  TFile infile((configdir).c_str());
156 
157  m_jet_systRpt_pt_eta.reset(dynamic_cast<TH2D*>( infile.Get("jet_systRpt_pt_eta")));
158 // m_jet_systRpt_pt_eta.reset(dynamic_cast<TH2D*>( infile.Get("uncertaintyMap")));
159 
161  {
162  ATH_MSG_ERROR("Could not get jet track histo from the config file:" << histfile);
163  return StatusCode::FAILURE;
164  }
165 
166  m_jet_systRpt_pt_eta->SetDirectory(nullptr);
167 
168  ATH_MSG_VERBOSE( __PRETTY_FUNCTION__ << " DONE!!");
169  return StatusCode::SUCCESS;
170  }
171 
172 
174  {
175  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__ );
176 
177  std::string histfile = "";
178  std::string psystpath = "";
179  std::string histpath = "";
180  std::string suffix = "";
181 
182  ATH_CHECK( extractHistoPath(histfile,psystpath,histpath, suffix, SOFTTRK) );//properly sets the paths
183 
184  TFile infile(histpath.c_str());
185 
186  m_resoperp_pthard_njet_mu.reset(dynamic_cast<TH3D*>( infile.Get((psystpath+"/resoperp_"+suffix).c_str()) ));
187  m_resopara_pthard_njet_mu.reset(dynamic_cast<TH3D*>( infile.Get((psystpath+"/resopara_"+suffix).c_str()) ));
188  m_shiftpara_pthard_njet_mu.reset(dynamic_cast<TH3D*>( infile.Get((psystpath+"/shiftpara_"+suffix).c_str())));
189 
193  )
194  )
195  {
196  ATH_MSG_ERROR("Could not get all track histos from the config file:" << histfile );
197  return StatusCode::FAILURE;
198  }
199 
200  m_resoperp_pthard_njet_mu ->SetDirectory(nullptr);
201  m_resopara_pthard_njet_mu ->SetDirectory(nullptr);
202  m_shiftpara_pthard_njet_mu->SetDirectory(nullptr);
203 
204  ATH_MSG_VERBOSE( __PRETTY_FUNCTION__ <<" DONE!!");
205  return StatusCode::SUCCESS;
206  }
207 
208  StatusCode METSystematicsTool::sysApplySystematicVariation(const CP::SystematicSet& systSet){//this should already be filtered for MET systematics
209  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__ );
210  // Only a single systematic can be applied at a time:
211  // If at some point we can deal with multiple systematics, we will check here that the combination we are given will work
212 
214  if( systSet.empty() ) {
215  ATH_MSG_DEBUG("No affecting systematics received.");
216  return StatusCode::SUCCESS;
217  } else if( systSet.size() > 1 ) {
218  ATH_MSG_WARNING("Tool does not support multiple systematics, returning unsupported" );
219  return StatusCode::FAILURE;
220  }
221  CP::SystematicVariation systVar = *systSet.begin();
222  if ( systVar == CP::SystematicVariation("") ) m_appliedSystEnum = NONE ;
223  else if( systVar == softTrkAffSyst::MET_SoftTrk_ScaleUp) m_appliedSystEnum = MET_SOFTTRK_SCALEUP ;
224  else if( systVar == softTrkAffSyst::MET_SoftTrk_ScaleDown) m_appliedSystEnum = MET_SOFTTRK_SCALEDOWN ;
225  else if( systVar == softTrkAffSyst::MET_SoftTrk_ResoPara) m_appliedSystEnum = MET_SOFTTRK_RESOPARA ;
226  else if( systVar == softTrkAffSyst::MET_SoftTrk_ResoPerp) m_appliedSystEnum = MET_SOFTTRK_RESOPERP ;
227  else if( systVar == softTrkAffSyst::MET_SoftTrk_ResoCorr) m_appliedSystEnum = MET_SOFTTRK_RESOCORR ;
228  else if( systVar == softCaloAffSyst::MET_SoftCalo_ScaleUp) m_appliedSystEnum = MET_SOFTCALO_SCALEUP ;
229  else if( systVar == softCaloAffSyst::MET_SoftCalo_ScaleDown) m_appliedSystEnum = MET_SOFTCALO_SCALEDOWN;
230  else if( systVar == softCaloAffSyst::MET_SoftCalo_Reso) m_appliedSystEnum = MET_SOFTCALO_RESO ;
231  else if( systVar == jetTrkAffSyst::MET_JetTrk_ScaleUp) m_appliedSystEnum = MET_JETTRK_SCALEUP ;
232  else if( systVar == jetTrkAffSyst::MET_JetTrk_ScaleDown) m_appliedSystEnum = MET_JETTRK_SCALEDOWN ;
233  else{
234  ATH_MSG_WARNING("unsupported systematic applied " );
235  return StatusCode::FAILURE;
236  }
237 
238  ATH_MSG_DEBUG("applied systematic is " << m_appliedSystEnum );
239 
240  return StatusCode::SUCCESS;
241  }
242 
245 
246  //if asking for jet track systematics, the user needs to give a met association helper (with a map) as well
247  //if using a different jetContainer, you can give it as an option to applyCorrection
248  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__ );
249 
250  if( getDefaultEventInfo() == nullptr) {
251  ATH_MSG_WARNING("event info is empty, returning without applying correction");
253  }
254 
256  ATH_MSG_WARNING("This tool should be applied to MC only. Return without changing the input MET object");
258  }
259 
260  if( MissingETBase::Source::isSoftTerm(inputMet.source())){
261 
262  xAOD::MissingETContainer const * METcont = dynamic_cast<xAOD::MissingETContainer const*>(inputMet.container());
263  if(METcont == nullptr){
264  ATH_MSG_WARNING("MissingET object not owned by a container. Returning without applying correction" );
266  }
267 
268  return internalSoftTermApplyCorrection(inputMet, METcont, *getDefaultEventInfo());
269  }
270 
271  // if( MissingETBase::Source::isTrackTerm(inputMet.source()) &&
273  ){
274  if( helper.map() == nullptr) {
275  ATH_MSG_WARNING("The MissingETAssociationMap for the given MissingETAssociationHelper is null. Returning without applying correction ");
277  }
278 
279  return getCorrectedJetTrackMET(inputMet, helper);
280  }
281 
282  ATH_MSG_WARNING("METSystematicsTool received a MissingET object it can't correct. You should only pass soft MET terms or jet track MET terms.");
284  }
285 
286 
289  { ATH_MSG_VERBOSE (__PRETTY_FUNCTION__ );
290  xAOD::MissingET * copy = nullptr;
291 
292  if(outputmet != nullptr ){
293  ATH_MSG_WARNING("Please pass a nullptr to the 2nd argument of correctedCopy to fill the output pointer");
294  ATH_MSG_WARNING("Returning without making a correctedCopy");
296  }
297 
298  if( getDefaultEventInfo() == nullptr) {
299  ATH_MSG_WARNING("event info is empty, return a nullptr");
300  outputmet = nullptr;
302  }
303 
305  ATH_MSG_WARNING("This tool should be applied to MC only. Return without changing the input MET object");
306  outputmet = nullptr;
308  }
309 
310  if( MissingETBase::Source::isSoftTerm(met.source())){
311  xAOD::MissingETContainer const * METcont = dynamic_cast<xAOD::MissingETContainer const*>(met.container());
312  if(METcont == nullptr){
313  ATH_MSG_WARNING("MissingET object not owned by a container. Unable to apply correction, returning output MET object as null" );
314  outputmet = nullptr;
316  }
317  copy = new xAOD::MissingET(met);
318 
320  outputmet = nullptr; delete copy;
322  }
323  }//soft term source
324  if( //MissingETBase::Source::isTrackTerm(met.source()) &&
326  if( helper.map() == nullptr) {
327  ATH_MSG_WARNING("MissingETAssociationHelper contained a null MissingETAssociationMap pointer");
328  outputmet = nullptr; delete copy;
330  }
331  delete copy;
332  copy = new xAOD::MissingET(met);
334  outputmet = nullptr; delete copy;
336  }
337  }//jet track term source
338 
339  outputmet = copy;
340  return CP::CorrectionCode::Ok;
341  }
342 
344  xAOD::MissingETContainer const * METcont,
345  xAOD::EventInfo const & eInfo
346  ) const{ //this is equivalent of "getSoftTerms"
347 
348  ATH_MSG_VERBOSE( __PRETTY_FUNCTION__ );
349 
350 
351  if( ! MissingETBase::Source::isSoftTerm(softMet.source()) ){
352  ATH_MSG_ERROR("not soft met, cannot apply soft term correction to this MET");
354  }
355 
356  bool doSyst = false;
357  if( MissingETBase::Source::isTrackTerm(softMet.source()) ) {
359  ATH_MSG_VERBOSE("Track soft term " << softMet.name()
360  << ", met = " << softMet.met()
361  << ", applied systematic is " << m_appliedSystEnum
362  << ", do syst? " << doSyst);
363  } else {
365  ATH_MSG_VERBOSE("Calo soft term " << softMet.name()
366  << ", met = " << softMet.met()
367  << ", applied systematic is " << m_appliedSystEnum
368  << ", do syst? " << doSyst);
369  }
370 
371  if(doSyst) {
372 
373  //this is for speed
374  //we avoid creating met private stores here
375  missingEt softMetStruct;
376  softMetStruct.mpx = softMet.mpx();
377  softMetStruct.mpy = softMet.mpy();
378  softMetStruct.sumet = softMet.sumet();
379  softMetStruct.name = softMet.name();
380  softMetStruct.source = softMet.source();
381 
382  if(METcont == nullptr){
383  ATH_MSG_WARNING("failed to retrieve MET container from passed object");
385  }
386 
387  missingEt const ptHard = calcPtHard(METcont);
388  double const ptHardMet = std::sqrt( ptHard.mpx * ptHard.mpx +
389  ptHard.mpy * ptHard.mpy ) ;
390 
391  const xAOD::MissingET* jetterm = *METcont->find( MissingETBase::Source::jet() );
392  size_t njet = (jetterm==nullptr) ? 0 : acc_constitObjLinks(*jetterm ).size();
393 
394  int phbin = std::as_const(m_shiftpara_pthard_njet_mu)->GetXaxis()->FindBin( ptHardMet ) ;
395  if(phbin>m_shiftpara_pthard_njet_mu->GetNbinsX()) phbin = m_shiftpara_pthard_njet_mu->GetNbinsX();
396  int const jetbin = std::as_const(m_shiftpara_pthard_njet_mu)->GetYaxis()->FindBin(njet);
397  int const mubin = std::as_const(m_shiftpara_pthard_njet_mu)->GetZaxis()->FindBin(eInfo.actualInteractionsPerCrossing() );
398  double const ptHardShift = m_shiftpara_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin);
399 
400  double const randGaus = getTLSRandomGen()->Gaus(0.,1.);
401 
402  ATH_MSG_DEBUG("About to apply systematic " << appliedSystematicsString() );
403 
404  //now we need to know what soft term systematics we are doing
405  //m_appliedSystEnum was cached by the applySystematicVariation method
406  switch( m_appliedSystEnum ){
407  case MET_SOFTTRK_SCALEUP : {
408  softMetStruct = softTrkSyst_scale(softMetStruct, ptHard, ptHardShift);
409  break;
410  }
411  case MET_SOFTTRK_SCALEDOWN: {
412  softMetStruct = softTrkSyst_scale(softMetStruct, ptHard,-1*ptHardShift);
413  break;
414  }
415  case MET_SOFTTRK_RESOPARA : {
416  double const smearpara = m_resopara_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
417  softMetStruct = softTrkSyst_reso(softMetStruct, ptHard, ptHardShift, smearpara, 0.);
418  break;
419  }
420  case MET_SOFTTRK_RESOPERP : {
421  double const smearperp = m_resoperp_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
422  softMetStruct = softTrkSyst_reso(softMetStruct, ptHard, ptHardShift, 0., smearperp );
423  break;
424  }
425  case MET_SOFTTRK_RESOCORR : {
426  double const smearpara = m_resopara_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
427  double const smearperp = m_resoperp_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
428  softMetStruct = softTrkSyst_reso(softMetStruct, ptHard, ptHardShift, smearpara , smearperp);
429  break;
430  }
431  case MET_SOFTCALO_SCALEUP : {
432  double const caloscale = 1. + m_h_calosyst_scale->GetBinContent(1);
433  softMetStruct = caloSyst_scale(softMetStruct,caloscale);
434  break;
435  }
436  case MET_SOFTCALO_SCALEDOWN : {
437  double const caloscale = 1. - m_h_calosyst_scale->GetBinContent(1);
438  softMetStruct = caloSyst_scale(softMetStruct,caloscale);
439  break;
440  }
441  case MET_SOFTCALO_RESO : {
442  softMetStruct = caloSyst_reso(softMetStruct) ;
443  break;
444  }
445  default:{
446  ATH_MSG_DEBUG("No systematic applied, returning nominal MET term");
447  }
448  }
449 
450  //fill the softMet back with the struct values to return
451  softMet.setMpx( softMetStruct.mpx);
452  softMet.setMpy( softMetStruct.mpy);
453  softMet.setSumet( softMetStruct.sumet);
454  softMet.setName( softMetStruct.name);
455  softMet.setSource( softMetStruct.source);
456  } else {
457  ATH_MSG_DEBUG("Ignore irrelevant systematic.");
458  }
459 
460  ATH_MSG_VERBOSE("Output soft term " << softMet.name()
461  << ", met = " << softMet.met() );
462 
463  return CP::CorrectionCode::Ok;
464  }
465 
468  const xAOD::Jet* jet) const
469 
470  {
471  ATH_MSG_VERBOSE(__PRETTY_FUNCTION__);
472 
473  if( m_jet_systRpt_pt_eta == nullptr ) {
474  ATH_MSG_ERROR("jet track systematics histogram not initialized properly.") ;
476  }
477 
481 
482  int phbin = std::as_const(m_jet_systRpt_pt_eta)->GetXaxis()->FindBin(jet->pt()/1e3);
483  if(phbin>m_jet_systRpt_pt_eta->GetNbinsX()) phbin = m_jet_systRpt_pt_eta->GetNbinsX();
484 
485  int etabin = std::as_const(m_jet_systRpt_pt_eta)->GetYaxis()->FindBin(std::abs( jet->eta() ));
486  if(etabin>m_jet_systRpt_pt_eta->GetNbinsY()) etabin = m_jet_systRpt_pt_eta->GetNbinsY();
487 
488  double uncert = 0.;
489  switch( m_appliedSystEnum ){
490  case MET_JETTRK_SCALEUP : {
491  uncert = m_jet_systRpt_pt_eta->GetBinContent(phbin,etabin);
492  break;
493  }
494  case MET_JETTRK_SCALEDOWN : {
495  uncert = -1.*m_jet_systRpt_pt_eta->GetBinContent(phbin,etabin);
496  break;
497  }
498  default:
499  break;
500  }
501 
502  ATH_MSG_VERBOSE("Uncertainty on this jet is " << uncert);
503 
504  jettrkmet.setMpx ( jettrkmet.mpx() - trkvec.cpx() * uncert);
505  jettrkmet.setMpy ( jettrkmet.mpy() - trkvec.cpy() * uncert);
506  } else { ATH_MSG_VERBOSE("No jet track systematics applied"); }
507 
508  return CP::CorrectionCode::Ok;
509  }
510 
513 
514  {
515  ATH_MSG_VERBOSE(__PRETTY_FUNCTION__);
516 
517  if( m_jet_systRpt_pt_eta == nullptr ) {
518  ATH_MSG_ERROR("jet track systematics histogram not initialized properly.") ;
520  }
521 
523  double uncert = 0.;
524  int jetCount=0;
525 
526  std::vector<const xAOD::Jet*> jets;
527  for(const iplink_t& jetlink : acc_constitObjLinks(jettrkmet)) {
528  if((*jetlink)->type()!=xAOD::Type::Jet) {
529  ATH_MSG_ERROR("Invalid object of type " << (*jetlink)->type() << " in jet term");
531  }
532  jets.push_back(static_cast<const xAOD::Jet*>(*jetlink));
533  }
534  bool originalInputs = jets.empty() ? false : !acc_originalObject.isAvailable(*jets.front());
535  for(const xAOD::Jet *jet : jets) {
536  const MissingETAssociation* assoc = nullptr;
537  const MissingETAssociationMap* map = helper.map();
538  if(originalInputs) {
540  } else {
541  const IParticle* orig = *acc_originalObject(*jet);
542  assoc = MissingETComposition::getAssociation(map,static_cast<const xAOD::Jet*>(orig));
543  }
544 
546  if(std::abs(jet->eta())<=2.5)
547  {
548  jetCount++;
549  int phbin = std::as_const(m_jet_systRpt_pt_eta)->GetXaxis()->FindBin(jet->pt()/1e3);
550  if(phbin>m_jet_systRpt_pt_eta->GetNbinsX()) phbin = m_jet_systRpt_pt_eta->GetNbinsX();
551 
552  int etabin = std::as_const(m_jet_systRpt_pt_eta)->GetYaxis()->FindBin(std::abs( jet->eta() ));
553  if(etabin>m_jet_systRpt_pt_eta->GetNbinsY()) etabin = m_jet_systRpt_pt_eta->GetNbinsY();
554  float uncert_frac=(trkvec.sumpt())*(m_jet_systRpt_pt_eta->GetBinContent(phbin, etabin));
555 
556  ATH_MSG_VERBOSE("Sumpt: "<< trkvec.sumpt());
557  ATH_MSG_VERBOSE("jet uncert: "<< m_jet_systRpt_pt_eta->GetBinContent(phbin, etabin));
558  uncert = std::sqrt(uncert*uncert+uncert_frac*uncert_frac);
559  }
560  }
561 
562  ATH_MSG_VERBOSE("Uncertainty: "<< uncert);
563  ATH_MSG_VERBOSE("Jet Counting: "<< jetCount);
564 
565  switch( m_appliedSystEnum ) {
566  case MET_JETTRK_SCALEUP :
567  {
568  //uncert = uncert;
569  break;
570  }
571  case MET_JETTRK_SCALEDOWN :
572  {
573  uncert = -1.*uncert;
574  break;
575  }
576  default:
577  break;
578  }
579 
580  jettrkmet.setMpx ( jettrkmet.mpx()*(1 + uncert/(std::abs(jettrkmet.mpx())*std::sqrt(2))));
581  jettrkmet.setMpy ( jettrkmet.mpy()*(1 + uncert/(std::abs(jettrkmet.mpy())*std::sqrt(2))));
582  jettrkmet.setSumet( jettrkmet.sumet() + uncert);
583  }
584 
585  return CP::CorrectionCode::Ok;
586  }
587 
588 
591  ) const
592  {
593  ATH_MSG_VERBOSE( __PRETTY_FUNCTION__ );
594 
595  const MissingETAssociationMap* map = helper.map();
596  if(!map) {
597  ATH_MSG_ERROR("MissingETAssociationMap null, error calculating jet track systematics.");
599  }
600 
602  ATH_MSG_ERROR("Failed to calculate jet track systematics.");
604  }
605  return CP::CorrectionCode::Ok;
606  }
607 
608  missingEt METSystematicsTool::caloSyst_scale(missingEt const &softTerms, double const scale) const{
609  ATH_MSG_VERBOSE( __PRETTY_FUNCTION__ );
610 
611  return missingEt(softTerms.mpx*scale, softTerms.mpy*scale, softTerms.sumet,
612  softTerms.name,softTerms.source);
613  }
614 
616  ATH_MSG_VERBOSE( __PRETTY_FUNCTION__ );
617  // ATH_MSG_VERBOSE("caloSyst_reso: input MET: " << softTerms.met);
618 
619  double const metSigma = .7 * std::sqrt(softTerms.sumet);
620  double const resUnc = m_h_calosyst_reso->GetBinContent(1);
621  double const smearedSigma = std::sqrt( (metSigma* (1. + resUnc))*(metSigma* (1. + resUnc)) -
622  metSigma * metSigma );
623 
624  ATH_MSG_VERBOSE("caloSyst_reso: metSigma: " << metSigma << ", resUnc: " << resUnc << ", smearedSigma = " << smearedSigma);
625 
626  double const softTermsMet = std::sqrt( softTerms.mpx * softTerms.mpx +
627  softTerms.mpy * softTerms.mpy );
628 
629 
630  double const rand = getTLSRandomGen()->Gaus(0.,1.);
631  double const shift = softTermsMet<1e-9 ? 0. : rand*smearedSigma / softTermsMet;
632 
633  ATH_MSG_VERBOSE("caloSyst_reso: shift = " << shift);
634 
635  return missingEt(softTerms.mpx*(1.+shift),softTerms.mpy*(1.+shift),softTerms.sumet,
636  softTerms.name,softTerms.source);
637  }
638 
639  missingEt METSystematicsTool::softTrkSyst_scale(missingEt const &softTerms, missingEt const &ptHard, double const shift) const
640  { ATH_MSG_VERBOSE(__PRETTY_FUNCTION__);
641  return softTrkSyst_reso(softTerms, ptHard, shift, 0. , 0.);
642  }
643 
645  missingEt const &ptHard,
646  double const shift,
647  double const smearpara,
648  double const smearperp) const{
649  ATH_MSG_VERBOSE( __PRETTY_FUNCTION__ );
650 
651  missingEt projection = projectST(softTerms,ptHard);
652  projection.mpx = (projection.mpx + shift + smearpara );
653  projection.mpy = (projection.mpy + + smearperp );
654 
655  return projectST(projection, ptHard);
656  }
657 
658  missingEt METSystematicsTool::projectST(missingEt const &softTerms, missingEt const &ptHard) const
659  {
660  ATH_MSG_VERBOSE( __PRETTY_FUNCTION__ );
661  double const ptHardMet = std::sqrt( ptHard.mpx * ptHard.mpx +
662  ptHard.mpy * ptHard.mpy );
663 
664  double const ux = ptHard.mpx/ptHardMet;
665  double const uy = ptHard.mpy/ptHardMet;
666  double const projL = ux*softTerms.mpx + uy*softTerms.mpy;
667  double const projT = uy*softTerms.mpx - ux*softTerms.mpy;
668  missingEt proj(projL,projT,softTerms.sumet,
669  softTerms.name,softTerms.source);
670 
671  return proj;
672  }
673 
675  {
676  ATH_MSG_VERBOSE(__PRETTY_FUNCTION__ );
677 
678  //get truth container
680  if (!truthCont.isValid()) {
681 
682  ATH_MSG_ERROR( m_TruthContKey.key() << " container empty or doesn't exist, calcPtHard returning zero.");
683  return {};
684  }
685 
687  if(truthiter == truthCont->end()){
688  ATH_MSG_ERROR( "NonInt is not in " << m_TruthContKey.key() << ". calcPtHard returing zero." );
689  return {};
690  }
691  const xAOD::MissingET& truthmet = **truthiter;
692 
693  missingEt ptHard;
694  ptHard.mpx = truthmet.mpx();
695  ptHard.mpy = truthmet.mpy();
696  ptHard.sumet = truthmet.sumet();
697  ptHard.name = truthmet.name();
698  ptHard.source = truthmet.source();
699 
700  //loop over all non soft or total terms
701  for(xAOD::MissingETContainer::const_iterator iMET=cont->begin();iMET!=cont->end(); ++iMET ) {
702  if( !( MissingETBase::Source::isSoftTerm( (*iMET)->source() ) ||
703  MissingETBase::Source::isTotalTerm( (*iMET)->source() ) ) ) {
704  ptHard.mpx -= (*iMET)->mpx();
705  ptHard.mpy -= (*iMET)->mpy();
706  ptHard.sumet += (*iMET)->sumet();
707  }
708  }
709 
710  if( ptHard.sumet < 0 ) {
711  ATH_MSG_ERROR("PtHard has a negative sumet, returning ptHart = 0");
712  return {};
713  }
714 
715  ptHard.mpx *= 1./(double(m_units)) ;
716  ptHard.mpy *= 1./(double(m_units)) ;
717  ptHard.sumet*= 1./(double(m_units)) ;
718 
719  // protect from zero pthard. protects against an empty pthard for the soft term systematic
720  if(ptHard.sumet<1.0e-6){
721  ptHard.sumet=1.0e-6;
722  ptHard.mpx=1.0e-6;
723  ptHard.mpy=0.0;
724  }
725 
726  return ptHard;
727  }
728 
730  std::string & systpath ,
731  std::string & histpath,
732  std::string & suffix ,
733  SystType const & type
734  )
735  {
736  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__);
737  TEnv reader;
738 
739  std::string configpath = "";
740  std::string configfile = "";
741  if(m_useDevArea) { configpath += "dev/"; }
742 
743  switch(type){
744  case SOFTCALO : configfile += m_configSoftCaloFile.value();
745  configpath = PathResolverFindCalibFile(m_configPrefix.value()+m_configSoftCaloFile.value());//, "CALIBPATH", PathResolver::RecursiveSearch) ;
746  break;
747  case SOFTTRK : configfile += m_configSoftTrkFile.value();
748  configpath = PathResolverFindCalibFile(m_configPrefix.value()+m_configSoftTrkFile.value());//, "CALIBPATH", PathResolver::RecursiveSearch) ;
749  break;
750  case JETTRK : configfile += m_configJetTrkFile.value();
751  configpath = PathResolverFindCalibFile(m_configPrefix.value()+m_configJetTrkFile.value());//, "CALIBPATH", PathResolver::RecursiveSearch) ;
752  break;
753  default : configpath = "";
754  }
755 
756  ATH_MSG_INFO( "Searching for configFile: " << configfile);
757  ATH_MSG_DEBUG( "PWD: " << gSystem->Getenv("PWD") ) ;
758  ATH_MSG_DEBUG( "CALIBPATH: " << gSystem->Getenv("CALIBPATH") );
759 
760  if(configpath.empty() || configfile.empty() ){
761  ATH_MSG_ERROR( "Path Resolver couldn't find config file");
762  return StatusCode::FAILURE;
763  }
764 
765  if( reader.ReadFile(configpath.c_str(),EEnvLevel(0)) < 0) {
766  ATH_MSG_ERROR( "Couldn't read the track config file!" );
767  return StatusCode::FAILURE;
768  }
769 
770  ATH_MSG_INFO( "Configuring from file : " << configpath );
771 
772 
773  switch(type){
774  case SOFTCALO :
775  histfile = reader.GetValue( "Conf.InputFile" , "");
776  systpath = reader.GetValue( "GlobalSyst.sourcedir" , "" );
777  break;
778  case SOFTTRK :
779  histfile = reader.GetValue( "Conf.InputFile" , "");
780  systpath = reader.GetValue( "PtHardSyst.sourcedir" , "" );
781  suffix = reader.GetValue( "PtHardSyst.suffix" , "" );
782  break;
783  case JETTRK :
784  histfile = reader.GetValue( "JetTrkSyst.InputFile" , "");
786  systpath = "/";
787  break;
788  default : break;
789  }
790  if(m_useDevArea) histfile = "dev/"+histfile;
791 
792  std::string const units_string = reader.GetValue( "Units", "" );
793 
794  //check if we already set the units in another config file
795  if(m_units == 1000){
796  if(units_string != "GeV"){
797  ATH_MSG_ERROR("initialized the different systematics using two config files that conflict on units");
798  return StatusCode::FAILURE;
799  }
800  }
801  if(m_units == 1){
802  if( (!units_string.empty()) &&
803  (units_string != "MeV")
804  ){
805  ATH_MSG_ERROR("initialized the different systematics using two config files that conflict on units");
806  return StatusCode::FAILURE;
807  }
808  }
809 
810  //set the units again
811  if( (units_string.empty()) ||
812  (units_string == "MeV")
813  ){
814  m_units = 1;
815  }else if(units_string == "GeV"){
816  m_units = 1000;
817  }else{
818  ATH_MSG_ERROR("You specified an incorrect 'Units' value. Please specify MeV , GeV , or leave it blank for MeV");
819  return StatusCode::FAILURE;
820  }
821 
822  ATH_MSG_INFO( "Will read histograms from : " << histfile );
823  ATH_MSG_DEBUG( "Systpath :" << systpath ) ;
824  histpath = PathResolverFindCalibFile(histfile);//, "CALIBPATH", PathResolver::RecursiveSearch) ;
825  ATH_MSG_INFO("Extracted histogram path : " << histpath);
826 
827  if(histfile.empty() || systpath.empty() || histpath.empty() ){
828  ATH_MSG_ERROR("Failed to correctly set histfile path, or path to histograms inside of the histfile" );
829  return StatusCode::FAILURE;
830  }
831 
832 
833  if( (m_units != 1) &&
834  (m_units != 1000) &&
835  (m_units != -1)
836  ){
837  ATH_MSG_ERROR("Something is wrong with your units initialization. Please contact the developers (you should never get here).");
838  return StatusCode::FAILURE;
839  }
840 
841 
842  return StatusCode::SUCCESS;
843  }
844 
845 
846  //stolen from JetUncertainties
848  { ATH_MSG_VERBOSE (__PRETTY_FUNCTION__ );
849 
851  if (!eInfoConst.isValid()) {
852 
853  ATH_MSG_ERROR("Failed to retrieve default EventInfo object");
854  }
855  return &*eInfoConst;
856  }
857 
859  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__ );
861 
862  if (!vertices.isValid()) {
863 
864  ATH_MSG_ERROR("Failed to retrieve default NPV value from PrimaryVertices");
865  return 0;
866  }
867 
868  int NPV = 0;
870  for (itr = vertices->begin(); itr != vertices->end(); ++itr)
871  if ( (*itr)->vertexType() != xAOD::VxType::NoVtx) NPV++;
872 
873  return NPV;
874  }
875 
877  TRandom3* random = m_rand_tls.get();
878  if (!random) {
879  random = new TRandom3();
880  m_rand_tls.reset(random);
881  }
882  return random;
883  }
884 
885  void METSystematicsTool::setRandomSeed(int seed) const {
886  ATH_MSG_VERBOSE(__PRETTY_FUNCTION__);
887  getTLSRandomGen()->SetSeed(seed);
888  }
889 }
890 
891 // LocalWords: SOFTTRK
ShallowCopy.h
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
met::METSystematicsTool::m_resoperp_pthard_njet_mu
std::unique_ptr< TH3D > m_resoperp_pthard_njet_mu
Definition: METSystematicsTool.h:157
met::METSystematicsTool::internalSoftTermApplyCorrection
CP::CorrectionCode internalSoftTermApplyCorrection(xAOD::MissingET &softMet, xAOD::MissingETContainer const *METcont, xAOD::EventInfo const &eInfo) const
Definition: METSystematicsTool.cxx:343
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:151
hotSpotInTAG.suffix
string suffix
Definition: hotSpotInTAG.py:186
checkCorrelInHIST.histpath
histpath
Definition: checkCorrelInHIST.py:400
run.infile
string infile
Definition: run.py:13
xAOD::MissingET_v1::setSumet
void setSumet(float value)
Set .
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
met::METSystematicsTool::jetTrkSystInitialize
StatusCode jetTrkSystInitialize()
Definition: METSystematicsTool.cxx:144
xAOD::MissingETAssociation_v1
MET association descriptor contains object links and corresponding parameters.
Definition: MissingETAssociation_v1.h:29
met::missingEt::mpy
double mpy
Definition: METSystematicsTool.h:60
met::METSystematicsTool::applySystematicVariation
StatusCode applySystematicVariation(const CP::SystematicSet &set)
effects: configure this tool for the given list of systematic variations.
Definition: METSystematicsTool.h:125
xAOD::MissingET_v1::sumet
float sumet() const
Returns.
CP::SystematicSet::size
size_t size() const
returns: size of the set
Definition: SystematicSet.h:71
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
met::METSystematicsTool::softTrkSystInitialize
StatusCode softTrkSystInitialize()
Definition: METSystematicsTool.cxx:173
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:876
MissingETBase::Source::isTotalTerm
static bool isTotalTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
Definition: MissingETBase.h:405
asg
Definition: DataHandleTestTool.h:28
met::MET_SOFTCALO_RESO
@ MET_SOFTCALO_RESO
Definition: METSystematicsTool.h:77
met::METSystematicsTool::applyCorrection
CP::CorrectionCode applyCorrection(xAOD::MissingET &inputMet, const xAOD::MissingETAssociationHelper &helper) const
Definition: METSystematicsTool.cxx:243
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
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:149
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:79
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::JETTRK
@ JETTRK
Definition: IMETSystematicsTool.h:50
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
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
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
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.
xAOD::VxType::NoVtx
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.
Definition: TrackingPrimitives.h:570
MissingETBase::Source::isJetTerm
static bool isJetTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
Definition: MissingETBase.h:402
xAOD::MissingETAssociation_v1::ConstVec
Vector sum of constituents for subtractive overlap removal.
Definition: MissingETAssociation_v1.h:36
xAOD::MissingETAssociationMap_v1
Definition: MissingETAssociationMap_v1.h:29
met::METSystematicsTool::m_h_calosyst_scale
std::unique_ptr< TH1D > m_h_calosyst_scale
Definition: METSystematicsTool.h:159
met::METSystematicsTool::caloSyst_scale
missingEt caloSyst_scale(missingEt const &softTerms, double const scale) const
Definition: METSystematicsTool.cxx:608
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:112
met::METSystematicsTool::m_configSoftCaloFile
Gaudi::Property< std::string > m_configSoftCaloFile
Definition: METSystematicsTool.h:152
met::NONE
@ NONE
Definition: METSystematicsTool.h:69
met::METSystematicsTool::m_appliedSystEnum
SystApplied m_appliedSystEnum
Definition: METSystematicsTool.h:136
met::METSystematicsTool::addMETAffectingSystematics
StatusCode addMETAffectingSystematics()
Definition: METSystematicsTool.cxx:41
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
met::METSystematicsTool::m_h_calosyst_reso
std::unique_ptr< TH1D > m_h_calosyst_reso
Definition: METSystematicsTool.h:160
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:162
met
Definition: IMETSignificance.h:24
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
LArG4FSStartPointFilter.rand
rand
Definition: LArG4FSStartPointFilter.py:80
met::MET_SOFTTRK_RESOCORR
@ MET_SOFTTRK_RESOCORR
Definition: METSystematicsTool.h:74
met::METSystematicsTool::calcPtHard
missingEt calcPtHard(xAOD::MissingETContainer const *const cont) const
Definition: METSystematicsTool.cxx:674
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:165
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:847
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:153
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::calcJetTrackMETWithSyst
CP::CorrectionCode calcJetTrackMETWithSyst(xAOD::MissingET &jettrkmet, const xAOD::MissingETAssociationHelper &helper) const
Definition: METSystematicsTool.cxx:511
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:858
xAOD::MissingETAssociation_v1::jetTrkVec
ConstVec jetTrkVec() const
Get track constituent vector for the reference jet.
Definition: MissingETAssociation_v1.cxx:570
met::METSystematicsTool::setRandomSeed
void setRandomSeed(int seed) const
Definition: METSystematicsTool.cxx:885
met::SOFTTRK
@ SOFTTRK
Definition: IMETSystematicsTool.h:49
met::METSystematicsTool::correctedCopy
CP::CorrectionCode correctedCopy(const xAOD::MissingET &met, xAOD::MissingET *&outputmet, const xAOD::MissingETAssociationHelper &helper) const
Definition: METSystematicsTool.cxx:287
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:228
met::missingEt
Definition: METSystematicsTool.h:42
ReadHandle.h
Handle class for reading from StoreGate.
met::METSystematicsTool::m_shiftpara_pthard_njet_mu
std::unique_ptr< TH3D > m_shiftpara_pthard_njet_mu
Definition: METSystematicsTool.h:155
met::METSystematicsTool::softTrkSyst_scale
missingEt softTrkSyst_scale(missingEt const &softTerms, missingEt const &ptHard, double const shift) const
Definition: METSystematicsTool.cxx:639
met::METSystematicsTool::caloSyst_reso
missingEt caloSyst_reso(missingEt const &softTerms) const
Definition: METSystematicsTool.cxx:615
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:26
met::SOFTCALO
@ SOFTCALO
Definition: IMETSystematicsTool.h:48
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:782
met::SystType
SystType
Definition: IMETSystematicsTool.h:46
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:431
met::METSystematicsTool::sysApplySystematicVariation
StatusCode sysApplySystematicVariation(const CP::SystematicSet &)
effects: configure this tool for the given list of systematic variations.
Definition: METSystematicsTool.cxx:208
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:158
met::METSystematicsTool::projectST
missingEt projectST(missingEt const &softTerms, missingEt const &ptHard) const
Definition: METSystematicsTool.cxx:658
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:172
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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:150
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:173
met::MET_SOFTTRK_SCALEUP
@ MET_SOFTTRK_SCALEUP
Definition: METSystematicsTool.h:70
met::METSystematicsTool::m_resopara_pthard_njet_mu
std::unique_ptr< TH3D > m_resopara_pthard_njet_mu
Definition: METSystematicsTool.h:156
met::MET_JETTRK_SCALEUP
@ MET_JETTRK_SCALEUP
Definition: METSystematicsTool.h:78
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
met::METSystematicsTool::getCorrectedJetTrackMET
CP::CorrectionCode getCorrectedJetTrackMET(xAOD::MissingET &jettrkmet, const xAOD::MissingETAssociationHelper &helper) const
Definition: METSystematicsTool.cxx:589
calibdata.copy
bool copy
Definition: calibdata.py:27
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 .
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
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:729
module_driven_slicing.histfile
histfile
Definition: module_driven_slicing.py:571
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:174
met::METSystematicsTool::softTrkSyst_reso
missingEt softTrkSyst_reso(missingEt const &softTerms, missingEt const &ptHard, double const shift, double const smearpara, double const smearperp) const
Definition: METSystematicsTool.cxx:644
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