MINT2
Histo_BW.h
Go to the documentation of this file.
1 #ifndef HISTO_BW_LINESHAPE_HH
2 #define HISTO_BW_LINESHAPE_HH
3 // author: Philippe d'Argent (p.dargent@cern.ch)
4 // status: 19 March 2015 GMT
5 #include <complex>
6 
7 #include "TH1D.h"
8 #include "TFile.h"
9 
10 #include "Mint/ILineshape.h"
11 #include "Mint/BW_BW.h"
12 #include "Mint/NamedParameter.h"
15 #include "Mint/FitParDependent.h"
17 #include "ResonanceProperties.h"
18 
19 using namespace MINT;
20 using namespace std;
21 
22 class Histo_BW : public BW_BW, virtual public ILineshape
23 {
24  public:
25  Histo_BW( const AssociatedDecayTree& tree, const std::string& namePrefix )
26  : BW_BW(tree, namePrefix)
27  , _runningMassHist(0)
28  , _runningWidthHist(0)
29  {
30  if( !std::getenv("MINT2") ){
31  std::cout
32  << "ERROR: Mint2 environment variable not set."
33  << " Energy-dependent mass/width histograms cannot be found."
34  << std::endl;
35  exit(1);
36  }
37 
38  const std::string hist_path =
39  static_cast<std::string>(std::getenv("MINT2"))+"/share/";
40 
41  NamedParameter<string> fileNameMass(("RunningMass_"+ namePrefix+ (BW_BW::resonanceProperties()->nameFromPid(abs(mumsPID())))),(hist_path+"running_mass/"+"RunningMass_"+ (BW_BW::resonanceProperties()->nameFromPid(abs(mumsPID()))) + ".root"));
42  NamedParameter<string> fileNameWidth(("RunningWidth_"+ namePrefix + (BW_BW::resonanceProperties()->nameFromPid(abs(mumsPID())))),(hist_path+"running_width/"+"RunningWidth_"+ (BW_BW::resonanceProperties()->nameFromPid(abs(mumsPID()))) + ".root"));
43 
44  TFile* const f_m = TFile::Open(((string)fileNameMass).c_str());
45  _runningMassHist = get_mass_histo(f_m, "RunningMass");
46  TFile* const f_w = TFile::Open(((string)fileNameWidth).c_str());
47  _runningWidthHist = get_width_histo(f_w, "RunningWidth");
48  }
49 
50  virtual ~Histo_BW(){}
51 
52  virtual std::string name() const
53  { return "Histo_BW("+prefix()+_theDecay.oneLiner() +")"; }
54 
55  protected:
58  double runningMass2();
59  virtual double GofM();
60  virtual std::complex<double> BreitWigner();
61  TH1D* get_width_histo(TFile* f, const std::string& hname);
62  TH1D* get_mass_histo(TFile* f, const std::string& hname);
63 
64  TH1D* producePhaseSpaceHist();
65 };
66 
67 #endif //HISTO_BW_LINESHAPE_HH
virtual std::string name() const
Definition: Histo_BW.h:52
TH1D * _runningMassHist
Definition: Histo_BW.h:56
Definition: BW_BW.h:30
TH1D * _runningWidthHist
Definition: Histo_BW.h:57
Histo_BW(const AssociatedDecayTree &tree, const std::string &namePrefix)
Definition: Histo_BW.h:25
virtual ~Histo_BW()
Definition: Histo_BW.h:50
const ResonanceProperties * resonanceProperties() const
Definition: BW_BW.cpp:403