ATLAS Offline Software
METSignificance.cxx
Go to the documentation of this file.
1 /*
3  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4 */
5 // METSignificance.cxx
6 // Implementation file for class METSignificance
7 // Author: P.Francavilla<francav@cern.ch>
8 // Author: D.Schaefer<schae@cern.ch>
10 
11 // METUtilities includes
13 
14 // MET EDM
18 
19 // Jet EDM
20 #include "xAODJet/JetAttributes.h"
21 
22 // Other xAOD EDM
24 #include "xAODMuon/MuonContainer.h"
28 
30 #include "AsgTools/AsgToolConfig.h"
32 
33 // Needed for xAOD::get_eta_calo() function
34 
36 
37 #ifdef XAOD_STANDALONE
39 #endif
40 
41 namespace met {
42 
44 
45  static const SG::AuxElement::ConstAccessor<float> acc_varX("varX");
46  static const SG::AuxElement::ConstAccessor<float> acc_varY("varY");
47  static const SG::AuxElement::ConstAccessor<float> acc_covXY("covXY");
48  static const SG::AuxElement::ConstAccessor<float> acc_jvt("Jvt");
49  static const SG::AuxElement::ConstAccessor<float> acc_fjvt("fJvt");
50  static const SG::AuxElement::ConstAccessor<float> acc_fjvt_der("DFCommonJets_fJvt");
51  static const SG::AuxElement::ConstAccessor< std::vector<iplink_t > > acc_constitObjLinks("ConstitObjectLinks");
52  const static MissingETBase::Types::bitmask_t invisSource = 0x100000; // doesn't overlap with any other
53 
54  METSignificance::METSignificance(const std::string& name) :
55  AsgTool(name),
56  m_GeV(1.0e3),
57  m_softTermParam(met::Random),
58  m_jerForEMu(false),
59  m_jetPtThr(-1.0),
60  m_jetEtaThr(-1.0),
61  m_significance(0.0),
62  m_rho(0.0),
63  m_VarL(0.0),
64  m_VarT(0.0),
65  m_CvLT(0.0),
66  m_met_VarL(0.0),
67  m_met_VarT(0.0),
68  m_met_CvLT(0.0),
69  m_met(0.0),
70  m_metphi(0.0),
71  m_ht(0.0),
72  m_sumet(0.0),
73  m_file(nullptr),
74  m_phi_reso_pt20(nullptr),
75  m_phi_reso_pt50(nullptr),
76  m_phi_reso_pt100(nullptr)
77  {
78  declareProperty("SoftTermParam", m_softTermParam = met::Random );
79  declareProperty("SoftTermReso", m_softTermReso = 8.5 );
80  declareProperty("TreatPUJets", m_treatPUJets = true );
81  declareProperty("DoPhiReso", m_doPhiReso = false );
82  declareProperty("ApplyBias", m_applyBias = false );
83  declareProperty("DoJerForEMu", m_jerForEMu = false ); // run jet resolution for all electrons and muons
84  declareProperty("ScalarBias", m_scalarBias = 0.0 );
85  declareProperty("JetPtThr", m_jetPtThr = -1.0 );
86  declareProperty("JetEtaThr", m_jetEtaThr = -1.0 );
87  declareProperty("ConfigPrefix", m_configPrefix = "METUtilities/data17_13TeV/metsig_Aug15/");
88  declareProperty("ConfigJetPhiResoFile", m_configJetPhiResoFile = "jet_unc.root" );
89  declareProperty("JetResoAux", m_JetResoAux = "" ); // relative pT resolution in addition to normal JES
90  declareProperty("EMuResoAux", m_EMuResoAux = "" ); // aux string sets a bool for the leptons to run the jet resolation
91  declareProperty("JetCollection", m_JetCollection = "AntiKt4EMPFlow" );
92 
93  // properties to delete eventually
94  declareProperty("IsDataJet", m_isDataJet = false );
95  declareProperty("IsDataMuon", m_isDataMuon = false );
96  declareProperty("IsAFII", m_isAFII = false );
97 
98  m_file = nullptr;
99  }
100 
102 
104 
105  ATH_MSG_INFO ("Initializing " << name() << "...");
106  ATH_MSG_INFO("Set up JER tools");
107  if(m_JetCollection == "AntiKt4EMTopoJets"){
108  ATH_MSG_WARNING(" tool wasn't updated for EMTopo jets so far and is not supported.");
109  }
110  // Phi resolution
112  m_file = TFile::Open(configpath.c_str());
113  if(m_file){
114  m_phi_reso_pt20 = static_cast<TH2F *>(m_file->Get("phi_reso_pt20"));
115  if(!m_phi_reso_pt20) ATH_MSG_ERROR("PU Jet Uncertainty Histogram not valid");
116  m_phi_reso_pt50 = static_cast<TH2F *>(m_file->Get("phi_reso_pt50"));
117  if(!m_phi_reso_pt50) ATH_MSG_ERROR("PU Jet Uncertainty Histogram not valid");
118  m_phi_reso_pt100 = static_cast<TH2F *>(m_file->Get("phi_reso_pt100"));
119  if(!m_phi_reso_pt100) ATH_MSG_ERROR("PU Jet Uncertainty Histogram not valid");
120  }
121  else{
122  ATH_MSG_ERROR("PU Jet Uncertainty TFile is not valid: " << configpath);
123  return StatusCode::FAILURE;
124  }
125 
126  std::string toolName;
127  std::string jetcoll = "AntiKt4EMTopoJets";
128  toolName = "JetCalibrationTool/jetCalibTool_"+m_JetCollection;
129  ATH_MSG_INFO("Set up jet resolution tool");
130  if (m_jetCalibTool.empty()){
131 
132  asg::AsgToolConfig toolConfig (toolName);
133  // FIXME: it would be better to configure this via properties
134  std::string config = "JES_data2017_2016_2015_Recommendation_Aug2018_rel21.config";
135  std::string calibSeq = "JetArea_Residual_EtaJES_GSC_Smear";
136  std::string calibArea = "00-04-81";
137  if(m_JetCollection=="AntiKt4EMPFlow"){
138  config = "JES_data2017_2016_2015_Recommendation_PFlow_Aug2018_rel21.config";
139  calibSeq = "JetArea_Residual_EtaJES_GSC_Smear";
140  calibArea = "00-04-81";
141  }
142 
143  ANA_CHECK( toolConfig.setProperty("JetCollection",m_JetCollection) );
144  ANA_CHECK( toolConfig.setProperty("ConfigFile",config) );
145  ANA_CHECK( toolConfig.setProperty("CalibSequence",calibSeq) );
146  ANA_CHECK( toolConfig.setProperty("CalibArea",calibArea) );
147  ANA_CHECK( toolConfig.setProperty("IsData",false) ); // configure for MC due to technical reasons. Both data and MC smearing are available with this setting.
148  ANA_CHECK( toolConfig.makePrivateTool (m_jetCalibTool) );
149  }
150  ANA_CHECK( m_jetCalibTool.retrieve() );
151 
152  ATH_MSG_INFO("Set up MuonCalibrationAndSmearing tools");
153  toolName = "MuonCalibrationAndSmearingTool";
154  if (m_muonCalibrationAndSmearingTool.empty()) {
155  ATH_MSG_WARNING("Setup the muon calibration tool with calib mode 1. Please consider to configure the tool via the 'MuonCalibTool' property.");
156  asg::AsgToolConfig toolConfig ("CP::MuonCalibTool/METSigAutoConf_"+toolName);
157  ATH_CHECK(toolConfig.setProperty("calibMode", 1));
159  }
161 
162  ATH_MSG_DEBUG( "Initialising EgcalibTool " );
163  toolName = "EgammaCalibrationAndSmearingTool";
164  if (m_egammaCalibTool.empty()){
165  asg::AsgToolConfig toolConfig ("CP::EgammaCalibrationAndSmearingTool/METSigAutoConf_" + toolName);
166  ATH_CHECK(toolConfig.setProperty("ESModel", "es2017_R21_v0"));
167  ATH_CHECK(toolConfig.setProperty("decorrelationModel", "1NP_v1"));
168  if(m_isAFII) ATH_CHECK(toolConfig.setProperty("useFastSim", 1));
169  else ATH_CHECK(toolConfig.setProperty("useFastSim", 0));
171  }
172  ATH_CHECK( m_egammaCalibTool.retrieve() );
173 
174  toolName = "TauPerfTool";
175  if (m_tauCombinedTES.empty()){
176  asg::AsgToolConfig toolConfig ("TauCombinedTES/METSigAutoConf_" + toolName);
177  ATH_CHECK( toolConfig.setProperty("WeightFileName", "CombinedTES_R22_Round2.5_v2.root") );
178  ATH_CHECK( toolConfig.setProperty("useMvaResolution", true) );
180  }
181  ATH_CHECK( m_tauCombinedTES.retrieve() );
182 
183  return StatusCode::SUCCESS;
184  }
185 
187 
188  ATH_MSG_INFO ("Finalizing " << name() << "...");
189  delete m_phi_reso_pt20;
190  delete m_phi_reso_pt50;
191  delete m_phi_reso_pt100;
192 
193  return StatusCode::SUCCESS;
194  }
195 
196  // **** Rebuild generic MET term ****
197  StatusCode METSignificance::varianceMET(xAOD::MissingETContainer* metCont, float avgmu, const std::string& jetTermName, const std::string& softTermName, const std::string& totalMETName){
198 
199  // reset variables
200  m_VarL = 0.0;
201  m_VarT = 0.0;
202  m_CvLT = 0.0;
203 
204  int metTerm = 0;
205  double particle_sum[2][2] = {{0.0,0.0}, {0.0,0.0}};
206  m_metphi = 0.0; //Angle for rotation of the cov matrix
207  m_met = -1.0; // Numerator
208  m_metsoft = 0.0;
209  m_metsoftphi = 0.0;
210  m_sumet=-1.0;
211  m_ht=0.0;
212  m_term_VarL.clear();
213  m_term_VarT.clear();
214  m_term_CvLT.clear();
215 
216  unsigned nIterSoft=0;
217  double softSumET=0.0;
218 
219  // first fill the total MET
220  if(metCont->find(totalMETName)!=metCont->end()){
221  const auto &tot_met = static_cast<xAOD::MissingET*>(*(metCont->find(totalMETName)));
222  if(!MissingETBase::Source::isTotalTerm(tot_met->source())){
223  ATH_MSG_ERROR("NOT the total MET with name:" <<totalMETName);
224  return StatusCode::SUCCESS;
225  }
226  m_met = tot_met->met()/m_GeV;
227  m_metx = tot_met->mpx()/m_GeV;
228  m_mety = tot_met->mpy()/m_GeV;
229  m_metphi = tot_met->phi();
230  m_sumet = tot_met->sumet()/m_GeV;
231  m_ht = m_sumet;
232  ATH_MSG_VERBOSE("total MET: " << m_met << " phi: " << m_metphi << " name: " << tot_met->name());
233  }
234  else{
235  ATH_MSG_ERROR("Could not find the total MET with name:" <<totalMETName);
236  return StatusCode::SUCCESS;
237  }
238  m_met_vect.SetXYZ(m_metx, m_mety, 0);
239 
240  // Fill the remaining terms
241  for(const auto met : *metCont) {
242 
243  // skip the invisible and total MET
245  ATH_MSG_VERBOSE("Total: " << met->name() << " val: " << met->met());
246  continue;
247  }
248  if(met->source()==invisSource) continue;
249 
250  // Soft term collection
251  if(MissingETBase::Source::isSoftTerm(met->source())){
252 
254  ATH_MSG_VERBOSE("Soft Name: " << met->name());
255  // make sure the container name matches
256  if(met->name()!=softTermName || nIterSoft>0){
257  if(nIterSoft>0) ATH_MSG_ERROR("Found multiple soft terms with the name:" <<softTermName << ". Your MET configuration is wrong!!!");
258  continue;
259  }
260  ++nIterSoft;
261  softSumET=(met->sumet()/m_GeV);
262 
263  AddSoftTerm(met, m_met_vect, particle_sum);
264  m_metsoft = met->met()/m_GeV;
265  m_metsoftphi = met->phi();
266  metTerm = 2; // this is actually filled in AddSoftTerm
267  // done with the soft term. go to the next term.
268  continue;
269  }
270  ATH_MSG_VERBOSE("Add MET term " << met->name() );
271  for(const auto& el : acc_constitObjLinks(*met)) {
272  const xAOD::IParticle* obj(*el);
273  float pt_reso=0.0, phi_reso=0.0;
274  if(!obj){
275  ATH_MSG_ERROR("Particle pointer is not valid. This will likely result in a crash " << obj);
276  return StatusCode::FAILURE;
277  }
278  ATH_MSG_VERBOSE("pT: " << obj->pt() << " type: " << obj->type() << " truth: " << (obj->type()==xAOD::Type::TruthParticle));
279  if(obj->type()==xAOD::Type::Muon || (obj->type()==xAOD::Type::TruthParticle && std::abs(static_cast<const xAOD::TruthParticle*>(obj)->pdgId())==13)){
280  ATH_CHECK(AddMuon(obj, pt_reso, phi_reso, avgmu));
281  metTerm=4;
282  }
283  else if(obj->type()==xAOD::Type::Jet){
284  // make sure the container name matches
285  if(met->name()!=jetTermName) continue;
286  ATH_CHECK(AddJet(obj, pt_reso, phi_reso, avgmu));
287  metTerm=1;
288  }
289  else if(obj->type()==xAOD::Type::Electron || (obj->type()==xAOD::Type::TruthParticle && std::abs(static_cast<const xAOD::TruthParticle*>(obj)->pdgId())==11)){
290  ATH_CHECK(AddElectron(obj, pt_reso, phi_reso, avgmu));
291  metTerm=3;
292  }
293  else if(obj->type()==xAOD::Type::Photon || (obj->type()==xAOD::Type::TruthParticle && std::abs(static_cast<const xAOD::TruthParticle*>(obj)->pdgId())==22)){
294  ATH_CHECK(AddPhoton(obj, pt_reso, phi_reso));
295  metTerm=5;
296  }
297  else if(obj->type()==xAOD::Type::Tau || (obj->type()==xAOD::Type::TruthParticle && std::abs(static_cast<const xAOD::TruthParticle*>(obj)->pdgId())==15)){
298  AddTau(obj, pt_reso, phi_reso);
299  metTerm=6;
300  }
301 
302  // compute NEW
303  double particle_u[2][2] = {{pt_reso*pt_reso*obj->pt()*obj->pt()/m_GeV/m_GeV,0.0},
304  {0.0,phi_reso*phi_reso/m_GeV/m_GeV}};
305  double particle_u_rot[2][2] = {{pt_reso*pt_reso*obj->pt()*obj->pt()/m_GeV/m_GeV,0.0},
306  {0.0,phi_reso*phi_reso/m_GeV/m_GeV}};
307  RotateXY(particle_u, particle_u_rot,m_met_vect.DeltaPhi(obj->p4().Vect()));
308  m_VarL+=particle_u_rot[0][0];
309  m_VarT+=particle_u_rot[1][1];
310  m_CvLT+=particle_u_rot[0][1];
311 
312  // Save the resolutions separated for each object type
313  AddResoMap(particle_u_rot[0][0],
314  particle_u_rot[1][1],
315  particle_u_rot[0][1],
316  metTerm);
317 
318  RotateXY (particle_u, particle_u_rot, obj->p4().Phi()); // positive phi rotation
319  AddMatrix(particle_sum, particle_u_rot, particle_sum);
320  // END compute NEW
321 
322  ATH_MSG_VERBOSE("Resolution: " << pt_reso << " phi reso: " << phi_reso );
323  }
324  }
325 
326  // setting the MET directed variables for later phi rotations if requested
330 
331  if( m_VarL != 0 ){
332 
333  if(m_applyBias){
334  TVector3 met_vect = m_met_vect;
335  TVector3 soft_vect = m_soft_vect;
336 
337  // should be done to reset the phi as well...
339  Double_t Bias_TST = BiasPtSoftdir(m_metsoft);
340  Double_t MEx = m_met * std::cos(m_metphi) - Bias_TST * std::cos(m_metsoftphi);
341  Double_t MEy = m_met * std::sin(m_metphi) - Bias_TST * std::sin(m_metsoftphi);
342  met_vect.SetXYZ(MEx,MEy,0.0);
343  }
345  m_soft_vect.SetPtEtaPhi(m_metsoft, 0.0, m_metsoftphi);
347  Double_t PtSoftparaPH = m_pthard_vect.Mag()>0.0 ? (m_soft_vect.Dot(m_pthard_vect))/m_pthard_vect.Mag() : 0.0;
348  Double_t Bias_pthard = Bias_PtSoftParall(PtSoftparaPH);
349  Double_t MEx = m_met * std::cos(m_metphi) - Bias_pthard * std::cos(m_metsoftphi);
350  Double_t MEy = m_met * std::sin(m_metphi) - Bias_pthard * std::sin(m_metsoftphi);
351  met_vect.SetXYZ(MEx,MEy,0.0);
352  }
353  // Rotate & compute
354  ATH_CHECK(RotateToPhi(met_vect.Phi()));
355  m_significance = Significance_LT(met_vect.Pt(), m_VarL, m_VarT, m_CvLT);
356  m_rho = m_CvLT / std::sqrt( m_VarL * m_VarT ) ;
357  }
358  else{
359  // standard calculation
361  m_rho = m_CvLT / std::sqrt( m_VarL * m_VarT ) ;
362  }
363  m_ht-=softSumET;
364  ATH_MSG_VERBOSE(" Significance (squared): " << m_significance << " rho: " << GetRho()
365  << " MET: " << m_met << " phi: " << m_metphi << " SUMET: " << m_sumet << " HT: " << m_ht << " sigmaL: " << GetVarL()
366  << " sigmaT: " << GetVarT() << " MET/sqrt(SumEt): " << GetMETOverSqrtSumET()
367  << " MET/sqrt(HT): " << GetMETOverSqrtHT()
368  << " sqrt(signif): " << GetSignificance()
369  << " sqrt(signifDirectional): " << GetSigDirectional());
370  }
371  else
372  ATH_MSG_DEBUG("Var_L is 0");
373 
374  return StatusCode::SUCCESS;
375  }
376 
378 
379  // Rotation (components)
381 
382  if( m_VarL != 0 ){
384  m_rho = m_CvLT / std::sqrt( m_VarL * m_VarT ) ;
385  }
386  ATH_MSG_DEBUG(" Significance (squared) at new phi: " << m_significance
387  << " rho: " << GetRho()
388  << " MET: " << m_met
389  << " sigmaL: " << GetVarL()
390  << " sigmaT: " << GetVarT() );
391 
392  return StatusCode::SUCCESS;
393  }
394 
395  StatusCode METSignificance::SetLambda(const float px, const float py, const bool GeV){
396 
397  // compute the new direction
398  double GeVConv = GeV ? 1.0 : m_GeV;
399  m_lamda_vect.SetXYZ(px/GeVConv, py/GeVConv, 0.0);
401  const double met_m_lamda = m_lamda_vect.Pt();
402 
403  // Rotation (components)
405 
406  if( m_VarL != 0 ){
408  m_rho = m_CvLT / std::sqrt( m_VarL * m_VarT ) ;
409  }
410  ATH_MSG_DEBUG(" Significance (squared) at new phi: " << m_significance
411  << " rho: " << GetRho()
412  << " MET: " << m_met
413  << " sigmaL: " << GetVarL()
414  << " sigmaT: " << GetVarT() );
415 
416  return StatusCode::SUCCESS;
417  }
418 
419  // Muon propagation of resolution
420  StatusCode METSignificance::AddMuon(const xAOD::IParticle* obj, float &pt_reso, float &phi_reso, float avgmu){
421 
422  int dettype = 0;
423  bool DoEMuReso = false;
424  ATH_MSG_VERBOSE("Particle type: " << obj->type());
425 
426  if(obj->type()==xAOD::Type::TruthParticle){
427  pt_reso =0.01;
428  if(obj->pt()>0.5e6) pt_reso=0.03;
429  if(obj->pt()>1.0e6) pt_reso=0.1;// this is just a rough estimate for the time being until the interface can handle truth muons
430  }
431  else{
432  const xAOD::Muon* muon(static_cast<const xAOD::Muon*>(obj));
433  if(muon->muonType()==0){//Combined
434  dettype=3;//CB
435  }
436  else if(muon->muonType()==1){//MuonStandAlone
437  dettype=1;//MS
438  }
439  else if(muon->muonType()>1){//Segment, Calo, Silicon
440  dettype=2;//ID
441  }
442  else{
443  ATH_MSG_VERBOSE("This muon had none of the normal muon types (ID,MS,CB) - check this in detail");
444  return StatusCode::FAILURE;
445  }
446 
447  pt_reso=m_muonCalibrationAndSmearingTool->expectedResolution(dettype,*muon,!m_isDataMuon);
448  if(m_doPhiReso) phi_reso = muon->pt()*0.001;
449  // run the jet resolution for muons. for validation region extrapolation
450  if(!m_EMuResoAux.empty()){
452  DoEMuReso = acc_EMReso.isAvailable(*muon) ? acc_EMReso(*muon) : false;
453  }
454  ATH_MSG_VERBOSE("muon: " << pt_reso << " dettype: " << dettype << " " << muon->pt() << " " << muon->p4().Eta() << " " << muon->p4().Phi());
455  }// end reco setup
456 
457  // Common setup
458  if(m_doPhiReso) phi_reso = obj->pt()*0.001;
459  ATH_MSG_VERBOSE("muon: " << pt_reso << " dettype: " << dettype << " " << obj->pt() << " " << obj->p4().Eta() << " " << obj->p4().Phi());
460 
461  if(m_jerForEMu || DoEMuReso){
462  bool treatPUJets = m_treatPUJets;
463  m_treatPUJets=false; //turn off pileup jet treatement for this electron
464  ATH_CHECK(AddJet(obj, pt_reso, phi_reso, avgmu));
465  m_treatPUJets = treatPUJets; // reset value
466  }
467 
468  return StatusCode::SUCCESS;
469  }
470 
471  // Electron propagation of resolution
472  StatusCode METSignificance::AddElectron(const xAOD::IParticle* obj, float &pt_reso, float &phi_reso, float avgmu){
473 
474  bool DoEMuReso = false;
475  if(obj->type()==xAOD::Type::TruthParticle){
476  pt_reso=m_egammaCalibTool->resolution(obj->e(),obj->eta(),obj->eta(),PATCore::ParticleType::Electron);
477  if(m_doPhiReso) phi_reso = obj->pt()*0.004;
478  }
479  else{
480  const xAOD::Electron* ele(static_cast<const xAOD::Electron*>(obj));
481  const auto cl_etaCalo = xAOD::get_eta_calo(*(ele->caloCluster()), ele->author());
482  pt_reso=m_egammaCalibTool->resolution(ele->e(),ele->caloCluster()->eta(),cl_etaCalo,PATCore::ParticleType::Electron);
483  if(m_doPhiReso) phi_reso = ele->pt()*0.004;
484  ATH_MSG_VERBOSE("el: " << pt_reso << " " << ele->pt() << " " << ele->p4().Eta() << " " << ele->p4().Phi());
485 
486  // run the jet resolution for muons. for validation region extrapolation
487  if(!m_EMuResoAux.empty()){
489  DoEMuReso = acc_EMReso.isAvailable(*ele) ? acc_EMReso(*ele) : false;
490  }
491  }
492 
493  if(m_jerForEMu || DoEMuReso){
494  bool treatPUJets = m_treatPUJets;
495  m_treatPUJets=false; //turn off pileup jet treatement for this electron
496  ATH_CHECK(AddJet(obj, pt_reso, phi_reso, avgmu));
497  m_treatPUJets = treatPUJets; // reset value
498  }
499  return StatusCode::SUCCESS;
500  }
501 
502  // Photon propagation of resolution
503  StatusCode METSignificance::AddPhoton(const xAOD::IParticle* obj, float &pt_reso, float &phi_reso){
504 
505  if(obj->type()==xAOD::Type::TruthParticle){
506  pt_reso=m_egammaCalibTool->resolution(obj->e(),obj->eta(),obj->eta(),PATCore::ParticleType::Electron); // leaving as an electron for the truth implementation rather than declaring a reco photon
507  if(m_doPhiReso) phi_reso = obj->pt()*0.004;
508  }
509  else{
510  const xAOD::Egamma* pho(static_cast<const xAOD::Egamma*>(obj));
511  pt_reso=m_egammaCalibTool->getResolution(*pho);
512  if(m_doPhiReso) phi_reso = pho->pt()*0.004;
513  ATH_MSG_VERBOSE("pho: " << pt_reso << " " << pho->pt() << " " << pho->p4().Eta() << " " << pho->p4().Phi());
514  }
515  return StatusCode::SUCCESS;
516  }
517 
518  // Jet propagation of resolution. returns the relative pT and phi resolution.
519  StatusCode METSignificance::AddJet(const xAOD::IParticle* obj, float &pt_reso, float &phi_reso, float &avgmu){
520 
521  const xAOD::Jet* jet(static_cast<const xAOD::Jet*>(obj));
522  double pt_reso_dbl_data=0.0, pt_reso_dbl_mc=0.0, pt_reso_dbl_max=0.0;
523 
524  // setting limits on jets if requested
525  if(m_jetPtThr>0.0 && m_jetPtThr>jet->pt()) return StatusCode::SUCCESS;
526  if(m_jetEtaThr>0.0 && m_jetEtaThr<std::abs(jet->eta())) return StatusCode::SUCCESS;
527 
528  ATH_CHECK(m_jetCalibTool->getNominalResolutionData(*jet, pt_reso_dbl_data));
529  ATH_CHECK(m_jetCalibTool->getNominalResolutionMC(*jet, pt_reso_dbl_mc));
530  pt_reso_dbl_max = std::max(pt_reso_dbl_data,pt_reso_dbl_mc);
531  pt_reso = pt_reso_dbl_max;
532 
533  ATH_MSG_VERBOSE("jet: " << pt_reso << " jetpT: " << jet->pt() << " " << jet->p4().Eta() << " " << jet->p4().Phi());
534 
535  // Add extra uncertainty for PU jets based on JVT
536  if(m_treatPUJets){
537  double jet_pu_unc = 0.;
538  if(acc_fjvt.isAvailable(*jet))
539  jet_pu_unc = GetPUProb(jet->eta(), jet->phi(),jet->pt()/m_GeV, acc_jvt(*jet), acc_fjvt(*jet), avgmu);
540  else if(acc_fjvt_der.isAvailable(*jet))
541  jet_pu_unc = GetPUProb(jet->eta(), jet->phi(),jet->pt()/m_GeV, acc_jvt(*jet), acc_fjvt_der(*jet), avgmu);
542  else{
543  ATH_MSG_ERROR("No fJVT decoration available - must have treat pileup jets set to off or provide fJVT!");
544  return StatusCode::FAILURE;
545  }
546  pt_reso = std::sqrt(jet_pu_unc*jet_pu_unc + pt_reso*pt_reso);
547  ATH_MSG_VERBOSE("jet_pu_unc: " << jet_pu_unc);
548  }
549 
550  // Use the phi resolution of the jets
551  // needs to be finished
552  if(m_doPhiReso){
553  double jet_phi_unc = std::abs(GetPhiUnc(jet->eta(), jet->phi(),jet->pt()/m_GeV));
554  phi_reso = jet->pt()*jet_phi_unc;
555  }
556 
557  // Add user defined additional resolutions. For example, b-tagged jets
558  if(!m_JetResoAux.empty()){
560  if(acc_extra.isAvailable(*jet)){
561  float extra_relative_pt_reso = acc_extra(*jet);
562  pt_reso = std::sqrt(pt_reso*pt_reso + extra_relative_pt_reso*extra_relative_pt_reso);
563  }
564  }
565 
566  return StatusCode::SUCCESS;
567  }
568 
569  // Tau propagation of resolution
570  void METSignificance::AddTau(const xAOD::IParticle* obj, float &pt_reso, float &phi_reso){
571 
572  // tau objects
573  if(obj->type()==xAOD::Type::TruthParticle){
574  pt_reso= 0.1;
575  if(m_doPhiReso) phi_reso = obj->pt()*0.01;
576  }
577  else{
578  const xAOD::TauJet* tau(static_cast<const xAOD::TauJet*>(obj));
579  if (auto *combp4 = dynamic_cast<TauCombinedTES*>(&*m_tauCombinedTES)) {
580  pt_reso = combp4->getMvaEnergyResolution(*tau);
581  }
582 
583  if(m_doPhiReso) phi_reso = tau->pt()*0.01;
584  ATH_MSG_VERBOSE("tau: " << pt_reso << " " << tau->pt() << " " << tau->p4().Eta() << " " << tau->p4().Phi() << " phi reso: " << phi_reso);
585  }
586  }
587 
588  //
589  // Soft term propagation of resolution
590  //
591  void METSignificance::AddSoftTerm(const xAOD::MissingET* soft, const TVector3 &met_vect, double (&particle_sum)[2][2]){
592 
594 
595  ATH_MSG_VERBOSE("Resolution Soft term set to 10GeV");
596 
597  m_soft_vect.SetXYZ(soft->mpx()/m_GeV, soft->mpy()/m_GeV, 0);
598 
599  double particle_u[2][2] = {{m_softTermReso*m_softTermReso,0.0},
601  double particle_u_rot[2][2] = {{m_softTermReso*m_softTermReso,0.0},
603 
604  RotateXY(particle_u, particle_u_rot,met_vect.DeltaPhi(m_soft_vect));
605  m_VarL+=particle_u_rot[0][0];
606  m_VarT+=particle_u_rot[1][1];
607  m_CvLT+=particle_u_rot[0][1];
608 
609  // Save the resolutions separated for each object type
610  AddResoMap(particle_u_rot[0][0],
611  particle_u_rot[1][1],
612  particle_u_rot[0][1],
613  met::ResoSoft);
614 
615  RotateXY (particle_u, particle_u_rot,-1.0*soft->phi()); // negative phi rotation
616  AddMatrix(particle_sum, particle_u_rot, particle_sum);
617 
618  ATH_MSG_VERBOSE("SOFT " << soft->name() <<" - pt_reso: " << m_softTermReso << " soft: " << soft->met() << " phi: " << soft->phi()
619  << " Var_L: " << particle_u_rot[0][0] << " Var_T: " << particle_u_rot[1][1]
620  << " " << particle_u_rot[0][1]);
621  }
623 
624  ATH_MSG_VERBOSE("Resolution Soft term parameterized in pthard direction");
625 
626  m_soft_vect.SetXYZ(soft->mpx()/m_GeV, soft->mpy()/m_GeV, 0);
627 
628  m_pthard_vect = m_soft_vect - met_vect;
629 
630  double varTST = Var_Ptsoft(soft->met()/m_GeV);
631 
632  double particle_u[2][2] = {{varTST,0.0},
633  {0.0,varTST}};
634  double particle_u_rot[2][2] = {{varTST,0.0},
635  {0.0,varTST}};
636 
637  RotateXY(particle_u, particle_u_rot,met_vect.DeltaPhi(m_pthard_vect));
638  m_VarL+=particle_u_rot[0][0];
639  m_VarT+=particle_u_rot[1][1];
640  m_CvLT+=particle_u_rot[0][1];
641 
642  // Save the resolutions separated for each object type
643  AddResoMap(particle_u_rot[0][0],
644  particle_u_rot[1][1],
645  particle_u_rot[0][1],
646  met::ResoSoft);
647 
648  RotateXY (particle_u, particle_u_rot,-1.0*m_pthard_vect.Phi()); // negative phi rotation
649  AddMatrix(particle_sum, particle_u_rot, particle_sum);
650 
651  }
652  else if (m_softTermParam==met::TSTParam){
653 
654  ATH_MSG_VERBOSE("Resolution Soft term parameterized in TST");
655 
656  m_soft_vect.SetXYZ(soft->mpx()/m_GeV, soft->mpy()/m_GeV, 0);
657 
658  double varTST = VarparPtSoftdir(soft->met()/m_GeV, soft->sumet()/m_GeV);
659 
660  double particle_u[2][2] = {{varTST,0.0},
661  {0.0,varTST}};
662  double particle_u_rot[2][2] = {{varTST,0.0},
663  {0.0,varTST}};
664 
665  RotateXY(particle_u, particle_u_rot,met_vect.DeltaPhi(m_soft_vect));
666  m_VarL+=particle_u_rot[0][0];
667  m_VarT+=particle_u_rot[1][1];
668  m_CvLT+=particle_u_rot[0][1];
669 
670  // Save the resolutions separated for each object type
671  AddResoMap(particle_u_rot[0][0],
672  particle_u_rot[1][1],
673  particle_u_rot[0][1],
674  met::ResoSoft);
675 
676  RotateXY (particle_u, particle_u_rot,-1.0*soft->phi()); // negative phi rotation
677  AddMatrix(particle_sum, particle_u_rot, particle_sum);
678 
679  }
680  else{
681  ATH_MSG_ERROR("Soft term parameterization is NOT defined for:" << m_softTermParam);
682  }
683 
684  }
685 
686  double METSignificance::GetPUProb(double jet_eta, double /*jet_phi*/,
687  double jet_pt, double jet_jvt,
688  double jet_fjvt,
689  float avgmu) {
690 
691  double unc=0.0;
692 
693  // Coefficients from Doug Schaefer <schae@cern.ch> and the MET subgroup
694  if(m_JetCollection == "AntiKt4EMTopoJets"){
695  if(std::abs(jet_eta)<2.4){
696  if(jet_pt<30){
697  if(jet_jvt<0.11) unc = 1;
698  else if(jet_jvt<0.25) unc = 0.0730 + 0.0024 * avgmu + 0.00001 * avgmu * avgmu;
699  else if(jet_jvt<0.85) unc = 0.0995 + 0.0031 * avgmu + 0.00005 * avgmu * avgmu;
700  else if(jet_jvt<0.95) unc = 0.0311 + 0.0025 * avgmu + 0.00005 * avgmu * avgmu;
701  else unc = 0.0308 -0.0010 * avgmu + 0.00006 * avgmu * avgmu ;
702  }else if(jet_pt<40){
703  if(jet_jvt<0.11) unc = 1.;
704  else if(jet_jvt<0.25) unc = 1.;
705  else if(jet_jvt<0.85) unc = -0.0188 + 0.0039 * avgmu + 0.00002 * avgmu * avgmu;
706  else if(jet_jvt<0.95) unc = 0.0252 -0.0009 * avgmu + 0.00006 * avgmu * avgmu ;
707  else unc = 0.0085 -0.0003 * avgmu + 0.00002 * avgmu * avgmu ;
708  }else if(jet_pt<50){
709  if(jet_jvt<0.11) unc = 1;
710  else if(jet_jvt<0.25) unc = 0.0345 -0.0006 * avgmu + 0.00004 * avgmu * avgmu ;
711  else if(jet_jvt<0.85) unc = 0.1078 -0.0051 * avgmu + 0.00011 * avgmu * avgmu ;
712  else if(jet_jvt<0.95) unc = -0.0026 + 0.0005 * avgmu + 0.00002 * avgmu * avgmu;
713  else unc = 0.0090 -0.0004 * avgmu + 0.00001 * avgmu * avgmu ;
714  }else if(jet_pt<60){
715  if(jet_jvt<0.11) unc = 1;
716  else if(jet_jvt<0.25) unc = -0.0321 + 0.0030 * avgmu -0.00002 * avgmu * avgmu;
717  else if(jet_jvt<0.85) unc = 0.0260 -0.0007 * avgmu + 0.00003 * avgmu * avgmu ;
718  else unc = -0.0040 + 0.0003 * avgmu;
719  }else if(jet_pt<100){
720  unc = 0.9492 -2.0757 * jet_jvt + 1.13328 * jet_jvt * jet_jvt;
721  }else if(jet_pt<150){
722  unc = 0.7888 -1.8372 * jet_jvt + 1.05539 * jet_jvt * jet_jvt;
723  }
724  }else if(std::abs(jet_eta)<2.6){
725  if(jet_pt<30){
726  if(jet_jvt<0.11) unc = 0.2633 + 0.0091 * avgmu + -0.00009 * avgmu * avgmu;
727  else if(jet_jvt<0.25) unc = 0.1841 + 0.0144 * avgmu + -0.00008 * avgmu * avgmu;
728  else if(jet_jvt<0.85) unc = 0.1401 + 0.0048 * avgmu + 0.00006 * avgmu * avgmu ;
729  else if(jet_jvt<0.95) unc = -0.0118 + 0.0076 * avgmu + 0.00003 * avgmu * avgmu;
730  else unc = 0.0534 + -0.0011 * avgmu + 0.00010 * avgmu * avgmu;
731  }else if(jet_pt<40){
732  if(jet_jvt<0.11) unc = 0.1497 + 0.0133 * avgmu + -0.00015 * avgmu * avgmu ;
733  else if(jet_jvt<0.25) unc = -0.2260 + 0.0276 * avgmu + -0.00021 * avgmu * avgmu ;
734  else if(jet_jvt<0.85) unc = 0.2743 + -0.0093 * avgmu + 0.00022 * avgmu * avgmu ;
735  else if(jet_jvt<0.95) unc = 0.0604 + 0.0006 * avgmu + 0.00006 * avgmu * avgmu ;
736  else unc = 0.0478 + -0.0009 * avgmu + 0.00004 * avgmu * avgmu ;
737  }else if(jet_pt<50){
738  if(jet_jvt<0.11) unc = -0.2187 + 0.0317 * avgmu + -0.00037 * avgmu * avgmu ;
739  else if(jet_jvt<0.25) unc = 0.0964 + 0.0053 * avgmu + 0.00002 * avgmu * avgmu ;
740  else if(jet_jvt<0.85) unc = 1.1730 + -0.0624 * avgmu + 0.00088 * avgmu * avgmu ;
741  else if(jet_jvt<0.95) unc = -0.2011 + 0.0151 * avgmu + -0.00018 * avgmu * avgmu ;
742  else unc = 0.0145 + -0.0003 * avgmu + 0.00002 * avgmu * avgmu ;
743  }else if(jet_pt<60){
744  if(jet_jvt<0.11) unc = 0.0051 + 0.0113 * avgmu + -0.00008 * avgmu * avgmu ;
745  else if(jet_jvt<0.25) unc = -0.1024 + 0.0109 * avgmu + -0.00006 * avgmu * avgmu ;
746  else if(jet_jvt<0.85) unc = 1.2491 + -0.0501 * avgmu + 0.00052 * avgmu * avgmu ;
747  else unc = 0.0267 + -0.0014 * avgmu + 0.00003 * avgmu * avgmu ;
748  }else if(jet_pt<100){
749  unc = 0.8951 -2.4995 * jet_jvt + 1.63229 * jet_jvt * jet_jvt;
750  }else if(jet_pt<150){
751  unc = 0.9998 -1.7319 * jet_jvt + 0.72680 * jet_jvt * jet_jvt;
752  }
753  }else if(std::abs(jet_eta)<2.7){
754  if(jet_pt<30){
755  if(jet_jvt<0.11) unc = 0.3001 + 0.0054 * avgmu -0.00004 * avgmu * avgmu ;
756  else if(jet_jvt<0.25) unc = 0.0663 + 0.0198 * avgmu -0.00013 * avgmu * avgmu ;
757  else if(jet_jvt<0.85) unc = -0.0842 + 0.0163 * avgmu -0.00008 * avgmu * avgmu ;
758  else if(jet_jvt<0.95) unc = -0.0219 + 0.0080 * avgmu + 0.00003 * avgmu * avgmu;
759  else unc = 0.0461 -0.0003 * avgmu + 0.00012 * avgmu * avgmu ;
760  }else if(jet_pt<40){
761  if(jet_jvt<0.11) unc = 0.1885 + 0.0083 * avgmu -0.00006 * avgmu * avgmu ;
762  else if(jet_jvt<0.25) unc = -0.0286 + 0.0150 * avgmu -0.00007 * avgmu * avgmu;
763  else if(jet_jvt<0.85) unc = 0.0152 + 0.0028 * avgmu + 0.00005 * avgmu * avgmu;
764  else if(jet_jvt<0.95) unc = 0.1815 -0.0076 * avgmu + 0.00018 * avgmu * avgmu ;
765  else unc = 0.0192 -0.0003 * avgmu + 0.00007 * avgmu * avgmu ;
766  }else if(jet_pt<50){
767  if(jet_jvt<0.11) unc = 0.1257 + 0.0074 * avgmu -0.00004 * avgmu * avgmu ;
768  else if(jet_jvt<0.25) unc = -0.0276 + 0.0080 * avgmu + 0.00000 * avgmu * avgmu;
769  else if(jet_jvt<0.85) unc = 0.1403 -0.0051 * avgmu + 0.00009 * avgmu * avgmu ;
770  else if(jet_jvt<0.95) unc = 0.2078 -0.0101 * avgmu + 0.00017 * avgmu * avgmu ;
771  else unc = 0.2597 -0.0132 * avgmu + 0.00020 * avgmu * avgmu ;
772  }else if(jet_pt<60){
773  if(jet_jvt<0.11) unc = 0.1111 + 0.0045 * avgmu -0.00000 * avgmu * avgmu ;
774  else if(jet_jvt<0.25) unc = 0.0975 -0.0011 * avgmu + 0.00008 * avgmu * avgmu ;
775  else if(jet_jvt<0.85) unc = 0.0920 -0.0053 * avgmu + 0.00013 * avgmu * avgmu ;
776  else unc = -0.0071 + 0.0016 * avgmu -0.00001 * avgmu * avgmu;
777  }else if(jet_pt<100){
778  unc = 0.4660 -1.2116 * jet_jvt + 0.78807 * jet_jvt * jet_jvt;
779  }else if(jet_pt<150){
780  unc = 0.2254 -0.5476 * jet_jvt + 0.32617 * jet_jvt * jet_jvt;
781  }
782  }// end eta 2.7
783  else{//forward jets
784  float fjvt = jet_fjvt>0.6 ? 0.6 : jet_fjvt; // the pileup more or less plateaus at 0.6
785  if(jet_pt<30) unc = 0.5106 + 1.2566 * fjvt -1.15060 * fjvt * fjvt;
786  else if(jet_pt<40) unc = 0.2972 + 1.9418 * fjvt -1.82694 * fjvt * fjvt;
787  else if(jet_pt<50) unc = 0.1543 + 1.9864 * fjvt -1.48429 * fjvt * fjvt;
788  else if(jet_pt<60) unc = 0.1050 + 1.3196 * fjvt + 0.03554 * fjvt * fjvt;
789  else if(jet_pt<120) unc = 0.0400 + 0.5653 * fjvt + 1.96323 * fjvt * fjvt;
790  // max of 0.9 seems reasonable
791  if(jet_fjvt>0.6) unc = 0.9;
792  }
793  // end emtopo
794  // Coefficients from Badr-eddine Ngair <badr-eddine.ngair@cern.ch>
795  // Pile-UP (resolution) estimatetd using Z->ee Events using exclusive jet_pt binning using RUN3 samples
796  }else{//p-flow inputs
797  if(std::abs(jet_eta)<2.4){
798  if(jet_pt<30){
799  if(jet_jvt<0.11) unc = 0.524466 + 0.00750057 * avgmu -4.73422e-05 * avgmu * avgmu ;
800  else if(jet_jvt<0.25) unc = 4.17584e-01 + 1.00112e-02 * avgmu -7.43546e-05 * avgmu * avgmu ;
801  else if(jet_jvt<0.85) unc = 2.12625e-01 + 1.03484e-02 * avgmu -5.68063e-05 * avgmu * avgmu;
802  else if(jet_jvt<0.95) unc = 1.08396e-01 + 1.04273e-02 * avgmu -5.00299e-05 * avgmu * avgmu;
803  else unc = 1.26304e-03 +2.10385e-04 * avgmu + 1.10086e-06 * avgmu * avgmu ;
804  }else if(jet_pt<40){
805  if(jet_jvt<0.11) unc = 3.78090e-01 + 8.83535e-03 * avgmu -5.38873e-05* avgmu * avgmu;
806  else if(jet_jvt<0.25) unc = 2.67244e-01+ 9.81193e-03* avgmu -5.87765e-05 * avgmu * avgmu;
807  else if(jet_jvt<0.85) unc = 9.60892e-02 +8.11069e-03 * avgmu -3.73101e-05 * avgmu * avgmu ;
808  else if(jet_jvt<0.95) unc = 5.16235e-02 +6.27371e-03 * avgmu -1.95433e-05 * avgmu * avgmu ;
809  else unc = -2.74714e-03 +2.45273e-04* avgmu -1.44731e-06* avgmu * avgmu ;
810  }else if(jet_pt<50){
811  if(jet_jvt<0.11) unc = 2.44953e-01 + 1.23246e-02 * avgmu -8.48696e-05 * avgmu * avgmu;
812  else if(jet_jvt<0.25) unc = 1.78141e-01 + 1.09451e-02 * avgmu -6.90796e-05 * avgmu * avgmu;
813  else if(jet_jvt<0.85) unc = 9.60998e-02+6.21945e-03* avgmu -2.76203e-05* avgmu * avgmu ;
814  else if(jet_jvt<0.95) unc = 5.79210e-02+ 4.49780e-03 * avgmu + -1.15125e-05 * avgmu * avgmu ;
815  else unc = -2.96644e-03 +2.27707e-04 * avgmu -1.86712e-06 * avgmu * avgmu ;
816  }else if(jet_pt<60){
817  if(jet_jvt<0.11) unc = 1.97017e-01 + 1.34089e-02 * avgmu -9.18923e-05 * avgmu * avgmu ;
818  else if(jet_jvt<0.25) unc = 1.27602e-01 + 1.12287e-02 * avgmu -6.62192e-05 * avgmu * avgmu ;
819  else if(jet_jvt<0.85) unc = 6.94905e-02 + 6.27784e-03 * avgmu -3.07298e-05 * avgmu * avgmu;
820  else if(jet_jvt<0.95) unc = 3.58417e-02 +4.62268e-03 * avgmu -2.12417e-05 * avgmu * avgmu ;
821  else unc = 1.35616e-03 + 5.46723e-06* avgmu + 1.92327e-07 * avgmu * avgmu;
822  }else if(jet_pt<100){
823  unc = 6.19009e-01 -8.96042e-01 * jet_jvt + 2.89066e-01 * jet_jvt * jet_jvt;
824  }else if(jet_pt<150){
825  unc = 6.18350e-01 -8.97327e-01 * jet_jvt + 2.90998e-01 * jet_jvt * jet_jvt;
826  }
827  }else if(std::abs(jet_eta)<2.6){
828  if(jet_pt<30){
829  if(jet_jvt<0.11) unc = 5.06496e-01 + 8.21123e-03 * avgmu -5.17501e-05 * avgmu * avgmu;
830  else if(jet_jvt<0.25) unc = 4.26616e-01 + 9.25936e-03 * avgmu -5.68847e-05 * avgmu * avgmu;
831  else if(jet_jvt<0.85) unc = 2.03333e-01 + 1.11951e-02 * avgmu-6.09233e-05 * avgmu * avgmu ;
832  else if(jet_jvt<0.95) unc = 1.03167e-01 + 1.13444e-02 * avgmu -5.43274e-05 * avgmu * avgmu;
833  else unc = 1.51480e-03 + 2.08394e-04 * avgmu + 1.39579e-06 * avgmu * avgmu;
834  }else if(jet_pt<40){
835  if(jet_jvt<0.11) unc = 3.40612e-01 + 9.94199e-03 * avgmu + -5.93760e-05* avgmu * avgmu ;
836  else if(jet_jvt<0.25) unc = 2.43360e-01 + 1.05579e-02* avgmu + -6.05403e-05* avgmu * avgmu ;
837  else if(jet_jvt<0.85) unc = 8.34364e-02 + 8.76364e-03 * avgmu -3.64035e-05 * avgmu * avgmu ;
838  else if(jet_jvt<0.95) unc = 4.40362e-02 + 6.92580e-03 * avgmu -1.79853e-05 * avgmu * avgmu ;
839  else unc = -2.68670e-03 + 2.50861e-04 * avgmu + -1.46410e-06* avgmu * avgmu ;
840  }else if(jet_pt<50){
841  if(jet_jvt<0.11) unc = 2.36561e-01 + 1.14078e-02 * avgmu +-7.10025e-05 * avgmu * avgmu ;
842  else if(jet_jvt<0.25) unc = 1.86653e-01 +9.61140e-03 * avgmu +-5.15356e-05 * avgmu * avgmu ;
843  else if(jet_jvt<0.85) unc = 9.37026e-02 +5.93028e-03 * avgmu +-2.02571e-05 * avgmu * avgmu ;
844  else if(jet_jvt<0.95) unc = 5.79210e-02+ 4.49780e-03 * avgmu + -1.15125e-05 * avgmu * avgmu ;
845  else unc = -3.02487e-03 + 2.31337e-04* avgmu + -1.85225e-06 * avgmu * avgmu ;
846  }else if(jet_pt<60){
847  if(jet_jvt<0.11) unc =1.75215e-01+ 1.21805e-02 * avgmu + -7.48846e-05 * avgmu * avgmu ;
848  else if(jet_jvt<0.25) unc = 1.26276e-01+ 9.80117e-03 * avgmu + -4.99913e-05 * avgmu * avgmu ;
849  else if(jet_jvt<0.85) unc = 7.91422e-02 + 5.26009e-03 * avgmu +-1.87388e-05 * avgmu * avgmu ;
850  else if(jet_jvt<0.95) unc = 4.39136e-02+ 4.09435e-03* avgmu +-1.35926e-05 * avgmu * avgmu ;
851  else unc = 1.21410e-03 + 1.14188e-05 * avgmu + 1.53654e-07 * avgmu * avgmu ;
852  }else if( jet_pt<100){
853  unc = 6.44179e-01 -9.20194e-01* jet_jvt + 2.89686e-01 * jet_jvt * jet_jvt;
854  }else if(jet_pt<150){
855  unc = 6.43423e-01 -9.21407e-01 * jet_jvt + 2.91648e-01 * jet_jvt * jet_jvt;
856  }
857  }else if(std::abs(jet_eta)<2.7){
858  if(jet_pt<30){
859  if(jet_jvt<0.11) unc = 4.76243e-01 + 9.22046e-03 * avgmu -5.88765e-05 * avgmu * avgmu;
860  else if(jet_jvt<0.25) unc = 4.07406e-01+ 1.01167e-02 * avgmu -6.30429e-05 * avgmu * avgmu;
861  else if(jet_jvt<0.85) unc = 2.01324e-01+ 1.20631e-02 * avgmu -6.75582e-05 * avgmu * avgmu;
862  else if(jet_jvt<0.95) unc = 1.03815e-01 + 1.24007e-02 * avgmu -6.26892e-05 * avgmu * avgmu;
863  else unc = 1.63714e-03 +2.00682e-04 * avgmu + 1.53621e-06 * avgmu * avgmu;
864  }else if(jet_pt<40){
865  if(jet_jvt<0.11) unc = 2.89505e-01 + 1.11643e-02 * avgmu -6.45475e-05* avgmu * avgmu;
866  else if(jet_jvt<0.25) unc = 2.15968e-01 + 1.14451e-02* avgmu -6.32545e-05 * avgmu * avgmu;
867  else if(jet_jvt<0.85) unc = 7.92319e-02 +9.66239e-03* avgmu -3.81872e-05 * avgmu * avgmu ;
868  else if(jet_jvt<0.95) unc = 4.25501e-02 +7.90022e-03 * avgmu -1.93561e-05 * avgmu * avgmu;
869  else unc = -2.68089e-03 +2.50117e-04 * avgmu -1.43591e-06 * avgmu * avgmu ;
870  }else if(jet_pt<50){
871  if(jet_jvt<0.11) unc = 1.66062e-01+ 1.21029e-02 * avgmu -7.00743e-05 * avgmu * avgmu;
872  else if(jet_jvt<0.25) unc = 1.36874e-01+ 1.03543e-02 * avgmu -5.13482e-05 * avgmu * avgmu;
873  else if(jet_jvt<0.85) unc = 7.24015e-02 +6.72611e-03 * avgmu -1.98316e-05 * avgmu * avgmu;
874  else if(jet_jvt<0.95) unc = 4.84508e-02 +5.10548e-03* avgmu -8.65067e-06 * avgmu * avgmu;
875  else unc = -3.02710e-03 +2.31422e-04* avgmu -1.84795e-06 * avgmu * avgmu;
876  }else if(jet_pt<60){
877  if(jet_jvt<0.11) unc =1.33626e-01 + 1.02813e-02 * avgmu -4.87698e-05 * avgmu * avgmu;
878  else if(jet_jvt<0.25) unc = 1.06724e-01 + 8.45131e-03 * avgmu -3.26833e-05 * avgmu * avgmu;
879  else if(jet_jvt<0.85) unc = 7.47468e-02 +4.85387e-03 * avgmu -1.01430e-05* avgmu * avgmu;
880  else if(jet_jvt<0.95) unc = 4.57521e-02 + 3.86782e-03 * avgmu -6.38948e-06 * avgmu * avgmu;
881  else unc = 1.20495e-03 +1.18941e-05* avgmu +1.47846e-07 * avgmu * avgmu;
882  }else if( jet_pt<100){
883  unc = 6.59079e-01 -9.29754e-01 * jet_jvt + 2.83653e-01 * jet_jvt * jet_jvt;
884  }else if(jet_pt<150){
885  unc = 6.58295e-01 -9.31032e-01 * jet_jvt + 2.85724e-01 * jet_jvt * jet_jvt;
886  }
887  }// end eta 2.7
888  else{//forward jets
889  float fjvt = jet_fjvt>0.6 ? 0.6 : jet_fjvt; // the pileup more or less plateaus at 0.6
890  if(jet_pt<30) unc = 0.605329 + 0.625734 * fjvt -0.42484 * fjvt * fjvt;
891  else if(jet_pt<40) unc = 0.409696 + 1.00173 * fjvt -0.609179 * fjvt * fjvt;
892  else if(jet_pt<50) unc = 0.173755 + 1.48847 * fjvt -0.803771 * fjvt * fjvt;
893  else if(jet_pt<60) unc = 0.0140303 + 1.79909 * fjvt -0.889274 * fjvt * fjvt;
894  else if(jet_pt<120) unc = -0.0828333 + 1.81167 * fjvt -0.716881 * fjvt * fjvt;
895  // max of 0.9 seems reasonable
896  if(jet_fjvt>0.6) unc = 0.9;
897  }
898  }// end pflow
899 
900  unc = std::min(unc, 1.0);
901  unc = std::max(unc, 0.0);
902 
903  return unc;
904  }
905 
906  double METSignificance::GetPhiUnc(double jet_eta, double jet_phi,double jet_pt){
907 
908  unsigned int xbin = getEtaBin(jet_eta);
909  unsigned int ybin = jet_phi>0.0 ? int(jet_phi/0.4)+9 : int(jet_phi/0.4)+8;
910 
911  // Stored as bin content = Mean, error = RMS, we want to use the RMS.
913  ATH_MSG_ERROR("Jet Phi Resolution histograms are invalid.");
914  return 0.0;
915  }
916 
917  // Collect the phi resolution
918  if(jet_pt<50.0)
919  return m_phi_reso_pt20->GetBinError(xbin, ybin);
920  else if(jet_pt<100.0)
921  return m_phi_reso_pt50->GetBinError(xbin, ybin);
922  return m_phi_reso_pt100->GetBinError(xbin, ybin);
923  }
924 
925  unsigned int METSignificance::getEtaBin(double jet_eta){
926  // For the phi uncertainty lookup
927  if(-4.5<jet_eta && -3.8>=jet_eta) return 1;
928  else if(-3.8<jet_eta && -3.5>=jet_eta) return 2;
929  else if(-3.5<jet_eta && -3.0>=jet_eta) return 3;
930  else if(-3.0<jet_eta && -2.7>=jet_eta) return 4;
931  else if(-2.7<jet_eta && -2.4>=jet_eta) return 5;
932  else if(-2.4<jet_eta && -1.5>=jet_eta) return 6;
933  else if(-1.5<jet_eta && -0.5>=jet_eta) return 7;
934  else if(-0.5<jet_eta && 0.0>=jet_eta) return 8;
935  else if(0.0<jet_eta && 0.5>=jet_eta) return 9;
936  else if(0.5<jet_eta && 1.5>=jet_eta) return 10;
937  else if(1.5<jet_eta && 2.4>=jet_eta) return 11;
938  else if(2.4<jet_eta && 2.7>=jet_eta) return 12;
939  else if(2.7<jet_eta && 3.0>=jet_eta) return 13;
940  else if(3.0<jet_eta && 3.5>=jet_eta) return 14;
941  else if(3.5<jet_eta && 3.8>=jet_eta) return 15;
942  else if(3.8<jet_eta ) return 16;
943  return 0;
944  }
945 
946  std::tuple<double,double,double> METSignificance::CovMatrixRotation(double var_x, double var_y, double cv_xy, double Phi){
947  // Covariance matrix parallel and transverse to the Phi direction
948  Double_t V11 = std::pow(std::cos(Phi),2)*var_x + 2*std::sin(Phi)*std::cos(Phi)*cv_xy + std::pow(std::sin(Phi),2)*var_y;
949  Double_t V22 = std::pow(std::sin(Phi),2)*var_x - 2*std::sin(Phi)*std::cos(Phi)*cv_xy + std::pow(std::cos(Phi),2)*var_y;
950  Double_t V12 = std::pow(std::cos(Phi),2)*cv_xy -std::sin(Phi)*std::cos(Phi)*var_x + std::sin(Phi)*std::cos(Phi)*var_y - std::pow(std::sin(Phi),2)*cv_xy; // rho is equal to one for just one jet
951  return std::make_tuple( V11, V22, V12);
952  }
953 
954  double METSignificance::Significance_LT(double Numerator, double var_parall, double var_perpen, double cov){
955 
956  Double_t rho = cov / std::sqrt( var_parall * var_perpen ) ;
957  Double_t Significance = 0;
958  if (std::abs( rho ) >= 0.9 ){ //Cov Max not invertible -> Significance diverges
959  ATH_MSG_VERBOSE("rho is large: " << rho);
960  Significance = std::pow( Numerator - m_scalarBias , 2 ) / ( var_parall ) ;
961  }
962  else
963  Significance = std::pow( Numerator - m_scalarBias , 2 ) / ( var_parall * ( 1 - std::pow(rho,2) ) ) ;
964 
965  if( std::abs(Significance) >= 10e+15)
966  ATH_MSG_WARNING("warning -->"<< Significance);
967 
968  return Significance;
969  }
970 
971  void METSignificance::InvertMatrix(double (&mat)[2][2], double (&m)[2][2]){
972 
973  // determinant
974  double det = mat[0][0]*mat[1][1]-mat[0][1]*mat[1][0];
975 
976  m[0][0]=0.0;
977  m[0][1]=0.0;
978  m[1][0]=0.0;
979  m[1][1]=0.0;
980 
981  if(det==0.0) return;
982 
983  m[0][0]= 1.0/det*(mat[1][1]);
984  m[1][0]=-1.0/det*(mat[1][0]);
985  m[0][1]=-1.0/det*(mat[0][1]);
986  m[1][1]= 1.0/det*(mat[0][0]);
987  }
988 
989  void METSignificance::AddMatrix(double (&X)[2][2],double (&Y)[2][2], double (&mat_new)[2][2]){
990  mat_new[0][0]=X[0][0]+Y[0][0];
991  mat_new[0][1]=X[0][1]+Y[0][1];
992  mat_new[1][0]=X[1][0]+Y[1][0];
993  mat_new[1][1]=X[1][1]+Y[1][1];
994  }
995 
996  void METSignificance::RotateXY(const double (&mat)[2][2], double (&mat_new)[2][2], double phi){
997 
998  double c = std::cos(phi);
999  double s = std::sin(phi);
1000  double cc = c*c;
1001  double ss = s*s;
1002  double cs = c*s;
1003 
1004  double V11 = mat[0][0]*cc + mat[1][1]*ss - cs*(mat[1][0] + mat[0][1]);
1005  double V12 = mat[0][1]*cc - mat[1][0]*ss + cs*(mat[0][0] - mat[1][1]);
1006  double V21 = mat[1][0]*cc - mat[0][1]*ss + cs*(mat[0][0] - mat[1][1]);
1007  double V22 = mat[0][0]*ss + mat[1][1]*cc + cs*(mat[1][0] + mat[0][1]);
1008 
1009  mat_new[0][0]=V11;
1010  mat_new[0][1]=V12;
1011  mat_new[1][0]=V21;
1012  mat_new[1][1]=V22;
1013  }
1014 
1016  // Coefficients from Doug Schaefer <schae@cern.ch> and the MET subgroup
1017  double METSignificance::BiasPtSoftdir(const double PtSoft){
1018  if (PtSoft<60.) return (0.145)+(-0.45)*PtSoft;
1019  else return (0.145)+(-0.45)*(60.);
1020  }
1021 
1022  // variation in ptsoft direction
1023  // Coefficients from Doug Schaefer <schae@cern.ch> and the MET subgroup
1024  double METSignificance::VarparPtSoftdir(const double PtSoft, const double SoftSumet){
1025  if (SoftSumet<25){
1026  if (PtSoft<50.) return 41.9+3.8*PtSoft+0.1*std::pow(PtSoft,2)-12.7+ 1.39*SoftSumet-0.03*std::pow(SoftSumet,2);
1027  else return 41.9+3.8*50.+0.1*std::pow(50.,2)-12.7+ 1.39*SoftSumet-0.03*std::pow(SoftSumet,2);
1028  }
1029  else{
1030  if (PtSoft<50.) return 41.9+3.8*PtSoft+0.1*std::pow(PtSoft,2);
1031  else return (40.5614)+(4.10965)*50.+(0.0955044)*std::pow(50.,2);
1032  }
1033  }
1034 
1035  // Coefficients from Doug Schaefer <schae@cern.ch> and the MET subgroup
1036  double METSignificance::Var_Ptsoft(const double PtSoft){
1037  if (PtSoft<45.) return 40. + 2*PtSoft + 0.1*std::pow(PtSoft,2);
1038  else return 40. + 2*45 + 0.1*std::pow(45,2);
1039  }
1040 
1041  // Coefficients from Doug Schaefer <schae@cern.ch> and the MET subgroup
1042  double METSignificance::Bias_PtSoftParall(const double PtSoft_Parall)
1043  {
1044  if (-60.<=PtSoft_Parall && PtSoft_Parall<0.) return -8. -0.4*PtSoft_Parall;
1045  if (-60.>PtSoft_Parall) return -8. -0.4 * (-60.);
1046  if( PtSoft_Parall>=0. && PtSoft_Parall<60.) return -8. -PtSoft_Parall;
1047  if(PtSoft_Parall>60.) return -8. -60.;
1048  return 0.0;
1049  }
1050 
1051  void METSignificance::AddResoMap(const double varL, const double varT, const double CvLT, const int term){
1052 
1053  m_term_VarL[term] += varL;
1054  m_term_VarT[term] += varT;
1055  m_term_CvLT[term] += CvLT;
1056 
1057  }
1058 
1059 } //> end namespace met
met::METSignificance::m_jerForEMu
bool m_jerForEMu
Definition: METSignificance.h:135
met::METSignificance::m_pthard_vect
TVector3 m_pthard_vect
Definition: METSignificance.h:127
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
TrigJetMonitorAlgorithm.jetcoll
jetcoll
Definition: TrigJetMonitorAlgorithm.py:1306
met::METSignificance::VarparPtSoftdir
double VarparPtSoftdir(const double PtSoft, const double SoftSumet)
Definition: METSignificance.cxx:1024
met::METSignificance::InvertMatrix
void InvertMatrix(double(&mat)[2][2], double(&m)[2][2])
Definition: METSignificance.cxx:971
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
met::METSignificance::m_jetEtaThr
float m_jetEtaThr
Definition: METSignificance.h:143
met::METSignificance::m_lamda_vect
TVector3 m_lamda_vect
Definition: METSignificance.h:128
met::METSignificance::m_VarL
double m_VarL
Definition: METSignificance.h:148
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
met::METSignificance::AddResoMap
void AddResoMap(const double varL, const double varT, const double CvTV, const int term)
Definition: METSignificance.cxx:1051
met::METSignificance::Bias_PtSoftParall
double Bias_PtSoftParall(const double PtSoft_Parall)
Definition: METSignificance.cxx:1042
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
xAOD::Electron
Electron_v1 Electron
Definition of the current "egamma version".
Definition: Event/xAOD/xAODEgamma/xAODEgamma/Electron.h:17
met::METSignificance::m_met
double m_met
Definition: METSignificance.h:160
met::METSignificance::RotateXY
void RotateXY(const double(&mat)[2][2], double(&mat_new)[2][2], double phi)
Definition: METSignificance.cxx:996
MissingETBase::Source::hasPattern
static bool hasPattern(E bits, F mask)
Generic check for given pattern.
Definition: MissingETBase.h:382
test_pyathena.px
px
Definition: test_pyathena.py:18
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
max
#define max(a, b)
Definition: cfImp.cxx:41
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
met::METSignificance::initialize
StatusCode initialize()
Dummy implementation of the initialisation function.
Definition: METSignificance.cxx:103
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
xAOD::MissingET_v1::sumet
float sumet() const
Returns.
TRTCalib_Extractor.det
det
Definition: TRTCalib_Extractor.py:36
met::METSignificance::m_configJetPhiResoFile
std::string m_configJetPhiResoFile
Definition: METSignificance.h:176
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
xAOD::Egamma_v1::e
virtual double e() const override final
The total energy of the particle.
Definition: Egamma_v1.cxx:90
met::METSignificance::m_configPrefix
std::string m_configPrefix
Definition: METSignificance.h:175
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:55
met::METSignificance::m_GeV
double m_GeV
Definition: METSignificance.h:123
xAOD::MissingET_v1::phi
float phi() const
Returns .
TauCombinedTES
Definition: TauCombinedTES.h:19
met::ResoSoft
@ ResoSoft
Definition: IMETSignificance.h:34
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
met::METSignificance::varianceMET
StatusCode varianceMET(xAOD::MissingETContainer *metCont, float avgmu, const std::string &jetTermName, const std::string &softTermName, const std::string &totalMETName)
Definition: METSignificance.cxx:197
met::METSignificance::m_JetResoAux
std::string m_JetResoAux
Definition: METSignificance.h:177
xAOD::Egamma_v1::author
uint16_t author(uint16_t bitmask=EgammaParameters::AuthorALL) const
Get author.
Definition: Egamma_v1.cxx:166
JetAttributes.h
met::METSignificance::m_jetCalibTool
ToolHandle< IJetCalibrationTool > m_jetCalibTool
Definition: METSignificance.h:88
MissingETBase::Source::isTotalTerm
static bool isTotalTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
Definition: MissingETBase.h:405
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
met::METSignificance::m_metphi
double m_metphi
Definition: METSignificance.h:163
met::METSignificance::SetLambda
StatusCode SetLambda(const float px, const float py, const bool GeV=true)
Definition: METSignificance.cxx:395
met::METSignificance::m_treatPUJets
bool m_treatPUJets
Definition: METSignificance.h:132
met::METSignificance::m_term_CvLT
std::map< int, double > m_term_CvLT
Definition: METSignificance.h:158
met::METSignificance::AddMuon
StatusCode AddMuon(const xAOD::IParticle *obj, float &pt_reso, float &phi_reso, float avgmu)
Definition: METSignificance.cxx:420
xAOD::Egamma_v1::p4
virtual FourMom_t p4() const override final
The full 4-momentum of the particle as a TLoretzVector.
Definition: Egamma_v1.cxx:98
met::METSignificance::m_muonCalibrationAndSmearingTool
ToolHandle< CP::IMuonCalibrationAndSmearingTool > m_muonCalibrationAndSmearingTool
Definition: METSignificance.h:89
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
met::METSignificance::m_significance
double m_significance
Definition: METSignificance.h:146
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
Phi
@ Phi
Definition: RPCdef.h:8
met::METSignificance::GetPUProb
double GetPUProb(double jet_eta, double jet_phi, double jet_pt, double jet_jvt, double jet_fjvt, float avgmu)
Definition: METSignificance.cxx:686
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
met::METSignificance::m_mety
double m_mety
Definition: METSignificance.h:162
met::METSignificance::GetVarT
double GetVarT() const
Definition: METSignificance.h:79
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
met::METSignificance::m_CvLT
double m_CvLT
Definition: METSignificance.h:150
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MissingETBase::Types::bitmask_t
uint64_t bitmask_t
Type for status word bit mask.
Definition: MissingETBase.h:39
met::METSignificance::m_ht
double m_ht
Definition: METSignificance.h:166
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
asg::AsgToolConfig::makePrivateTool
::StatusCode makePrivateTool(ToolHandle< T > &toolHandle) const
make a private tool with the given configuration
met::METSignificance::m_met_VarT
double m_met_VarT
Definition: METSignificance.h:153
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
met::METSignificance::m_metsoft
double m_metsoft
Definition: METSignificance.h:164
Monitored::X
@ X
Definition: HistogramFillerUtils.h:24
met::METSignificance::m_softTermParam
int m_softTermParam
Definition: METSignificance.h:130
met::METSignificance::AddPhoton
StatusCode AddPhoton(const xAOD::IParticle *obj, float &pt_reso, float &phi_reso)
Definition: METSignificance.cxx:503
m_file
std::unique_ptr< TFile > m_file
description: this is a custom writer for the old-school drivers that don't use an actual writer
Definition: OutputStreamData.cxx:52
met::METSignificance::CovMatrixRotation
std::tuple< double, double, double > CovMatrixRotation(double var_x, double var_y, double cv_xy, double Phi)
Definition: METSignificance.cxx:946
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
met::METSignificance::m_met_vect
TVector3 m_met_vect
Definition: METSignificance.h:125
xAOD::TauJet_v3::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
met::METSignificance::~METSignificance
virtual ~METSignificance()
Destructor:
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::METSignificance::GetPhiUnc
double GetPhiUnc(double jet_eta, double jet_phi, double jet_pt)
Definition: METSignificance.cxx:906
met
Definition: IMETSignificance.h:24
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
JetCalibrationTool.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
Random
Definition: TrigAnalysis/TrigInDetAnalysisUser/Resplot/src/Random.h:26
asg::AsgToolConfig
an object that can create a AsgTool
Definition: AsgToolConfig.h:22
ElectronContainer.h
met::METSignificance::m_rho
double m_rho
Definition: METSignificance.h:147
met::METSignificance::GetVarL
double GetVarL() const
Definition: METSignificance.h:78
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: CaloCluster_v1.cxx:251
met::METSignificance::m_metsoftphi
double m_metsoftphi
Definition: METSignificance.h:165
met::METSignificance::m_tauCombinedTES
ToolHandle< ITauToolBase > m_tauCombinedTES
Definition: METSignificance.h:91
met::METSignificance::Significance_LT
double Significance_LT(double Numerator, double var_parall, double var_perpen, double cov)
Definition: METSignificance.cxx:954
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
met::METSignificance::m_phi_reso_pt20
TH2F * m_phi_reso_pt20
Definition: METSignificance.h:171
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
MissingETAuxContainer.h
met::METSignificance::BiasPtSoftdir
double BiasPtSoftdir(const double PtSoft)
Parameterization with PtSoft Direction //.
Definition: METSignificance.cxx:1017
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
AsgToolConfig.h
xAOD::Egamma_v1::caloCluster
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
Definition: Egamma_v1.cxx:388
met::METSignificance::METSignificance
METSignificance()
Default constructor:
met::Random
@ Random
Definition: IMETSignificance.h:27
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition: Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
met::METSignificance::m_EMuResoAux
std::string m_EMuResoAux
Definition: METSignificance.h:178
met::PthardParam
@ PthardParam
Definition: IMETSignificance.h:28
xAOD::MissingET_v1
Principal data object for Missing ET.
Definition: MissingET_v1.h:25
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
xAOD::MissingET_v1::mpx
float mpx() const
Returns .
met::TSTParam
@ TSTParam
Definition: IMETSignificance.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
METSignificance.h
met::METSignificance::m_applyBias
bool m_applyBias
Definition: METSignificance.h:134
TauJetContainer.h
xAOD::MissingET_v1::name
const std::string & name() const
Identifier getters.
TauCombinedTES.h
met::METSignificance::GetSigDirectional
double GetSigDirectional() const
Definition: METSignificance.h:76
min
#define min(a, b)
Definition: cfImp.cxx:40
met::METSignificance::m_phi_reso_pt100
TH2F * m_phi_reso_pt100
Definition: METSignificance.h:173
Monitored::Y
@ Y
Definition: HistogramFillerUtils.h:24
xAOD::MissingETContainer_v1
Container for xAOD::MissingET_v1 objects.
Definition: MissingETContainer_v1.h:21
Amg::py
@ py
Definition: GeoPrimitives.h:39
PathResolver.h
met::METSignificance::AddTau
void AddTau(const xAOD::IParticle *obj, float &pt_reso, float &phi_reso)
Definition: METSignificance.cxx:570
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
met::METSignificance::AddJet
StatusCode AddJet(const xAOD::IParticle *obj, float &pt_reso, float &phi_reso, float &avgmu)
Definition: METSignificance.cxx:519
met::METSignificance::m_metx
double m_metx
Definition: METSignificance.h:161
met::METSignificance::AddSoftTerm
void AddSoftTerm(const xAOD::MissingET *soft, const TVector3 &met_vect, double(&particle_sum)[2][2])
Definition: METSignificance.cxx:591
met::METSignificance::m_soft_vect
TVector3 m_soft_vect
Definition: METSignificance.h:126
xAOD::Electron_v1
Definition: Electron_v1.h:34
met::METSignificance::Var_Ptsoft
double Var_Ptsoft(const double PtSoft)
Definition: METSignificance.cxx:1036
met::METSignificance::GetRho
double GetRho() const
Definition: METSignificance.h:77
met::METSignificance::m_met_CvLT
double m_met_CvLT
Definition: METSignificance.h:154
MuonContainer.h
xAOD::Photon
Photon_v1 Photon
Definition of the current "egamma version".
Definition: Event/xAOD/xAODEgamma/xAODEgamma/Photon.h:17
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
Muon
struct TBPatternUnitContext Muon
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
MissingETBase::Source::Signal::Track
@ Track
Indicator for MET contribution from reconstructed charged particle tracks.
met::METSignificance::m_scalarBias
double m_scalarBias
Definition: METSignificance.h:145
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAOD::TauJet_v3::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition: TauJet_v3.cxx:97
met::METSignificance::m_phi_reso_pt50
TH2F * m_phi_reso_pt50
Definition: METSignificance.h:172
met::METSignificance::m_isDataMuon
bool m_isDataMuon
Definition: METSignificance.h:138
met::METSignificance::AddMatrix
void AddMatrix(double(&X)[2][2], double(&Y)[2][2], double(&mat_new)[2][2])
Definition: METSignificance.cxx:989
met::METSignificance::finalize
StatusCode finalize()
Definition: METSignificance.cxx:186
asg::AsgComponentConfig::setProperty
StatusCode setProperty(const std::string &name, const T &value)
set the given property
met::METSignificance::m_egammaCalibTool
ToolHandle< CP::IEgammaCalibrationAndSmearingTool > m_egammaCalibTool
Definition: METSignificance.h:90
met::METSignificance::m_isAFII
bool m_isAFII
Definition: METSignificance.h:139
met::METSignificance::m_met_VarL
double m_met_VarL
Definition: METSignificance.h:152
met::METSignificance::m_term_VarL
std::map< int, double > m_term_VarL
Definition: METSignificance.h:156
xAOD::get_eta_calo
float get_eta_calo(const xAOD::CaloCluster &cluster, int author, bool do_throw=false)
Definition: EgammaCalibrationAndSmearingTool.h:64
met::METSignificance::m_doPhiReso
bool m_doPhiReso
Definition: METSignificance.h:133
met::METSignificance::m_jetPtThr
float m_jetPtThr
Definition: METSignificance.h:142
met::METSignificance::m_sumet
double m_sumet
Definition: METSignificance.h:167
xAOD::Egamma_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: Egamma_v1.cxx:65
xAODType::Tau
@ Tau
The object is a tau (jet)
Definition: ObjectType.h:49
met::METSignificance::GetSignificance
double GetSignificance() const
Definition: METSignificance.h:75
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Trk::jet_phi
@ jet_phi
Definition: JetVtxParamDefs.h:28
PATCore::ParticleType::Electron
@ Electron
Definition: PATCoreEnums.h:40
met::METSignificance::m_JetCollection
std::string m_JetCollection
Definition: METSignificance.h:179
met::METSignificance::GetMETOverSqrtHT
double GetMETOverSqrtHT() const
Definition: METSignificance.h:74
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
met::METSignificance::m_softTermReso
double m_softTermReso
Definition: METSignificance.h:131
met::METSignificance::RotateToPhi
StatusCode RotateToPhi(float phi)
Definition: METSignificance.cxx:377
TruthParticle.h
met::METSignificance::AddElectron
StatusCode AddElectron(const xAOD::IParticle *obj, float &pt_reso, float &phi_reso, float avgmu)
Definition: METSignificance.cxx:472
xAOD::TruthParticle_v1::pdgId
int pdgId() const
PDG ID code.
met::METSignificance::getEtaBin
static unsigned int getEtaBin(double jet_eta)
Definition: METSignificance.cxx:925
xAOD::MissingET_v1::mpy
float mpy() const
Returns .
met::METSignificance::m_term_VarT
std::map< int, double > m_term_VarT
Definition: METSignificance.h:157
python.PyAthena.obj
obj
Definition: PyAthena.py:132
MissingETBase::Source::isSoftTerm
static bool isSoftTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
Definition: MissingETBase.h:403
python.compressB64.c
def c
Definition: compressB64.py:93
met::METSignificance::m_file
TFile * m_file
Definition: METSignificance.h:170
EgammaCalibrationAndSmearingTool.h
PhotonContainer.h
MissingETComposition.h
MissingETContainer.h
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition: Event/xAOD/xAODJet/xAODJet/Jet.h:17
xAOD::MissingET_v1::met
float met() const
Returns .
fitman.rho
rho
Definition: fitman.py:532
python.handimod.cc
int cc
Definition: handimod.py:523
met::METSignificance::GetMETOverSqrtSumET
double GetMETOverSqrtSumET() const
Definition: METSignificance.h:73
met::METSignificance::m_VarT
double m_VarT
Definition: METSignificance.h:149
met::METSignificance::m_isDataJet
bool m_isDataJet
Definition: METSignificance.h:137