ProfLike.h
Go to the documentation of this file.
1 #ifndef _MdLDFFinderAG_ProfLike_h_
2 #define _MdLDFFinderAG_ProfLike_h_
3 
14 #include "LikeFCN.h"
15 #include <Minuit2/MnUserParameters.h>
16 #include <vector>
17 #include <utility>
18 #include <utl/Trace.h>
19 
20 
21 namespace MdLDFFinderAG {
22 
23  class ProfLike {
24 
25  static const double kInitError; // error in the initial parameters
26 
27  static const double satLikeLimit;
28  // max. value of the likelihood of a saturated window to start using the large mu approximation
29 
30  static const double kMuPoissonApprox; // use the Poisson approximation to the likelihood if mu is lower than this value
31 
32  public:
33  ProfLike(const unsigned int, const utl::TraceUI&);
34 
35  double operator()(const double mu) const;
36 
37  double operator()(const double* const mup, const double* const) const { return this->operator()(*mup); }
38  // used to draw a 2 window likelihood with ROOT
39 
40  // Get the inverse of the likelihood in the range [xmin,xmax]
41  // using a numerical minimization
42  double Inverse(const double y, const double xmin, const double xmax) const;
43 
44  // Get the maximum likelihood estimator
45  double GetMLE() const;
46 
47  // Get the (assymetric) error bars
48  double GetErrorHigh() const;
49  double GetErrorLow() const;
50 
51  // Get the low limit to the number of muons such as -logL(mu_min)=0.5
52  // this method even works for a saturated likelihood!
53  double GetLowLimit() const;
54 
55  private:
56  unsigned int fNumberSegments; // number of segments
57 
58  SegmentsOnMulti fSegmentsOnMulti; // holds the number of segments on and their multiplicity
59 
60  unsigned int fMaxSegments; // maximum number of segments on in a time window
61 
62  unsigned int fMaxMultiplicity; // multiplicity of fMaxSegments
63 
64  // Methods to build the minimisation seed
65  ROOT::Minuit2::MnUserParameters SetSeed(const double mu) const;
66  ROOT::Minuit2::MnUserParameters SetMnUserParameters(const std::vector<double>&) const;
67 
68  double GlobalMin() const; // Calculate the global minimum of the likelihood
69  double Like1(const double mu, const unsigned int k) const; // single time window likelihood
70 
71  unsigned int GetTotalSegmentsOn() const; // Calculate the number of on segments considering their multiplicity
72 
73  // The the 1-sigma low limit to the number of muons for an unsaturated detector
74  double GetLowLimitUnsaturated() const;
75 
76  };
77 
78 }
79 
80 
81 #endif
static const double kInitError
Definition: ProfLike.h:25
ROOT::Minuit2::MnUserParameters SetSeed(const double mu) const
Definition: ProfLike.cc:103
double GetErrorLow() const
Definition: ProfLike.cc:360
double GetLowLimit() const
Definition: ProfLike.cc:415
static const double kMuPoissonApprox
Definition: ProfLike.h:30
static const double satLikeLimit
Definition: ProfLike.h:27
ProfLike(const unsigned int, const utl::TraceUI &)
Definition: ProfLike.cc:37
double GetErrorHigh() const
Definition: ProfLike.cc:339
double GetMLE() const
Definition: ProfLike.cc:307
unsigned int fMaxSegments
Definition: ProfLike.h:60
unsigned int fNumberSegments
Definition: ProfLike.h:56
double Like1(const double mu, const unsigned int k) const
Definition: ProfLike.cc:283
double operator()(const double mu) const
Definition: ProfLike.cc:154
ROOT::Minuit2::MnUserParameters SetMnUserParameters(const std::vector< double > &) const
Definition: ProfLike.cc:133
Template class for a FADC data or calibrated data container. Use the typedefs (TraceD, TraceI, etc.) defined in Trace-fwd.h.
Definition: Trace-fwd.h:19
unsigned int GetTotalSegmentsOn() const
Definition: ProfLike.cc:395
double operator()(const double *const mup, const double *const) const
Definition: ProfLike.h:37
unsigned int fMaxMultiplicity
Definition: ProfLike.h:62
std::vector< std::pair< unsigned int, unsigned int > > SegmentsOnMulti
Definition: LikeFCN.h:21
double GlobalMin() const
Definition: ProfLike.cc:83
double GetLowLimitUnsaturated() const
Definition: ProfLike.cc:371
SegmentsOnMulti fSegmentsOnMulti
Definition: ProfLike.h:58
double Inverse(const double y, const double xmin, const double xmax) const
Definition: ProfLike.cc:329

, generated on Tue Sep 26 2023.