ATLAS Offline Software
MissingMassInput.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Class handling the input of the MissingMassCalculator
6 // author Michael Huebner <michael.huebner@no.spam.cern.ch>
7 
8 // Local include(s):
10 
11 using namespace DiTauMassTools;
12 using ROOT::Math::PtEtaPhiMVector;
13 using ROOT::Math::XYVector;
14 
15 // Default Constructor
17 }
18 
19 // Default Desctructor
21 }
22 
23 //------- clearing input
25 
26  if(m_fUseVerbose == 1){ Info("DiTauMassTools", "MissingMassCalculator::ClearInput()"); }
27 
28  m_MetVec.SetXY(0.,0.);
29  m_vistau1.SetCoordinates(0.,0.,0.,0.);
30  m_vistau2.SetCoordinates(0.,0.,0.,0.);
31 
32  m_type_visTau1 = 0;
33  m_type_visTau2 = 0;
34  m_Nprong_tau1 = 0;
35  m_Nprong_tau2 = 0;
36  m_dataType = 0;
37  m_Njet25 = 0;
38 
39  m_METcovphi = 0.;
40  m_METsigmaP = 0.;
41  m_METsigmaL = 0.;
42  m_SumEt = 0.;
43  m_DelPhiTT = 0.;
44  m_MHtSigma1 = 0.;
45  m_MHtSigma2 = 0.;
46  m_MHtGaussFr = 0.;
47  m_HtOffset = 0.;
48 
49  m_jet4vecs.clear();
50 
51  m_LFVmode = -1;
52 
53  return;
54 }
55 
56 
57 // Printout of final results
59  if(m_fUseVerbose!=1) return;
60 
61  Info("DiTauMassTools", "%s", ("met_x="+std::to_string(m_MetVec.X())+" met_y="+std::to_string(m_MetVec.Y())+" MET="+std::to_string(m_MetVec.R())+" met_phi="+std::to_string(m_MetVec.Phi())).c_str());
62  Info("DiTauMassTools", "%s", ("sumEt="+std::to_string(m_SumEt)+" METsigmaP="+std::to_string(m_METsigmaP)+" METsigmaL="+std::to_string(m_METsigmaL)+" METcovphi="+std::to_string(m_METcovphi)).c_str());
63  //Info("DiTauMassTools", "%s", (" Njet25="+std::to_string(Njet25)+" allowUseHT="+std::to_string(prob->GetAllowUseHT())+" useHT="+std::to_string(prob->GetUseHT())).c_str());
64 
65  Info("DiTauMassTools", "%s", ("MHtSigma1="+std::to_string(m_MHtSigma1)+" MHtSigma2="+std::to_string(m_MHtSigma2)
66  +" MHtGaussFr="+std::to_string(m_MHtGaussFr)
67  +" HtOffset="+std::to_string(m_HtOffset)).c_str());
68 
69  Info("DiTauMassTools", "%s", ("1st visible tau: type="+std::to_string(m_type_visTau1)+" Nprong="+std::to_string(m_Nprong_tau1)+" P="+std::to_string(m_vistau1.P())+" Pt="+std::to_string(m_vistau1.Pt())
70  +" Eta="+std::to_string(m_vistau1.Eta())+" Phi="+std::to_string(m_vistau1.Phi())+" M="+std::to_string(m_vistau1.M())).c_str());
71  Info("DiTauMassTools", "%s", ("2nd visible tau: type="+std::to_string(m_type_visTau2)+" Nprong="+std::to_string(m_Nprong_tau2)+" P="+std::to_string(m_vistau2.P())+" Pt="+std::to_string(m_vistau2.Pt())
72  +" Eta="+std::to_string(m_vistau2.Eta())+" Phi="+std::to_string(m_vistau2.Phi())+" M="+std::to_string(m_vistau2.M())).c_str());
73 
74  if(m_jet4vecs.size()>0)
75  {
76  for(unsigned int i=0; i<m_jet4vecs.size(); i++)
77  {
78  Info("DiTauMassTools", "%s", ("Printing jets: jet "+std::to_string(i)+" E="+std::to_string(m_jet4vecs[i].E())+" Pt="
79  +std::to_string(m_jet4vecs[i].Pt())+" Phi="+std::to_string(m_jet4vecs[i].Phi())+" Eta="+std::to_string(m_jet4vecs[i].Eta())).c_str());
80  }
81  }
82  return;
83 }
84 
85 
86 
87 // input is sumEt after electrons and taus have been removed
88 // data_code=0 for data and =1 for MC
89 void MissingMassInput::SetMetScanParamsUE(double sumEt, double phi_scan, int data_code) {
90  m_METcovphi = phi_scan;
91  if(sumEt>2.0*m_beamEnergy) sumEt = sumEt/1000.0; // it's likely that sumEt was entered in MeV; this fix won't work only for a very small fraction of events
92  double sigma = 1.0;
93  double sigmaSyst = 0.10; // 10% systematics for now (be conservative)
94  double METresScale = 0.7; // using inclusive number for winter 2012
95  if(data_code==1) METresScale=0.7; // use the same for data & MC
96  METresScale = METresScale*(1.0+m_METresSyst*sigmaSyst);
97  // MET resolution can't be perfect in presence of other objects (i.e., electrons, jets, taus), so assume minSumEt = 5.0 for now
98  sigma = sumEt>pow(3.0/METresScale,2) ? METresScale*sqrt(sumEt) : 3.0; // assume that MET resolution can't be better than 3 GeV
100  m_METsigmaL = sigma;
101  m_SumEt = sumEt;
102  m_dataType = data_code; // Sasha added on 09/26/11
103  return;
104 }
105 
106 // ---- input number of jets with Et>25 GeV
108  if(val>-1) m_Njet25 = val;
109  return;
110 }
111 // ----- input SumEt
112 void MissingMassInput::SetSumEt(double sumEt) {
113  m_SumEt = sumEt;
114  return;
115 }
116 // ----- input vis Tau type
117 void MissingMassInput::SetVisTauType(int i, int tautype) {
118  if(i==0) m_type_visTau1 = tautype;
119  if(i==1) m_type_visTau2 = tautype;
120  return;
121 }
122 // ----- input vis Tau vectors
123 void MissingMassInput::SetVisTauVec(int i, const PtEtaPhiMVector & vec) {
124  if(m_fUseVerbose==1) { Info("DiTauMassTools", "%s", ("Seting input "+std::to_string(i)+" to pT="+std::to_string(vec.Pt())).c_str()); }
125  if(i==0) m_vistau1 = vec;
126  if(i==1) m_vistau2 = vec;
127  return;
128 }
129 // ---- input Met vector
130 void MissingMassInput::SetMetVec(const XYVector & vec) {
131  m_MetVec = vec;
132  return;
133 }
134 
135 // not used but might be helpful?
136 // ----- input data type
138  if(val==0 || val==1) m_dataType = val;
139  return;
140 }
141 // ----- input vis Tau N-prong
142 void MissingMassInput::SetNprong(int i, int nprong) {
143  if(i==0) m_Nprong_tau1 = nprong;
144  if(i==1) m_Nprong_tau2 = nprong;
145  return;
146 }
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
DiTauMassTools::MissingMassInput::m_METsigmaP
double m_METsigmaP
Definition: MissingMassInput.h:62
DiTauMassTools::MissingMassInput::~MissingMassInput
~MissingMassInput()
Definition: MissingMassInput.cxx:20
DiTauMassTools::MissingMassInput::SetMetScanParamsUE
void SetMetScanParamsUE(double sumEt, double phi_scan=0.0, int data_code=0)
Definition: MissingMassInput.cxx:89
DiTauMassTools::MissingMassInput::m_MHtGaussFr
double m_MHtGaussFr
Definition: MissingMassInput.h:70
DiTauMassTools::MissingMassInput::m_MHtSigma1
double m_MHtSigma1
Definition: MissingMassInput.h:68
DiTauMassTools::MissingMassInput::m_METsigmaL
double m_METsigmaL
Definition: MissingMassInput.h:63
DiTauMassTools::MissingMassInput::m_vistau1
PtEtaPhiMVector m_vistau1
Definition: MissingMassInput.h:54
Phi
@ Phi
Definition: RPCdef.h:8
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
DiTauMassTools::MissingMassInput::m_METcovphi
double m_METcovphi
Definition: MissingMassInput.h:61
DiTauMassTools::MissingMassInput::SetVisTauVec
void SetVisTauVec(int i, const PtEtaPhiMVector &vec)
Definition: MissingMassInput.cxx:123
CxxUtils::vec
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
Definition: vec.h:207
DiTauMassTools::MissingMassInput::m_Njet25
int m_Njet25
Definition: MissingMassInput.h:66
DiTauMassTools
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:24
DiTauMassTools::MissingMassInput::m_SumEt
double m_SumEt
Definition: MissingMassInput.h:64
DiTauMassTools::MissingMassInput::m_Nprong_tau2
int m_Nprong_tau2
Definition: MissingMassInput.h:59
lumiFormat.i
int i
Definition: lumiFormat.py:85
DiTauMassTools::MissingMassInput::m_MHtSigma2
double m_MHtSigma2
Definition: MissingMassInput.h:69
DiTauMassTools::MissingMassInput::SetIsData
void SetIsData(int val)
Definition: MissingMassInput.cxx:137
DiTauMassTools::MissingMassInput::m_Nprong_tau1
int m_Nprong_tau1
Definition: MissingMassInput.h:58
DiTauMassTools::MissingMassInput::SetNjet25
void SetNjet25(int val)
Definition: MissingMassInput.cxx:107
DiTauMassTools::MissingMassInput::m_dataType
int m_dataType
Definition: MissingMassInput.h:60
DiTauMassTools::MissingMassInput::m_fUseVerbose
bool m_fUseVerbose
Definition: MissingMassInput.h:78
DiTauMassTools::MissingMassInput::m_HtOffset
double m_HtOffset
Definition: MissingMassInput.h:71
DiTauMassTools::MissingMassInput::m_MetVec
XYVector m_MetVec
Definition: MissingMassInput.h:53
DiTauMassTools::MissingMassInput::m_type_visTau2
int m_type_visTau2
Definition: MissingMassInput.h:57
DiTauMassTools::MissingMassInput::m_DelPhiTT
double m_DelPhiTT
Definition: MissingMassInput.h:67
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
DiTauMassTools::MissingMassInput::PrintInputInfo
void PrintInputInfo()
Definition: MissingMassInput.cxx:58
MissingMassInput.h
DiTauMassTools::MissingMassInput::m_vistau2
PtEtaPhiMVector m_vistau2
Definition: MissingMassInput.h:55
DiTauMassTools::MissingMassInput::SetVisTauType
void SetVisTauType(int i, int tautype)
Definition: MissingMassInput.cxx:117
Prompt::Def::Pt
@ Pt
Definition: VarHolder.h:76
DiTauMassTools::MissingMassInput::ClearInput
void ClearInput()
Definition: MissingMassInput.cxx:24
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
DiTauMassTools::MissingMassInput::m_jet4vecs
std::vector< PtEtaPhiMVector > m_jet4vecs
Definition: MissingMassInput.h:65
DiTauMassTools::MissingMassInput::m_type_visTau1
int m_type_visTau1
Definition: MissingMassInput.h:56
DiTauMassTools::MissingMassInput::m_METresSyst
int m_METresSyst
Definition: MissingMassInput.h:75
DiTauMassTools::MissingMassInput::m_beamEnergy
double m_beamEnergy
Definition: MissingMassInput.h:72
DiTauMassTools::MissingMassInput::SetMetVec
void SetMetVec(const XYVector &vec)
Definition: MissingMassInput.cxx:130
DiTauMassTools::MissingMassInput::SetSumEt
void SetSumEt(double sumEt)
Definition: MissingMassInput.cxx:112
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
DiTauMassTools::MissingMassInput::SetNprong
void SetNprong(int i, int nprong)
Definition: MissingMassInput.cxx:142
DiTauMassTools::MissingMassInput::MissingMassInput
MissingMassInput()
Definition: MissingMassInput.cxx:16
DiTauMassTools::MissingMassInput::m_LFVmode
int m_LFVmode
Definition: MissingMassInput.h:84
Eta
@ Eta
Definition: RPCdef.h:8