Belle II Software  release-08-01-10
InvariantMassBhadStandAlone.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 
11 #include <framework/geometry/B2Vector3.h>
12 #include <vector>
13 #include <tuple>
14 #include <Eigen/Dense>
15 
16 //If compiled within BASF2
17 #ifdef _PACKAGE_
18 #include <tracking/calibration/Splitter.h>
19 #else
20 #include <Splitter.h>
21 #endif
22 
23 namespace Belle2::InvariantMassBhadCalib {
24 
25  static const double realNaN = std::numeric_limits<double>::quiet_NaN();
26  static const B2Vector3D vecNaN(realNaN, realNaN, realNaN);
27 
28 
30  struct Candidate {
31  double pBcms = realNaN;
32  double mB = realNaN;
33  int pdg = 0;
34  int mode = -1;
35  double Kpid = realNaN;
36  double R2 = realNaN;
37  double mD = realNaN;
38  double dmDstar = realNaN;
39 
40  bool isSig = false;
41  };
42 
43 
44 
46  struct Event {
47 
48  int exp = -1;
49  int run = -1;
50  int evtNo = -1;
51  double t = realNaN;
52 
53 
54  std::vector<Candidate> cand = {};
55 
56 
57  int nBootStrap = 1;
58  };
59 
60 
61 
62 
63 
65  std::vector<Event> getEvents(TTree* tr);
66 
67 
69  std::vector<std::vector<double>> doBhadFit(const std::vector<Event>& evts, std::vector<std::pair<double, double>> limits,
70  std::vector<std::pair<double, double>> mumuVals, const std::vector<double>& startPars);
71 
73  std::vector<double> doBhadOnlyFit(const std::vector<Event>& evts, const std::vector<std::pair<double, double>>& limits);
74 
75 
81  std::tuple<std::vector<Eigen::VectorXd>, std::vector<Eigen::MatrixXd>, Eigen::MatrixXd> runInvariantMassAnalysis(
82  std::vector<Event> evts,
83  const std::vector<double>& splitPoints);
84 
85 }
static const double realNaN
constant for double NaN
B2Vector3< double > B2Vector3D
typedef for common usage with double
Definition: B2Vector3.h:516
structure containing variables relevant to the B-candidate
int mode
integer code identifying the decay channel, -1 is dummy value
double dmDstar
reconstructed mass difference between Dstar and D
int pdg
PDG code of the signal B-meson, 0 for dummy value.
double R2
R2 continuum suppression variable.
bool isSig
isSignal flag (for applying selections)
double mD
reconstructed mass of the D meson
structure containing variables relevant for the hadronic B decays
int nBootStrap
bootstap weight, 1 -> data without bootstrapping
std::vector< Candidate > cand
vector of B meson candidates