ATLAS Offline Software
MissingMassCalculator.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // vim: ts=8 sw=2
6 /*
7  Missing Mass Calculator
8 */
9 //
10 // to be done : tau 4-vect and type should be data member of MMC.
11 
12 // if histogram smoothing
13 //#define SMOOTH
14 
15 #include "DiTauMassTools/MissingMassCalculator.h" // this is for RootCore package
16 #include <fstream>
17 #include <iomanip>
18 #include <iostream>
19 #include <sstream>
20 // #include "MissingMassCalculator.h" // this is for standalone
21 // package
22 
23 #include <TObject.h>
24 // SpeedUp committed from revision 163876
25 #include <TF1.h>
26 #include <TFitResult.h>
27 #include <TFitResultPtr.h>
28 #include <TMatrixDSym.h>
29 #include <TObject.h>
30 #include <TVectorD.h>
31 #include "Math/VectorUtil.h"
32 
33 using namespace DiTauMassTools;
34 using ROOT::Math::PtEtaPhiMVector;
35 using ROOT::Math::PxPyPzMVector;
36 using ROOT::Math::XYVector;
39 
40 //______________________________constructor________________________________
42  MMCCalibrationSet::e aset, std::string m_paramFilePath)
43  : m_randomGen(), Prob(new MissingMassProb(aset, m_paramFilePath)) {
44  m_mmcCalibrationSet = aset;
46  preparedInput.m_beamEnergy = 6500.0; // for now LHC default is sqrt(S)=7 TeV
47  m_niter_fit1 = 20;
48  m_niter_fit2 = 30;
49  m_niter_fit3 = 10;
50  m_NsucStop = -1;
51  m_NiterRandom = -1; // if the user does not set it to positive value,will be set
52  // in SpaceWalkerInit
53  m_niterRandomLocal = -1; // niterandom which is really used
54  // to be used with RMSSTOP NiterRandom=10000000; // number of random
55  // iterations for lh. Multiplied by 10 for ll, divided by 10 for hh (to be
56  // optimised)
57  // RMSStop=200;// Stop criteria depending of rms of histogram
58  m_reRunWithBestMET = false;
59  m_RMSStop = -1; // disable
60 
61  m_RndmSeedAltering = 0; // can be changed to re-compute with different random seed
62  m_dRmax_tau = 0.4; // changed from 0.2
63  m_nsigma_METscan = -1; // number of sigmas for MET scan
64  m_nsigma_METscan_ll = 3.0; // number of sigmas for MET scan
65  m_nsigma_METscan_lh = 3.0; // number of sigmas for MET scan
66  m_nsigma_METscan_hh = 4.0; // number of sigmas for MET scan (4 for hh 2013)
67  m_nsigma_METscan_lfv_ll = 5.0; // number of sigmas for MET scan (LFV leplep)
68  m_nsigma_METscan_lfv_lh = 5.0; // number of sigmas for MET scan (LFV lephad)
69 
70  m_meanbinStop = -1; // meanbin stopping criterion (-1 if not used)
71  m_proposalTryMEt = -1; // loop on METproposal disable // FIXME should be cleaner
72  m_ProposalTryPhi = -1; // loop on Phiproposal disable
73  m_ProposalTryMnu = -1; // loop on MNuProposal disable
74  m_ProposalTryEtau = -1; // loop on ETauProposal disable
75 
76  Prob->SetUseTauProbability(true); // TauProbability is ON by default DRMERGE comment out for now
77  Prob->SetUseMnuProbability(false); // MnuProbability is OFF by default
78  Prob->SetUseDphiLL(false); // added by Tomas Davidek for lep-lep
79  m_dTheta3d_binMin = 0.0025;
80  m_dTheta3d_binMax = 0.02;
81  preparedInput.m_METresSyst = 0; // no MET resolution systematics by default (+/-1: up/down 1 sigma)
82  preparedInput.m_dataType = 1; // set to "data" by default
83  preparedInput.m_fUseTailCleanup = 1; // cleanup by default for lep-had Moriond 2012 analysis
84  preparedInput.m_fUseDefaults = 0; // use pre-set defaults for various configurations; if set it to 0
85  // if need to study various options
86  m_fUseEfficiencyRecovery = 0; // no re-fit by default
87  m_fUseFloatStopping = 1; // use floating stopping criterion by default
88 
89  preparedInput.m_METScanScheme = 1; // MET-scan scheme: 0- use JER; 1- use simple sumEt & missingHt
90  // for Njet=0 events in (lep-had winter 2012)
91  // MnuScanRange=1.777; // range of M(nunu) scan
92  m_MnuScanRange = 1.5; // better value (sacha)
93  preparedInput.m_LFVmode = -1; // by default consider case of H->mu+tau(->ele)
95 
97  m_iterTheta3d = 0;
98  m_debugThisIteration = false;
99  m_lfvLeplepRefit = true;
100 
101  m_nsolmax = 4;
103 
104  m_nuvecsol1.resize(m_nsolmax);
105  m_nuvecsol2.resize(m_nsolmax);
106  m_tauvecsol1.resize(m_nsolmax);
107  m_tauvecsol2.resize(m_nsolmax);
108  m_tauvecprob1.resize(m_nsolmax);
109  m_tauvecprob2.resize(m_nsolmax);
110 
111  m_nsol = 0;
116 
117  m_nsolOld = 0;
122 
123  float hEmax = 3000.0; // maximum energy (GeV)
124  // number of bins
125  int hNbins = 1500; // original 2500 for mass, 10000 for P
126  // choice of hNbins also related to size of window for fitting (see
127  // maxFromHist)
128 
129  //--- define histograms for histogram method
130  //--- upper limits need to be revisied in the future!!! It may be not enough
131  // for some analyses
132 
133  m_fMfit_all = std::make_shared<TH1F>("MMC_h1", "M", hNbins, 0.0,
134  hEmax); // all solutions
135  if(m_SaveLlhHisto){
136  m_fMEtP_all = std::make_shared<TH1F>("MEtP_h1", "M", hNbins, -100.0,
137  100.); // all solutions
138  m_fMEtL_all = std::make_shared<TH1F>("MEtL_h1", "M", hNbins, -100.0,
139  100.); // all solutions
140  m_fMnu1_all = std::make_shared<TH1F>("Mnu1_h1", "M", hNbins, 0.0,
141  hEmax); // all solutions
142  m_fMnu2_all = std::make_shared<TH1F>("Mnu2_h1", "M", hNbins, 0.0,
143  hEmax); // all solutions
144  m_fPhi1_all = std::make_shared<TH1F>("Phi1_h1", "M", hNbins, -10.0,
145  10.); // all solutions
146  m_fPhi2_all = std::make_shared<TH1F>("Phi2_h1", "M", hNbins, -10.0,
147  10.); // all solutions
148  m_fMfit_allGraph = std::make_shared<TGraph>(); // all solutions
149  }
150 
151  m_fMfit_all->Sumw2(); // allow proper error bin calculation. Slightly slower but
152  // completely negligible
153  // these histograms are used for the floating stopping criterion
154  if (m_fUseFloatStopping) {
155  m_fMmass_split1 = std::make_shared<TH1F>("mass_h1_1", "M", hNbins, 0.0, hEmax);
156  m_fMEtP_split1 = std::make_shared<TH1F>("MEtP_h1_1", "M", hNbins, -100.0, 100.0);
157  m_fMEtL_split1 = std::make_shared<TH1F>("MEtL_h1_1", "M", hNbins, -100.0, 100.0);
158  m_fMnu1_split1 = std::make_shared<TH1F>("Mnu1_h1_1", "M", hNbins, 0.0, hEmax);
159  m_fMnu2_split1 = std::make_shared<TH1F>("Mnu2_h1_1", "M", hNbins, 0.0, hEmax);
160  m_fPhi1_split1 = std::make_shared<TH1F>("Phi1_h1_1", "M", hNbins, -10.0, 10.0);
161  m_fPhi2_split1 = std::make_shared<TH1F>("Phi2_h1_1", "M", hNbins, -10.0, 10.0);
162  m_fMmass_split2 = std::make_shared<TH1F>("mass_h1_2", "M", hNbins, 0.0, hEmax);
163  m_fMEtP_split2 = std::make_shared<TH1F>("MEtP_h1_2", "M", hNbins, -100.0, 100.0);
164  m_fMEtL_split2 = std::make_shared<TH1F>("MEtL_h1_2", "M", hNbins, -100.0, 100.0);
165  m_fMnu1_split2 = std::make_shared<TH1F>("Mnu1_h1_2", "M", hNbins, 0.0, hEmax);
166  m_fMnu2_split2 = std::make_shared<TH1F>("Mnu2_h1_2", "M", hNbins, 0.0, hEmax);
167  m_fPhi1_split2 = std::make_shared<TH1F>("Phi1_h1_2", "M", hNbins, -10.0, 10.0);
168  m_fPhi2_split2 = std::make_shared<TH1F>("Phi2_h1_2", "M", hNbins, -10.0, 10.0);
169  }
170 
171  if(m_SaveLlhHisto){
172  m_fMEtP_all->Sumw2();
173  m_fMEtL_all->Sumw2();
174  m_fMnu1_all->Sumw2();
175  m_fMnu2_all->Sumw2();
176  m_fPhi1_all->Sumw2();
177  m_fPhi2_all->Sumw2();
178  }
179 
180  // these histograms are used for the floating stopping criterion
181  if (m_fUseFloatStopping) {
182  m_fMmass_split1->Sumw2();
183  m_fMEtP_split1->Sumw2();
184  m_fMEtL_split1->Sumw2();
185  m_fMnu1_split1->Sumw2();
186  m_fMnu2_split1->Sumw2();
187  m_fPhi1_split1->Sumw2();
188  m_fPhi2_split1->Sumw2();
189  m_fMmass_split2->Sumw2();
190  m_fMEtP_split2->Sumw2();
191  m_fMEtL_split2->Sumw2();
192  m_fMnu1_split2->Sumw2();
193  m_fMnu2_split2->Sumw2();
194  m_fPhi1_split2->Sumw2();
195  m_fPhi2_split2->Sumw2();
196  }
197 
198  // histogram without weight. useful for debugging. negligibly slow until now
200  std::make_shared<TH1F>("MMC_h1NoW", "M no weight", hNbins, 0.0, hEmax); // all solutions
201 
202  m_fPXfit1 = std::make_shared<TH1F>("MMC_h2", "Px1", 4 * hNbins, -hEmax,
203  hEmax); // Px for tau1
204  m_fPYfit1 = std::make_shared<TH1F>("MMC_h3", "Py1", 4 * hNbins, -hEmax,
205  hEmax); // Py for tau1
206  m_fPZfit1 = std::make_shared<TH1F>("MMC_h4", "Pz1", 4 * hNbins, -hEmax,
207  hEmax); // Pz for tau1
208  m_fPXfit2 = std::make_shared<TH1F>("MMC_h5", "Px2", 4 * hNbins, -hEmax,
209  hEmax); // Px for tau2
210  m_fPYfit2 = std::make_shared<TH1F>("MMC_h6", "Py2", 4 * hNbins, -hEmax,
211  hEmax); // Py for tau2
212  m_fPZfit2 = std::make_shared<TH1F>("MMC_h7", "Pz2", 4 * hNbins, -hEmax,
213  hEmax); // Pz for tau2
214 
215  m_fMfit_all->SetDirectory(0);
216 
217  if(m_SaveLlhHisto){
218  m_fMEtP_all->SetDirectory(0);
219  m_fMEtL_all->SetDirectory(0);
220  m_fMnu1_all->SetDirectory(0);
221  m_fMnu2_all->SetDirectory(0);
222  m_fPhi1_all->SetDirectory(0);
223  m_fPhi2_all->SetDirectory(0);
224  }
225 
226  m_fMfit_allNoWeight->SetDirectory(0);
227  m_fPXfit1->SetDirectory(0);
228  m_fPYfit1->SetDirectory(0);
229  m_fPZfit1->SetDirectory(0);
230  m_fPXfit2->SetDirectory(0);
231  m_fPYfit2->SetDirectory(0);
232  m_fPZfit2->SetDirectory(0);
233 
234  // these histograms are used for the floating stopping criterion
235  if (m_fUseFloatStopping) {
236  m_fMmass_split1->SetDirectory(0);
237  m_fMEtP_split1->SetDirectory(0);
238  m_fMEtL_split1->SetDirectory(0);
239  m_fMnu1_split1->SetDirectory(0);
240  m_fMnu2_split1->SetDirectory(0);
241  m_fPhi1_split1->SetDirectory(0);
242  m_fPhi2_split1->SetDirectory(0);
243  m_fMmass_split2->SetDirectory(0);
244  m_fMEtP_split2->SetDirectory(0);
245  m_fMEtL_split2->SetDirectory(0);
246  m_fMnu1_split2->SetDirectory(0);
247  m_fMnu2_split2->SetDirectory(0);
248  m_fPhi1_split2->SetDirectory(0);
249  m_fPhi2_split2->SetDirectory(0);
250  }
251 
252  // max hist fitting function
253  m_fFitting =
254  new TF1("MMC_maxFitting", this, &MissingMassCalculator::maxFitting, 0., hEmax, 3);
255  // Sets initial parameter names
256  m_fFitting->SetParNames("Max", "Mean", "InvWidth2");
257 
258  if (preparedInput.m_fUseVerbose == 1) {
259  gDirectory->pwd();
260  gDirectory->ls();
261  }
262 
263  if (preparedInput.m_fUseVerbose == 1) {
264  gDirectory->pwd();
265  gDirectory->ls();
266  }
267 }
268 
270 
271 //_____________________________________________________________________________
272 // Main Method to run MissingMassCalculator
274  const xAOD::IParticle *part2,
275  const xAOD::MissingET *met,
276  const int &njets) {
277  m_reRunWithBestMET = false;
278 
280  if (preparedInput.m_fUseVerbose == 1) {
281  Info("DiTauMassTools", "------------- Raw Input for MissingMassCalculator --------------");
282  }
283  FinalizeSettings(part1, part2, met, njets); // rawInput, preparedInput );
285  if (preparedInput.m_fUseVerbose == 1) {
286  Info("DiTauMassTools", "------------- Prepared Input for MissingMassCalculator--------------");
288  }
289 
290  if (preparedInput.m_LFVmode < 0) {
291  // remove argument DiTauMassCalculatorV9Walk work directly on preparedInput
293 
294  // re-running MMC for on failed events
296  // most events where MMC failed happened to have dPhi>2.9. Run re-fit only
297  // on these events
298  if (preparedInput.m_DelPhiTT > 2.9) {
299  // preparedInput.MetVec.Set(-(preparedInput.vistau1+preparedInput.vistau2).Px(),-(preparedInput.vistau1+preparedInput.vistau2).Py());
300  // // replace MET by MPT
301 
302  XYVector dummy_met(-(preparedInput.m_vistau1 + preparedInput.m_vistau2).Px(),
304  preparedInput.m_METcovphi = dummy_met.Phi();
305  double dummy_METres =
308  dummy_METres * std::abs(cos(dummy_met.Phi() - preparedInput.m_MetVec.Phi()));
310  dummy_METres * std::abs(sin(dummy_met.Phi() - preparedInput.m_MetVec.Phi()));
311  if (preparedInput.m_METsigmaP < 5.0)
313  m_nsigma_METscan_lh = 6.0; // increase range of MET scan
314  m_nsigma_METscan_hh = 6.0; // increase range of MET scan
315 
316  OutputInfo.ClearOutput(preparedInput.m_fUseVerbose); // clear output stuff before re-running
317  OutputInfo.m_FitStatus = DitauMassCalculatorV9walk(); // run MMC again
318  }
319  }
320 
321  }
322 
323  // running MMC in LFV mode for reconstructing mass of X->lep+tau
324  else {
325  if (preparedInput.m_fUseVerbose == 1) {
326  Info("DiTauMassTools", "Calling DitauMassCalculatorV9lfv");
327  }
329  }
330 
331  if(m_SaveLlhHisto){
332  TFile *outFile = TFile::Open("MMC_likelihoods.root", "UPDATE");
333  outFile->cd();
335  if (!outFile->GetDirectory(path.c_str()))
336  outFile->mkdir(path.c_str());
337  outFile->cd(path.c_str());
338  m_fMfit_all->Write(m_fMfit_all->GetName(), TObject::kOverwrite);
339  m_fMEtP_all->Write(m_fMEtP_all->GetName(), TObject::kOverwrite);
340  m_fMEtL_all->Write(m_fMEtL_all->GetName(), TObject::kOverwrite);
341  m_fMnu1_all->Write(m_fMnu1_all->GetName(), TObject::kOverwrite);
342  m_fMnu2_all->Write(m_fMnu2_all->GetName(), TObject::kOverwrite);
343  m_fPhi1_all->Write(m_fPhi1_all->GetName(), TObject::kOverwrite);
344  m_fPhi2_all->Write(m_fPhi2_all->GetName(), TObject::kOverwrite);
345  m_fMfit_allNoWeight->Write(m_fMfit_allNoWeight->GetName(), TObject::kOverwrite);
346  m_fMfit_allGraph->Write("Graph", TObject::kOverwrite);
347  TH1D *nosol = new TH1D("nosol", "nosol", 7, 0, 7);
348  nosol->SetBinContent(1, m_testptn1);
349  nosol->SetBinContent(2, m_testptn2);
350  nosol->SetBinContent(3, m_testdiscri1);
351  nosol->SetBinContent(4, m_testdiscri2);
352  nosol->SetBinContent(5, m_nosol1);
353  nosol->SetBinContent(6, m_nosol1);
354  nosol->SetBinContent(7, m_iterNuPV3);
355  nosol->Write(nosol->GetName(), TObject::kOverwrite);
356  outFile->Write();
357  outFile->Close();
358  }
359 
360  DoOutputInfo();
361  PrintResults();
363  return 1;
364 }
365 
366 //-------- clearing ditau container
368  fStuff.Mditau_best = 0.0;
369  fStuff.Sign_best = 1.0E6;
370  fStuff.nutau1 = PtEtaPhiMVector(0., 0., 0., 0.);
371  fStuff.nutau2 = PtEtaPhiMVector(0., 0., 0., 0.);
372  fStuff.vistau1 = PtEtaPhiMVector(0., 0., 0., 0.);
373  fStuff.vistau2 = PtEtaPhiMVector(0., 0., 0., 0.);
374  fStuff.RMSoverMPV = 0.0;
375 
376  return;
377 }
378 
379 //---------------------------- Accessors to output parameters
380 //------------------------
381 // finalizes output information
383  if (OutputInfo.m_FitStatus > 0) {
384  if (preparedInput.m_fUseVerbose == 1) {
385  Info("DiTauMassTools", "Retrieving output from fDitauStuffFit");
386  }
387  // MAXW method : get from fDittauStuffFit
390  double q1 = (1. - 0.68) / 2.;
391  double q2 = 1. - q1;
392  double xq[2], yq[2];
393  xq[0] = q1;
394  xq[1] = q2;
395  m_fMfit_all->GetQuantiles(2, yq, xq);
407  XYVector metmaxw(OutputInfo.m_nuvec1[MMCFitMethod::MAXW].Px() +
412 
416 
417  PtEtaPhiMVector tlvdummy(0., 0., 0., 0.);
418  XYVector metdummy(0., 0.);
426 
427  // MLNU3P method : get from fDittauStuffHisto 4 momentum
441 
442  XYVector metmlnu3p(OutputInfo.m_nuvec1[MMCFitMethod::MLNU3P].Px() +
447 
449  }
450 
453  OutputInfo.m_NSolutions = m_fMfit_all->GetEntries();
454  OutputInfo.m_SumW = m_fMfit_all->GetSumOfWeights();
455 
456  //----------------- Check if input was re-ordered in FinalizeInputStuff() and
457  // restore the original order if needed
458  if (preparedInput.m_InputReorder == 1) {
459  PtEtaPhiMVector dummy_vec1(0.0, 0.0, 0.0, 0.0);
460  PtEtaPhiMVector dummy_vec2(0.0, 0.0, 0.0, 0.0);
461  for (int i = 0; i < 3; i++) {
462  // re-ordering neutrinos
463  dummy_vec1 = OutputInfo.m_nuvec1[i];
464  dummy_vec2 = OutputInfo.m_nuvec2[i];
465  OutputInfo.m_nuvec1[i] = dummy_vec2;
466  OutputInfo.m_nuvec2[i] = dummy_vec1;
467  // re-ordering tau's
468  dummy_vec1 = OutputInfo.m_objvec1[i];
469  dummy_vec2 = OutputInfo.m_objvec2[i];
470  OutputInfo.m_objvec1[i] = dummy_vec2;
471  OutputInfo.m_objvec2[i] = dummy_vec1;
472  }
473  }
474 
475  return;
476 }
477 
478 // Printout of final results
480  if (preparedInput.m_fUseVerbose != 1)
481  return;
482 
483  Info("DiTauMassTools",
484  ".........................Other input.....................................");
485  Info("DiTauMassTools", "%s",
486  ("Beam energy =" + std::to_string(preparedInput.m_beamEnergy) +
487  " sqrt(S) for collisions =" + std::to_string(2.0 * preparedInput.m_beamEnergy))
488  .c_str());
489  Info("DiTauMassTools", "%s",
490  ("CalibrationSet " + MMCCalibrationSet::name[m_mmcCalibrationSet])
491  .c_str());
492  Info("DiTauMassTools", "%s",
493  ("LFV mode " + std::to_string(preparedInput.m_LFVmode) + " seed=" + std::to_string(m_seed))
494  .c_str());
495  Info("DiTauMassTools", "%s", ("usetauProbability=" + std::to_string(Prob->GetUseTauProbability()) +
496  " useTailCleanup=" + std::to_string(preparedInput.m_fUseTailCleanup))
497  .c_str());
498 
499  if (preparedInput.m_InputReorder != 0) {
500  Info("DiTauMassTools",
501  "tau1 and tau2 were internally swapped (visible on prepared input printout)");
502  } else {
503  Info("DiTauMassTools", "tau1 and tau2 were NOT internally swapped");
504  }
505 
506  Info("DiTauMassTools", "%s",
507  (" MEtLMin=" + std::to_string(m_MEtLMin) + " MEtLMax=" + std::to_string(m_MEtLMax)).c_str());
508  Info("DiTauMassTools", "%s",
509  (" MEtPMin=" + std::to_string(m_MEtPMin) + " MEtPMax=" + std::to_string(m_MEtPMax)).c_str());
510  Info("DiTauMassTools", "%s",
511  (" Phi1Min=" + std::to_string(m_Phi1Min) + " Phi1Max=" + std::to_string(m_Phi1Max)).c_str());
512  Info("DiTauMassTools", "%s",
513  (" Phi2Min=" + std::to_string(m_Phi2Min) + " Phi2Max=" + std::to_string(m_Phi2Max)).c_str());
514  Info("DiTauMassTools", "%s",
515  (" Mnu1Min=" + std::to_string(m_Mnu1Min) + " Mnu1Max=" + std::to_string(m_Mnu1Max)).c_str());
516  Info("DiTauMassTools", "%s",
517  (" Mnu2Min=" + std::to_string(m_Mnu2Min) + " Mnu2Max=" + std::to_string(m_Mnu2Max)).c_str());
518 }
519 
520 // Printout of final results
522 
523  if (preparedInput.m_fUseVerbose != 1)
524  return;
525 
526  const PtEtaPhiMVector *origVisTau1 = 0;
527  const PtEtaPhiMVector *origVisTau2 = 0;
528 
529  if (preparedInput.m_InputReorder == 0) {
530  origVisTau1 = &preparedInput.m_vistau1;
531  origVisTau2 = &preparedInput.m_vistau2;
532  } else // input order was flipped
533  {
534  origVisTau1 = &preparedInput.m_vistau2;
535  origVisTau2 = &preparedInput.m_vistau1;
536  }
537 
538  PrintOtherInput();
539 
540  Info("DiTauMassTools",
541  "------------- Printing Final Results for MissingMassCalculator --------------");
542  Info("DiTauMassTools",
543  ".............................................................................");
544  Info("DiTauMassTools", "%s", ("Fit status=" + std::to_string(OutputInfo.m_FitStatus)).c_str());
545 
546  for (int imeth = 0; imeth < MMCFitMethod::MAX; ++imeth) {
547  Info("DiTauMassTools", "%s",
548  ("___ Results for " + MMCFitMethod::name[imeth] + "Method ___")
549  .c_str());
550  Info("DiTauMassTools", "%s",
551  (" signif=" + std::to_string(OutputInfo.m_FitSignificance[imeth])).c_str());
552  Info("DiTauMassTools", "%s", (" mass=" + std::to_string(OutputInfo.m_FittedMass[imeth])).c_str());
553  Info("DiTauMassTools", "%s", (" rms/mpv=" + std::to_string(OutputInfo.m_RMS2MPV)).c_str());
554 
555  if (imeth == MMCFitMethod::MLM) {
556  Info("DiTauMassTools", " no 4-momentum or MET from this method ");
557  continue;
558  }
559 
560  if (OutputInfo.m_FitStatus <= 0) {
561  Info("DiTauMassTools", " fit failed ");
562  }
563 
564  const PtEtaPhiMVector &tlvnu1 = OutputInfo.m_nuvec1[imeth];
565  const PtEtaPhiMVector &tlvnu2 = OutputInfo.m_nuvec2[imeth];
566  const PtEtaPhiMVector &tlvo1 = OutputInfo.m_objvec1[imeth];
567  const PtEtaPhiMVector &tlvo2 = OutputInfo.m_objvec2[imeth];
568  const XYVector &tvmet = OutputInfo.m_FittedMetVec[imeth];
569 
570  Info("DiTauMassTools", "%s",
571  (" Neutrino-1: P=" + std::to_string(tlvnu1.P()) + " Pt=" + std::to_string(tlvnu1.Pt()) +
572  " Eta=" + std::to_string(tlvnu1.Eta()) + " Phi=" + std::to_string(tlvnu1.Phi()) +
573  " M=" + std::to_string(tlvnu1.M()) + " Px=" + std::to_string(tlvnu1.Px()) +
574  " Py=" + std::to_string(tlvnu1.Py()) + " Pz=" + std::to_string(tlvnu1.Pz()))
575  .c_str());
576  Info("DiTauMassTools", "%s",
577  (" Neutrino-2: P=" + std::to_string(tlvnu2.P()) + " Pt=" + std::to_string(tlvnu2.Pt()) +
578  " Eta=" + std::to_string(tlvnu2.Eta()) + " Phi=" + std::to_string(tlvnu2.Phi()) +
579  " M=" + std::to_string(tlvnu2.M()) + " Px=" + std::to_string(tlvnu2.Px()) +
580  " Py=" + std::to_string(tlvnu2.Py()) + " Pz=" + std::to_string(tlvnu2.Pz()))
581  .c_str());
582  Info("DiTauMassTools", "%s",
583  (" Tau-1: P=" + std::to_string(tlvo1.P()) + " Pt=" + std::to_string(tlvo1.Pt()) +
584  " Eta=" + std::to_string(tlvo1.Eta()) + " Phi=" + std::to_string(tlvo1.Phi()) +
585  " M=" + std::to_string(tlvo1.M()) + " Px=" + std::to_string(tlvo1.Px()) +
586  " Py=" + std::to_string(tlvo1.Py()) + " Pz=" + std::to_string(tlvo1.Pz()))
587  .c_str());
588  Info("DiTauMassTools", "%s",
589  (" Tau-2: P=" + std::to_string(tlvo2.P()) + " Pt=" + std::to_string(tlvo2.Pt()) +
590  " Eta=" + std::to_string(tlvo2.Eta()) + " Phi=" + std::to_string(tlvo2.Phi()) +
591  " M=" + std::to_string(tlvo2.M()) + " Px=" + std::to_string(tlvo2.Px()) +
592  " Py=" + std::to_string(tlvo2.Py()) + " Pz=" + std::to_string(tlvo2.Pz()))
593  .c_str());
594 
595  Info("DiTauMassTools", "%s",
596  (" dR(nu1-visTau1)=" + std::to_string(DeltaR(tlvnu1,*origVisTau1))).c_str());
597  Info("DiTauMassTools", "%s",
598  (" dR(nu2-visTau2)=" + std::to_string(DeltaR(tlvnu2,*origVisTau2))).c_str());
599 
600  Info("DiTauMassTools", "%s",
601  (" Fitted MET =" + std::to_string(tvmet.R()) + " Phi=" + std::to_string(tlvnu1.Phi()) +
602  " Px=" + std::to_string(tvmet.X()) + " Py=" + std::to_string(tvmet.Y()))
603  .c_str());
604 
605  Info("DiTauMassTools", "%s", (" Resonance: P=" + std::to_string(OutputInfo.m_totalvec[imeth].P()) +
606  " Pt=" + std::to_string(OutputInfo.m_totalvec[imeth].Pt()) +
607  " Eta=" + std::to_string(OutputInfo.m_totalvec[imeth].Eta()) +
608  " Phi=" + std::to_string(OutputInfo.m_totalvec[imeth].Phi()) +
609  " M=" + std::to_string(OutputInfo.m_totalvec[imeth].M()) +
610  " Px=" + std::to_string(OutputInfo.m_totalvec[imeth].Px()) +
611  " Py=" + std::to_string(OutputInfo.m_totalvec[imeth].Py()) +
612  " Pz=" + std::to_string(OutputInfo.m_totalvec[imeth].Pz()))
613  .c_str());
614  }
615 
616  return;
617 }
618 
619 // returns P1, P2, and theta1 & theta2 solutions
620 // This compute the nu1 nu2 solution in the most efficient way. Wrt to
621 // NuPsolutionV2, the output nu1 nu2 4-vector have non zero mass (if relevant).
622 // It is not optimised for grid running so much less caching is done (which
623 // makes it more readable). Only quantities fixed within an event are cached.
624 // relies on a number of these variables to be initialised before the loop.
625 
626 int MissingMassCalculator::NuPsolutionV3(const double &mNu1, const double &mNu2,
627  const double &phi1, const double &phi2,
628  int &nsol1, int &nsol2) {
629 
630  // Pv1, Pv2 : visible tau decay product momentum
631  // Pn1 Pn2 : neutrino momentum
632  // phi1, phi2 : neutrino azymutal angles
633  // PTmiss2=PTmissy Cos[phi2] - PTmissx Sin[phi2]
634  // PTmiss2cscdphi=PTmiss2/Sin[phi1-phi2]
635  // Pv1proj=Pv1x Cos[phi1] + Pv1y Sin[phi1]
636  // M2noma1=Mtau^2-Mv1^2-Mn1^2
637  // ETv1^2=Ev1^2-Pv1z^2
638 
639  // discriminant : 16 Ev1^2 (M2noma1^2 + 4 M2noma1 PTmiss2cscdphi Pv1proj - 4
640  // (ETv1^2 (Mn1^2 + PTmiss2cscdphi^2) - PTmiss2cscdphi^2 Pv1proj^2))
641  // two solutions for epsilon = +/-1
642  // Pn1z=(1/(2 ETv1^2))(epsilon Ev1 Sqrt[ M2noma1^2 + 4 M2noma1 PTmiss2cscdphi
643  // Pv1proj - 4 (ETv1^2 (Mn1^2 + qPTmiss2cscdphi^2) - PTmiss2cscdphi^2
644  // Pv1proj^2)] + M2noma1 Pv1z + 2 PTmiss2cscdphi Pv1proj Pv1z)
645  // with conditions: M2noma1 + 2 PTmiss2cscdphi Pv1proj + 2 Pn1z Pv1z > 0
646  // PTn1 -> PTmiss2 Csc[phi1 - phi2]
647 
648  // if initialisation precompute some quantities
649  int solution_code = 0; // 0 with no solution, 1 with solution
650  nsol1 = 0;
651  nsol2 = 0;
652 
653  // Variables used to test PTn1 and PTn2 > 0
654 
655  const double &pTmissx = preparedInput.m_MEtX;
656  const double &pTmissy = preparedInput.m_MEtY;
657 
659  double pTmiss2 = pTmissy * m_cosPhi2 - pTmissx * m_sinPhi2;
660 
661  int dPhiSign = 0;
662  dPhiSign = fixPhiRange(phi1 - phi2) > 0 ? +1 : -1;
663 
664  // Test if PTn1 and PTn2 > 0. Then MET vector is between the two neutrino
665  // vector
666 
667  if (pTmiss2 * dPhiSign < 0) {
668  ++m_testptn1;
669  return solution_code;
670  }
671 
673  double pTmiss1 = pTmissy * m_cosPhi1 - pTmissx * m_sinPhi1;
674 
675  if (pTmiss1 * (-dPhiSign) < 0) {
676  ++m_testptn2;
677  return solution_code;
678  }
679 
680  // Variables used to calculate discri1
681 
682  double m2Vis1 = m_tauVec1M * m_tauVec1M;
684  m_m2Nu1 = mNu1 * mNu1;
685  double m2noma1 = m_mTau2 - m_m2Nu1 - m2Vis1;
686  double m4noma1 = m2noma1 * m2noma1;
687  double pv1proj = m_tauVec1Px * m_cosPhi1 + m_tauVec1Py * m_sinPhi1;
688  double p2v1proj = std::pow(pv1proj, 2);
689  double sinDPhi2 = m_cosPhi2 * m_sinPhi1 - m_sinPhi2 * m_cosPhi1; // sin(Phi1-Phi2)
690  double pTmiss2CscDPhi = pTmiss2 / sinDPhi2;
691  double &pTn1 = pTmiss2CscDPhi;
692  double pT2miss2CscDPhi = pTmiss2CscDPhi * pTmiss2CscDPhi;
693 
694  // Test on discri1
695  const double discri1 = m4noma1 + 4 * m2noma1 * pTmiss2CscDPhi * pv1proj -
696  4 * (m_ET2v1 * (m_m2Nu1 + pT2miss2CscDPhi) - (pT2miss2CscDPhi * p2v1proj));
697 
698  if (discri1 < 0) // discriminant negative -> no solution
699  {
700  ++m_testdiscri1;
701  return solution_code;
702  }
703 
704  // Variables used to calculate discri2
705  double m2Vis2 = m_tauVec2M * m_tauVec2M;
707  m_m2Nu2 = mNu2 * mNu2;
708  double m2noma2 = m_mTau2 - m_m2Nu2 - m2Vis2;
709  double m4noma2 = m2noma2 * m2noma2;
710  double pv2proj = m_tauVec2Px * m_cosPhi2 + m_tauVec2Py * m_sinPhi2;
711  double p2v2proj = std::pow(pv2proj, 2);
712  double sinDPhi1 = -sinDPhi2;
713  double pTmiss1CscDPhi = pTmiss1 / sinDPhi1;
714  double &pTn2 = pTmiss1CscDPhi;
715  double pT2miss1CscDPhi = pTmiss1CscDPhi * pTmiss1CscDPhi;
716 
717  const double discri2 = m4noma2 + 4 * m2noma2 * pTmiss1CscDPhi * pv2proj -
718  4 * (m_ET2v2 * (m_m2Nu2 + pT2miss1CscDPhi) - (pT2miss1CscDPhi * p2v2proj));
719 
720  if (discri2 < 0) // discriminant negative -> no solution
721  {
722  ++m_testdiscri2;
723  return solution_code;
724  }
725 
726  // this should be done only once we know there are solutions for nu2
728  m_Ev1 = sqrt(m_E2v1);
729  double sqdiscri1 = sqrt(discri1);
730  double first1 =
731  (m2noma1 * m_tauVec1Pz + 2 * pTmiss2CscDPhi * pv1proj * m_tauVec1Pz) / (2 * m_ET2v1);
732  double second1 = sqdiscri1 * m_Ev1 / (2 * m_ET2v1);
733 
734  // first solution
735  double pn1Z = first1 + second1;
736 
737  if (m2noma1 + 2 * pTmiss2CscDPhi * pv1proj + 2 * pn1Z * m_tauVec1Pz >
738  0) // Condition for solution to exist
739  {
740  m_nuvecsol1[nsol1].SetPxPyPzE(pTn1 * m_cosPhi1, pTn1 * m_sinPhi1, pn1Z,
741  sqrt(std::pow(pTn1, 2) + std::pow(pn1Z, 2) + m_m2Nu1));
742 
743  ++nsol1;
744  }
745 
746  pn1Z = first1 - second1;
747 
748  if (m2noma1 + 2 * pTmiss2CscDPhi * pv1proj + 2 * pn1Z * m_tauVec1Pz >
749  0) // Condition for solution to exist
750  {
751 
752  m_nuvecsol1[nsol1].SetPxPyPzE(pTn1 * m_cosPhi1, pTn1 * m_sinPhi1, pn1Z,
753  sqrt(std::pow(pTn1, 2) + std::pow(pn1Z, 2) + m_m2Nu1));
754 
755  ++nsol1;
756  }
757 
758  if (nsol1 == 0) {
759  ++m_nosol1;
760  return solution_code;
761  }
762 
764  m_Ev2 = sqrt(m_E2v2);
765  double sqdiscri2 = sqrt(discri2);
766  double first2 =
767  (m2noma2 * m_tauVec2Pz + 2 * pTmiss1CscDPhi * pv2proj * m_tauVec2Pz) / (2 * m_ET2v2);
768  double second2 = sqdiscri2 * m_Ev2 / (2 * m_ET2v2);
769 
770  // second solution
771  double pn2Z = first2 + second2;
772 
773  if (m2noma2 + 2 * pTmiss1CscDPhi * pv2proj + 2 * pn2Z * m_tauVec2Pz >
774  0) // Condition for solution to exist
775  {
776  m_nuvecsol2[nsol2].SetPxPyPzE(pTn2 * m_cosPhi2, pTn2 * m_sinPhi2, pn2Z,
777  sqrt(std::pow(pTn2, 2) + std::pow(pn2Z, 2) + m_m2Nu2));
778 
779  ++nsol2;
780  }
781 
782  pn2Z = first2 - second2;
783  ;
784 
785  if (m2noma2 + 2 * pTmiss1CscDPhi * pv2proj + 2 * pn2Z * m_tauVec2Pz >
786  0) // Condition for solution to exist
787  {
788  m_nuvecsol2[nsol2].SetPxPyPzE(pTn2 * m_cosPhi2, pTn2 * m_sinPhi2, pn2Z,
789  sqrt(std::pow(pTn2, 2) + std::pow(pn2Z, 2) + m_m2Nu2));
790 
791  ++nsol2;
792  }
793 
794  if (nsol2 == 0) {
795  ++m_nosol2;
796  return solution_code;
797  }
798 
799  // Verification if solution exist
800 
801  solution_code = 1;
802  ++m_iterNuPV3;
803 
804  // double check solutions from time to time
805  if (m_iterNuPV3 % 1000 == 1) {
806  double pnux = m_nuvecsol1[0].Px() + m_nuvecsol2[0].Px();
807  double pnuy = m_nuvecsol1[0].Py() + m_nuvecsol2[0].Py();
808  double mtau1plus = (m_nuvecsol1[0] + m_tauVec1).M();
809  double mtau1moins = (m_nuvecsol1[1] + m_tauVec1).M();
810  double mtau2plus = (m_nuvecsol2[0] + m_tauVec2).M();
811  double mtau2moins = (m_nuvecsol2[1] + m_tauVec2).M();
812  if (std::abs(pnux - pTmissx) > 0.001 || std::abs(pnuy - pTmissy) > 0.001) {
813  Info("DiTauMassTools", "%s", ("NuPsolutionV3 ERROR Pnux-Met.X or Pnuy-Met.Y > 0.001 : " +
814  std::to_string(pnux - pTmissx) + " and " +
815  std::to_string(pnuy - pTmissx) + " " + "Invalid solutions")
816  .c_str());
817  }
818  if (std::abs(mtau1plus - m_mTau) > 0.001 || std::abs(mtau1moins - m_mTau) > 0.001 ||
819  std::abs(mtau2plus - m_mTau) > 0.001 || std::abs(mtau2moins - m_mTau) > 0.001) {
820  Info("DiTauMassTools", "%s", ("NuPsolutionV3 ERROR tau mass not recovered : " +
821  std::to_string(mtau1plus) + " " + std::to_string(mtau1moins) + " " +
822  std::to_string(mtau2plus) + " " + std::to_string(mtau2moins))
823  .c_str());
824  }
825  }
826 
827  return solution_code;
828 }
829 
830 // returns solution for Lepton Flavor Violating X->lep+tau studies
831 int MissingMassCalculator::NuPsolutionLFV(const XYVector &met_vec,
832  const PtEtaPhiMVector &tau, const double &l_nu,
833  std::vector<PtEtaPhiMVector> &nu_vec) {
834  int solution_code = 0; // 0 with no solution, 1 with solution
835 
836  nu_vec.clear();
837  PxPyPzMVector nu(met_vec.X(), met_vec.Y(), 0.0, l_nu);
838  PxPyPzMVector nu2(met_vec.X(), met_vec.Y(), 0.0, l_nu);
839 
840  const double Mtau = 1.777;
841  // double msq = (Mtau*Mtau-tau.M()*tau.M())/2;
842  double msq = (Mtau * Mtau - tau.M() * tau.M() - l_nu * l_nu) /
843  2; // to take into account the fact that 2-nu systema has mass
844  double gamma = nu.Px() * nu.Px() + nu.Py() * nu.Py();
845  double beta = tau.Px() * nu.Px() + tau.Py() * nu.Py() + msq;
846  double a = tau.E() * tau.E() - tau.Pz() * tau.Pz();
847  double b = -2 * tau.Pz() * beta;
848  double c = tau.E() * tau.E() * gamma - beta * beta;
849  if ((b * b - 4 * a * c) < 0)
850  return solution_code; // no solution found
851  else
852  solution_code = 2;
853  double pvz1 = (-b + sqrt(b * b - 4 * a * c)) / (2 * a);
854  double pvz2 = (-b - sqrt(b * b - 4 * a * c)) / (2 * a);
855 
856  nu.SetCoordinates(met_vec.X(), met_vec.Y(), pvz1, l_nu);
857  nu2.SetCoordinates(met_vec.X(), met_vec.Y(), pvz2, l_nu);
858 
859  PtEtaPhiMVector return_nu(nu.Pt(), nu.Eta(), nu.Phi(), nu.M());
860  PtEtaPhiMVector return_nu2(nu2.Pt(), nu2.Eta(), nu2.Phi(), nu2.M());
861  nu_vec.push_back(return_nu);
862  nu_vec.push_back(return_nu2);
863  return solution_code;
864 }
865 
866 // like v9fast, but the parameter space scanning is now factorised out, to allow
867 // flexibility
869 
870  int nsuccesses = 0;
871 
872  int fit_code = 0; // 0==bad, 1==good
875  OutputInfo.m_AveSolRMS = 0.;
876 
877  m_fMfit_all->Reset();
878 
879  if(m_SaveLlhHisto){
880  m_fMEtP_all->Reset();
881  m_fMEtL_all->Reset();
882  m_fMnu1_all->Reset();
883  m_fMnu2_all->Reset();
884  m_fPhi1_all->Reset();
885  m_fPhi2_all->Reset();
886  }
887 
888  m_fMfit_allNoWeight->Reset();
889  m_fPXfit1->Reset();
890  m_fPYfit1->Reset();
891  m_fPZfit1->Reset();
892  m_fPXfit2->Reset();
893  m_fPYfit2->Reset();
894  m_fPZfit2->Reset();
895 
896  // these histograms are used for the floating stopping criterion
897  if (m_fUseFloatStopping) {
898  m_fMmass_split1->Reset();
899  m_fMEtP_split1->Reset();
900  m_fMEtL_split1->Reset();
901  m_fMnu1_split1->Reset();
902  m_fMnu2_split1->Reset();
903  m_fPhi1_split1->Reset();
904  m_fPhi2_split1->Reset();
905  m_fMmass_split2->Reset();
906  m_fMEtP_split2->Reset();
907  m_fMEtL_split2->Reset();
908  m_fMnu1_split2->Reset();
909  m_fMnu2_split2->Reset();
910  m_fPhi1_split2->Reset();
911  m_fPhi2_split2->Reset();
912  }
913 
914  m_prob_tmp = 0.0;
915 
916  m_iter1 = 0;
917 
918  m_totalProbSum = 0;
919  m_mtautauSum = 0;
920 
921  XYVector deltamet_vec;
922 
923  // initialize a spacewalker, which walks the parameter space according to some
924  // algorithm
925  SpaceWalkerInit();
926 
927  while (SpaceWalkerWalk()) {
928  bool paramInsideRange = false;
929  m_nsol = 0;
930 
931  paramInsideRange = checkAllParamInRange();
932 
933  // FIXME if no tau scanning, or symmetric matrices, rotatin is made twice
934  // which is inefficient
935  const double deltaMetx = m_MEtL * m_metCovPhiCos - m_MEtP * m_metCovPhiSin;
936  const double deltaMety = m_MEtL * m_metCovPhiSin + m_MEtP * m_metCovPhiCos;
937 
938  // deltaMetVec.Set(met_smear_x,met_smear_y);
940  preparedInput.m_inputMEtY + deltaMety);
941 
942  // save in global variable for speed sake
946 
947  if (paramInsideRange)
949 
950  // DR for markov chain need to enter handleSolution also when zero solutions
951  handleSolutions();
952  // be careful that with markov, current solution is from now on stored in
953  // XYZOldSolVec
954 
955  if (m_nsol <= 0)
956  continue;
957 
958  // for markov, nsuccess more difficult to define. Decide this is the number
959  // of independent point accepted (hence without weight)
960  nsuccesses = m_markovNAccept;
962 
963  m_iter1 += m_nsol;
964  fit_code = 1;
965 
966  } // while loop
967 
969  OutputInfo.m_NSuccesses = nsuccesses;
970 
971  if (nsuccesses > 0) {
972  OutputInfo.m_AveSolRMS /= nsuccesses;
973  } else {
974  OutputInfo.m_AveSolRMS = -1.;
975  }
976 
977  double Px1, Py1, Pz1;
978  double Px2, Py2, Pz2;
979  if (nsuccesses > 0) {
980 
981  // note that smoothing can slightly change the integral of the histogram
982 
983 #ifdef SMOOTH
984  m_fMfit_all->Smooth();
985  m_fMfit_allNoWeight->Smooth();
986  m_fPXfit1->Smooth();
987  m_fPYfit1->Smooth();
988  m_fPZfit1->Smooth();
989  m_fPXfit2->Smooth();
990  m_fPYfit2->Smooth();
991  m_fPZfit2->Smooth();
992 #endif
993 
994  // default max finding method defined in MissingMassCalculator.h
995  // note that window defined in terms of number of bin, so depend on binning
996  std::vector<double> histInfo(HistInfo::MAXHISTINFO);
998  double prob_hist = histInfo.at(HistInfo::PROB);
999 
1000  if (prob_hist != 0.0)
1001  m_fDitauStuffHisto.Sign_best = -log10(std::abs(prob_hist));
1002  else {
1003  // this mean the histogram is empty.
1004  // possible but very rare if all entries outside histogram range
1005  // fall back to maximum
1006  m_fDitauStuffHisto.Sign_best = -999.;
1008  }
1009 
1010  if (m_fDitauStuffHisto.Mditau_best > 0.0)
1012  std::vector<double> histInfoOther(HistInfo::MAXHISTINFO);
1013  //---- getting full tau1 momentum
1014  Px1 = maxFromHist(m_fPXfit1, histInfoOther);
1015  Py1 = maxFromHist(m_fPYfit1, histInfoOther);
1016  Pz1 = maxFromHist(m_fPZfit1, histInfoOther);
1017 
1018  //---- getting full tau2 momentum
1019  Px2 = maxFromHist(m_fPXfit2, histInfoOther);
1020  Py2 = maxFromHist(m_fPYfit2, histInfoOther);
1021  Pz2 = maxFromHist(m_fPZfit2, histInfoOther);
1022 
1023  //---- setting 4-vecs
1024  PxPyPzMVector fulltau1, fulltau2;
1025  fulltau1.SetCoordinates(Px1, Py1, Pz1, 1.777);
1026  fulltau2.SetCoordinates(Px2, Py2, Pz2, 1.777);
1027  // PtEtaPhiMVector fulltau1(_fulltau1.Pt(), _fulltau1.Eta(), _fulltau1.Phi(), _fulltau1.M());
1028  //PtEtaPhiMVector fulltau2(_fulltau2.Pt(), _fulltau2.Eta(), _fulltau2.Phi(), _fulltau2.M());
1029 
1030  if (fulltau1.P() < preparedInput.m_vistau1.P())
1031  fulltau1 = 1.01 * preparedInput.m_vistau1; // protection against cases when fitted tau
1032  // momentum is smaller than visible tau momentum
1033  if (fulltau2.P() < preparedInput.m_vistau2.P())
1034  fulltau2 = 1.01 * preparedInput.m_vistau2; // protection against cases when fitted tau
1035  // momentum is smaller than visible tau momentum
1036  m_fDitauStuffHisto.vistau1 = preparedInput.m_vistau1; // FIXME should also be fitted if tau scan
1038  m_fDitauStuffHisto.nutau1 = fulltau1 - preparedInput.m_vistau1; // these are the original tau vis
1040  fulltau2 - preparedInput.m_vistau2; // FIXME neutrino mass not necessarily zero
1041  }
1042 
1043  // Note that for v9walk, points outside the METx MEty disk are counted, while
1044  // this was not the case for v9
1045  if (preparedInput.m_fUseVerbose == 1) {
1046  Info("DiTauMassTools", "Scanning ");
1047  Info("DiTauMassTools", " Markov ");
1048  Info("DiTauMassTools", "%s",
1049  (" V9W niters=" + std::to_string(m_iter0) + " " + std::to_string(m_iter1)).c_str());
1050  Info("DiTauMassTools", "%s", (" nFullScan " + std::to_string(m_markovNFullScan)).c_str());
1051  Info("DiTauMassTools", "%s", (" nRejectNoSol " + std::to_string(m_markovNRejectNoSol)).c_str());
1052  Info("DiTauMassTools", "%s", (" nRejectMetro " + std::to_string(m_markovNRejectMetropolis)).c_str());
1053  Info("DiTauMassTools", "%s", (" nAccept " + std::to_string(m_markovNAccept)).c_str());
1054  Info("DiTauMassTools", "%s",
1055  (" probsum " + std::to_string(m_totalProbSum) + " msum " + std::to_string(m_mtautauSum))
1056  .c_str());
1057  }
1058 
1059  if (preparedInput.m_fUseVerbose == 1) {
1060  if (fit_code == 0) {
1061  Info("DiTauMassTools", "%s", ("!!!----> Warning-3 in "
1062  "MissingMassCalculator::DitauMassCalculatorV9Walk() : fit status=" +
1063  std::to_string(fit_code))
1064  .c_str());
1065  Info("DiTauMassTools", "%s", "....... No solution is found. Printing input info .......");
1066 
1067  Info("DiTauMassTools", "%s", (" vis Tau-1: Pt=" + std::to_string(preparedInput.m_vistau1.Pt()) +
1068  " M=" + std::to_string(preparedInput.m_vistau1.M()) +
1069  " eta=" + std::to_string(preparedInput.m_vistau1.Eta()) +
1070  " phi=" + std::to_string(preparedInput.m_vistau1.Phi()) +
1072  .c_str());
1073  Info("DiTauMassTools", "%s", (" vis Tau-2: Pt=" + std::to_string(preparedInput.m_vistau2.Pt()) +
1074  " M=" + std::to_string(preparedInput.m_vistau2.M()) +
1075  " eta=" + std::to_string(preparedInput.m_vistau2.Eta()) +
1076  " phi=" + std::to_string(preparedInput.m_vistau2.Phi()) +
1078  .c_str());
1079  Info("DiTauMassTools", "%s", (" MET=" + std::to_string(preparedInput.m_MetVec.R()) +
1080  " Met_X=" + std::to_string(preparedInput.m_MetVec.X()) +
1081  " Met_Y=" + std::to_string(preparedInput.m_MetVec.Y()))
1082  .c_str());
1083  Info("DiTauMassTools", " ---------------------------------------------------------- ");
1084  }
1085  }
1086 
1087  return fit_code;
1088 }
1089 
1091 
1092  // debugThisIteration=false;
1093  m_debugThisIteration = true;
1094 
1095  int fit_code = 0; // 0==bad, 1==good
1098  OutputInfo.m_NTrials = 0;
1100  OutputInfo.m_AveSolRMS = 0.;
1101 
1102  //------- Settings -------------------------------
1103  int NiterMET = m_niter_fit2; // number of iterations for each MET scan loop
1104  int NiterMnu = m_niter_fit3; // number of iterations for Mnu loop
1105  const double Mtau = 1.777;
1106  double Mnu_binSize = m_MnuScanRange / NiterMnu;
1107 
1108  double METresX = preparedInput.m_METsigmaL; // MET resolution in direction parallel to
1109  // leading jet, for MET scan
1110  double METresY = preparedInput.m_METsigmaP; // MET resolution in direction perpendicular to
1111  // leading jet, for MET scan
1112 
1113  //-------- end of Settings
1114 
1115  // if m_nsigma_METscan was not set by user, set to default values
1116  if(m_nsigma_METscan == -1){
1117  if (preparedInput.m_tauTypes == TauTypes::ll) { // both tau's are leptonic
1119  } else if (preparedInput.m_tauTypes == TauTypes::lh) { // lep had
1121  }
1122  }
1123 
1124  double N_METsigma = m_nsigma_METscan; // number of sigmas for MET scan
1125  double METresX_binSize = 2 * N_METsigma * METresX / NiterMET;
1126  double METresY_binSize = 2 * N_METsigma * METresY / NiterMET;
1127 
1128  int solution = 0;
1129 
1130  std::vector<PtEtaPhiMVector> nu_vec;
1131 
1132  m_totalProbSum = 0;
1133  m_mtautauSum = 0;
1134 
1135  double metprob = 1.0;
1136  double sign_tmp = 0.0;
1137  double tauprob = 1.0;
1138  double totalProb = 0.0;
1139 
1140  m_prob_tmp = 0.0;
1141 
1142  double met_smear_x = 0.0;
1143  double met_smear_y = 0.0;
1144  double met_smearL = 0.0;
1145  double met_smearP = 0.0;
1146 
1147  double angle1 = 0.0;
1148 
1149  if (m_fMfit_all) {
1150  m_fMfit_all->Reset();
1151  }
1152  if (m_fMfit_allNoWeight) {
1153  m_fMfit_allNoWeight->Reset();
1154  }
1155  if (m_fPXfit1) {
1156  m_fPXfit1->Reset();
1157  }
1158  if (m_fPYfit1) {
1159  m_fPYfit1->Reset();
1160  }
1161  if (m_fPZfit1) {
1162  m_fPZfit1->Reset();
1163  }
1164 
1165  int iter0 = 0;
1166  m_iter1 = 0;
1167  m_iter2 = 0;
1168  m_iter3 = 0;
1169  m_iter4 = 0;
1170 
1171  const double met_coscovphi = cos(preparedInput.m_METcovphi);
1172  const double met_sincovphi = sin(preparedInput.m_METcovphi);
1173 
1174  m_iang1low = 0;
1175  m_iang1high = 0;
1176 
1177  // double Mvis=(tau_vec1+tau_vec2).M();
1178  // PtEtaPhiMVector met4vec(0.0,0.0,0.0,0.0);
1179  // met4vec.SetPxPyPzE(met_vec.X(),met_vec.Y(),0.0,met_vec.R());
1180  // double Meff=(tau_vec1+tau_vec2+met4vec).M();
1181  // double met_det=met_vec.R();
1182 
1183  //---------------------------------------------
1184  if (preparedInput.m_tauTypes == TauTypes::ll) // dilepton case
1185  {
1186  if (preparedInput.m_fUseVerbose == 1) {
1187  Info("DiTauMassTools", "Running in dilepton mode");
1188  }
1189  double input_metX = preparedInput.m_MetVec.X();
1190  double input_metY = preparedInput.m_MetVec.Y();
1191 
1192  PtEtaPhiMVector tau_tmp(0.0, 0.0, 0.0, 0.0);
1193  PtEtaPhiMVector lep_tmp(0.0, 0.0, 0.0, 0.0);
1194  int tau_type_tmp;
1195  int tau_ind = 0;
1196 
1197  if (preparedInput.m_LFVmode == 1) // muon case: H->mu+tau(->ele) decays
1198  {
1199  if ((preparedInput.m_vistau1.M() > 0.05 &&
1200  preparedInput.m_vistau2.M() < 0.05) != refit) // choosing lepton from Higgs decay
1201  //When the mass calculator is rerun with refit==true the alternative lepton ordering is used
1202  {
1203  tau_tmp = preparedInput.m_vistau2;
1204  lep_tmp = preparedInput.m_vistau1;
1205  tau_type_tmp = preparedInput.m_type_visTau2;
1206  tau_ind = 2;
1207  } else {
1208  tau_tmp = preparedInput.m_vistau1;
1209  lep_tmp = preparedInput.m_vistau2;
1210  tau_type_tmp = preparedInput.m_type_visTau1;
1211  tau_ind = 1;
1212  }
1213  }
1214  if (preparedInput.m_LFVmode == 0) // electron case: H->ele+tau(->mu) decays
1215  {
1216  if ((preparedInput.m_vistau1.M() < 0.05 &&
1217  preparedInput.m_vistau2.M() > 0.05) != refit) // choosing lepton from Higgs decay
1218  //When the mass calculator is rerun with refit=true the alternative lepton ordering is used
1219  {
1220  tau_tmp = preparedInput.m_vistau2;
1221  lep_tmp = preparedInput.m_vistau1;
1222  tau_type_tmp = preparedInput.m_type_visTau2;
1223  tau_ind = 2;
1224  } else {
1225  tau_tmp = preparedInput.m_vistau1;
1226  lep_tmp = preparedInput.m_vistau2;
1227  tau_type_tmp = preparedInput.m_type_visTau1;
1228  tau_ind = 1;
1229  }
1230  }
1231 
1232  //------- Settings -------------------------------
1233  double Mlep = tau_tmp.M();
1234  // double dMnu_max=m_MnuScanRange-Mlep;
1235  // double Mnu_binSize=dMnu_max/NiterMnu;
1236  //-------- end of Settings
1237 
1238  // double M=Mtau;
1239  double M_nu = 0.0;
1240  double MnuProb = 1.0;
1241  //---------------------------------------------
1242  for (int i3 = 0; i3 < NiterMnu; i3++) //---- loop-3: virtual neutrino mass
1243  {
1244  M_nu = Mnu_binSize * i3;
1245  if (M_nu >= (Mtau - Mlep))
1246  continue;
1247  // M=sqrt(Mtau*Mtau-M_nu*M_nu);
1248  MnuProb = Prob->MnuProbability(preparedInput, M_nu,
1249  Mnu_binSize); // Mnu probability
1250  //---------------------------------------------
1251  for (int i4 = 0; i4 < NiterMET + 1; i4++) // MET_X scan
1252  {
1253  met_smearL = METresX_binSize * i4 - N_METsigma * METresX;
1254  for (int i5 = 0; i5 < NiterMET + 1; i5++) // MET_Y scan
1255  {
1256  met_smearP = METresY_binSize * i5 - N_METsigma * METresY;
1257  if (pow(met_smearL / METresX, 2) + pow(met_smearP / METresY, 2) > pow(N_METsigma, 2))
1258  continue; // use ellipse instead of square
1259  met_smear_x = met_smearL * met_coscovphi - met_smearP * met_sincovphi;
1260  met_smear_y = met_smearL * met_sincovphi + met_smearP * met_coscovphi;
1261  metvec_tmp.SetXY(input_metX + met_smear_x, input_metY + met_smear_y);
1262 
1263  solution = NuPsolutionLFV(metvec_tmp, tau_tmp, M_nu, nu_vec);
1264 
1265  ++iter0;
1266 
1267  if (solution < 1)
1268  continue;
1269  ++m_iter1;
1270 
1271  // if fast sin cos, result to not match exactly nupsolutionv2, so skip
1272  // test
1273  // SpeedUp no nested loop to compute individual probability
1274  int ngoodsol1 = 0;
1275 
1276  metprob = Prob->MetProbability(preparedInput, met_smearL, met_smearP, METresX, METresY);
1277  if (metprob <= 0)
1278  continue;
1279  for (unsigned int j1 = 0; j1 < nu_vec.size(); j1++) {
1280  if (tau_tmp.E() + nu_vec[j1].E() >= preparedInput.m_beamEnergy)
1281  continue;
1282  const double tau1_tmpp = (tau_tmp + nu_vec[j1]).P();
1283  angle1 = Angle(nu_vec[j1], tau_tmp);
1284 
1285  if (angle1 < dTheta3DLimit(tau_type_tmp, 0, tau1_tmpp)) {
1286  ++m_iang1low;
1287  continue;
1288  } // lower 99% bound
1289  if (angle1 > dTheta3DLimit(tau_type_tmp, 1, tau1_tmpp)) {
1290  ++m_iang1high;
1291  continue;
1292  } // upper 99% bound
1293  double tauvecprob1j =
1294  Prob->dTheta3d_probabilityFast(preparedInput, tau_type_tmp, angle1, tau1_tmpp);
1295  if (tauvecprob1j == 0.)
1296  continue;
1297  tauprob = Prob->TauProbabilityLFV(preparedInput, tau_type_tmp, tau_tmp, nu_vec[j1]);
1298  totalProb = tauvecprob1j * metprob * MnuProb * tauprob;
1299 
1300  m_tautau_tmp.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
1301  m_tautau_tmp += tau_tmp;
1302  m_tautau_tmp += lep_tmp;
1303  m_tautau_tmp += nu_vec[j1];
1304 
1305  const double mtautau = m_tautau_tmp.M();
1306 
1307  m_totalProbSum += totalProb;
1308  m_mtautauSum += mtautau;
1309 
1310  fit_code = 1; // at least one solution is found
1311 
1312  m_fMfit_all->Fill(mtautau, totalProb);
1313  m_fMfit_allNoWeight->Fill(mtautau, 1.);
1314  //----------------- using P*fit to fill Px,y,z_tau
1315  m_fPXfit1->Fill((tau_tmp + nu_vec[j1]).Px(), totalProb);
1316  m_fPYfit1->Fill((tau_tmp + nu_vec[j1]).Py(), totalProb);
1317  m_fPZfit1->Fill((tau_tmp + nu_vec[j1]).Pz(), totalProb);
1318 
1319  if (totalProb > m_prob_tmp) // fill solution with highest probability
1320  {
1321  sign_tmp = -log10(totalProb);
1322  m_prob_tmp = totalProb;
1323  m_fDitauStuffFit.Mditau_best = mtautau;
1324  m_fDitauStuffFit.Sign_best = sign_tmp;
1325  if (tau_ind == 1)
1326  m_fDitauStuffFit.nutau1 = nu_vec[j1];
1327  if (tau_ind == 2)
1328  m_fDitauStuffFit.nutau2 = nu_vec[j1];
1329  }
1330 
1331  ++ngoodsol1;
1332  }
1333 
1334  if (ngoodsol1 == 0)
1335  continue;
1336  m_iter2 += 1;
1337 
1338  m_iter3 += 1;
1339  }
1340  }
1341  }
1342  } else if (preparedInput.m_tauTypes == TauTypes::lh) // lepton+tau case
1343  {
1344  if (preparedInput.m_fUseVerbose == 1) {
1345  Info("DiTauMassTools", "Running in lepton+tau mode");
1346  }
1347  //------- Settings -------------------------------
1348 
1349  //----- Stuff below are for Winter 2012 lep-had analysis only; it has to be
1350  // replaced by a more common scheme once other channels are optimized
1351  // XYVector
1352  // mht_vec((tau_vec1+tau_vec2).Px(),(tau_vec1+tau_vec2).Py()); //
1353  // missing Ht vector for Njet25=0 events const double
1354  // mht=mht_vec.R();
1355  double input_metX = preparedInput.m_MetVec.X();
1356  double input_metY = preparedInput.m_MetVec.Y();
1357 
1358  // double mht_offset=0.0;
1359  // if(InputInfo.UseHT) // use missing Ht (for 0-jet events only for
1360  // now)
1361  // {
1362  // input_metX=-mht_vec.X();
1363  // input_metY=-mht_vec.Y();
1364  // }
1365  // else // use MET (for 0-jet and 1-jet events)
1366  // {
1367  // input_metX=met_vec.X();
1368  // input_metY=met_vec.Y();
1369  // }
1370 
1371  PtEtaPhiMVector tau_tmp(0.0, 0.0, 0.0, 0.0);
1372  PtEtaPhiMVector lep_tmp(0.0, 0.0, 0.0, 0.0);
1373  int tau_type_tmp;
1374  if (preparedInput.m_type_visTau1 == 8) {
1375  tau_tmp = preparedInput.m_vistau2;
1376  lep_tmp = preparedInput.m_vistau1;
1377  tau_type_tmp = preparedInput.m_type_visTau2;
1378  }
1379  if (preparedInput.m_type_visTau2 == 8) {
1380  tau_tmp = preparedInput.m_vistau1;
1381  lep_tmp = preparedInput.m_vistau2;
1382  tau_type_tmp = preparedInput.m_type_visTau1;
1383  }
1384 
1385  //---------------------------------------------
1386  for (int i4 = 0; i4 < NiterMET + 1; i4++) // MET_X scan
1387  {
1388  met_smearL = METresX_binSize * i4 - N_METsigma * METresX;
1389  for (int i5 = 0; i5 < NiterMET + 1; i5++) // MET_Y scan
1390  {
1391  met_smearP = METresY_binSize * i5 - N_METsigma * METresY;
1392  if (pow(met_smearL / METresX, 2) + pow(met_smearP / METresY, 2) > pow(N_METsigma, 2))
1393  continue; // use ellipse instead of square
1394  met_smear_x = met_smearL * m_metCovPhiCos - met_smearP * m_metCovPhiSin;
1395  met_smear_y = met_smearL * m_metCovPhiSin + met_smearP * m_metCovPhiCos;
1396  metvec_tmp.SetXY(input_metX + met_smear_x, input_metY + met_smear_y);
1397 
1398  solution = NuPsolutionLFV(metvec_tmp, tau_tmp, 0.0, nu_vec);
1399 
1400  ++iter0;
1401 
1402  if (solution < 1)
1403  continue;
1404  ++m_iter1;
1405 
1406  // if fast sin cos, result to not match exactly nupsolutionv2, so skip
1407  // test
1408  // SpeedUp no nested loop to compute individual probability
1409  int ngoodsol1 = 0;
1410 
1411  metprob = Prob->MetProbability(preparedInput, met_smearL, met_smearP, METresX, METresY);
1412  if (metprob <= 0)
1413  continue;
1414  for (unsigned int j1 = 0; j1 < nu_vec.size(); j1++) {
1415  if (tau_tmp.E() + nu_vec[j1].E() >= preparedInput.m_beamEnergy)
1416  continue;
1417  const double tau1_tmpp = (tau_tmp + nu_vec[j1]).P();
1418  angle1 = Angle(nu_vec[j1], tau_tmp);
1419 
1420  if (angle1 < dTheta3DLimit(tau_type_tmp, 0, tau1_tmpp)) {
1421  ++m_iang1low;
1422  continue;
1423  } // lower 99% bound
1424  if (angle1 > dTheta3DLimit(tau_type_tmp, 1, tau1_tmpp)) {
1425  ++m_iang1high;
1426  continue;
1427  } // upper 99% bound
1428  double tauvecprob1j =
1429  Prob->dTheta3d_probabilityFast(preparedInput, tau_type_tmp, angle1, tau1_tmpp);
1430  if (tauvecprob1j == 0.)
1431  continue;
1432  tauprob = Prob->TauProbabilityLFV(preparedInput, tau_type_tmp, tau_tmp, nu_vec[j1]);
1433  totalProb = tauvecprob1j * metprob * tauprob;
1434 
1435  m_tautau_tmp.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
1436  m_tautau_tmp += tau_tmp;
1437  m_tautau_tmp += lep_tmp;
1438  m_tautau_tmp += nu_vec[j1];
1439 
1440  const double mtautau = m_tautau_tmp.M();
1441 
1442  m_totalProbSum += totalProb;
1443  m_mtautauSum += mtautau;
1444 
1445  fit_code = 1; // at least one solution is found
1446 
1447  m_fMfit_all->Fill(mtautau, totalProb);
1448  m_fMfit_allNoWeight->Fill(mtautau, 1.);
1450  // m_fPXfit1->Fill((tau_tmp+nu_vec[j1]).Px(),totalProb);
1451  // m_fPYfit1->Fill((tau_tmp+nu_vec[j1]).Py(),totalProb);
1452  // m_fPZfit1->Fill((tau_tmp+nu_vec[j1]).Pz(),totalProb);
1453 
1454  if (totalProb > m_prob_tmp) // fill solution with highest probability
1455  {
1456  sign_tmp = -log10(totalProb);
1457  m_prob_tmp = totalProb;
1458  m_fDitauStuffFit.Mditau_best = mtautau;
1459  m_fDitauStuffFit.Sign_best = sign_tmp;
1460  if (preparedInput.m_type_visTau1 == 8) {
1461  m_fDitauStuffFit.vistau1 = lep_tmp;
1462  m_fDitauStuffFit.vistau2 = tau_tmp;
1463  m_fDitauStuffFit.nutau2 = nu_vec[j1];
1464  } else if (preparedInput.m_type_visTau2 == 8) {
1465  m_fDitauStuffFit.vistau2 = lep_tmp;
1466  m_fDitauStuffFit.vistau1 = tau_tmp;
1467  m_fDitauStuffFit.nutau1 = nu_vec[j1];
1468  }
1469  }
1470 
1471  ++ngoodsol1;
1472  }
1473 
1474  if (ngoodsol1 == 0)
1475  continue;
1476  m_iter2 += 1;
1477 
1478  m_iter3 += 1;
1479  }
1480  }
1481  } else {
1482  Info("DiTauMassTools", "Running in an unknown mode?!?!");
1483  }
1484 
1485  OutputInfo.m_NTrials = iter0;
1487 
1488  if (preparedInput.m_fUseVerbose == 1) {
1489  Info("DiTauMassTools", "%s",
1490  ("SpeedUp niters=" + std::to_string(iter0) + " " + std::to_string(m_iter1) + " " +
1492  " " + std::to_string(m_iang1high))
1493  .c_str());
1494  }
1495 
1496  if (m_fMfit_all->GetEntries() > 0 && m_iter3 > 0) {
1497 #ifdef SMOOTH
1498  m_fMfit_all->Smooth();
1499  m_fMfit_allNoWeight->Smooth();
1500  m_fPXfit1->Smooth();
1501  m_fPYfit1->Smooth();
1502  m_fPZfit1->Smooth();
1503 #endif
1504 
1505  // default max finding method defined in MissingMassCalculator.h
1506  // note that window defined in terms of number of bin, so depend on binning
1507  std::vector<double> histInfo(HistInfo::MAXHISTINFO);
1509  double prob_hist = histInfo.at(HistInfo::PROB);
1510 
1511  if (prob_hist != 0.0)
1512  m_fDitauStuffHisto.Sign_best = -log10(std::abs(prob_hist));
1513  else {
1514  // this mean the histogram is empty.
1515  // possible but very rare if all entries outside histogram range
1516  // fall back to maximum
1517  m_fDitauStuffHisto.Sign_best = -999.;
1519  }
1520 
1521  if (m_fDitauStuffHisto.Mditau_best > 0.0)
1523  std::vector<double> histInfoOther(HistInfo::MAXHISTINFO);
1524  //---- getting Nu1
1525  double Px1 = maxFromHist(m_fPXfit1, histInfoOther);
1526  double Py1 = maxFromHist(m_fPYfit1, histInfoOther);
1527  double Pz1 = maxFromHist(m_fPZfit1, histInfoOther);
1528  //---- setting 4-vecs
1529  PxPyPzMVector nu1_tmp(0.0, 0.0, 0.0, 0.0);
1530  PxPyPzMVector nu2_tmp(0.0, 0.0, 0.0, 0.0);
1531  if (preparedInput.m_type_visTau1 == 8) {
1532  nu1_tmp = preparedInput.m_vistau1;
1533  nu2_tmp.SetCoordinates(Px1, Py1, Pz1, 1.777);
1534  }
1535  if (preparedInput.m_type_visTau2 == 8) {
1536  nu2_tmp = preparedInput.m_vistau2;
1537  nu1_tmp.SetCoordinates(Px1, Py1, Pz1, 1.777);
1538  }
1541  }
1542  if (m_lfvLeplepRefit && fit_code==0 && !refit) {
1543  fit_code = DitauMassCalculatorV9lfv(true);
1544  return fit_code;
1545  }
1546 
1547 
1548 
1549  if (preparedInput.m_fUseVerbose == 1) {
1550  if (fit_code == 0) {
1551  Info(
1552  "DiTauMassTools", "%s",
1553  ("!!!----> Warning-3 in MissingMassCalculator::DitauMassCalculatorV9lfv() : fit status=" +
1554  std::to_string(fit_code))
1555  .c_str());
1556  Info("DiTauMassTools", "....... No solution is found. Printing input info .......");
1557 
1558  Info("DiTauMassTools", "%s", (" vis Tau-1: Pt="+std::to_string(preparedInput.m_vistau1.Pt())
1560  +" phi="+std::to_string(preparedInput.m_vistau1.Phi())
1561  +" type="+std::to_string(preparedInput.m_type_visTau1)).c_str());
1562  Info("DiTauMassTools", "%s", (" vis Tau-2: Pt="+std::to_string(preparedInput.m_vistau2.Pt())
1564  +" phi="+std::to_string(preparedInput.m_vistau2.Phi())
1565  +" type="+std::to_string(preparedInput.m_type_visTau2)).c_str());
1566  Info("DiTauMassTools", "%s", (" MET="+std::to_string(preparedInput.m_MetVec.R())+" Met_X="+std::to_string(preparedInput.m_MetVec.X())
1567  +" Met_Y="+std::to_string(preparedInput.m_MetVec.Y())).c_str());
1568  Info("DiTauMassTools", " ---------------------------------------------------------- ");
1569  }
1570  }
1571  return fit_code;
1572 }
1573 
1574 // function to fit maximum
1575 Double_t MissingMassCalculator::maxFitting(Double_t *x, Double_t *par)
1576 // Double_t maxFitting(Double_t *x, Double_t *par)
1577 {
1578  // parabola with parameters max, mean and invwidth
1579  const double mM = x[0];
1580  const double mMax = par[0];
1581  const double mMean = par[1];
1582  const double mInvWidth2 = par[2]; // if param positif distance between intersection of the
1583  // parabola with x axis: 1/Sqrt(mInvWidth2)
1584  const double fitval = mMax * (1 - 4 * mInvWidth2 * std::pow(mM - mMean, 2));
1585  return fitval;
1586 }
1587 
1588 // determine the maximum from the histogram
1589 // if input prob not default , compute also some probability
1590 // MaxHistStrategy : different method to find maximum
1591 // TODO should get the array on work on it
1592 // should also find the effective range of the hist
1593 
1594 double
1595 MissingMassCalculator::maxFromHist(TH1F *theHist, std::vector<double> &histInfo,
1596  const MaxHistStrategy::e maxHistStrategy,
1597  const int winHalfWidth, bool debug) {
1598  // namespace HistInfo
1599  // enum e {
1600  // PROB=0,INTEGRAL,CHI2,DISCRI,TANTHETA,TANTHETAW,FITLENGTH,RMS,RMSVSDISCRI,MAXHISTINFO
1601  // };
1602  double maxPos = 0.;
1603  double prob = 0.;
1604 
1605  for (std::vector<double>::iterator itr = histInfo.begin(); itr != histInfo.end(); ++itr) {
1606  *itr = -1;
1607  }
1608 
1609  histInfo[HistInfo::INTEGRAL] = theHist->Integral();
1610 
1611  if (maxHistStrategy == MaxHistStrategy::MAXBIN ||
1612  ((maxHistStrategy == MaxHistStrategy::MAXBINWINDOW ||
1613  maxHistStrategy == MaxHistStrategy::SLIDINGWINDOW) &&
1614  winHalfWidth == 0)) {
1615 
1616  // simple max search
1617  // original version, simple bin maximum
1618  int max_bin = theHist->GetMaximumBin();
1619  maxPos = theHist->GetBinCenter(max_bin);
1620 
1621  // FIXME GetEntries is unweighted
1622  prob = theHist->GetBinContent(max_bin) / double(theHist->GetEntries());
1623  if (prob > 1.)
1624  prob = 1.;
1625  histInfo[HistInfo::PROB] = prob;
1626  return maxPos;
1627  }
1628 
1629  int hNbins = theHist->GetNbinsX();
1630 
1631  if (maxHistStrategy == MaxHistStrategy::MAXBINWINDOW) {
1632  // average around maximum bin (nearly useless in fact)
1633  // could be faster
1634  int max_bin = theHist->GetMaximumBin();
1635  int iBinMin = max_bin - winHalfWidth;
1636  if (iBinMin < 0)
1637  iBinMin = 0;
1638  int iBinMax = max_bin + winHalfWidth;
1639  if (iBinMax > hNbins)
1640  iBinMax = hNbins - 1;
1641  double sumw = 0;
1642  double sumx = 0;
1643  for (int iBin = iBinMin; iBin <= iBinMax; ++iBin) {
1644  const double weight = theHist->GetBinContent(iBin);
1645  sumw += weight;
1646  sumx += weight * theHist->GetBinCenter(iBin);
1647  }
1648  maxPos = sumx / sumw;
1649 
1650  // FIXME GetEntries is unweighted
1651  prob = sumw / theHist->GetEntries();
1652  if (prob > 1.)
1653  prob = 1.;
1654 
1655  return maxPos;
1656  }
1657 
1658  // now compute sliding window anyway
1659  if (maxHistStrategy != MaxHistStrategy::SLIDINGWINDOW &&
1660  maxHistStrategy != MaxHistStrategy::FIT) {
1661  Error("DiTauMassTools", "%s",
1662  ("ERROR undefined maxHistStrategy:" + std::to_string(maxHistStrategy)).c_str());
1663  return -10.;
1664  }
1665 
1666  // first iteration to find the first and last non zero bin, and the histogram
1667  // integral (not same as Entries because of weights)
1668  int lastNonZeroBin = -1;
1669  int firstNonZeroBin = -1;
1670  double totalSumw = 0.;
1671  bool firstNullPart = true;
1672  for (int iBin = 0; iBin < hNbins; ++iBin) {
1673  const double weight = theHist->GetBinContent(iBin);
1674  if (weight > 0) {
1675  totalSumw += weight;
1676  lastNonZeroBin = iBin;
1677  if (firstNullPart) {
1678  firstNullPart = false;
1679  firstNonZeroBin = iBin;
1680  }
1681  }
1682  }
1683 
1684  // enlarge first and last non zero bin with window width to avoid side effect
1685  // (maximum close to the edge)
1686  firstNonZeroBin = std::max(0, firstNonZeroBin - winHalfWidth - 1);
1687  lastNonZeroBin = std::min(hNbins - 1, lastNonZeroBin + winHalfWidth + 1);
1688 
1689  // if null histogram quit
1690  if (firstNullPart)
1691  return maxPos;
1692 
1693  // determine the size of the sliding window in the fit case
1694 
1695  // sliding window
1696  const int nwidth = 2 * winHalfWidth + 1;
1697  double winsum = 0.;
1698 
1699  for (int ibin = 0; ibin < nwidth; ++ibin) {
1700  winsum += theHist->GetBinContent(ibin);
1701  }
1702  double winmax = winsum;
1703 
1704  int max_bin = 0.;
1705  int iBinL = firstNonZeroBin;
1706  int iBinR = iBinL + 2 * winHalfWidth;
1707  bool goingUp = true;
1708 
1709  do {
1710  ++iBinL;
1711  ++iBinR;
1712  const double deltawin = theHist->GetBinContent(iBinR) - theHist->GetBinContent(iBinL - 1);
1713 
1714  if (deltawin < 0) {
1715  if (goingUp) {
1716  // if were climbing and now loose more on the left
1717  // than win on the right. This was a local maxima
1718  if (winsum > winmax) {
1719  // global maximum one so far
1720  winmax = winsum;
1721  max_bin = (iBinR + iBinL) / 2 - 1;
1722  }
1723  goingUp = false; // now going down
1724  }
1725  } else {
1726  // do not care about minima, simply indicate we are going down
1727  goingUp = true;
1728  }
1729 
1730  winsum += deltawin;
1731 
1732  } while (iBinR < lastNonZeroBin);
1733 
1734  // now compute average
1735  int iBinMin = max_bin - winHalfWidth;
1736  if (iBinMin < 0)
1737  iBinMin = 0;
1738  int iBinMax = max_bin + winHalfWidth;
1739  if (iBinMax >= hNbins)
1740  iBinMax = hNbins - 1;
1741  double sumw = 0;
1742  double sumx = 0;
1743  for (int iBin = iBinMin; iBin <= iBinMax; ++iBin) {
1744  const double weight = theHist->GetBinContent(iBin);
1745  sumw += weight;
1746  sumx += weight * theHist->GetBinCenter(iBin);
1747  }
1748 
1749  double maxPosWin = -1.;
1750 
1751  if (sumw > 0.) {
1752  maxPosWin = sumx / sumw;
1753  }
1754  // prob if the fraction of events in the window
1755  prob = sumw / totalSumw;
1756 
1757  // Definitions of some useful parameters
1758 
1759  const double h_rms = theHist->GetRMS(1);
1760  histInfo[HistInfo::RMS] = h_rms;
1761 
1762  double num = 0;
1763  double numerator = 0;
1764  double denominator = 0;
1765  bool nullBin = false;
1766 
1767  for (int i = iBinMin; i < iBinMax; ++i) {
1768  double binError = theHist->GetBinError(i);
1769  if (binError < 1e-10) {
1770  nullBin = true;
1771  }
1772  double binErrorSquare = std::pow(binError, 2);
1773  num = theHist->GetBinContent(i) / (binErrorSquare);
1774  numerator = numerator + num;
1775  denominator = denominator + (1 / (binErrorSquare));
1776  }
1777  if (numerator < 1e-10 || denominator < 1e-10 || nullBin == true) {
1778  histInfo[HistInfo::MEANBIN] = -1;
1779  } else {
1780  histInfo[HistInfo::MEANBIN] = sqrt(1 / denominator) / (numerator / denominator);
1781  }
1782 
1783  // stop here if only looking for sliding window
1784  if (maxHistStrategy == MaxHistStrategy::SLIDINGWINDOW) {
1785  return maxPosWin;
1786  }
1787 
1788  maxPos = maxPosWin;
1789  // now FIT maxHistStrategy==MaxHistStrategy::FIT
1790 
1791  // now mass fit in range defined by sliding window
1792  // window will be around maxPos
1793  const double binWidth = theHist->GetBinCenter(2) - theHist->GetBinCenter(1);
1794  double fitWidth = (winHalfWidth + 0.5) * binWidth;
1795  // fit range 2 larger than original window range, 3 if less than 20% of the
1796  // histogram in slinding window
1797 
1798  if (prob > 0.2) {
1799  fitWidth *= 2.;
1800  } else {
1801  fitWidth *= 3.;
1802  }
1803  // fit option : Q == Quiet, no printout S result of the fit returned in
1804  // TFitResultPtr N do not draw the resulting function
1805 
1806  // if debug plot the fitted function
1807  TString fitOption = debug ? "QS" : "QNS";
1808  // root fit
1809  // Sets initial values
1810  m_fFitting->SetParameters(sumw / winHalfWidth, maxPos, 0.0025);
1811  // TFitResultPtr
1812  // fitRes=theHist->Fit("pol2",fitOption,"",maxPos-fitWidth,maxPos+fitWidth);
1813  TFitResultPtr fitRes =
1814  theHist->Fit(m_fFitting, fitOption, "", maxPos - fitWidth, maxPos + fitWidth);
1815 
1816  double maxPosFit = -1.;
1817 
1818  if (int(fitRes) == 0) {
1819  // root fit
1820  histInfo[HistInfo::CHI2] = fitRes->Chi2();
1821  const double mMax = fitRes->Parameter(0);
1822  const double mMean = fitRes->Parameter(1);
1823  const double mInvWidth2 = fitRes->Parameter(2);
1824  double mMaxError = fitRes->ParError(0);
1825  m_PrintmMaxError = mMaxError;
1826  double mMeanError = fitRes->ParError(1);
1827  m_PrintmMeanError = mMeanError;
1828  double mInvWidth2Error = fitRes->ParError(2);
1829  m_PrintmInvWidth2Error = mInvWidth2Error;
1830  mMeanError = 0.; // avoid warning
1831  mInvWidth2Error = 0.; // avoid warning
1832  const double c = mMax * (1 - 4 * mMean * mMean * mInvWidth2);
1833  const double b = 8 * mMax * mMean * mInvWidth2;
1834  const double a = -4 * mMax * mInvWidth2;
1835  // when built in polynomial fit
1836  // const double c=fitRes->Parameter(0);
1837  // const double b=fitRes->Parameter(1);
1838  // const double a=fitRes->Parameter(2);
1839 
1840  const double h_discri = b * b - 4 * a * c;
1841  histInfo[HistInfo::DISCRI] = h_discri;
1842  const double sqrth_discri = sqrt(h_discri);
1843  const double h_fitLength = sqrth_discri / a;
1844  histInfo[HistInfo::FITLENGTH] = h_fitLength;
1845  histInfo[HistInfo::TANTHETA] = 2 * a / sqrth_discri;
1846  histInfo[HistInfo::TANTHETAW] = 2 * a * sumw / sqrth_discri;
1847  histInfo[HistInfo::RMSVSDISCRI] = h_rms / h_fitLength;
1848  // compute maximum position (only if inverted parabola)
1849  if (a < 0)
1850  maxPosFit = -b / (2 * a);
1851  }
1852 
1853  // keep fit result only if within 80% of fit window, and fit succeeded
1854  if (maxPosFit >= 0. and std::abs(maxPosFit - maxPosWin) < 0.8 * fitWidth) {
1855  histInfo[HistInfo::PROB] = prob;
1856  return maxPosFit;
1857  } else {
1858  // otherwise keep the weighted average
1859  // negate prob just to flag such event
1860  prob = -prob;
1861  histInfo[HistInfo::PROB] = prob;
1862  return maxPosWin;
1863  }
1864 }
1865 
1866 // compute probability for any input value,can be called from a pure parameter
1867 // scan
1868 // deltametvec is along phijet
1869 // returns number of solution if positive, return code if negative, vector of
1870 // probability and mass
1871 int MissingMassCalculator::probCalculatorV9fast(const double &phi1, const double &phi2,
1872  const double &M_nu1,
1873  const double &M_nu2) {
1874  // bool debug=true;
1875 
1876  int nsol1;
1877  int nsol2;
1878 
1879  const int solution = NuPsolutionV3(M_nu1, M_nu2, phi1, phi2, nsol1, nsol2);
1880 
1881  if (solution != 1)
1882  return -4;
1883  // refineSolutions ( M_nu1,M_nu2,
1884  // met_smearL,met_smearP,metvec_tmp.R(),
1885  // nsol1, nsol2,m_Mvis,m_Meff);
1886  refineSolutions(M_nu1, M_nu2, nsol1, nsol2, m_Mvis, m_Meff);
1887 
1888  if (m_nsol <= 0)
1889  return 0;
1890 
1891  // success
1892 
1893  return m_nsol; // for backward compatibility
1894 }
1895 
1896 // nuvecsol1 and nuvecsol2 passed by MMC
1897 int MissingMassCalculator::refineSolutions(const double &M_nu1, const double &M_nu2,
1898  const int nsol1, const int nsol2,
1899  const double &Mvis, const double &Meff)
1900 
1901 {
1902  m_nsol = 0;
1903 
1904  if (int(m_probFinalSolVec.size()) < m_nsolfinalmax)
1905  Error("DiTauMassTools", "%s",
1906  ("refineSolutions ERROR probFinalSolVec.size() should be " + std::to_string(m_nsolfinalmax))
1907  .c_str());
1908  if (int(m_mtautauFinalSolVec.size()) < m_nsolfinalmax)
1909  Error("DiTauMassTools", "%s",
1910  ("refineSolutions ERROR mtautauSolVec.size() should be " + std::to_string(m_nsolfinalmax))
1911  .c_str());
1912  if (int(m_nu1FinalSolVec.size()) < m_nsolfinalmax)
1913  Error("DiTauMassTools", "%s",
1914  ("refineSolutions ERROR nu1FinalSolVec.size() should be " + std::to_string(m_nsolfinalmax))
1915  .c_str());
1916  if (int(m_nu2FinalSolVec.size()) < m_nsolfinalmax)
1917  Error("DiTauMassTools", "%s",
1918  ("refineSolutions ERROR nu2FinalSolVec.size() should be " + std::to_string(m_nsolfinalmax))
1919  .c_str());
1920  if (nsol1 > int(m_nsolmax))
1921  Error("DiTauMassTools", "%s", ("refineSolutions ERROR nsol1 " + std::to_string(nsol1) +
1922  " > nsolmax !" + std::to_string(m_nsolmax))
1923  .c_str());
1924  if (nsol2 > int(m_nsolmax))
1925  Error("DiTauMassTools", "%s", ("refineSolutions ERROR nsol1 " + std::to_string(nsol2) +
1926  " > nsolmax !" + std::to_string(m_nsolmax))
1927  .c_str());
1928 
1929  int ngoodsol1 = 0;
1930  int ngoodsol2 = 0;
1931  double constProb =
1932  Prob->apply(preparedInput, -99, -99, PtEtaPhiMVector(0, 0, 0, 0), PtEtaPhiMVector(0, 0, 0, 0),
1933  PtEtaPhiMVector(0, 0, 0, 0), PtEtaPhiMVector(0, 0, 0, 0), true, false, false);
1934 
1935  for (int j1 = 0; j1 < nsol1; ++j1) {
1936  PtEtaPhiMVector &nuvec1_tmpj = m_nuvecsol1[j1];
1937  PtEtaPhiMVector &tauvecsol1j = m_tauvecsol1[j1];
1938  double &tauvecprob1j = m_tauvecprob1[j1];
1939  tauvecprob1j = 0.;
1940  // take first or second solution
1941  // no time to call rndm, switch more or less randomely, according to an
1942  // oscillating switch perturbed by m_phi1
1943  if (nsol1 > 1) {
1944  if (j1 == 0) { // decide at the first solution which one we will take
1945  const int pickInt = std::abs(10000 * m_Phi1);
1946  const int pickDigit = pickInt - 10 * (pickInt / 10);
1947  if (pickDigit < 5)
1948  m_switch1 = !m_switch1;
1949  }
1950  m_switch1 = !m_switch1;
1951  }
1952 
1953  if (!m_switch1) {
1954  nuvec1_tmpj.SetCoordinates(nuvec1_tmpj.Pt(), nuvec1_tmpj.Eta(), nuvec1_tmpj.Phi(), M_nu1);
1955  tauvecsol1j.SetPxPyPzE(0., 0., 0., 0.);
1956  tauvecsol1j += nuvec1_tmpj;
1957  tauvecsol1j += m_tauVec1;
1958  if (tauvecsol1j.E() >= preparedInput.m_beamEnergy)
1959  continue;
1961  PtEtaPhiMVector(0, 0, 0, 0), nuvec1_tmpj,
1962  PtEtaPhiMVector(0, 0, 0, 0), false, true, false);
1963  ++ngoodsol1;
1964  }
1965 
1966  for (int j2 = 0; j2 < nsol2; ++j2) {
1967  PtEtaPhiMVector &nuvec2_tmpj = m_nuvecsol2[j2];
1968  PtEtaPhiMVector &tauvecsol2j = m_tauvecsol2[j2];
1969  double &tauvecprob2j = m_tauvecprob2[j2];
1970  if (j1 == 0) {
1971  tauvecprob2j = 0.;
1972  // take first or second solution
1973  // no time to call rndm, switch more or less randomely, according to an
1974  // oscillating switch perturbed by m_phi2
1975  if (nsol2 > 1) {
1976  if (j2 == 0) { // decide at the first solution which one we will take
1977  const int pickInt = std::abs(10000 * m_Phi2);
1978  const int pickDigit = pickInt - 10 * int(pickInt / 10);
1979  if (pickDigit < 5)
1980  m_switch2 = !m_switch2;
1981  }
1982  m_switch2 = !m_switch2;
1983  }
1984 
1985  if (!m_switch2) {
1986  nuvec2_tmpj.SetCoordinates(nuvec2_tmpj.Pt(), nuvec2_tmpj.Eta(), nuvec2_tmpj.Phi(), M_nu2);
1987  tauvecsol2j.SetPxPyPzE(0., 0., 0., 0.);
1988  tauvecsol2j += nuvec2_tmpj;
1989  tauvecsol2j += m_tauVec2;
1990  if (tauvecsol2j.E() >= preparedInput.m_beamEnergy)
1991  continue;
1992  tauvecprob2j = Prob->apply(preparedInput, -99, preparedInput.m_type_visTau2,
1993  PtEtaPhiMVector(0, 0, 0, 0), m_tauVec2,
1994  PtEtaPhiMVector(0, 0, 0, 0), nuvec2_tmpj, false, true, false);
1995  ++ngoodsol2;
1996  }
1997  }
1998  if (tauvecprob1j == 0.)
1999  continue;
2000  if (tauvecprob2j == 0.)
2001  continue;
2002 
2003  double totalProb = 1.;
2004 
2005  m_tautau_tmp.SetPxPyPzE(0., 0., 0., 0.);
2006  m_tautau_tmp += tauvecsol1j;
2007  m_tautau_tmp += tauvecsol2j;
2008  const double mtautau = m_tautau_tmp.M();
2009 
2010  if (TailCleanUp(m_tauVec1, nuvec1_tmpj, m_tauVec2, nuvec2_tmpj, mtautau, Mvis, Meff,
2011  preparedInput.m_DelPhiTT) == 0) {
2012  continue;
2013  }
2014 
2015  totalProb *=
2016  (constProb * tauvecprob1j * tauvecprob2j *
2018  m_tauVec1, m_tauVec2, nuvec1_tmpj, nuvec2_tmpj, false, false, true));
2019 
2020  if (totalProb <= 0) {
2022  Warning("DiTauMassTools", "%s",
2023  ("null proba solution, rejected "+std::to_string(totalProb)).c_str());
2024  } else {
2025  // only count solution with non zero probability
2026  m_totalProbSum += totalProb;
2027  m_mtautauSum += mtautau;
2028 
2029  if (m_nsol >= int(m_nsolfinalmax)) {
2030  Error("DiTauMassTools", "%s",
2031  ("refineSolutions ERROR nsol getting larger than nsolfinalmax!!! " +
2033  .c_str());
2034  Error("DiTauMassTools", "%s",
2035  (" j1 " + std::to_string(j1) + " j2 " + std::to_string(j2) + " nsol1 " +
2036  std::to_string(nsol1) + " nsol2 " + std::to_string(nsol2))
2037  .c_str());
2038  --m_nsol; // overwrite last solution. However this should really never
2039  // happen
2040  }
2041 
2042  // good solution found, copy in vector
2043  m_mtautauFinalSolVec[m_nsol] = mtautau;
2044  m_probFinalSolVec[m_nsol] = totalProb;
2045 
2046  PtEtaPhiMVector &nu1Final = m_nu1FinalSolVec[m_nsol];
2047  PtEtaPhiMVector &nu2Final = m_nu2FinalSolVec[m_nsol];
2048  // for (int iv=0;iv<4;++iv){
2049 
2050  nu1Final.SetPxPyPzE(nuvec1_tmpj.Px(), nuvec1_tmpj.Py(), nuvec1_tmpj.Pz(), nuvec1_tmpj.E());
2051  nu2Final.SetPxPyPzE(nuvec2_tmpj.Px(), nuvec2_tmpj.Py(), nuvec2_tmpj.Pz(), nuvec2_tmpj.E());
2052  // }
2053 
2054  ++m_nsol;
2055  } // else totalProb<=0
2056 
2057  } // loop j2
2058  } // loop j1
2059  if (ngoodsol1 == 0) {
2060  return -1;
2061  }
2062  if (ngoodsol2 == 0) {
2063  return -2;
2064  }
2065  return m_nsol;
2066 }
2067 
2068 int MissingMassCalculator::TailCleanUp(const PtEtaPhiMVector &vis1,
2069  const PtEtaPhiMVector &nu1,
2070  const PtEtaPhiMVector &vis2,
2071  const PtEtaPhiMVector &nu2, const double &mmc_mass,
2072  const double &vis_mass, const double &eff_mass,
2073  const double &dphiTT) {
2074 
2075  int pass_code = 1;
2077  return pass_code;
2078 
2079  // the Clean-up cuts are specifically for rel16 analyses.
2080  // the will change in rel17 analyses and after the MMC is updated
2081 
2082  if (preparedInput.m_tauTypes == TauTypes::ll) // lepton-lepton channel
2083  {
2084  const double MrecoMvis = mmc_mass / vis_mass;
2085  if (MrecoMvis > 2.6)
2086  return 0;
2087  const double MrecoMeff = mmc_mass / eff_mass;
2088  if (MrecoMeff > 1.9)
2089  return 0;
2090  const double e1p1 = nu1.E() / vis1.P();
2091  const double e2p2 = nu2.E() / vis2.P();
2092  if ((e1p1 + e2p2) > 4.5)
2093  return 0;
2094  if (e2p2 > 4.0)
2095  return 0;
2096  if (e1p1 > 3.0)
2097  return 0;
2098  }
2099 
2100  //-------- these are new cuts for lep-had analysis for Moriond
2101  if (preparedInput.m_tauTypes == TauTypes::lh) // lepton-hadron channel
2102  {
2103 
2108  return pass_code; // don't use TailCleanup for 8 & 13 TeV data
2109 
2110  //--------- leave code uncommented to avoid Compilation warnings
2111  if (Prob->GetUseHT()) {
2112  const double MrecoMvis = mmc_mass / vis_mass;
2113  const double MrecoMeff = mmc_mass / eff_mass;
2114  const double x = dphiTT > 1.5 ? dphiTT : 1.5;
2115  if ((MrecoMeff + MrecoMvis) > 5.908 - 1.881 * x + 0.2995 * x * x)
2116  return 0;
2117  }
2118  }
2119  return pass_code;
2120 }
2121 
2122 // note that if MarkovChain the input solutions can be modified
2124 
2125 {
2126 
2127  bool reject = true;
2128  double totalProbSumSol = 0.;
2129  double totalProbSumSolOld = 0.;
2130  bool firstPointWithSol = false;
2131 
2132  for (int isol = 0; isol < m_nsol; ++isol) {
2133  totalProbSumSol += m_probFinalSolVec[isol];
2134  }
2135 
2136  double uMC = -1.;
2137  bool notSureToKeep = true;
2138  // note : if no solution, the point is treated as having a zero probability
2139  if (m_fullParamSpaceScan) {
2140  reject = false; // accept anyway in this mode
2141  notSureToKeep = false; // do not need to test on prob
2142  if (m_nsol <= 0) {
2143  // if initial full scaning and no sol : continue
2144  m_markovNFullScan += 1;
2145  } else {
2146  // if we were in in full scan mode and we have a solution, switch it off
2147  m_fullParamSpaceScan = false;
2148  firstPointWithSol = true; // as this is the first point without a solution
2149  // there is no old sol
2150  m_iter0 = 0; // reset the counter so that separately the full scan pphase
2151  // and the markov phase use m_niterRandomLocal points
2152  // hack for hh : allow 10 times less iteration for markov than for the
2153  // fullscan phase
2155  m_niterRandomLocal /= 10;
2156  }
2157  }
2158  }
2159 
2160  if (notSureToKeep) {
2161  // apply Metropolis algorithm to decide to keep this point.
2162  // compute the probability of the previous point and the current one
2163  for (int isol = 0; isol < m_nsolOld; ++isol) {
2164  totalProbSumSolOld += m_probFinalSolOldVec[isol];
2165  }
2166 
2167  // accept anyway if null old probability (should only happen for the very
2168  // first point with a solution)
2169  if (!firstPointWithSol && totalProbSumSolOld <= 0.) {
2170  Error("DiTauMassTools", "%s",
2171  (" ERROR null old probability !!! " + std::to_string(totalProbSumSolOld) + " nsolOld " +
2173  .c_str());
2174  reject = false;
2175  } else if (totalProbSumSol > totalProbSumSolOld) {
2176  // if going up, accept anyway
2177  reject = false;
2178  // else if (totalProbSumSol < 1E-16) { // if null target probability,
2179  // reject anyway
2180  } else if (totalProbSumSol < totalProbSumSolOld * 1E-6) { // if ratio of probability <1e6, point
2181  // will be accepted only every 1E6
2182  // iteration, so can reject anyway
2183  reject = true;
2184  } else if (m_nsol <= 0) { // new parametrisation give prob too small to
2185  // trigger above condition if no solution is found
2186  reject = true;
2187  } else {
2188  // if going down, reject with a probability
2189  // 1-totalProbSum/totalProbSumOld)
2190  uMC = m_randomGen.Rndm();
2191  reject = (uMC > totalProbSumSol / totalProbSumSolOld);
2192  }
2193  } // if reject
2194 
2195  // proceed with the handling of the solutions wether the old or the new ones
2196 
2197  // optionally fill the vectors with the complete list of points (for all
2198  // walkstrategy)
2199 
2200  if (reject) {
2201  // current point reset to the previous one
2202  // Note : only place where m_MEtP etc... are modified outside spacewalkerXYZ
2203  m_MEtP = m_MEtP0;
2204  m_MEtL = m_MEtL0;
2205  m_Phi1 = m_Phi10;
2206  m_Phi2 = m_Phi20;
2207  m_eTau1 = m_eTau10;
2208  m_eTau2 = m_eTau20;
2209  if (m_scanMnu1)
2210  m_Mnu1 = m_Mnu10;
2211  if (m_scanMnu2)
2212  m_Mnu2 = m_Mnu20;
2213  }
2214 
2215  // default case : fill the histogram with solution, using current point
2216  bool fillSolution = true;
2217  bool oldToBeUsed = false;
2218 
2219  // now handle the reject or accept cases
2220  // the tricky thing is that for markov, we accept the old point as soon as a
2221  // new accepted point is found with a weight equal to one plus the number of
2222  // rejected point inbetween
2223 
2224  if (reject) {
2225  fillSolution = false; // do not fill solution, just count number of replication
2227  if (m_nsol <= 0) {
2228  m_markovNRejectNoSol += 1;
2229  } else {
2231  }
2232 
2233  } else {
2234  // if accept, will fill solution (except for very first point) but taking
2235  // the values from the previous point
2236  if (!m_fullParamSpaceScan) {
2237  m_markovNAccept += 1;
2238  }
2239  if (!firstPointWithSol) {
2240  fillSolution = true;
2241  oldToBeUsed = true;
2242  } else {
2243  fillSolution = false;
2244  }
2245  } // else reject
2246 
2247  // if do not fill solution exit now
2248  // for the first point with solution we need to copy the new sol into the old
2249  // one before leaving
2250  if (!fillSolution) {
2251  if (firstPointWithSol) {
2252  // current point is the future previous one
2253  m_nsolOld = m_nsol;
2254  for (int isol = 0; isol < m_nsol; ++isol) {
2257  m_nu1FinalSolOldVec[isol] = m_nu1FinalSolVec[isol];
2258  m_nu2FinalSolOldVec[isol] = m_nu2FinalSolVec[isol];
2259  }
2260  }
2261  return;
2262  }
2263 
2264  // compute RMS of the different solutions
2265  double solSum = 0.;
2266  double solSum2 = 0.;
2267 
2268  for (int isol = 0; isol < m_nsol; ++isol) {
2269  ++m_iter5;
2270  double totalProb;
2271  double mtautau;
2272  const PtEtaPhiMVector *pnuvec1_tmpj;
2273  const PtEtaPhiMVector *pnuvec2_tmpj;
2274 
2275  if (oldToBeUsed) {
2276  totalProb = m_probFinalSolOldVec[isol];
2277  mtautau = m_mtautauFinalSolOldVec[isol];
2278  pnuvec1_tmpj = &m_nu1FinalSolOldVec[isol];
2279  pnuvec2_tmpj = &m_nu2FinalSolOldVec[isol];
2280  } else {
2281  totalProb = m_probFinalSolVec[isol];
2282  mtautau = m_mtautauFinalSolVec[isol];
2283  pnuvec1_tmpj = &m_nu1FinalSolVec[isol];
2284  pnuvec2_tmpj = &m_nu2FinalSolVec[isol];
2285  }
2286  const PtEtaPhiMVector &nuvec1_tmpj = *pnuvec1_tmpj;
2287  const PtEtaPhiMVector &nuvec2_tmpj = *pnuvec2_tmpj;
2288 
2289  solSum += mtautau;
2290  solSum2 += mtautau * mtautau;
2291 
2292  double weight;
2293  // MarkovChain : accepted events already distributed according to
2294  // probability distribution, so weight is 1. acutally to have a proper
2295  // estimate of per bin error, instead of putting several time the same point
2296  // when metropolis alg reject one (or no solution), rather put it with the
2297  // multiplicity weight. Should only change the error bars might change if
2298  // weighted markov chain are used there is also an issue with the 4 very
2299  // close nearly identical solution
2301  1; // incremented only when a point is rejected, hence need to add 1
2302 
2303  m_fMfit_all->Fill(mtautau, weight);
2304 
2305  if(m_SaveLlhHisto){
2306  m_fMEtP_all->Fill(m_MEtP, weight);
2307  m_fMEtL_all->Fill(m_MEtL, weight);
2308  m_fMnu1_all->Fill(m_Mnu1, weight);
2309  m_fMnu2_all->Fill(m_Mnu2, weight);
2310  m_fPhi1_all->Fill(m_Phi1, weight);
2311  m_fPhi2_all->Fill(m_Phi2, weight);
2312  if (mtautau != 0. && weight != 0.)
2313  m_fMfit_allGraph->SetPoint(m_iter0, mtautau, -TMath::Log(weight));
2314  }
2315 
2316  m_fMfit_allNoWeight->Fill(mtautau, 1.);
2317 
2318  // m_fPXfit1->Fill(nuvec1_tmpj.Px(),weight);
2319  // m_fPYfit1->Fill(nuvec1_tmpj.Py(),weight);
2320  // m_fPZfit1->Fill(nuvec1_tmpj.Pz(),weight);
2321  // m_fPXfit2->Fill(nuvec2_tmpj.Px(),weight);
2322  // m_fPYfit2->Fill(nuvec2_tmpj.Py(),weight);
2323  // m_fPZfit2->Fill(nuvec2_tmpj.Pz(),weight);
2324 
2325  //----------------- using P*fit to fill Px,y,z_tau
2326  // Note that the original vistau are used there deliberately,
2327  // since they will be subtracted after histogram fitting
2328  // DR, kudos Antony Lesage : do not create temporary TLV within each Fill,
2329  // saves 10% CPU
2330  m_fPXfit1->Fill(preparedInput.m_vistau1.Px() + nuvec1_tmpj.Px(), totalProb);
2331  m_fPYfit1->Fill(preparedInput.m_vistau1.Py() + nuvec1_tmpj.Py(), totalProb);
2332  m_fPZfit1->Fill(preparedInput.m_vistau1.Pz() + nuvec1_tmpj.Pz(), totalProb);
2333  m_fPXfit2->Fill(preparedInput.m_vistau2.Px() + nuvec2_tmpj.Px(), totalProb);
2334  m_fPYfit2->Fill(preparedInput.m_vistau2.Py() + nuvec2_tmpj.Py(), totalProb);
2335  m_fPZfit2->Fill(preparedInput.m_vistau2.Pz() + nuvec2_tmpj.Pz(), totalProb);
2336 
2337  // fill histograms for floating stopping criterion, split randomly
2338  if (m_fUseFloatStopping) {
2339  if (m_randomGen.Rndm() <= 0.5) {
2340  m_fMmass_split1->Fill(mtautau, weight);
2341  m_fMEtP_split1->Fill(m_MEtP, weight);
2342  m_fMEtL_split1->Fill(m_MEtL, weight);
2343  m_fMnu1_split1->Fill(m_Mnu1, weight);
2344  m_fMnu2_split1->Fill(m_Mnu2, weight);
2345  m_fPhi1_split1->Fill(m_Phi1, weight);
2346  m_fPhi2_split1->Fill(m_Phi2, weight);
2347  } else {
2348  m_fMmass_split2->Fill(mtautau, weight);
2349  m_fMEtP_split2->Fill(m_MEtP, weight);
2350  m_fMEtL_split2->Fill(m_MEtL, weight);
2351  m_fMnu1_split2->Fill(m_Mnu1, weight);
2352  m_fMnu2_split2->Fill(m_Mnu2, weight);
2353  m_fPhi1_split2->Fill(m_Phi1, weight);
2354  m_fPhi2_split2->Fill(m_Phi2, weight);
2355  }
2356  }
2357 
2358  if (totalProb > m_prob_tmp) // fill solution with highest probability
2359  {
2360  m_prob_tmp = totalProb;
2361  m_fDitauStuffFit.Mditau_best = mtautau;
2362  m_fDitauStuffFit.Sign_best = -log10(totalProb);
2363  ;
2364  m_fDitauStuffFit.nutau1 = nuvec1_tmpj;
2365  m_fDitauStuffFit.nutau2 = nuvec2_tmpj;
2368  }
2369  } // loop on solutions
2370 
2371  m_markovCountDuplicate = 0; // now can reset the duplicate count
2372 
2373  if (oldToBeUsed) {
2374  // current point is the future previous one
2375  // TLV copy not super efficient but not dramatic
2376  m_nsolOld = m_nsol;
2377  for (int isol = 0; isol < m_nsol; ++isol) {
2380  m_nu1FinalSolOldVec[isol] = m_nu1FinalSolVec[isol];
2381  m_nu2FinalSolOldVec[isol] = m_nu2FinalSolVec[isol];
2382  }
2383  }
2384 
2385  // compute rms of solutions
2386  const double solRMS = sqrt(solSum2 / m_nsol - std::pow(solSum / m_nsol, 2));
2387  OutputInfo.m_AveSolRMS += solRMS;
2388 
2389  return;
2390 }
2391 
2393  // FIXME could use function pointer to switch between functions
2394  m_nsolOld = 0;
2395 
2396  double METresX = preparedInput.m_METsigmaL; // MET resolution in direction parallel to MET
2397  // resolution major axis, for MET scan
2398  double METresY = preparedInput.m_METsigmaP; // MET resolution in direction perpendicular to
2399  // to MET resolution major axis, for MET scan
2400 
2401  // precompute some quantities and store in m_ data members
2402  precomputeCache();
2409  }
2410 
2411  // if m_nsigma_METscan was not set by user, set to default values
2412  if(m_nsigma_METscan == -1){
2413  if (preparedInput.m_tauTypes == TauTypes::ll) // both tau's are leptonic
2414  {
2416  } else if (preparedInput.m_tauTypes == TauTypes::lh) // lep had
2417  {
2419  } else // hh
2420  {
2422  }
2423  }
2424 
2426 
2429 
2430  m_walkWeight = 1.;
2431 
2432  // dummy initial value to avoid printout with random values
2433  m_Phi10 = 0.;
2434  m_Phi20 = 0.;
2435  m_MEtL0 = 0.;
2436  m_MEtP0 = 0.;
2437  m_Mnu10 = 0.;
2438  m_Mnu20 = 0.;
2439 
2440  m_mTau = 1.777;
2441 
2442  // seeds the random generator in a reproducible way from the phi of both tau;
2443  double aux = std::abs(m_tauVec1Phi + double(m_tauVec2Phi) / 100. / TMath::Pi()) * 100;
2444  m_seed = (aux - floor(aux)) * 1E6 * (1 + m_RndmSeedAltering) + 13;
2445 
2446  m_randomGen.SetSeed(m_seed);
2447  // int Niter=Niter_fit1; // number of points for each dR loop
2448  // int NiterMET=Niter_fit2; // number of iterations for each MET scan loop
2449  // int NiterMnu=Niter_fit3; // number of iterations for Mnu loop
2450 
2451  // approximately compute the number of points from the grid scanning
2452  // divide by abritry number to recover timing with still better results
2453  // m_NiterRandom=(NiterMET+1)*(NiterMET+1)*4*Niter*Niter/10;
2454 
2458 
2462 
2463  m_Mnu1Min = 0.;
2464  m_scanMnu1 = false;
2465  m_Mnu1 = m_Mnu1Min;
2466 
2467  // for markov chain use factor 2
2469 
2470  // NiterRandom set by user (default is -1). If negative, defines the default
2471  // here. no more automatic scaling for ll hl hh
2472  if (m_NiterRandom <= 0) {
2473  m_niterRandomLocal = 100000; // number of iterations for Markov for lh
2475  m_niterRandomLocal *= 2; // multiplied for ll , unchecked
2477  m_niterRandomLocal *= 5; // divided for hh ,checked
2478  } else {
2480  }
2481 
2482  if (preparedInput.m_type_visTau1 == 8) {
2483  // m_Mnu1Max=m_mTau-m_tauVec1M;
2486  m_scanMnu1 = true;
2487  }
2488 
2489  m_Mnu2Min = 0.;
2490  m_scanMnu2 = false;
2491  m_Mnu2 = m_Mnu2Min;
2492  if (preparedInput.m_type_visTau2 == 8) {
2493  // m_Mnu2Max=m_mTau-m_tauVec2M;
2496  m_scanMnu2 = true;
2497  }
2498 
2499  m_MEtLMin = -m_nsigma_METscan * METresX;
2500  m_MEtLMax = +m_nsigma_METscan * METresX;
2502 
2503  m_MEtPMin = -m_nsigma_METscan * METresY;
2504  m_MEtPMax = +m_nsigma_METscan * METresY;
2506 
2507  m_eTau1Min = -1;
2508  m_eTau1Max = -1;
2509  m_eTau2Min = -1;
2510  m_eTau2Max = -1;
2511 
2512  m_switch1 = true;
2513  m_switch2 = true;
2514 
2516  m_rmsStop = m_RMSStop;
2517 
2518  m_iter0 = -1;
2519  m_iterNuPV3 = 0;
2520  m_testptn1 = 0;
2521  m_testptn2 = 0;
2522  m_testdiscri1 = 0;
2523  m_testdiscri2 = 0;
2524  m_nosol1 = 0;
2525  m_nosol2 = 0;
2526  m_iterNsuc = 0;
2527  if (m_meanbinStop > 0) {
2528  m_meanbinToBeEvaluated = true;
2529  } else {
2530  m_meanbinToBeEvaluated = false;
2531  }
2532 
2536  m_markovNAccept = 0;
2537  m_markovNFullScan = 0;
2538  // set full parameter space scannning for the first steps, until a solution is
2539  // found
2540  m_fullParamSpaceScan = true;
2541  // size of step. Needs to be tune. Start with simple heuristic.
2542  if (m_proposalTryMEt < 0) {
2543  m_MEtProposal = m_MEtPRange / 30.;
2544  } else {
2546  }
2547  if (m_ProposalTryPhi < 0) {
2548  m_PhiProposal = 0.04;
2549  } else {
2551  }
2552  // FIXME if m_Mnu1Range !ne m_Mnu2Range same proposal will be done
2553  if (m_scanMnu1) {
2554  if (m_ProposalTryMnu < 0) {
2555  m_MnuProposal = m_Mnu1Range / 10.;
2556  } else {
2558  }
2559  }
2560  if (m_scanMnu2) {
2561  if (m_ProposalTryMnu < 0) {
2562  m_MnuProposal = m_Mnu2Range / 10.;
2563  } else {
2565  }
2566  }
2567 }
2568 
2569 // iterator. walk has internal counters, should only be used in a while loop
2570 // so far only implement grid strategy
2571 // act on MMC data member to be fast
2573  preparedInput.m_MEtX = -999.;
2574  preparedInput.m_MEtY = -999.;
2575 
2576  ++m_iter0;
2577 
2578  if (m_meanbinToBeEvaluated && m_iterNsuc == 500) {
2579  Info("DiTauMassTools", " in m_meanbinToBeEvaluated && m_iterNsuc==500 ");
2580  // for markov chain m_iterNsuc is the number of *accepted* points, so there
2581  // can be several iterations without any increment of m_iterNsuc. Hence need
2582  // to make sure meanbin is evaluated only once
2583  m_meanbinToBeEvaluated = false;
2584 
2585  // Meanbin stopping criterion
2586  std::vector<double> histInfo(HistInfo::MAXHISTINFO);
2587  // SLIDINGWINDOW strategy to avoid doing the parabola fit now given it will
2588  // not be use
2590  double meanbin = histInfo.at(HistInfo::MEANBIN);
2591  if (meanbin < 0) {
2592  m_nsucStop = -1; // no meaningful meanbin switch back to niter criterion
2593  } else {
2594  double stopdouble = 500 * std::pow((meanbin / m_meanbinStop), 2);
2595  int stopint = stopdouble;
2596  m_nsucStop = stopint;
2597  }
2598  if (m_nsucStop < 500)
2599  return false;
2600  }
2601  // should be outside m_meanbinStop test
2602  if (m_iterNsuc == m_nsucStop)
2603  return false; // Critere d'arret pour nombre de succes
2604 
2605  if (m_iter0 == m_niterRandomLocal)
2606  return false; // for now simple stopping criterion on number of iteration
2607 
2608  // floating stopping criterion, reduces run-time for lh, hh by a factor ~2 and ll by roughly
2609  // factor ~3 check if every scanned variable and resulting mass thermalised after 10k iterations
2610  // and then every 1k iterations do this by checking that the means of the split distributions is
2611  // comparable within 5% of their sigma
2612  if (m_iter0 >= 10000 && (m_iter0 % 1000) == 0 && m_fUseFloatStopping) {
2613  if (std::abs(m_fMEtP_split1->GetMean() - m_fMEtP_split2->GetMean()) <= 0.05 * m_fMEtP_split1->GetRMS()) {
2614  if (std::abs(m_fMEtL_split1->GetMean() - m_fMEtL_split2->GetMean()) <=
2615  0.05 * m_fMEtL_split1->GetRMS()) {
2616  if (std::abs(m_fMnu1_split1->GetMean() - m_fMnu1_split2->GetMean()) <=
2617  0.05 * m_fMnu1_split1->GetRMS()) {
2618  if (std::abs(m_fMnu2_split1->GetMean() - m_fMnu2_split2->GetMean()) <=
2619  0.05 * m_fMnu2_split1->GetRMS()) {
2620  if (std::abs(m_fPhi1_split1->GetMean() - m_fPhi1_split2->GetMean()) <=
2621  0.05 * m_fPhi1_split1->GetRMS()) {
2622  if (std::abs(m_fPhi2_split1->GetMean() - m_fPhi2_split2->GetMean()) <=
2623  0.05 * m_fPhi2_split1->GetRMS()) {
2624  if (std::abs(m_fMmass_split1->GetMean() - m_fMmass_split2->GetMean()) <=
2625  0.05 * m_fMmass_split1->GetRMS()) {
2626  return false;
2627  }
2628  }
2629  }
2630  }
2631  }
2632  }
2633  }
2634  }
2635 
2636  if (m_fullParamSpaceScan) {
2637  // as long as no solution found need to randomise on the full parameter
2638  // space
2639 
2640  // cut the corners in MissingET (not optimised at all)
2641  // not needed if distribution is already gaussian
2642  do {
2643  m_MEtP = m_MEtPMin + m_MEtPRange * m_randomGen.Rndm();
2644  m_MEtL = m_MEtLMin + m_MEtLRange * m_randomGen.Rndm();
2645  } while (!checkMEtInRange());
2646 
2647  if (m_scanMnu1) {
2648  m_Mnu1 = m_Mnu1Min + m_Mnu1Range * m_randomGen.Rndm();
2649  }
2650 
2651  if (m_scanMnu2) {
2652  m_Mnu2 = m_Mnu2Min + m_Mnu2Range * m_randomGen.Rndm();
2653  }
2654 
2655  m_Phi1 = m_Phi1Min + m_Phi1Range * m_randomGen.Rndm();
2656  m_Phi2 = m_Phi2Min + m_Phi2Range * m_randomGen.Rndm();
2657 
2658  return true;
2659  }
2660 
2661  // here the real markov chain takes place : "propose" the new point
2662  // note that if one parameter goes outside range, this should not be fixed
2663  // here but later in handleSolution, otherwise would cause a bias
2664 
2665  // m_MEtP0 etc... also store the position of the previous Markov Chain step,
2666  // which is needed by the algorithm
2667  m_MEtP0 = m_MEtP;
2668  m_MEtL0 = m_MEtL;
2669 
2671 
2673 
2674  if (m_scanMnu1) {
2675  m_Mnu10 = m_Mnu1;
2677  }
2678 
2679  if (m_scanMnu2) {
2680  m_Mnu20 = m_Mnu2;
2682  }
2683 
2684  m_Phi10 = m_Phi1;
2686 
2687  m_Phi20 = m_Phi2;
2688 
2690 
2691  return true;
2692 }
2693 
2694 // compute cached values (this value do not change within one call of MMC,
2695 // except for tau e scanning) return true if cache was already uptodatexs
2697 
2698  // copy tau 4 vect. If tau E scanning, these vectors will be modified
2701 
2702  const XYVector &metVec = preparedInput.m_MetVec;
2703 
2704  bool same = true;
2719 
2720  same = updateDouble(1.777, m_mTau) && same;
2725 
2726  PtEtaPhiMVector Met4vec;
2727  Met4vec.SetPxPyPzE(preparedInput.m_MetVec.X(), preparedInput.m_MetVec.Y(), 0.0,
2728  preparedInput.m_MetVec.R());
2729  same = updateDouble((m_tauVec1 + m_tauVec2 + Met4vec).M(), m_Meff) && same;
2730 
2732  // note that if useHT met_vec is actually -HT
2733  same = updateDouble(metVec.X(), preparedInput.m_inputMEtX) && same;
2734  same = updateDouble(metVec.Y(), preparedInput.m_inputMEtY) && same;
2735  same = updateDouble(metVec.R(), preparedInput.m_inputMEtT) && same;
2736 
2737  return same;
2738 }
2739 
2740 // return true if all parameters are within their domain
2742 
2743  if (m_scanMnu1) {
2744  if (m_Mnu1 < m_Mnu1Min)
2745  return false;
2746  if (m_Mnu1 > m_Mnu1Max)
2747  return false;
2748  if (m_Mnu1 > m_mTau - m_tauVec1M)
2749  return false;
2750  }
2751 
2752  if (m_scanMnu2) {
2753  if (m_Mnu2 < m_Mnu2Min)
2754  return false;
2755  if (m_Mnu2 > m_Mnu2Max)
2756  return false;
2757  if (m_Mnu2 > m_mTau - m_tauVec2M)
2758  return false;
2759  }
2760 
2761  // FIXME note that since there is a coupling between Met and tau, should
2762  // rigorously test both together however since the 3 sigma range is just a
2763  // hack, it is probably OK
2764 
2765  if (m_Phi1 < m_Phi1Min)
2766  return false;
2767  if (m_Phi1 > m_Phi1Max)
2768  return false;
2769 
2770  if (m_Phi2 < m_Phi2Min)
2771  return false;
2772  if (m_Phi2 > m_Phi2Max)
2773  return false;
2774 
2775  if (!checkMEtInRange())
2776  return false;
2777 
2778  return true;
2779 }
2780 
2781 // return true if Met is within disk instead of withing square (cut the corners)
2783  // check MEt is in allowed range
2784  // range is 3sigma disk ("cutting the corners")
2788  return false;
2789  } else {
2790  return true;
2791  }
2792 }
2793 
2794 // ----- returns dTheta3D lower and upper boundaries:
2795 // limit_code=0: 99% lower limit
2796 // limit_code=1; 99% upper limit
2797 // limit_code=2; 95% upper limit
2798 double MissingMassCalculator::dTheta3DLimit(const int &tau_type, const int &limit_code,
2799  const double &P_tau) {
2800 
2801 #ifndef WITHDTHETA3DLIM
2802  // make the test ineffective if desired
2803  if (limit_code == 0)
2804  return 0.;
2805  if (limit_code == 1)
2806  return 10.;
2807  if (limit_code == 2)
2808  return 10.;
2809 #endif
2810 
2811  double limit = 1.0;
2812  if (limit_code == 0)
2813  limit = 0.0;
2814  double par[3] = {0.0, 0.0, 0.0};
2815  // ---- leptonic tau's
2816  if (tau_type == 8) {
2817  if (limit_code == 0) // lower 99% limit
2818  {
2819  par[0] = 0.3342;
2820  par[1] = -0.3376;
2821  par[2] = -0.001377;
2822  }
2823  if (limit_code == 1) // upper 99% limit
2824  {
2825  par[0] = 3.243;
2826  par[1] = -12.87;
2827  par[2] = 0.009656;
2828  }
2829  if (limit_code == 2) // upper 95% limit
2830  {
2831  par[0] = 2.927;
2832  par[1] = -7.911;
2833  par[2] = 0.007783;
2834  }
2835  }
2836  // ---- 1-prong tau's
2837  if (tau_type >= 0 && tau_type <= 2) {
2838  if (limit_code == 0) // lower 99% limit
2839  {
2840  par[0] = 0.2673;
2841  par[1] = -14.8;
2842  par[2] = -0.0004859;
2843  }
2844  if (limit_code == 1) // upper 99% limit
2845  {
2846  par[0] = 9.341;
2847  par[1] = -15.88;
2848  par[2] = 0.0333;
2849  }
2850  if (limit_code == 2) // upper 95% limit
2851  {
2852  par[0] = 6.535;
2853  par[1] = -8.649;
2854  par[2] = 0.00277;
2855  }
2856  }
2857  // ---- 3-prong tau's
2858  if (tau_type >= 3 && tau_type <= 5) {
2859  if (limit_code == 0) // lower 99% limit
2860  {
2861  par[0] = 0.2308;
2862  par[1] = -15.24;
2863  par[2] = -0.0009458;
2864  }
2865  if (limit_code == 1) // upper 99% limit
2866  {
2867  par[0] = 14.58;
2868  par[1] = -6.043;
2869  par[2] = -0.00928;
2870  }
2871  if (limit_code == 2) // upper 95% limit
2872  {
2873  par[0] = 8.233;
2874  par[1] = -0.3018;
2875  par[2] = -0.009399;
2876  }
2877  }
2878 
2879  if (std::abs(P_tau + par[1]) > 0.0)
2880  limit = par[0] / (P_tau + par[1]) + par[2];
2881  if (limit_code == 0) {
2882  if (limit < 0.0) {
2883  limit = 0.0;
2884  } else if (limit > 0.03) {
2885  limit = 0.03;
2886  }
2887  } else {
2888  if (limit < 0.0 || limit > 0.5 * TMath::Pi()) {
2889  limit = 0.5 * TMath::Pi();
2890  } else if (limit < 0.05 && limit > 0.0) {
2891  limit = 0.05; // parameterization only runs up to P~220 GeV in this regime
2892  // will set an upper bound of 0.05
2893  }
2894  }
2895 
2896  return limit;
2897 }
2898 
2899 // checks units of input variables, converts into [GeV] if needed, make all
2900 // possible corrections DR new : now a second structure preparedInput is derived
2901 // from the input one which only has direct user input
2903  const xAOD::IParticle *part2,
2904  const xAOD::MissingET *met,
2905  const int &njets) {
2906  const double GEV = 1000.;
2907  int mmcType1 = mmcType(part1);
2908  if (mmcType1 < 0)
2909  return; // return CP::CorrectionCode::Error;
2910 
2911  int mmcType2 = mmcType(part2);
2912  if (mmcType2 < 0)
2913  return; // return CP::CorrectionCode::Error;
2914 
2915  preparedInput.SetLFVmode(-2); // initialise LFV mode value for this event with being *not* LFV
2916  // if(getLFVMode(part1, part2, mmcType1, mmcType2) ==
2917  // CP::CorrectionCode::Error) {
2919  int LFVMode = getLFVMode(part1, part2, mmcType1, mmcType2);
2920  if (LFVMode == -1) {
2921  return; // return CP::CorrectionCode::Error;
2922  } else if (LFVMode != -2) {
2923  preparedInput.SetLFVmode(LFVMode);
2924  }
2925  }
2926 
2927  // this will be in MeV but MMC allows MeV
2928  // assume the mass is correct as well
2929  PtEtaPhiMVector tlvTau1(part1->pt(), part1->eta(), part1->phi(), part1->m());
2930  PtEtaPhiMVector tlvTau2(part2->pt(), part2->eta(), part2->phi(), part2->m());
2931 
2932  // Convert to GeV. In principle, MMC should cope with MeV but should check
2933  // thoroughly
2934  PtEtaPhiMVector fixedtau1;
2935  fixedtau1.SetCoordinates(tlvTau1.Pt() / GEV, tlvTau1.Eta(), tlvTau1.Phi(), tlvTau1.M() / GEV);
2936  PtEtaPhiMVector fixedtau2;
2937  fixedtau2.SetCoordinates(tlvTau2.Pt() / GEV, tlvTau2.Eta(), tlvTau2.Phi(), tlvTau2.M() / GEV);
2938 
2939  preparedInput.SetVisTauType(0, mmcType1);
2940  preparedInput.SetVisTauType(1, mmcType2);
2941  preparedInput.SetVisTauVec(0, fixedtau1);
2942  preparedInput.SetVisTauVec(1, fixedtau2);
2943 
2944  if (mmcType1 == 8 && mmcType2 == 8) {
2946  } else if (mmcType1 >= 0 && mmcType1 <= 5 && mmcType2 >= 0 && mmcType2 <= 5) {
2948  } else {
2950  }
2952  Info("DiTauMassTools", "%s", ("running for tau types "+std::to_string(preparedInput.m_type_visTau1)+" "+std::to_string(preparedInput.m_type_visTau2)).c_str());
2953  XYVector met_vec(met->mpx() / GEV, met->mpy() / GEV);
2954  preparedInput.SetMetVec(met_vec);
2956  Info("DiTauMassTools", "%s", ("passing SumEt="+std::to_string(met->sumet() / GEV)).c_str());
2957  preparedInput.SetSumEt(met->sumet() / GEV);
2958  preparedInput.SetNjet25(njets);
2959 
2960  // check that the calibration set has been chosen explicitly, otherwise abort
2962  Error("DiTauMassTools", "MMCCalibrationSet has not been set !. Please use "
2963  "fMMC.SetCalibrationSet(MMCCalibrationSet::MMC2019)"
2964  ". Abort now. ");
2965  std::abort();
2966  }
2967  //----------- Re-ordering input info, to make sure there is no dependence of
2968  // results on input order
2969  // this might be needed because a random scan is used
2970  // highest pT tau is always first
2971  preparedInput.m_InputReorder = 0; // set flag to 0 by default, i.e. no re-ordering
2973  preparedInput.m_type_visTau2 == 8) // if hadron-lepton, reorder to have lepton first
2974  {
2976  1; // re-order to be done, this flag is to be checked in DoOutputInfo()
2977  } else if (!((preparedInput.m_type_visTau2 >= 0 && preparedInput.m_type_visTau2 <= 5) &&
2978  preparedInput.m_type_visTau1 == 8)) // if not lep-had nor had lep, reorder if tau1 is
2979  // after tau2 clockwise
2980  {
2981  if (fixPhiRange(preparedInput.m_vistau1.Phi() - preparedInput.m_vistau2.Phi()) > 0) {
2982  preparedInput.m_InputReorder = 1; // re-order to be done, this flag is to be
2983  // checked in DoOutputInfo()
2984  }
2985  }
2986 
2987  if (preparedInput.m_InputReorder == 1) // copy and re-order
2988  {
2992  }
2993  //--------- re-ordering is done ---------------------------------------
2994 
2996  std::abs(Phi_mpi_pi(preparedInput.m_vistau1.Phi() - preparedInput.m_vistau2.Phi()));
2997 
2998  for (unsigned int i = 0; i < preparedInput.m_jet4vecs.size(); i++) {
2999  // correcting sumEt, give priority to SetMetScanParamsUE()
3000  if (preparedInput.m_METScanScheme == 0) {
3001  if ((preparedInput.m_METsigmaP < 0.1 || preparedInput.m_METsigmaL < 0.1) &&
3003  preparedInput.m_jet4vecs[i].Pt() > 20.0) {
3004  if (preparedInput.m_fUseVerbose == 1) {
3005  Info("DiTauMassTools", "correcting sumET");
3006  }
3008  }
3009  }
3010  }
3011 
3012  // give priority to SetVisTauType, only do this if type_visTau1 and
3013  // type_visTau2 are not set
3014  /*if(type_visTau1<0 && type_visTau2<0 && Nprong_tau1>-1 && Nprong_tau2>-1)
3015  {
3016  if(Nprong_tau1==0) type_visTau1 = 8; // leptonic tau
3017  else if( Nprong_tau1==1) type_visTau1 = 0; // set to 1p0n for now, may use
3018 different solution later like explicit integer for this case that pantau info is
3019 not available? else if( Nprong_tau1==3) type_visTau1 = 3; // set to 3p0n for
3020 now, see above if(Nprong_tau2==0) type_visTau2 = 8; // leptonic tau else if(
3021 Nprong_tau2==1) type_visTau2 = 0; // set to 1p0n for now, see above else if(
3022 Nprong_tau2==3) type_visTau2=3; // set to 3p0n for now, see above
3023  }
3024  */
3025  // checking input mass of hadronic tau-1
3026  // one prong
3027  // // checking input mass of hadronic tau-1
3028  // DRMERGE LFV addition
3031  preparedInput.m_vistau1.M() != 1.1) {
3033  preparedInput.m_vistau1.Phi(), 1.1);
3034  }
3036  preparedInput.m_vistau1.M() != 1.35) {
3038  preparedInput.m_vistau1.Phi(), 1.35);
3039  }
3040  // checking input mass of hadronic tau-2
3042  preparedInput.m_vistau2.M() != 1.1) {
3044  preparedInput.m_vistau2.Phi(), 1.1);
3045  }
3047  preparedInput.m_vistau2.M() != 1.35) {
3049  preparedInput.m_vistau2.Phi(), 1.35);
3050  }
3051  } else {
3052  // DRMERGE end LFV addition
3054  preparedInput.m_vistau1.M() != 0.8) {
3056  preparedInput.m_vistau1.Phi(), 0.8);
3057  }
3058  // 3 prong
3060  preparedInput.m_vistau1.M() != 1.2) {
3062  preparedInput.m_vistau1.Phi(), 1.2);
3063  }
3064  // checking input mass of hadronic tau-2
3065  // one prong
3067  preparedInput.m_vistau2.M() != 0.8) {
3069  preparedInput.m_vistau2.Phi(), 0.8);
3070  }
3071  // 3 prong
3073  preparedInput.m_vistau2.M() != 1.2) {
3075  preparedInput.m_vistau2.Phi(), 1.2);
3076  }
3077  } // DRDRMERGE LFV else closing
3078 
3079  // correcting sumEt for electron pt, give priority to SetMetScanParamsUE()
3080  // DR20150615 in tag 00-00-11 and before. The following was done before the
3081  // mass of the hadronic tau was set which mean that sumEt was wrongly
3082  // corrected for the hadronic tau pt if the hadronic tau mass was set to zero
3083  // Sasha 08/12/15: don't do electron Pt subtraction for high mass studies; in
3084  // the future, need to check if lepton Pt needs to be subtracted for both ele
3085  // and muon
3086  if (preparedInput.m_METsigmaP < 0.1 || preparedInput.m_METsigmaL < 0.1) {
3087 
3088  // T. Davidek: hack for lep-lep -- subtract lepton pT both for muon and
3089  // electron
3092  preparedInput.m_vistau1.M() < 0.12 && preparedInput.m_vistau2.M() < 0.12) { // lep-lep channel
3097  } else {
3098  // continue with the original code
3101  if (preparedInput.m_fUseVerbose == 1) {
3102  Info("DiTauMassTools", "Substracting pt1 from sumEt");
3103  }
3105  }
3108  if (preparedInput.m_fUseVerbose == 1) {
3109  Info("DiTauMassTools", "Substracting pt2 from sumEt");
3110  }
3112  }
3113  }
3114  }
3115 
3116  // controling TauProbability settings for UPGRADE studies
3119  if ((preparedInput.m_vistau1.M() < 0.12 && preparedInput.m_vistau2.M() > 0.12) ||
3120  (preparedInput.m_vistau2.M() < 0.12 && preparedInput.m_vistau1.M() > 0.12)) {
3121  Prob->SetUseTauProbability(true); // lep-had case
3122  }
3123  if (preparedInput.m_vistau1.M() > 0.12 && preparedInput.m_vistau2.M() > 0.12) {
3124  Prob->SetUseTauProbability(false); // had-had case
3125  }
3126  }
3127 
3128  // change Beam Energy for different running conditions
3130 
3131  //--------------------- pre-set defaults for Run-2. To disable pre-set
3132  // defaults set fUseDefaults=0
3133  if (preparedInput.m_fUseDefaults == 1) {
3135  SetNsigmaMETscan_ll(4.0);
3136  SetNsigmaMETscan_lh(4.0);
3137  SetNsigmaMETscan_hh(4.0);
3139  if ((preparedInput.m_vistau1.M() < 0.12 && preparedInput.m_vistau2.M() > 0.12) ||
3140  (preparedInput.m_vistau2.M() < 0.12 && preparedInput.m_vistau1.M() > 0.12))
3141  Prob->SetUseTauProbability(false); // lep-had
3143  Prob->SetUseTauProbability(true); // had-had
3144  Prob->SetUseMnuProbability(false);
3145  }
3146  }
3147 
3148  // compute HTOffset if relevant
3149  if (Prob->GetUseHT()) // use missing Ht for Njet25=0 events
3150  {
3151  // dPhi(l-t) dependence of misHt-trueMET
3152  double HtOffset = 0.;
3153  // proper for hh
3155  // hh
3156  double x = preparedInput.m_DelPhiTT;
3157  HtOffset = 87.5 - 27.0 * x;
3158  }
3159 
3160  preparedInput.m_HtOffset = HtOffset;
3161 
3162  // if use HT, replace MET with HT
3164  preparedInput.m_MHtSigma2; // sigma of 2nd Gaussian for missing Ht resolution
3166 
3167  PtEtaPhiMVector tauSum = preparedInput.m_vistau1 + preparedInput.m_vistau2;
3168  preparedInput.m_MetVec.SetXY(-tauSum.Px(), -tauSum.Py()); // WARNING this replace metvec by -mht
3169  }
3170 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
DiTauMassTools::MissingMassCalculator::DitauStuff::Mditau_best
double Mditau_best
Definition: MissingMassCalculator.h:54
DiTauMassTools::MissingMassCalculator::m_Phi1
double m_Phi1
Definition: MissingMassCalculator.h:139
DiTauMassTools::MissingMassProb::SetUseDphiLL
void SetUseDphiLL(bool val)
Definition: MissingMassProb.h:57
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
DiTauMassTools::MissingMassCalculator::m_fFitting
TF1 * m_fFitting
Definition: MissingMassCalculator.h:229
DiTauMassTools::MissingMassCalculator::NuPsolutionLFV
int NuPsolutionLFV(const XYVector &met_vec, const PtEtaPhiMVector &tau, const double &m_nu, std::vector< PtEtaPhiMVector > &nu_vec)
Definition: MissingMassCalculator.cxx:831
DiTauMassTools::MissingMassCalculator::m_fMnu1_split2
std::shared_ptr< TH1F > m_fMnu1_split2
Definition: MissingMassCalculator.h:224
DiTauMassTools::MissingMassCalculator::m_testdiscri2
int m_testdiscri2
Definition: MissingMassCalculator.h:113
DiTauMassTools::MissingMassCalculator::m_eTau2
double m_eTau2
Definition: MissingMassCalculator.h:140
DiTauMassTools::MissingMassProb::setParamAngle
void setParamAngle(const PtEtaPhiMVector &tauvec, int tau, int tautype)
Definition: MissingMassProb.cxx:155
DiTauMassTools::TauTypes::lh
@ lh
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:53
DiTauMassTools::MissingMassCalculator::m_tautau_tmp
PtEtaPhiMVector m_tautau_tmp
Definition: MissingMassCalculator.h:88
DiTauMassTools::MissingMassCalculator::m_switch2
bool m_switch2
Definition: MissingMassCalculator.h:118
DiTauMassTools::MissingMassCalculator::m_nuvecsol1
std::vector< PtEtaPhiMVector > m_nuvecsol1
Definition: MissingMassCalculator.h:77
DiTauMassTools::MaxHistStrategy::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:30
DiTauMassTools::MissingMassCalculator::SpaceWalkerInit
void SpaceWalkerInit()
Definition: MissingMassCalculator.cxx:2392
DiTauMassTools::MissingMassCalculator::m_MEtPMax
double m_MEtPMax
Definition: MissingMassCalculator.h:144
DiTauMassTools::MissingMassCalculator::m_fMnu2_split2
std::shared_ptr< TH1F > m_fMnu2_split2
Definition: MissingMassCalculator.h:225
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
max
#define max(a, b)
Definition: cfImp.cxx:41
DiTauMassTools::MissingMassCalculator::precomputeCache
bool precomputeCache()
Definition: MissingMassCalculator.cxx:2696
DiTauMassTools::MissingMassCalculator::m_MEtL0
double m_MEtL0
Definition: MissingMassCalculator.h:142
DiTauMassTools::MissingMassCalculator::NuPsolutionV3
int NuPsolutionV3(const double &mNu1, const double &mNu2, const double &phi1, const double &phi2, int &nsol1, int &nsol2)
Definition: MissingMassCalculator.cxx:626
DiTauMassTools::MissingMassCalculator::DitauStuff::nutau1
PtEtaPhiMVector nutau1
Definition: MissingMassCalculator.h:56
DiTauMassTools::MMCFitMethod::MAX
@ MAX
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:46
DiTauMassTools::MMCCalibrationSet::MMC2015HIGHMASS
@ MMC2015HIGHMASS
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:40
DiTauMassTools::MissingMassCalculator::m_ProposalTryPhi
double m_ProposalTryPhi
Definition: MissingMassCalculator.h:133
DiTauMassTools::MissingMassProb::GetUseTauProbability
bool GetUseTauProbability()
Definition: MissingMassProb.h:52
DiTauMassTools::MissingMassCalculator::m_nosol2
int m_nosol2
Definition: MissingMassCalculator.h:115
DiTauMassTools::TauTypes::hh
@ hh
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:53
DiTauMassTools::MissingMassCalculator::m_E2v1
double m_E2v1
Definition: MissingMassCalculator.h:187
DiTauMassTools::MissingMassCalculator::m_fMnu2_all
std::shared_ptr< TH1F > m_fMnu2_all
Definition: MissingMassCalculator.h:200
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
DiTauMassTools::MissingMassCalculator::m_fDitauStuffHisto
DitauStuff m_fDitauStuffHisto
Definition: MissingMassCalculator.h:245
DiTauMassTools::MissingMassCalculator::m_iter5
int m_iter5
Definition: MissingMassCalculator.h:96
DiTauMassTools::MissingMassCalculator::m_tauvecprob1
std::vector< double > m_tauvecprob1
Definition: MissingMassCalculator.h:82
DiTauMassTools::MissingMassCalculator::m_PrintmMaxError
double m_PrintmMaxError
Definition: MissingMassCalculator.h:128
DiTauMassTools::MissingMassCalculator::m_m2Nu1
double m_m2Nu1
Definition: MissingMassCalculator.h:183
DiTauMassTools::MMCCalibrationSet::name
const std::string name[MAXMMCCALIBRATIONSET]
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:41
DiTauMassTools::MissingMassInput::m_METsigmaP
double m_METsigmaP
Definition: MissingMassInput.h:62
DiTauMassTools::MissingMassCalculator::m_Ev2
double m_Ev2
Definition: MissingMassCalculator.h:189
DiTauMassTools::MissingMassCalculator::m_Phi2Max
double m_Phi2Max
Definition: MissingMassCalculator.h:144
DiTauMassTools::MissingMassCalculator::m_tauVec2Phi
double m_tauVec2Phi
Definition: MissingMassCalculator.h:176
DiTauMassTools::MissingMassCalculator::m_fMEtL_split1
std::shared_ptr< TH1F > m_fMEtL_split1
Definition: MissingMassCalculator.h:216
DiTauMassTools::MissingMassInput::m_METScanScheme
int m_METScanScheme
Definition: MissingMassInput.h:74
DiTauMassTools::MissingMassCalculator::m_fPhi2_split1
std::shared_ptr< TH1F > m_fPhi2_split1
Definition: MissingMassCalculator.h:220
DiTauMassTools::MissingMassCalculator::m_lfvLeplepRefit
bool m_lfvLeplepRefit
Definition: MissingMassCalculator.h:90
DiTauMassTools::MissingMassCalculator::refineSolutions
int refineSolutions(const double &M_nu1, const double &M_nu2, const int nsol1, const int nsol2, const double &Mvis, const double &Meff)
Definition: MissingMassCalculator.cxx:1897
DiTauMassTools::MMCFitMethod::MLM
@ MLM
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:46
DMTest::P
P_v1 P
Definition: P.h:23
DiTauMassTools::MissingMassCalculator::m_metCovPhiCos
double m_metCovPhiCos
Definition: MissingMassCalculator.h:148
DiTauMassTools::MissingMassCalculator::m_eventNumber
int m_eventNumber
Definition: MissingMassCalculator.h:104
met::DeltaR
@ DeltaR
Definition: METRecoCommon.h:11
DiTauMassTools::MissingMassInput::m_metVec
XYVector m_metVec
Definition: MissingMassInput.h:79
DiTauMassTools::MissingMassCalculator::DitauMassCalculatorV9lfv
int DitauMassCalculatorV9lfv(bool refit)
Definition: MissingMassCalculator.cxx:1090
DiTauMassTools::MissingMassProb::MET
void MET(MissingMassInput &preparedInput)
Definition: MissingMassProb.cxx:1160
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
DiTauMassTools::MissingMassCalculator::m_niter_fit2
int m_niter_fit2
Definition: MissingMassCalculator.h:248
DiTauMassTools::MissingMassCalculator::m_tauVec1
PtEtaPhiMVector m_tauVec1
Definition: MissingMassCalculator.h:175
DiTauMassTools::MissingMassCalculator::DitauStuff::vistau2
PtEtaPhiMVector vistau2
Definition: MissingMassCalculator.h:59
DiTauMassTools::MissingMassInput::m_inputMEtT
double m_inputMEtT
Definition: MissingMassInput.h:81
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
DiTauMassTools::MissingMassCalculator::m_nsolOld
int m_nsolOld
Definition: MissingMassCalculator.h:155
DiTauMassTools::MissingMassCalculator::m_Mvis
double m_Mvis
Definition: MissingMassCalculator.h:191
DiTauMassTools::MissingMassProb::SetUseMnuProbability
void SetUseMnuProbability(bool val)
Definition: MissingMassProb.h:54
DiTauMassTools::MissingMassCalculator::PrintOtherInput
void PrintOtherInput()
Definition: MissingMassCalculator.cxx:479
DiTauMassTools::MissingMassInput::m_METsigmaL
double m_METsigmaL
Definition: MissingMassInput.h:63
DiTauMassTools::MissingMassCalculator::m_PhiProposal
double m_PhiProposal
Definition: MissingMassCalculator.h:147
DiTauMassTools::MissingMassCalculator::m_fPYfit2
std::shared_ptr< TH1F > m_fPYfit2
Definition: MissingMassCalculator.h:210
DiTauMassTools::MissingMassCalculator::m_fPhi1_all
std::shared_ptr< TH1F > m_fPhi1_all
Definition: MissingMassCalculator.h:201
DiTauMassTools::MissingMassCalculator::DitauStuff::vistau1
PtEtaPhiMVector vistau1
Definition: MissingMassCalculator.h:58
DiTauMassTools::MissingMassCalculator::m_Phi2
double m_Phi2
Definition: MissingMassCalculator.h:139
DiTauMassTools::MissingMassOutput::m_FittedMass
double m_FittedMass[MMCFitMethod::MAX]
Definition: MissingMassOutput.h:54
DiTauMassTools::MissingMassCalculator::m_meanbinToBeEvaluated
bool m_meanbinToBeEvaluated
Definition: MissingMassCalculator.h:120
DiTauMassTools::MissingMassCalculator::m_tauVec2
PtEtaPhiMVector m_tauVec2
Definition: MissingMassCalculator.h:175
DiTauMassTools::MissingMassCalculator::m_fPXfit2
std::shared_ptr< TH1F > m_fPXfit2
Definition: MissingMassCalculator.h:209
DiTauMassTools::MissingMassCalculator::m_nsigma_METscan_lfv_ll
double m_nsigma_METscan_lfv_ll
Definition: MissingMassCalculator.h:94
DiTauMassTools::MissingMassInput::m_vistau1
PtEtaPhiMVector m_vistau1
Definition: MissingMassInput.h:54
DiTauMassTools::MissingMassCalculator::m_ET2v2
double m_ET2v2
Definition: MissingMassCalculator.h:186
DiTauMassTools::MissingMassOutput::m_FitSignificance
double m_FitSignificance[MMCFitMethod::MAX]
Definition: MissingMassOutput.h:53
DiTauMassTools::MissingMassCalculator::m_MEtLMin
double m_MEtLMin
Definition: MissingMassCalculator.h:143
DiTauMassTools::MissingMassCalculator::m_mmcCalibrationSet
MMCCalibrationSet::e m_mmcCalibrationSet
Definition: MissingMassCalculator.h:65
DiTauMassTools::MissingMassCalculator::m_niterRandomLocal
int m_niterRandomLocal
Definition: MissingMassCalculator.h:71
DiTauMassTools::MissingMassCalculator::m_nsigma_METscan_hh
double m_nsigma_METscan_hh
Definition: MissingMassCalculator.h:94
DiTauMassTools::MissingMassCalculator::m_iang1low
int m_iang1low
Definition: MissingMassCalculator.h:96
DiTauMassTools::MissingMassCalculator::m_MEtP0
double m_MEtP0
Definition: MissingMassCalculator.h:142
DiTauMassTools::MissingMassCalculator::MissingMassCalculator
MissingMassCalculator(MMCCalibrationSet::e aset, std::string m_paramFilePath)
Definition: MissingMassCalculator.cxx:41
DiTauMassTools::MissingMassInput::SetLFVmode
void SetLFVmode(int val)
Definition: MissingMassInput.h:47
DiTauMassTools::MissingMassCalculator::m_fullParamSpaceScan
bool m_fullParamSpaceScan
Definition: MissingMassCalculator.h:153
DiTauMassTools::MissingMassOutput::m_FittedMassLowerError
double m_FittedMassLowerError[MMCFitMethod::MAX]
Definition: MissingMassOutput.h:56
DiTauMassTools::MissingMassCalculator::m_Mnu2Max
double m_Mnu2Max
Definition: MissingMassCalculator.h:144
DiTauMassTools::MissingMassCalculator::m_Phi20
double m_Phi20
Definition: MissingMassCalculator.h:142
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
DiTauMassTools::MissingMassCalculator::m_tauVec1M
double m_tauVec1M
Definition: MissingMassCalculator.h:177
DiTauMassTools::HistInfo::TANTHETA
@ TANTHETA
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:35
DiTauMassTools::MissingMassCalculator::m_cosPhi2
double m_cosPhi2
Definition: MissingMassCalculator.h:171
plotBeamSpotVxVal.sumw
int sumw
Definition: plotBeamSpotVxVal.py:236
DiTauMassTools::MissingMassCalculator::m_nsigma_METscan2
double m_nsigma_METscan2
Definition: MissingMassCalculator.h:94
DiTauMassTools::MissingMassOutput::m_hMfit_all
std::shared_ptr< TH1F > m_hMfit_all
Definition: MissingMassOutput.h:64
DiTauMassTools::MissingMassCalculator::m_MEtP
double m_MEtP
Definition: MissingMassCalculator.h:139
DiTauMassTools::MaxHistStrategy::MAXBINWINDOW
@ MAXBINWINDOW
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:30
DiTauMassTools::MissingMassCalculator::m_tauVec2Py
double m_tauVec2Py
Definition: MissingMassCalculator.h:179
DiTauMassTools::HistInfo::MEANBIN
@ MEANBIN
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:35
DiTauMassTools::MMCFitMethod::name
const std::string name[MAX]
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:47
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
DiTauMassTools::MissingMassCalculator::m_iterNuPV3
int m_iterNuPV3
Definition: MissingMassCalculator.h:109
covarianceTool.prob
prob
Definition: covarianceTool.py:678
DiTauMassTools::MissingMassCalculator::m_nsucStop
int m_nsucStop
Definition: MissingMassCalculator.h:72
Phi_mpi_pi
__HOSTDEV__ double Phi_mpi_pi(double)
Definition: GeoRegion.cxx:7
python.TrigEgammaFastCaloHypoTool.same
def same(val, tool)
Definition: TrigEgammaFastCaloHypoTool.py:12
x
#define x
DiTauMassTools::MissingMassCalculator::m_fMEtP_split1
std::shared_ptr< TH1F > m_fMEtP_split1
Definition: MissingMassCalculator.h:215
DiTauMassTools::MissingMassCalculator::m_mTau2
double m_mTau2
Definition: MissingMassCalculator.h:138
DiTauMassTools::MissingMassCalculator::m_fMnu2_split1
std::shared_ptr< TH1F > m_fMnu2_split1
Definition: MissingMassCalculator.h:218
DiTauMassTools::MMCCalibrationSet::LFVMMC2012
@ LFVMMC2012
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:40
DiTauMassTools::MissingMassCalculator::m_fMEtP_all
std::shared_ptr< TH1F > m_fMEtP_all
Definition: MissingMassCalculator.h:197
DiTauMassTools::MissingMassCalculator::maxFitting
Double_t maxFitting(Double_t *x, Double_t *par)
Definition: MissingMassCalculator.cxx:1575
DiTauMassTools::MissingMassCalculator::SetNsigmaMETscan_ll
void SetNsigmaMETscan_ll(const double val)
Definition: MissingMassCalculator.h:385
DiTauMassTools::MissingMassCalculator::m_fUseFloatStopping
bool m_fUseFloatStopping
Definition: MissingMassCalculator.h:68
binWidth
void binWidth(TH1 *h)
Definition: listroot.cxx:80
DiTauMassTools::MissingMassCalculator::m_Mnu2
double m_Mnu2
Definition: MissingMassCalculator.h:139
DiTauMassTools::MissingMassCalculator::m_nsigma_METscan_lh
double m_nsigma_METscan_lh
Definition: MissingMassCalculator.h:94
DiTauMassTools::MissingMassCalculator::m_walkWeight
double m_walkWeight
Definition: MissingMassCalculator.h:170
DiTauMassTools::MissingMassCalculator::m_MEtPMin
double m_MEtPMin
Definition: MissingMassCalculator.h:143
DiTauMassTools::MissingMassCalculator::m_ET2v1
double m_ET2v1
Definition: MissingMassCalculator.h:185
DiTauMassTools::MissingMassCalculator::m_Mnu20
double m_Mnu20
Definition: MissingMassCalculator.h:142
DiTauMassTools::MissingMassCalculator::m_debugThisIteration
bool m_debugThisIteration
Definition: MissingMassCalculator.h:90
DiTauMassTools::fastSinCos
void fastSinCos(const double &phi, double &sinPhi, double &cosPhi)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/Root/HelperFunctions.cxx:42
DiTauMassTools::MissingMassOutput::m_hMfit_allNoWeight
std::shared_ptr< TH1F > m_hMfit_allNoWeight
Definition: MissingMassOutput.h:65
DiTauMassTools::MissingMassCalculator::m_fPZfit1
std::shared_ptr< TH1F > m_fPZfit1
Definition: MissingMassCalculator.h:208
DiTauMassTools::updateDouble
bool updateDouble(const double in, double &out)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/Root/HelperFunctions.cxx:75
DiTauMassTools::MissingMassInput::m_METcovphi
double m_METcovphi
Definition: MissingMassInput.h:61
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
xAOD::EgammaParameters::deltaPhi1
@ deltaPhi1
difference between the cluster eta (1st sampling) and the eta of the track extrapolated to the 1st sa...
Definition: EgammaEnums.h:196
DiTauMassTools::MissingMassCalculator::m_markovNRejectNoSol
int m_markovNRejectNoSol
Definition: MissingMassCalculator.h:124
DiTauMassTools::MissingMassCalculator::m_fMEtL_split2
std::shared_ptr< TH1F > m_fMEtL_split2
Definition: MissingMassCalculator.h:223
DiTauMassTools::MissingMassInput::SetVisTauVec
void SetVisTauVec(int i, const PtEtaPhiMVector &vec)
Definition: MissingMassInput.cxx:123
DiTauMassTools::MissingMassInput::m_tauTypes
TauTypes::e m_tauTypes
Definition: MissingMassInput.h:85
DiTauMassTools::MissingMassCalculator::m_Mnu2Min
double m_Mnu2Min
Definition: MissingMassCalculator.h:143
DiTauMassTools::MissingMassCalculator::SpaceWalkerWalk
bool SpaceWalkerWalk()
Definition: MissingMassCalculator.cxx:2572
DiTauMassTools::MissingMassCalculator::m_Mnu1Range
double m_Mnu1Range
Definition: MissingMassCalculator.h:146
DiTauMassTools::HistInfo::MAXHISTINFO
@ MAXHISTINFO
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:35
DiTauMassTools::HistInfo::PROB
@ PROB
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:35
DiTauMassTools::MissingMassProb::apply
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)
Definition: MissingMassProb.cxx:534
DiTauMassTools::MissingMassCalculator::m_ProposalTryMnu
double m_ProposalTryMnu
Definition: MissingMassCalculator.h:134
part1
Definition: part1.py:1
DiTauMassTools
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:24
DiTauMassTools::MissingMassCalculator::m_nsigma_METscan_ll
double m_nsigma_METscan_ll
Definition: MissingMassCalculator.h:94
DiTauMassTools::MissingMassCalculator::m_fPXfit1
std::shared_ptr< TH1F > m_fPXfit1
Definition: MissingMassCalculator.h:206
DiTauMassTools::MissingMassCalculator::m_fMnu1_all
std::shared_ptr< TH1F > m_fMnu1_all
Definition: MissingMassCalculator.h:199
DiTauMassTools::MissingMassCalculator::m_fPhi1_split2
std::shared_ptr< TH1F > m_fPhi1_split2
Definition: MissingMassCalculator.h:226
DiTauMassTools::MissingMassCalculator::m_Mnu10
double m_Mnu10
Definition: MissingMassCalculator.h:142
DiTauMassTools::MaxDelPhi
double MaxDelPhi(int tau_type, double Pvis, double dRmax_tau)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/Root/HelperFunctions.cxx:15
DiTauMassTools::MissingMassCalculator::m_switch1
bool m_switch1
Definition: MissingMassCalculator.h:117
met
Definition: IMETSignificance.h:24
DiTauMassTools::MissingMassCalculator::m_fMEtP_split2
std::shared_ptr< TH1F > m_fMEtP_split2
Definition: MissingMassCalculator.h:222
DiTauMassTools::MissingMassCalculator::m_Phi10
double m_Phi10
Definition: MissingMassCalculator.h:142
DiTauMassTools::MissingMassCalculator::m_nuvecsol2
std::vector< PtEtaPhiMVector > m_nuvecsol2
Definition: MissingMassCalculator.h:78
DiTauMassTools::MissingMassCalculator::m_nCallprobCalculatorV9fast
int m_nCallprobCalculatorV9fast
Definition: MissingMassCalculator.h:92
DiTauMassTools::MissingMassCalculator::m_Mnu1
double m_Mnu1
Definition: MissingMassCalculator.h:139
DiTauMassTools::MissingMassCalculator::preparedInput
MissingMassInput preparedInput
Definition: MissingMassCalculator.h:335
DiTauMassTools::MissingMassInput::m_htOffset
double m_htOffset
Definition: MissingMassInput.h:83
DiTauMassTools::MissingMassCalculator::m_Phi2Min
double m_Phi2Min
Definition: MissingMassCalculator.h:143
DiTauMassTools::MissingMassInput::m_SumEt
double m_SumEt
Definition: MissingMassInput.h:64
doubleTestComp.j1
j1
Definition: doubleTestComp.py:21
DiTauMassTools::MissingMassProb::MnuProbability
double MnuProbability(MissingMassInput &preparedInput, double mnu, double binsize)
Definition: MissingMassProb.cxx:939
DiTauMassTools::MissingMassCalculator::FinalizeSettings
void FinalizeSettings(const xAOD::IParticle *part1, const xAOD::IParticle *part2, const xAOD::MissingET *met, const int &njets)
Definition: MissingMassCalculator.cxx:2902
TrigVtx::gamma
@ gamma
Definition: TrigParticleTable.h:26
DiTauMassTools::MissingMassCalculator::m_fMnu1_split1
std::shared_ptr< TH1F > m_fMnu1_split1
Definition: MissingMassCalculator.h:217
DiTauMassTools::MissingMassInput::m_Nprong_tau2
int m_Nprong_tau2
Definition: MissingMassInput.h:59
DiTauMassTools::MissingMassCalculator::m_nu1FinalSolOldVec
std::vector< PtEtaPhiMVector > m_nu1FinalSolOldVec
Definition: MissingMassCalculator.h:158
DiTauMassTools::MissingMassCalculator::m_Ev1
double m_Ev1
Definition: MissingMassCalculator.h:190
ParseInputs.gDirectory
gDirectory
Definition: Final2012/ParseInputs.py:133
lumiFormat.i
int i
Definition: lumiFormat.py:85
DiTauMassTools::MaxHistStrategy::MAXBIN
@ MAXBIN
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:30
DiTauMassTools::MissingMassInput::m_MHtSigma2
double m_MHtSigma2
Definition: MissingMassInput.h:69
DiTauMassTools::MissingMassCalculator::m_MnuScanRange
double m_MnuScanRange
Definition: MissingMassCalculator.h:259
DiTauMassTools::MissingMassCalculator::m_tauVec1Pz
double m_tauVec1Pz
Definition: MissingMassCalculator.h:178
DiTauMassTools::MissingMassCalculator::m_ProposalTryEtau
double m_ProposalTryEtau
Definition: MissingMassCalculator.h:135
DiTauMassTools::MissingMassOutput::ClearOutput
void ClearOutput(bool fUseVerbose)
Definition: MissingMassOutput.cxx:24
DiTauMassTools::MissingMassCalculator::DitauStuff::nutau2
PtEtaPhiMVector nutau2
Definition: MissingMassCalculator.h:57
DiTauMassTools::MissingMassCalculator::~MissingMassCalculator
~MissingMassCalculator()
Definition: MissingMassCalculator.cxx:269
DiTauMassTools::MissingMassCalculator::m_PrintmInvWidth2Error
double m_PrintmInvWidth2Error
Definition: MissingMassCalculator.h:130
DiTauMassTools::MissingMassCalculator::m_niter_fit3
int m_niter_fit3
Definition: MissingMassCalculator.h:249
DiTauMassTools::MissingMassInput::m_MEtT
double m_MEtT
Definition: MissingMassInput.h:82
DiTauMassTools::MissingMassCalculator::m_fMfit_all
std::shared_ptr< TH1F > m_fMfit_all
Definition: MissingMassCalculator.h:196
DiTauMassTools::getLFVMode
int getLFVMode(const xAOD::IParticle *p1, const xAOD::IParticle *p2, int mmcType1, int mmcType2)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/Root/HelperFunctions.cxx:83
DiTauMassTools::MissingMassCalculator::m_seed
int m_seed
Definition: MissingMassCalculator.h:105
DiTauMassTools::MissingMassInput::m_Nprong_tau1
int m_Nprong_tau1
Definition: MissingMassInput.h:58
DiTauMassTools::MissingMassCalculator::m_tauVec2P
double m_tauVec2P
Definition: MissingMassCalculator.h:180
DiTauMassTools::MissingMassCalculator::probCalculatorV9fast
int probCalculatorV9fast(const double &phi1, const double &phi2, const double &M_nu1, const double &M_nu2)
Definition: MissingMassCalculator.cxx:1871
DiTauMassTools::MissingMassCalculator::m_Phi1Max
double m_Phi1Max
Definition: MissingMassCalculator.h:144
DiTauMassTools::MMCCalibrationSet::MMC2019
@ MMC2019
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:40
DiTauMassTools::MissingMassCalculator::m_tauVec1Phi
double m_tauVec1Phi
Definition: MissingMassCalculator.h:176
xAOD::MissingET_v1
Principal data object for Missing ET.
Definition: MissingET_v1.h:25
DiTauMassTools::MissingMassProb::dTheta3d_probabilityFast
double dTheta3d_probabilityFast(MissingMassInput &preparedInput, const int &tau_type, const double &dTheta3d, const double &P_tau)
Definition: MissingMassProb.cxx:1036
DiTauMassTools::MissingMassCalculator::m_tauVec1E
double m_tauVec1E
Definition: MissingMassCalculator.h:181
DiTauMassTools::MissingMassProb::GetUseHT
bool GetUseHT()
Definition: MissingMassProb.h:49
DiTauMassTools::MaxHistStrategy::FIT
@ FIT
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:30
DiTauMassTools::MissingMassCalculator::m_randomGen
TRandom2 m_randomGen
Definition: MissingMassCalculator.h:63
DiTauMassTools::MissingMassCalculator::m_scanMnu2
bool m_scanMnu2
Definition: MissingMassCalculator.h:173
GEV
#define GEV
Definition: PrintPhotonSF.cxx:24
MissingMassCalculator.h
DiTauMassTools::MissingMassInput::SetNjet25
void SetNjet25(int val)
Definition: MissingMassInput.cxx:107
DiTauMassTools::MissingMassCalculator::SetNsigmaMETscan_hh
void SetNsigmaMETscan_hh(const double val)
Definition: MissingMassCalculator.h:387
DiTauMassTools::MissingMassCalculator::m_nsigma_METscan
double m_nsigma_METscan
Definition: MissingMassCalculator.h:94
DiTauMassTools::MMCCalibrationSet::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:40
DiTauMassTools::MissingMassProb::GetUseMnuProbability
bool GetUseMnuProbability()
Definition: MissingMassProb.h:55
DiTauMassTools::MissingMassCalculator::DitauMassCalculatorV9walk
int DitauMassCalculatorV9walk()
Definition: MissingMassCalculator.cxx:868
DiTauMassTools::MissingMassOutput::m_NSolutions
int m_NSolutions
Definition: MissingMassOutput.h:68
DiTauMassTools::MaxHistStrategy::SLIDINGWINDOW
@ SLIDINGWINDOW
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:30
DiTauMassTools::MissingMassCalculator::m_tauVec2M
double m_tauVec2M
Definition: MissingMassCalculator.h:177
DiTauMassTools::MissingMassInput::m_dataType
int m_dataType
Definition: MissingMassInput.h:60
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
DiTauMassTools::mmcType
int mmcType(const xAOD::IParticle *part)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/Root/HelperFunctions.cxx:140
DiTauMassTools::MissingMassCalculator::m_nsol
int m_nsol
Definition: MissingMassCalculator.h:161
DiTauMassTools::MissingMassInput::m_fUseVerbose
bool m_fUseVerbose
Definition: MissingMassInput.h:78
DiTauMassTools::MissingMassCalculator::m_reRunWithBestMET
bool m_reRunWithBestMET
Definition: MissingMassCalculator.h:192
DiTauMassTools::MissingMassCalculator::m_sinPhi2
double m_sinPhi2
Definition: MissingMassCalculator.h:171
DiTauMassTools::MissingMassCalculator::m_iter4
int m_iter4
Definition: MissingMassCalculator.h:96
DiTauMassTools::MissingMassCalculator::m_scanMnu1
bool m_scanMnu1
Definition: MissingMassCalculator.h:173
ReadTripsProbsFromCool.denominator
denominator
Definition: ReadTripsProbsFromCool.py:96
DiTauMassTools::MissingMassCalculator::m_beamEnergy
double m_beamEnergy
Definition: MissingMassCalculator.h:94
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
DiTauMassTools::MissingMassCalculator::checkAllParamInRange
bool checkAllParamInRange()
Definition: MissingMassCalculator.cxx:2741
DiTauMassTools::MissingMassOutput::m_objvec2
PtEtaPhiMVector m_objvec2[MMCFitMethod::MAX]
Definition: MissingMassOutput.h:60
DiTauMassTools::MissingMassCalculator::m_fMfit_allNoWeight
std::shared_ptr< TH1F > m_fMfit_allNoWeight
Definition: MissingMassCalculator.h:204
DiTauMassTools::MissingMassCalculator::m_mtautauSum
double m_mtautauSum
Definition: MissingMassCalculator.h:102
DiTauMassTools::MissingMassOutput::m_RMS2MPV
double m_RMS2MPV
Definition: MissingMassOutput.h:63
DiTauMassTools::MissingMassCalculator::m_markovNRejectMetropolis
int m_markovNRejectMetropolis
Definition: MissingMassCalculator.h:125
DiTauMassTools::MissingMassCalculator::m_eTau1Max
double m_eTau1Max
Definition: MissingMassCalculator.h:151
DiTauMassTools::MissingMassCalculator::checkMEtInRange
bool checkMEtInRange()
Definition: MissingMassCalculator.cxx:2782
DiTauMassTools::MissingMassCalculator::m_fPhi2_all
std::shared_ptr< TH1F > m_fPhi2_all
Definition: MissingMassCalculator.h:202
DiTauMassTools::MissingMassOutput::m_objvec1
PtEtaPhiMVector m_objvec1[MMCFitMethod::MAX]
Definition: MissingMassOutput.h:58
DiTauMassTools::MissingMassCalculator::m_fMmass_split1
std::shared_ptr< TH1F > m_fMmass_split1
Definition: MissingMassCalculator.h:214
DiTauMassTools::MissingMassCalculator::m_iterTheta3d
int m_iterTheta3d
Definition: MissingMassCalculator.h:97
DiTauMassTools::MissingMassInput::m_HtOffset
double m_HtOffset
Definition: MissingMassInput.h:71
part2
Definition: part2.py:1
DiTauMassTools::MissingMassCalculator::m_dRmax_tau
double m_dRmax_tau
Definition: MissingMassCalculator.h:257
DiTauMassTools::MissingMassCalculator::m_nsigma_METscan_lfv_lh
double m_nsigma_METscan_lfv_lh
Definition: MissingMassCalculator.h:94
DiTauMassTools::MissingMassProb::setParamRatio
void setParamRatio(int tau, int tautype)
Definition: MissingMassProb.cxx:184
DiTauMassTools::MissingMassCalculator::m_nsolmax
int m_nsolmax
Definition: MissingMassCalculator.h:70
min
#define min(a, b)
Definition: cfImp.cxx:40
DiTauMassTools::MissingMassCalculator::m_markovNFullScan
int m_markovNFullScan
Definition: MissingMassCalculator.h:123
DiTauMassTools::MissingMassCalculator::m_markovNAccept
int m_markovNAccept
Definition: MissingMassCalculator.h:126
DQPostProcessTest.outFile
outFile
Comment Out Those You do not wish to run.
Definition: DQPostProcessTest.py:37
DiTauMassTools::MissingMassCalculator::m_testdiscri1
int m_testdiscri1
Definition: MissingMassCalculator.h:112
DiTauMassTools::MissingMassCalculator::m_iter3
int m_iter3
Definition: MissingMassCalculator.h:96
DiTauMassTools::MissingMassCalculator::DitauStuff::RMSoverMPV
double RMSoverMPV
Definition: MissingMassCalculator.h:60
DiTauMassTools::MissingMassCalculator::m_Phi2Range
double m_Phi2Range
Definition: MissingMassCalculator.h:146
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
DiTauMassTools::MissingMassOutput::m_NSuccesses
int m_NSuccesses
Definition: MissingMassOutput.h:67
DiTauMassTools::MissingMassCalculator::m_Phi1Range
double m_Phi1Range
Definition: MissingMassCalculator.h:146
DiTauMassTools::MissingMassCalculator::RunMissingMassCalculator
int RunMissingMassCalculator(const xAOD::IParticle *part1, const xAOD::IParticle *part2, const xAOD::MissingET *met, const int &njets)
Definition: MissingMassCalculator.cxx:273
DiTauMassTools::MissingMassCalculator::m_tauVec2Px
double m_tauVec2Px
Definition: MissingMassCalculator.h:179
DiTauMassTools::HistInfo::RMS
@ RMS
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:35
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::MissingMassCalculator::m_nu1FinalSolVec
std::vector< PtEtaPhiMVector > m_nu1FinalSolVec
Definition: MissingMassCalculator.h:164
DiTauMassTools::MissingMassCalculator::m_fPZfit2
std::shared_ptr< TH1F > m_fPZfit2
Definition: MissingMassCalculator.h:211
DiTauMassTools::MissingMassCalculator::m_niter_fit1
int m_niter_fit1
Definition: MissingMassCalculator.h:247
DiTauMassTools::MissingMassCalculator::DitauStuff
Definition: MissingMassCalculator.h:53
DiTauMassTools::MissingMassProb::MetProbability
double MetProbability(MissingMassInput &preparedInput, const double &met1, const double &met2, const double &MetSigma1, const double &MetSigma2)
Definition: MissingMassProb.cxx:553
DiTauMassTools::MissingMassOutput::m_FittedMassUpperError
double m_FittedMassUpperError[MMCFitMethod::MAX]
Definition: MissingMassOutput.h:55
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
DiTauMassTools::MissingMassInput::m_DelPhiTT
double m_DelPhiTT
Definition: MissingMassInput.h:67
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
DiTauMassTools::MissingMassCalculator::m_eTau2Max
double m_eTau2Max
Definition: MissingMassCalculator.h:152
DiTauMassTools::MissingMassCalculator::m_proposalTryMEt
double m_proposalTryMEt
Definition: MissingMassCalculator.h:132
DiTauMassTools::MissingMassCalculator::m_probFinalSolOldVec
std::vector< double > m_probFinalSolOldVec
Definition: MissingMassCalculator.h:156
DiTauMassTools::MissingMassCalculator::m_tauvecsol1
std::vector< PtEtaPhiMVector > m_tauvecsol1
Definition: MissingMassCalculator.h:80
DiTauMassTools::MissingMassInput::PrintInputInfo
void PrintInputInfo()
Definition: MissingMassInput.cxx:58
DiTauMassTools::MissingMassCalculator::m_mtautauFinalSolOldVec
std::vector< double > m_mtautauFinalSolOldVec
Definition: MissingMassCalculator.h:157
DiTauMassTools::MissingMassProb::SetUseTauProbability
void SetUseTauProbability(bool val)
Definition: MissingMassProb.h:51
DiTauMassTools::MissingMassOutput::m_AveSolRMS
double m_AveSolRMS
Definition: MissingMassOutput.h:70
DiTauMassTools::MissingMassCalculator::m_tauVec1P
double m_tauVec1P
Definition: MissingMassCalculator.h:180
DiTauMassTools::MissingMassCalculator::m_eTau2Min
double m_eTau2Min
Definition: MissingMassCalculator.h:152
DiTauMassTools::MissingMassCalculator::m_fMfit_allGraph
std::shared_ptr< TGraph > m_fMfit_allGraph
Definition: MissingMassCalculator.h:203
xAOD::EgammaParameters::deltaPhi2
@ deltaPhi2
difference between the cluster phi (second sampling) and the phi of the track extrapolated to the sec...
Definition: EgammaEnums.h:204
DiTauMassTools::MissingMassCalculator::m_iter0
int m_iter0
Definition: MissingMassCalculator.h:108
DiTauMassTools::MissingMassCalculator::m_fPhi1_split1
std::shared_ptr< TH1F > m_fPhi1_split1
Definition: MissingMassCalculator.h:219
DiTauMassTools::MissingMassCalculator::TailCleanUp
int TailCleanUp(const PtEtaPhiMVector &vis1, const PtEtaPhiMVector &nu1, const PtEtaPhiMVector &vis2, const PtEtaPhiMVector &nu2, const double &mmc_mass, const double &vis_mass, const double &eff_mass, const double &dphiTT)
Definition: MissingMassCalculator.cxx:2068
DiTauMassTools::MissingMassCalculator::m_iang1high
int m_iang1high
Definition: MissingMassCalculator.h:96
DiTauMassTools::fixPhiRange
double fixPhiRange(const double &phi)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/Root/HelperFunctions.cxx:21
DiTauMassTools::MissingMassCalculator::m_tauVec2Pz
double m_tauVec2Pz
Definition: MissingMassCalculator.h:179
DiTauMassTools::MissingMassCalculator::DitauStuff::Sign_best
double Sign_best
Definition: MissingMassCalculator.h:55
DiTauMassTools::MissingMassInput::m_fUseTailCleanup
bool m_fUseTailCleanup
Definition: MissingMassInput.h:77
DiTauMassTools::HistInfo::INTEGRAL
@ INTEGRAL
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:35
DiTauMassTools::MissingMassCalculator::m_MnuProposal
double m_MnuProposal
Definition: MissingMassCalculator.h:147
DiTauMassTools::MissingMassCalculator::m_fPhi2_split2
std::shared_ptr< TH1F > m_fPhi2_split2
Definition: MissingMassCalculator.h:227
DiTauMassTools::MissingMassOutput::m_nuvec1
PtEtaPhiMVector m_nuvec1[MMCFitMethod::MAX]
Definition: MissingMassOutput.h:57
DiTauMassTools::MissingMassCalculator::maxFromHist
double maxFromHist(TH1F *theHist, std::vector< double > &histInfo, const MaxHistStrategy::e maxHistStrategy=MaxHistStrategy::FIT, const int winHalfWidth=2, bool debug=false)
Definition: MissingMassCalculator.cxx:1595
DiTauMassTools::MissingMassCalculator::metvec_tmp
XYVector metvec_tmp
Definition: MissingMassCalculator.h:413
DiTauMassTools::MissingMassOutput::m_FittedMetVec
XYVector m_FittedMetVec[MMCFitMethod::MAX]
Definition: MissingMassOutput.h:62
DiTauMassTools::MissingMassCalculator::DoOutputInfo
void DoOutputInfo()
Definition: MissingMassCalculator.cxx:382
DiTauMassTools::MissingMassCalculator::m_RMSStop
int m_RMSStop
Definition: MissingMassCalculator.h:252
DiTauMassTools::MissingMassCalculator::m_NsucStop
int m_NsucStop
Definition: MissingMassCalculator.h:251
DiTauMassTools::MissingMassOutput::m_nuvec2
PtEtaPhiMVector m_nuvec2[MMCFitMethod::MAX]
Definition: MissingMassOutput.h:59
DiTauMassTools::MissingMassCalculator::m_eTau1Min
double m_eTau1Min
Definition: MissingMassCalculator.h:151
DiTauMassTools::MissingMassCalculator::m_testptn2
int m_testptn2
Definition: MissingMassCalculator.h:111
DiTauMassTools::HistInfo::DISCRI
@ DISCRI
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:35
DiTauMassTools::MissingMassCalculator::SetNsigmaMETscan_lh
void SetNsigmaMETscan_lh(const double val)
Definition: MissingMassCalculator.h:386
DiTauMassTools::MissingMassInput::m_MEtX
double m_MEtX
Definition: MissingMassInput.h:82
DiTauMassTools::MissingMassInput::m_vistau2
PtEtaPhiMVector m_vistau2
Definition: MissingMassInput.h:55
DiTauMassTools::MissingMassInput::SetVisTauType
void SetVisTauType(int i, int tautype)
Definition: MissingMassInput.cxx:117
DiTauMassTools::MissingMassCalculator::m_iter1
int m_iter1
Definition: MissingMassCalculator.h:96
DiTauMassTools::MissingMassCalculator::m_fUseEfficiencyRecovery
bool m_fUseEfficiencyRecovery
Definition: MissingMassCalculator.h:67
DiTauMassTools::MissingMassCalculator::m_MEtL
double m_MEtL
Definition: MissingMassCalculator.h:139
DiTauMassTools::MissingMassCalculator::m_NiterRandom
int m_NiterRandom
Definition: MissingMassCalculator.h:250
DiTauMassTools::MissingMassProb
Definition: MissingMassProb.h:28
DiTauMassTools::MissingMassCalculator::m_MEtPRange
double m_MEtPRange
Definition: MissingMassCalculator.h:146
DiTauMassTools::MissingMassOutput::m_NTrials
int m_NTrials
Definition: MissingMassOutput.h:66
DiTauMassTools::MissingMassCalculator::m_eTau1
double m_eTau1
Definition: MissingMassCalculator.h:140
DiTauMassTools::MissingMassInput::m_MEtY
double m_MEtY
Definition: MissingMassInput.h:82
DiTauMassTools::MissingMassCalculator::m_dTheta3d_binMin
double m_dTheta3d_binMin
Definition: MissingMassCalculator.h:255
DiTauMassTools::MissingMassCalculator::m_MEtProposal
double m_MEtProposal
Definition: MissingMassCalculator.h:147
DiTauMassTools::MissingMassCalculator::m_MEtLRange
double m_MEtLRange
Definition: MissingMassCalculator.h:146
DiTauMassTools::MissingMassCalculator::m_iterNsuc
int m_iterNsuc
Definition: MissingMassCalculator.h:116
a
TList * a
Definition: liststreamerinfos.cxx:10
DiTauMassTools::MissingMassInput::ClearInput
void ClearInput()
Definition: MissingMassInput.cxx:24
DiTauMassTools::MissingMassProb::setParamNuMass
void setParamNuMass()
Definition: MissingMassProb.cxx:147
DiTauMassTools::MMCFitMethod::MAXW
@ MAXW
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:46
DiTauMassTools::MissingMassProb::TauProbabilityLFV
double TauProbabilityLFV(MissingMassInput &preparedInput, const int &type1, const PtEtaPhiMVector &vis1, const PtEtaPhiMVector &nu1)
Definition: MissingMassProb.cxx:614
DiTauMassTools::MissingMassInput::m_inputMEtX
double m_inputMEtX
Definition: MissingMassInput.h:81
DiTauMassTools::MissingMassOutput::m_FitStatus
int m_FitStatus
Definition: MissingMassOutput.h:52
DiTauMassTools::MissingMassCalculator::m_eTau20
double m_eTau20
Definition: MissingMassCalculator.h:141
DiTauMassTools::MissingMassCalculator::m_fPYfit1
std::shared_ptr< TH1F > m_fPYfit1
Definition: MissingMassCalculator.h:207
DiTauMassTools::MissingMassCalculator::m_markovCountDuplicate
int m_markovCountDuplicate
Definition: MissingMassCalculator.h:122
DiTauMassTools::MMCFitMethod::MLNU3P
@ MLNU3P
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:46
DiTauMassTools::MMCCalibrationSet::MAXMMCCALIBRATIONSET
@ MAXMMCCALIBRATIONSET
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:40
DiTauMassTools::HistInfo::FITLENGTH
@ FITLENGTH
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:35
DiTauMassTools::HistInfo::RMSVSDISCRI
@ RMSVSDISCRI
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:35
DiTauMassTools::MissingMassCalculator::m_Mnu1Min
double m_Mnu1Min
Definition: MissingMassCalculator.h:143
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::MMCCalibrationSet::MMC2016MC15C
@ MMC2016MC15C
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:40
DiTauMassTools::MissingMassCalculator::m_rmsStop
int m_rmsStop
Definition: MissingMassCalculator.h:73
DiTauMassTools::MissingMassInput::m_METresSyst
int m_METresSyst
Definition: MissingMassInput.h:75
DiTauMassTools::MissingMassCalculator::m_tauVec1Px
double m_tauVec1Px
Definition: MissingMassCalculator.h:178
DiTauMassTools::MissingMassCalculator::handleSolutions
void handleSolutions()
Definition: MissingMassCalculator.cxx:2123
DiTauMassTools::MissingMassCalculator::m_SaveLlhHisto
bool m_SaveLlhHisto
Definition: MissingMassCalculator.h:90
DiTauMassTools::MissingMassCalculator::m_m2Nu2
double m_m2Nu2
Definition: MissingMassCalculator.h:184
DiTauMassTools::MissingMassCalculator::m_RndmSeedAltering
int m_RndmSeedAltering
Definition: MissingMassCalculator.h:253
DiTauMassTools::MissingMassInput::m_InputReorder
int m_InputReorder
Definition: MissingMassInput.h:73
DiTauMassTools::MissingMassOutput::m_totalvec
PtEtaPhiMVector m_totalvec[MMCFitMethod::MAX]
Definition: MissingMassOutput.h:61
DiTauMassTools::MissingMassCalculator::m_iter2
int m_iter2
Definition: MissingMassCalculator.h:96
DiTauMassTools::HistInfo::TANTHETAW
@ TANTHETAW
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:35
DiTauMassTools::MissingMassOutput::m_SumW
double m_SumW
Definition: MissingMassOutput.h:69
DiTauMassTools::MissingMassCalculator::m_nu2FinalSolVec
std::vector< PtEtaPhiMVector > m_nu2FinalSolVec
Definition: MissingMassCalculator.h:165
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
DiTauMassTools::MissingMassCalculator::m_probFinalSolVec
std::vector< double > m_probFinalSolVec
Definition: MissingMassCalculator.h:162
DiTauMassTools::MissingMassCalculator::m_Phi1Min
double m_Phi1Min
Definition: MissingMassCalculator.h:143
DiTauMassTools::MissingMassInput::m_beamEnergy
double m_beamEnergy
Definition: MissingMassInput.h:72
DiTauMassTools::MissingMassCalculator::m_meanbinStop
double m_meanbinStop
Definition: MissingMassCalculator.h:74
DiTauMassTools::MissingMassCalculator::m_mtautauFinalSolVec
std::vector< double > m_mtautauFinalSolVec
Definition: MissingMassCalculator.h:163
DiTauMassTools::MMCCalibrationSet::UPGRADE
@ UPGRADE
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:40
DiTauMassTools::MissingMassCalculator::m_fMmass_split2
std::shared_ptr< TH1F > m_fMmass_split2
Definition: MissingMassCalculator.h:221
DiTauMassTools::MissingMassCalculator::m_PrintmMeanError
double m_PrintmMeanError
Definition: MissingMassCalculator.h:129
DiTauMassTools::MissingMassCalculator::m_totalProbSum
double m_totalProbSum
Definition: MissingMassCalculator.h:101
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
DiTauMassTools::MissingMassCalculator::m_MEtLMax
double m_MEtLMax
Definition: MissingMassCalculator.h:144
DiTauMassTools::MissingMassCalculator::m_dTheta3d_binMax
double m_dTheta3d_binMax
Definition: MissingMassCalculator.h:256
DiTauMassTools::MissingMassInput::SetMetVec
void SetMetVec(const XYVector &vec)
Definition: MissingMassInput.cxx:130
MuonParameters::beta
@ beta
Definition: MuonParamDefs.h:144
DiTauMassTools::MissingMassInput::m_fUseDefaults
bool m_fUseDefaults
Definition: MissingMassInput.h:76
DiTauMassTools::MissingMassCalculator::m_tauvecprob2
std::vector< double > m_tauvecprob2
Definition: MissingMassCalculator.h:83
DiTauMassTools::MissingMassInput::SetSumEt
void SetSumEt(double sumEt)
Definition: MissingMassInput.cxx:112
DiTauMassTools::MissingMassCalculator::m_testptn1
int m_testptn1
Definition: MissingMassCalculator.h:110
DiTauMassTools::Angle
double Angle(const VectorType1 &vec1, const VectorType2 &vec2)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:61
DiTauMassTools::HistInfo::CHI2
@ CHI2
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:35
DiTauMassTools::MissingMassCalculator::m_cosPhi1
double m_cosPhi1
Definition: MissingMassCalculator.h:171
DiTauMassTools::MissingMassCalculator::m_nsolfinalmax
int m_nsolfinalmax
Definition: MissingMassCalculator.h:70
DiTauMassTools::MissingMassCalculator::PrintResults
void PrintResults()
Definition: MissingMassCalculator.cxx:521
python.compressB64.c
def c
Definition: compressB64.py:93
updateCoolNtuple.limit
int limit
Definition: updateCoolNtuple.py:45
DiTauMassTools::MissingMassCalculator::m_prob_tmp
double m_prob_tmp
Definition: MissingMassCalculator.h:99
DiTauMassTools::MissingMassInput::m_inputMEtY
double m_inputMEtY
Definition: MissingMassInput.h:81
DiTauMassTools::MissingMassCalculator::m_sinPhi1
double m_sinPhi1
Definition: MissingMassCalculator.h:171
DiTauMassTools::MissingMassCalculator::m_Mnu2Range
double m_Mnu2Range
Definition: MissingMassCalculator.h:146
DiTauMassTools::MissingMassCalculator::m_tauvecsol2
std::vector< PtEtaPhiMVector > m_tauvecsol2
Definition: MissingMassCalculator.h:81
DiTauMassTools::MissingMassCalculator::dTheta3DLimit
double dTheta3DLimit(const int &tau_type, const int &limit_code, const double &P_tau)
Definition: MissingMassCalculator.cxx:2798
DiTauMassTools::MissingMassCalculator::m_Mnu1Max
double m_Mnu1Max
Definition: MissingMassCalculator.h:144
DiTauMassTools::MissingMassCalculator::m_metCovPhiSin
double m_metCovPhiSin
Definition: MissingMassCalculator.h:148
doubleTestComp.j2
j2
Definition: doubleTestComp.py:22
DiTauMassTools::MissingMassInput::m_LFVmode
int m_LFVmode
Definition: MissingMassInput.h:84
DiTauMassTools::MissingMassCalculator::OutputInfo
MissingMassOutput OutputInfo
Definition: MissingMassCalculator.h:336
DiTauMassTools::MissingMassCalculator::m_Meff
double m_Meff
Definition: MissingMassCalculator.h:191
DiTauMassTools::MissingMassCalculator::m_nu2FinalSolOldVec
std::vector< PtEtaPhiMVector > m_nu2FinalSolOldVec
Definition: MissingMassCalculator.h:159
DiTauMassTools::MissingMassCalculator::Prob
MissingMassProb * Prob
Definition: MissingMassCalculator.h:337
DiTauMassTools::MissingMassCalculator::m_tauVec1Py
double m_tauVec1Py
Definition: MissingMassCalculator.h:178
DiTauMassTools::MissingMassCalculator::m_mTau
double m_mTau
Definition: MissingMassCalculator.h:138
DiTauMassTools::MissingMassCalculator::m_eTau10
double m_eTau10
Definition: MissingMassCalculator.h:141
DiTauMassTools::MissingMassCalculator::m_fDitauStuffFit
DitauStuff m_fDitauStuffFit
Definition: MissingMassCalculator.h:244
DiTauMassTools::MissingMassCalculator::m_tauVec2E
double m_tauVec2E
Definition: MissingMassCalculator.h:182
DiTauMassTools::TauTypes::ll
@ ll
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:53
DiTauMassTools::MissingMassCalculator::m_E2v2
double m_E2v2
Definition: MissingMassCalculator.h:188
DiTauMassTools::MissingMassCalculator::ClearDitauStuff
void ClearDitauStuff(DitauStuff &fStuff)
Definition: MissingMassCalculator.cxx:367
DiTauMassTools::MissingMassCalculator::m_nosol1
int m_nosol1
Definition: MissingMassCalculator.h:114
DiTauMassTools::MissingMassCalculator::m_fMEtL_all
std::shared_ptr< TH1F > m_fMEtL_all
Definition: MissingMassCalculator.h:198