ATLAS Offline Software
Loading...
Searching...
No Matches
MissingMassProb.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Class handling the probability calculation of the MissingMassCalculator
6// author Michael Huebner <michael.huebner@no.spam.cern.ch>
7
8#ifndef DITAUMASSTOOLS_MISSINGMASSPROB_H
9#define DITAUMASSTOOLS_MISSINGMASSPROB_H
10
11// Local include(s):
14
15// ROOT include(s):
16#include <TFile.h>
17#include <TF1.h>
18#include <TGraphAsymmErrors.h>
19#include <Math/Vector4D.h>
20
21#include <string>
22
23namespace DiTauMassTools{
24 using ROOT::Math::PtEtaPhiMVector;
25
27
29
30 public:
31 MissingMassProb(MMCCalibrationSet::e aset, const std::string& paramFilePath);
33
34 double apply(MissingMassInput& preparedInput, const int & tau_type1, const int & tau_type2, const PtEtaPhiMVector & tauvec1, const PtEtaPhiMVector & tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector & nuvec2, bool constant=false, bool oneTau=false, bool twoTau=false);
35
36 void setParamAngle(const PtEtaPhiMVector & tauvec, int tau, int tautype);
37 void setParamRatio(int tau, int tautype);
38 void setParamNuMass();
44
45 void SetAllowUseHT(bool allowUseHT) { m_allowUseHT=allowUseHT;}
46 bool GetAllowUseHT() { return m_allowUseHT;}
47
48 void SetUseHT(bool val) { m_UseHT=val; }
49 bool GetUseHT() { return m_UseHT; } // if use HT
50
53
56
57 void SetUseDphiLL(bool val) {m_fUseDphiLL = val;}
58 bool GetUseDphiLL() { return m_fUseDphiLL; }
59
60 double MetProbability(MissingMassInput& preparedInput, const double & met1,const double & met2,const double & MetSigma1, const double & MetSigma2);
61 double dTheta3Dparam(const int & parInd, const int & tau_type, const double & P_tau,const double *par);
62
63 double dTheta3d_probabilityFast(MissingMassInput& preparedInput, const int & tau_type,const double & dTheta3d,const double & P_tau);
64 double myDelThetaHadFunc(double *x, double *par);
65 double myDelThetaLepFunc(double *x, double *par);
66
67 double MHtProbability(MissingMassInput& preparedInput, const double & d_mhtX, const double & d_mhtY, const double & mht,
68 const double & trueMetGuess, const double & mht_offset);
69 double MHtProbabilityHH(MissingMassInput& preparedInput, const double & d_mhtX, const double & d_mhtY, const double & mht,
70 const double & trueMetGuess, const double & mht_offset);
71
72 void MET(MissingMassInput& preparedInput);
73 double mEtAndTauProbability(MissingMassInput& preparedInput);
74 double MnuProbability(MissingMassInput& preparedInput, double mnu, double binsize);
75 double MnuProbability(MissingMassInput& preparedInput, double mnu);
76 double TauProbability(MissingMassInput& preparedInput, const int & type1, const PtEtaPhiMVector & vis1, const PtEtaPhiMVector & nu1,
77 const int & type2, const PtEtaPhiMVector & vis2, const PtEtaPhiMVector & nu2);
78 double TauProbability(MissingMassInput& preparedInput, const int & type1, const PtEtaPhiMVector & vis1, const PtEtaPhiMVector & nu1,
79 const int & type2, const PtEtaPhiMVector & vis2, const PtEtaPhiMVector & nu2, const double & detmet);
80 double TauProbabilityLFV(MissingMassInput& preparedInput, const int & type1, const PtEtaPhiMVector & vis1, const PtEtaPhiMVector & nu1);
81
82 static double MetProbabilityWrapper(MissingMassProb* prob, MissingMassInput& preparedInput, const int & tau_type1, const int & tau_type2, const PtEtaPhiMVector & tauvec1, const PtEtaPhiMVector & tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector & nuvec2);
83 static double mEtAndTauProbabilityWrapper(MissingMassProb* prob, MissingMassInput& preparedInput, const int & tau_type1, const int & tau_type2, const PtEtaPhiMVector & tauvec1, const PtEtaPhiMVector & tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector & nuvec2);
84 static double dTheta3d_probabilityFastWrapper( MissingMassProb* prob, MissingMassInput& preparedInput, const int & tau_type1, const int & tau_type2, const PtEtaPhiMVector & tauvec1, const PtEtaPhiMVector & tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector & nuvec2 );
85 static double TauProbabilityWrapper( MissingMassProb* prob, MissingMassInput& preparedInput, const int & tau_type1, const int & tau_type2, const PtEtaPhiMVector & tauvec1, const PtEtaPhiMVector & tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector & nuvec2 );
86 static double MnuProbabilityWrapper( MissingMassProb* prob, MissingMassInput& preparedInput, const int & tau_type1, const int & tau_type2, const PtEtaPhiMVector & tauvec1, const PtEtaPhiMVector & tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector & nuvec2 );
87 static double MnuProbabilityNewWrapper( MissingMassProb* prob, MissingMassInput& preparedInput, const int & tau_type1, const int & tau_type2, const PtEtaPhiMVector & tauvec1, const PtEtaPhiMVector & tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector & nuvec2 );
88
89 static double dTheta3d_probabilityNewWrapper( MissingMassProb* prob, MissingMassInput& preparedInput, const int & tau_type1, const int & tau_type2, const PtEtaPhiMVector & tauvec1, const PtEtaPhiMVector & tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector & nuvec2 );
90 static double TauProbabilityNewWrapper( MissingMassProb* prob, MissingMassInput& preparedInput, const int & tau_type1, const int & tau_type2, const PtEtaPhiMVector & tauvec1, const PtEtaPhiMVector & tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector & nuvec2 );
91
92 std::list<std::function<double(MissingMassInput& preparedInput, const int & tau_type1, const int & tau_type2, const PtEtaPhiMVector & tauvec1, const PtEtaPhiMVector & tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector & nuvec2)>> m_probListConstant;
93 std::list<std::function<double(MissingMassInput& preparedInput, const int & tau_type1, const int & tau_type2, const PtEtaPhiMVector & tauvec1, const PtEtaPhiMVector & tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector & nuvec2)>> m_probListOneTau;
94 std::list<std::function<double(MissingMassInput& preparedInput, const int & tau_type1, const int & tau_type2, const PtEtaPhiMVector & tauvec1, const PtEtaPhiMVector & tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector & nuvec2)>> m_probListTwoTau;
95 private:
96 //SpeedUp static array for efficient access
97 thread_local static double s_fit_param[2][3][6][5];
98 thread_local static double s_ter_sigma_par[2][10][3];
99 //cache quantities for efficient NuPSolution calculation
100
101 TF1 *m_formulaAngle1 = new TF1("formulaAngle1", "[0]*exp(-[2]*(log((x+[3])/[1]))**2)");
102 TF1 *m_formulaAngle2 = new TF1("formulaAngle2", "[0]*exp(-[2]*(log((x+[3])/[1]))**2)");
105 TF1 *m_formulaRatioLep1 = new TF1("formulaRatio1", "gaus(0)+expo(3)");
106 TF1 *m_formulaRatioLep2 = new TF1("formulaRatio2", "gaus(0)+expo(3)");
107 TF1 *m_formulaRatioHad1 = new TF1("formulaRatio1", "gaus(0)");
108 TF1 *m_formulaRatioHad2 = new TF1("formulaRatio2", "gaus(0)");
109 TF1 *m_formulaNuMass = new TF1("formulaNuMass", "pol6");
110 std::vector<TF1*> m_paramVectorAngle;
111 std::vector<TF1*> m_paramVectorAngleLep;
112 std::vector<TF1*> m_paramVectorRatio;
113 std::vector<TF1*> m_paramVectorRatioLep;
114 std::vector<TF1*> m_paramVectorNuMass;
115
116 std::string m_paramFilePath;
117 TFile *m_fParams;
119
122 bool m_fUseTauProbability; // switch to apply TauProbability
123 bool m_fUseMnuProbability; // switch to apply MnuProbability
124 bool m_fUseDphiLL; //for leplep
125
126 // comment by Sasha to keep this for the future
127 //inline double AngularProbability(PtEtaPhiMVector nu_vec, PtEtaPhiMVector vis_vec, int decayType);
128
129 // to be tested if helpful
130 //inline double ResonanceProbability(PtEtaPhiMVector vec1, PtEtaPhiMVector vec2);
131};
132} // namespace DiTauMassTools
133
134#endif
#define x
std::vector< TF1 * > m_paramVectorRatioLep
void SetAllowUseHT(bool allowUseHT)
double TauProbabilityLFV(MissingMassInput &preparedInput, const int &type1, const PtEtaPhiMVector &vis1, const PtEtaPhiMVector &nu1)
static double dTheta3d_probabilityFastWrapper(MissingMassProb *prob, MissingMassInput &preparedInput, const int &tau_type1, const int &tau_type2, const PtEtaPhiMVector &tauvec1, const PtEtaPhiMVector &tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector &nuvec2)
double MHtProbabilityHH(MissingMassInput &preparedInput, const double &d_mhtX, const double &d_mhtY, const double &mht, const double &trueMetGuess, const double &mht_offset)
std::vector< TF1 * > m_paramVectorNuMass
static thread_local double s_ter_sigma_par[2][10][3]
double MHtProbability(MissingMassInput &preparedInput, const double &d_mhtX, const double &d_mhtY, const double &mht, const double &trueMetGuess, const double &mht_offset)
MissingMassProb(MMCCalibrationSet::e aset, const std::string &paramFilePath)
double dTheta3d_probabilityFast(MissingMassInput &preparedInput, const int &tau_type, const double &dTheta3d, const double &P_tau)
std::list< std::function< double(MissingMassInput &preparedInput, const int &tau_type1, const int &tau_type2, const PtEtaPhiMVector &tauvec1, const PtEtaPhiMVector &tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector &nuvec2)> > m_probListConstant
double myDelThetaLepFunc(double *x, double *par)
double dTheta3Dparam(const int &parInd, const int &tau_type, const double &P_tau, const double *par)
void setParamRatio(int tau, int tautype)
double TauProbability(MissingMassInput &preparedInput, const int &type1, const PtEtaPhiMVector &vis1, const PtEtaPhiMVector &nu1, const int &type2, const PtEtaPhiMVector &vis2, const PtEtaPhiMVector &nu2)
std::vector< TF1 * > m_paramVectorAngle
static double TauProbabilityWrapper(MissingMassProb *prob, MissingMassInput &preparedInput, const int &tau_type1, const int &tau_type2, const PtEtaPhiMVector &tauvec1, const PtEtaPhiMVector &tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector &nuvec2)
double MetProbability(MissingMassInput &preparedInput, const double &met1, const double &met2, const double &MetSigma1, const double &MetSigma2)
static thread_local double s_fit_param[2][3][6][5]
static double MnuProbabilityNewWrapper(MissingMassProb *prob, MissingMassInput &preparedInput, const int &tau_type1, const int &tau_type2, const PtEtaPhiMVector &tauvec1, const PtEtaPhiMVector &tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector &nuvec2)
static double mEtAndTauProbabilityWrapper(MissingMassProb *prob, MissingMassInput &preparedInput, const int &tau_type1, const int &tau_type2, const PtEtaPhiMVector &tauvec1, const PtEtaPhiMVector &tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector &nuvec2)
static double MetProbabilityWrapper(MissingMassProb *prob, MissingMassInput &preparedInput, const int &tau_type1, const int &tau_type2, const PtEtaPhiMVector &tauvec1, const PtEtaPhiMVector &tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector &nuvec2)
static double dTheta3d_probabilityNewWrapper(MissingMassProb *prob, MissingMassInput &preparedInput, const int &tau_type1, const int &tau_type2, const PtEtaPhiMVector &tauvec1, const PtEtaPhiMVector &tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector &nuvec2)
std::vector< TF1 * > m_paramVectorRatio
static double MnuProbabilityWrapper(MissingMassProb *prob, MissingMassInput &preparedInput, const int &tau_type1, const int &tau_type2, const PtEtaPhiMVector &tauvec1, const PtEtaPhiMVector &tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector &nuvec2)
double mEtAndTauProbability(MissingMassInput &preparedInput)
double MnuProbability(MissingMassInput &preparedInput, double mnu, double binsize)
void setParamAngle(const PtEtaPhiMVector &tauvec, int tau, int tautype)
std::vector< TF1 * > m_paramVectorAngleLep
MMCCalibrationSet::e m_mmcCalibrationSet
double apply(MissingMassInput &preparedInput, const int &tau_type1, const int &tau_type2, const PtEtaPhiMVector &tauvec1, const PtEtaPhiMVector &tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector &nuvec2, bool constant=false, bool oneTau=false, bool twoTau=false)
static double TauProbabilityNewWrapper(MissingMassProb *prob, MissingMassInput &preparedInput, const int &tau_type1, const int &tau_type2, const PtEtaPhiMVector &tauvec1, const PtEtaPhiMVector &tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector &nuvec2)
std::list< std::function< double(MissingMassInput &preparedInput, const int &tau_type1, const int &tau_type2, const PtEtaPhiMVector &tauvec1, const PtEtaPhiMVector &tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector &nuvec2)> > m_probListOneTau
std::list< std::function< double(MissingMassInput &preparedInput, const int &tau_type1, const int &tau_type2, const PtEtaPhiMVector &tauvec1, const PtEtaPhiMVector &tauvec2, const PtEtaPhiMVector nuvec1, const PtEtaPhiMVector &nuvec2)> > m_probListTwoTau
double myDelThetaHadFunc(double *x, double *par)
Definition MET.py:1