MINT2
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Histo_BW Class Reference

#include <Histo_BW.h>

Inheritance diagram for Histo_BW:
BW_BW ILineshape ILineshape MINT::FitParDependent MINT::IFitParDependent MINT::IFitParDependent MINT::IFitParRegister MINT::PolymorphVector< FitParRef > MINT::IFitParDependent

Public Member Functions

 Histo_BW (const AssociatedDecayTree &tree, const std::string &namePrefix)
 
virtual ~Histo_BW ()
 
virtual std::string name () const
 
- Public Member Functions inherited from BW_BW
virtual double prSq () const
 
virtual double prSqForGofM () const
 
virtual double pABSq ()
 
virtual double prSqMax () const
 
 BW_BW (const AssociatedDecayTree &decay, const std::string &lineshapePrefix="", MINT::MinuitParameterSet *mps=0)
 
 BW_BW (const BW_BW &other)
 
virtual ~BW_BW ()
 
virtual std::complex< double > getVal (IDalitzEvent &evt)
 
virtual void print (IDalitzEvent &evt, std::ostream &out=std::cout)
 
virtual void print (std::ostream &out=std::cout) const
 
virtual DalitzCoordinate getDalitzCoordinate (double nSigma=3) const
 
virtual MINT::counted_ptr< IGenFctgeneratingFunction () const
 
virtual void setGenerationLimits (double mi, double ma)
 
virtual int twoLPlusOne () const
 
virtual std::complex< double > EvtGenValue (IDalitzEvent &evt)
 
- Public Member Functions inherited from ILineshape
virtual ~ILineshape ()
 
- Public Member Functions inherited from MINT::FitParDependent
virtual unsigned int size () const
 
virtual const FitParRefoperator[] (unsigned int i) const
 
virtual FitParRefoperator[] (unsigned int i)
 
virtual bool changedSinceLastCall () const
 
virtual void rememberFitParValues ()
 
virtual bool registerFitParDependence (const IFitParDependent &fpd)
 
bool registerFitParDependence (const FitParRef &fpr)
 
void removeAllFitParDependencies ()
 
 FitParDependent (IFitParRegister *daddy=0)
 
 FitParDependent (const FitParDependent &other, IFitParRegister *newDaddy=0)
 
void listFitParDependencies (std::ostream &os=std::cout) const
 
- Public Member Functions inherited from MINT::PolymorphVector< FitParRef >
 PolymorphVector ()
 
 PolymorphVector (unsigned int N)
 
 PolymorphVector (unsigned int N, const FitParRef &c)
 
 PolymorphVector (const PolymorphVector &other)
 
 PolymorphVector (const typename std::vector< FitParRef > &other)
 
virtual ~PolymorphVector ()
 
std::vector< FitParRef > & theVector ()
 
const std::vector< FitParRef > & theVector () const
 
FitParRefoperator[] (unsigned int i)
 
const FitParRefoperator[] (unsigned int i) const
 
FitParRefat (unsigned int i)
 
const FitParRefat (unsigned int i) const
 
std::vector< FitParRef >::iterator begin ()
 
std::vector< FitParRef >::const_iterator begin () const
 
std::vector< FitParRef >::iterator end ()
 
std::vector< FitParRef >::const_iterator end () const
 
std::vector< FitParRef >::iterator find (const FitParRef &c)
 
std::vector< FitParRef >::const_iterator find (const FitParRef &c) const
 
FitParReffront ()
 
const FitParReffront () const
 
FitParRefback ()
 
const FitParRefback () const
 
unsigned int size () const
 
bool empty () const
 
void push_back (const FitParRef &c)
 
void pop_back ()
 
void erase (typename std::vector< FitParRef >::iterator pos)
 
void erase (typename std::vector< FitParRef >::iterator first, typename std::vector< FitParRef >::iterator last)
 
PolymorphVector< FitParRef > & operator= (const PolymorphVector< FitParRef > &other)
 
void clear ()
 
void resize (unsigned int N)
 
void resize (unsigned int N, const FitParRef &c)
 
 operator const typename std::vector< FitParRef > & () const
 
 operator typename std::vector< FitParRef > & ()
 
bool operator== (const MINT::PolymorphVector< FitParRef > &v2) const
 
bool operator!= (const MINT::PolymorphVector< FitParRef > &v2) const
 
bool operator< (const MINT::PolymorphVector< FitParRef > &v2) const
 
bool operator> (const MINT::PolymorphVector< FitParRef > &v2) const
 

Protected Member Functions

double runningMass2 ()
 
virtual double GofM ()
 
virtual std::complex< double > BreitWigner ()
 
TH1D * get_width_histo (TFile *f, const std::string &hname)
 
TH1D * get_mass_histo (TFile *f, const std::string &hname)
 
TH1D * producePhaseSpaceHist ()
 
- Protected Member Functions inherited from BW_BW
const MINT::MinuitParameterSetgetMinuitParameterSet () const
 
MINT::MinuitParameterSetgetMinuitParameterSet ()
 
const std::string & prefix () const
 
bool substitutePDGForReco () const
 
virtual double twoBody_dgtPsq_in_MumsFrame (double mumsMass, double mA, double mB) const
 
virtual double twoBody_dgtPsq_in_MumsPDGFrame () const
 
virtual double twoBody_recodgtPsq_in_MumsPDGFrame () const
 
virtual double twoBody_dgtPsq_in_MumsRecoFrame ()
 
bool setEventPtr (IDalitzEvent &evt) const
 
IDalitzEventgetEvent () const
 
bool setAllFitParameters ()
 
ResonancePropertiesListresonancePropertiesList () const
 
const ResonancePropertiesresonanceProperties () const
 
virtual const ParticlePropertiesmumsProperties () const
 
virtual ResonancePropertiesFitRefmumsFittableProperties () const
 
virtual int mumsPID () const
 
virtual double mumsMass () const
 
virtual double mumsWidth () const
 
virtual double mumsRadius () const
 
virtual double globalRadius () const
 
virtual double Radius () const
 
double GetAlpha () const
 
virtual int lowestPossibleTwoLPlusOne () const
 
virtual int maxDaughterSpinSum () const
 
virtual int minDaughterSpinSum () const
 
virtual int minDaughterSpinSum2 () const
 
virtual int minDaughterSpinSum3 () const
 
virtual int minDaughterSpinSum4 () const
 
virtual int maxDaughterPairSpinSum (int i, int j) const
 
virtual int minDaughterPairSpinSum (int i, int j) const
 
virtual std::string mumsSpin () const
 
virtual int mumsSpinValue () const
 
virtual int mumsParity () const
 
virtual bool startOfDecayChain () const
 
virtual bool parityConservingL (int L) const
 
virtual double mumsRecoMass2 () const
 
virtual double mumsRecoMass () const
 
virtual MultiQuarkContent mumsQuarkContent () const
 
bool nonResonant () const
 
virtual int numDaughters () const
 
virtual TLorentzVector daughterP4 (int i) const
 
virtual double daughterPDGMass (const int &i) const
 
virtual double daughterWidth (int i) const
 
virtual double daughterRecoMass2 (int i) const
 
virtual double daughterRecoMass (int i) const
 
virtual std::string daughterSpin (int i) const
 
virtual int daughterSpinValue (int i) const
 
virtual MultiQuarkContent daughterQuarkContent (int i) const
 
virtual int daughterP (int i) const
 
virtual int dgtrsInternalParity () const
 
virtual MultiQuarkContent dgtrsQuarkContent () const
 
virtual bool isWeakDecay () const
 
virtual double Fr_PDG_BL ()
 
virtual double Fr_BELLE (double prSquared)
 
virtual double Fr_BELLE_Max ()
 
virtual double Fr ()
 
virtual double FrForGofM ()
 
virtual double FrMax ()
 
virtual void resetInternals ()
 
virtual void resetPDG ()
 

Protected Attributes

TH1D * _runningMassHist
 
TH1D * _runningWidthHist
 
- Protected Attributes inherited from BW_BW
MINT::MinuitParameterSet_mps
 
std::string _prefix
 
MINT::NamedParameter< int > _normBF
 
bool _useGlobalRadius
 
const AssociatedDecayTree_theDecay
 
double _gen_s_mi
 
double _gen_s_ma
 
ResonancePropertiesList_RPL
 
ResonancePropertiesFitRef_fittableResonancePropertiesPtr
 
MINT::FitParRef_fittableGlobalRadiusPtr
 
- Protected Attributes inherited from MINT::PolymorphVector< FitParRef >
std::vector< FitParRef_vec
 

Detailed Description

Definition at line 22 of file Histo_BW.h.

Constructor & Destructor Documentation

◆ Histo_BW()

Histo_BW::Histo_BW ( const AssociatedDecayTree tree,
const std::string &  namePrefix 
)
inline

Definition at line 25 of file Histo_BW.h.

26  : BW_BW(tree, namePrefix)
27  , _runningMassHist(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  }
TH1D * _runningMassHist
Definition: Histo_BW.h:56
virtual int mumsPID() const
Definition: BW_BW.cpp:517
BW_BW(const AssociatedDecayTree &decay, const std::string &lineshapePrefix="", MINT::MinuitParameterSet *mps=0)
Definition: BW_BW.cpp:26
TH1D * _runningWidthHist
Definition: Histo_BW.h:57
TH1D * get_mass_histo(TFile *f, const std::string &hname)
Definition: Histo_BW.cpp:63
const ResonanceProperties * resonanceProperties() const
Definition: BW_BW.cpp:403
TH1D * get_width_histo(TFile *f, const std::string &hname)
Definition: Histo_BW.cpp:44

◆ ~Histo_BW()

virtual Histo_BW::~Histo_BW ( )
inlinevirtual

Definition at line 50 of file Histo_BW.h.

50 {}

Member Function Documentation

◆ BreitWigner()

std::complex< double > Histo_BW::BreitWigner ( )
protectedvirtual

Reimplemented from BW_BW.

Definition at line 16 of file Histo_BW.cpp.

16  {
17  double mass2 = runningMass2();
18  std::complex<double> invBW(mass2 - mumsRecoMass2(), - mumsMass() * GofM());
19  return 1.*GeV*GeV/invBW;
20 }
virtual double mumsMass() const
Definition: BW_BW.cpp:453
double runningMass2()
Definition: Histo_BW.cpp:22
virtual double mumsRecoMass2() const
Definition: BW_BW.cpp:548
static const double GeV
virtual double GofM()
Definition: Histo_BW.cpp:31

◆ get_mass_histo()

TH1D * Histo_BW::get_mass_histo ( TFile *  f,
const std::string &  hname 
)
protected

Definition at line 63 of file Histo_BW.cpp.

63  {
64  TH1D* h=0;
65  if(0 != f){
66  h = (TH1D*) f->Get(hname.c_str());
67  if(0 != h){
68  cout << "Found running mass histogram in file " << f->GetName() << "." << endl;
69  }else{
70  cout << "ERROR: Couldn't find running mass histogram in file " << f->GetName() << ". I'll use a constant mass." << endl;
71  }
72  }
73  else {
74  cout << "Didn't find running mass file for " << (BW_BW::resonanceProperties()->nameFromPid(abs(mumsPID()))) << endl;
75  }
76  return h;
77 }
virtual int mumsPID() const
Definition: BW_BW.cpp:517
const ResonanceProperties * resonanceProperties() const
Definition: BW_BW.cpp:403
static std::string nameFromPid(int pdg_id)

◆ get_width_histo()

TH1D * Histo_BW::get_width_histo ( TFile *  f,
const std::string &  hname 
)
protected

Definition at line 44 of file Histo_BW.cpp.

44  {
45  TH1D* h=0;
46  if(0 != f){
47  h = (TH1D*) f->Get(hname.c_str());
48  if(0 != h){
49  cout << "Found running width histogram in file " << f->GetName() << "." << endl;
50  }else{
51  cout << "ERROR: Couldn't find running width histogram in file " << f->GetName() << ". I'll return a constant width." << endl;
52  }
53  }
54  else {
55  cout << "Didn't find running width file for " << (BW_BW::resonanceProperties()->nameFromPid(abs(mumsPID())))
56  << ". I'll produce it now assuming a flat 3 body phase space." << endl;
58  if(0 == h) cout << "ERROR: Couldn't produce running width histogram, I'll return a constant width" << endl;
59  }
60  return h;
61 }
virtual int mumsPID() const
Definition: BW_BW.cpp:517
TH1D * producePhaseSpaceHist()
Definition: Histo_BW.cpp:96
const ResonanceProperties * resonanceProperties() const
Definition: BW_BW.cpp:403
static std::string nameFromPid(int pdg_id)

◆ GofM()

double Histo_BW::GofM ( )
protectedvirtual

Reimplemented from BW_BW.

Definition at line 31 of file Histo_BW.cpp.

31  {
32 
33  if(_runningWidthHist==0)return mumsWidth();
34 
35  double ps_m = _runningWidthHist->Interpolate(mumsRecoMass2()/(GeV*GeV));
36  double ps_m0 = _runningWidthHist->Interpolate(mumsMass()*mumsMass()/(GeV*GeV));
37 
38  double ps_ratio = 0.;
39  if(ps_m0>0)ps_ratio= ps_m/ps_m0 ;
40 
41  return mumsWidth() * ps_ratio;
42 }
virtual double mumsMass() const
Definition: BW_BW.cpp:453
virtual double mumsRecoMass2() const
Definition: BW_BW.cpp:548
TH1D * _runningWidthHist
Definition: Histo_BW.h:57
static const double GeV
virtual double mumsWidth() const
Definition: BW_BW.cpp:460

◆ name()

virtual std::string Histo_BW::name ( ) const
inlinevirtual

Reimplemented from BW_BW.

Definition at line 52 of file Histo_BW.h.

53  { return "Histo_BW("+prefix()+_theDecay.oneLiner() +")"; }
const AssociatedDecayTree & _theDecay
Definition: BW_BW.h:69
void oneLiner(std::stringstream &seam, int generation=0) const
Definition: DDTree.h:375
const std::string & prefix() const
Definition: BW_BW.h:72

◆ producePhaseSpaceHist()

TH1D * Histo_BW::producePhaseSpaceHist ( )
protected

Definition at line 96 of file Histo_BW.cpp.

96  {
97 
98  std::vector<int> asi = _theDecay.getVal().asi();
99  double min = 0.;//getEvent()->eventPattern().sijMin(asi)/(GeV*GeV)*0.75;
100  double max = mumsMass()*mumsMass()/(GeV*GeV)*5.;//getEvent()->eventPattern().sijMax(asi)/(GeV*GeV)*1.25;
101 
102  TFile* f= new TFile(("RunningWidth_"+ (BW_BW::resonanceProperties()->nameFromPid(abs(mumsPID()))) + ".root").c_str(),"RECREATE");
103  TH1D* h= new TH1D("RunningWidth","RunningWidth",1000,min,max);
104 
105  TF1 *ps = new TF1("phaseSpace",phaseSpace,0,max,4);
106  std::vector<const AssociatedDecayTreeItem*> adti = _theDecay.finalState();
107  //cout << adti[0]->mass() << " " << adti[1]->mass() << " " << adti[2]->mass() << endl;
108  ps->SetParameters(mumsMass(),adti[0]->mass(),adti[1]->mass(),adti[2]->mass());
109 
110  for (int i=1; i<= h->GetNbinsX(); i++) {
111  h->SetBinContent(i,ps->Eval(h->GetXaxis()->GetBinCenter(i)));
112  }
113 
114  h->Write();
115  f->Write();
116 
117  return h;
118 
119 }
const AssociatedDecayTree & _theDecay
Definition: BW_BW.h:69
virtual double mumsMass() const
Definition: BW_BW.cpp:453
virtual int mumsPID() const
Definition: BW_BW.cpp:517
const ValueType & getVal() const
Definition: DDTree.h:102
static const double GeV
const ResonanceProperties * resonanceProperties() const
Definition: BW_BW.cpp:403
std::vector< const ValueType * > finalState() const
Definition: DDTree.h:293
const std::vector< int > & asi() const
Double_t phaseSpace(Double_t *x, Double_t *par)
Definition: Histo_BW.cpp:79

◆ runningMass2()

double Histo_BW::runningMass2 ( )
protected

Definition at line 22 of file Histo_BW.cpp.

22  {
23  if(_runningMassHist==0)return mumsMass()*mumsMass();
24 
25  double d_m2 = _runningMassHist->Interpolate(mumsRecoMass2()/(GeV*GeV));
26  double d_m02 = _runningMassHist->Interpolate(mumsMass()*mumsMass()/(GeV*GeV));
27 
28  return mumsMass()*mumsMass() + mumsWidth()*(d_m2 - d_m02);
29 }
virtual double mumsMass() const
Definition: BW_BW.cpp:453
TH1D * _runningMassHist
Definition: Histo_BW.h:56
virtual double mumsRecoMass2() const
Definition: BW_BW.cpp:548
static const double GeV
virtual double mumsWidth() const
Definition: BW_BW.cpp:460

Member Data Documentation

◆ _runningMassHist

TH1D* Histo_BW::_runningMassHist
protected

Definition at line 56 of file Histo_BW.h.

◆ _runningWidthHist

TH1D* Histo_BW::_runningWidthHist
protected

Definition at line 57 of file Histo_BW.h.


The documentation for this class was generated from the following files: