MINT2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
RunningWidthCalculator Class Reference

#include <RunningWidthCalculator.h>

Public Member Functions

 RunningWidthCalculator (const DalitzEventPattern &pat)
 
TH1D * makeHisto_phaseSpace (int nBins, double max_m_inMeV, std::string OutputFileName="")
 
TH1D * makeHisto_2body (int nBins, double max_m_inMeV, const DecayTree &thisDcy, std::string OutputFileName="")
 
TH1D * makeHisto_3body (int nBins, double max_m_inMeV, const DecayTree &thisDcy, std::string OutputFileName="")
 
TH1D * makeHisto_dalitz (int nBins, double max_m_inMeV, int nIntegrationEvents, IFastAmplitudeIntegrable *amps=0, std::string OutputFileName="")
 
TF1 * getRunningWidthFunction_phaseSpace (double max_s_inGeV2)
 
TF1 * getRunningWidthFunction_2body (double max_s_inGeV2, const DecayTree &thisDcy)
 
TF1 * getRunningWidthFunction_3body (double max_s_inGeV2, const DecayTree &thisDcy)
 
TF1 * getRunningWidthFunction_Fermi (double max_s_inGeV2, double lambda, double s0)
 
std::vector< double > getPartialWidthCouplingsFromBF (std::vector< double > BF, std::vector< TF1 * > partialWidths, double m0, double gamma0)
 
TH1D * makeRunningMassHisto_3body (int nBins, double max_s_inGeV2, std::vector< TF1 * > gamma, std::vector< double > g, std::string OutputFileName="")
 
void setDalitzEventPattern (const DalitzEventPattern &pat)
 

Private Member Functions

void set_min_s_inGeV2 ()
 

Private Attributes

DalitzEventPattern _pat
 
double _min_s_inGeV2
 

Detailed Description

Definition at line 13 of file RunningWidthCalculator.h.

Constructor & Destructor Documentation

◆ RunningWidthCalculator()

RunningWidthCalculator::RunningWidthCalculator ( const DalitzEventPattern pat)

Definition at line 37 of file RunningWidthCalculator.cpp.

37  :
38  _pat(pat)
39 {
40  cout << "RunningWidthCalculator::RunningWidthCalculator: I got called." << endl;
42 }

Member Function Documentation

◆ getPartialWidthCouplingsFromBF()

std::vector< double > RunningWidthCalculator::getPartialWidthCouplingsFromBF ( std::vector< double >  BF,
std::vector< TF1 * >  partialWidths,
double  m0,
double  gamma0 
)

Definition at line 452 of file RunningWidthCalculator.cpp.

452  {
453 
454  //MinuitParameterSet mps();
455 
456  std::vector<FitParameter*> fit_couplings;
457 
458  FitParameter* scale = new FitParameter("scale",2,1,0.1);
459  fit_couplings.push_back(scale);
460 
461  for (unsigned int i=1; i < BF.size() ; i++) {
462  FitParameter* g =
463  new FitParameter(("g_"+anythingToString((int) i)).c_str(),0,1,0.1);
464  //new FitParameter(("g_"+std::to_string(i)).c_str(),0,1,0.1);
465  fit_couplings.push_back(g);
466  }
467 
468  chi2BF f(BF, partialWidths, fit_couplings, m0, gamma0);
469  Minimiser mini(&f);
470  mini.doFit();
471 
472  vector<double> couplings;
473  double norm = 0.;
474 
475 
476  double sum = 0.;
477  for (unsigned int i=1; i<fit_couplings.size(); i++) {
478  sum += *fit_couplings[i];
479  }
480 
481  for (unsigned int i=0; i<fit_couplings.size(); i++) {
482  double c;
483  if(i==0) c = 1.;//(1.-sum);
484  else c = *fit_couplings[i];
485  norm += c*partialWidths[i]->Eval(m0*m0/(GeV*GeV));
486  }
487 
488  for (unsigned int i=0; i<fit_couplings.size(); i++) {
489  double c;
490  if(i==0) c = 1;//(1.-sum);
491  else c = *fit_couplings[i];
492  couplings.push_back(c / norm * gamma0/GeV);
493  }
494 
495  return couplings;
496 
497 }
static const double GeV
std::string anythingToString(const T &anything)
Definition: Utils.h:62
static const double g

◆ getRunningWidthFunction_2body()

TF1 * RunningWidthCalculator::getRunningWidthFunction_2body ( double  max_s_inGeV2,
const DecayTree thisDcy 
)

Definition at line 564 of file RunningWidthCalculator.cpp.

564  {
565 
566  bool dbThis=false;
567 
568  // Some safety checks
569  if(thisDcy.finalState().size() != 2){
570  cout << "ERROR in RunningWidthCalculator::makeHisto_2body: I can handle only 2 body decays but the decay " << thisDcy
571  << " has " << thisDcy.finalState().size() << " final state particles. I'll return 0." << endl;
572  return 0;
573  }
574 
575  if(thisDcy.nDgtr() != 2){
576  cout << "ERROR in RunningWidthCalculator::makeHisto_2body: "
577  << " Mother should have 2 daughters, but it says it has "
578  << thisDcy.nDgtr() << ". I'll return 0." << endl;
579  return 0;
580  }
581 
582  if( ! _pat.compatibleWith(thisDcy)){
583  cout << "ERROR in RunningWidthCalculator::makeHisto_2body:"
584  << "DalitzEventPattern and DecayTree are not compatible. I'll return 0." << endl;
585  return 0;
586  }
587 
588  // Use the BW_BW class to add resonances to ResonanceProperitiesList
589  // and to get acces to angular momentum
590  AssociatingDecayTree associatingDecayTreeX(thisDcy);
591  const AssociatedDecayTree X = associatingDecayTreeX.getTree(_pat);
592  BW_BW BW_X(X);
593 
594  // Define all parameters
595  // 2 body decay : X -> 1 2
596  const int nPar = 4;
597  Double_t par[nPar];
598 
599  // Final state (1,2) masses:
600  par[0] = ParticlePropertiesList::getMe()->get((int) X.getDgtrTreePtr(0)->getVal())->mass();
601  par[1] = ParticlePropertiesList::getMe()->get((int) X.getDgtrTreePtr(1)->getVal())->mass();
602  // Angular momentum in X -> 1 2
603  par[2] = (BW_X.twoLPlusOne()-1)/2;
604  // Mother (X) radius
605  par[3] = ResonancePropertiesList::getMe()->get((int)_pat[0])->radius();
606 
607  TF1 *gamma = new TF1("Gamma_2body",Gamma_2body,0,max_s_inGeV2,nPar);
608  gamma->SetParameters(par);
609 
610  return gamma;
611  (void)dbThis;
612 }
bool compatibleWith(const DecayTree &tree) const
const ResonanceProperties * get(int i) const
Definition: BW_BW.h:30
static ResonancePropertiesList * getMe(const std::string &prefix="", MINT::MinuitParameterSet *mps=0)
MINT::const_counted_ptr< DDTree< ValueType > > getDgtrTreePtr(int i) const
Definition: DDTree.h:114
const ParticleProperties * get(const std::string &name) const
Double_t Gamma_2body(double M, double m1, double m2, int l, double r)
static const ParticlePropertiesList * getMe()
std::vector< const ValueType * > finalState() const
Definition: DDTree.h:293
int nDgtr() const
Definition: DDTree.h:96

◆ getRunningWidthFunction_3body()

TF1 * RunningWidthCalculator::getRunningWidthFunction_3body ( double  max_s_inGeV2,
const DecayTree thisDcy 
)

Definition at line 285 of file RunningWidthCalculator.cpp.

285  {
286 
287  bool dbThis=false;
288 
289  // Some safety checks
290  if(thisDcy.finalState().size() != 3){
291  cout << "ERROR in RunningWidthCalculator::makeHisto_3body: I can handle only 3 body decays but the decay " << thisDcy
292  << " has " << thisDcy.finalState().size() << " final state particles. I'll return 0." << endl;
293  return 0;
294  }
295 
296  if(thisDcy.nDgtr() != 2){
297  cout << "ERROR in RunningWidthCalculator::makeHisto_3body: "
298  << " Mother should have 2 daughters, but it says it has "
299  << thisDcy.nDgtr() << ". I'll return 0." << endl;
300  return 0;
301  }
302 
303  if( ! _pat.compatibleWith(thisDcy)){
304  cout << "ERROR in RunningWidthCalculator::makeHisto_3body:"
305  << "DalitzEventPattern and DecayTree are not compatible. I'll return 0." << endl;
306  return 0;
307  }
308 
309  // Everything is fine, now search the resonance
311  for(int i=0; i< thisDcy.nDgtr(); i++){
313  if(dgtr->nDgtr() == 2) R = dgtr;
314  else bachelor = dgtr;
315  }
316 
317  if(0==R || 0== bachelor){
318  cout << "ERROR in RunningWidthCalculator::makeHisto_3body:"
319  << " Didn't find resonance or bachelor. I'll return 0. " << endl;
320  return 0;
321  }
322 
323  // Use the BW_BW class to add resonances to ResonanceProperitiesList
324  // and to get acces to angular momentum
325  AssociatingDecayTree associatingDecayTreeX(thisDcy);
326  const AssociatedDecayTree X = associatingDecayTreeX.getTree(_pat);
327 
328  BW_BW BW_X(X);
329  BW_BW BW_R(*R);
330 
331  // Define all parameters
332  // 3 body decay : X -> (R->1 2) 3
333  const int nPar = 10;
334  Double_t par[nPar];
335 
336  // Mother (X) radius
337  par[0] = ResonancePropertiesList::getMe()->get((int)_pat[0])->radius();
338  // Final state (1,2,3) masses:
339  par[1] = ParticlePropertiesList::getMe()->get((int) R->getDgtrTreePtr(0)->getVal())->mass();
340  par[2] = ParticlePropertiesList::getMe()->get((int) R->getDgtrTreePtr(1)->getVal())->mass();
341  par[3] = ParticlePropertiesList::getMe()->get((int) bachelor->getVal())->mass();
342  // Angular momentum in X -> R 3
343  par[4] = (BW_X.twoLPlusOne()-1)/2;
344  // Angular momentum in R -> 1 2
345  par[5] = (BW_R.twoLPlusOne()-1)/2;
346  // Resonance (R) mass, width and radius
347  par[6] = ResonancePropertiesList::getMe()->get((int) R->getVal())->mass();
348  par[7] = ResonancePropertiesList::getMe()->get((int) R->getVal())->width();
349  par[8] = ResonancePropertiesList::getMe()->get((int) R->getVal())->radius();
350  // Upper limit of s(1,2,3)
351  par[9] = max_s_inGeV2 * GeV *GeV;
352 
353  if(dbThis) for(int i=0; i<nPar; i++) cout << "Parameter " << i << " = " << par[i] << endl;
354 
355  TF1 *gamma = new TF1("Gamma_mother_3body",Gamma_mother_3body,_min_s_inGeV2,max_s_inGeV2,nPar);
356  gamma->SetParameters(par);
357 
358  return gamma;
359 }
Double_t Gamma_mother_3body(Double_t *x, Double_t *par)
bool compatibleWith(const DecayTree &tree) const
const ResonanceProperties * get(int i) const
const ValueType & getVal() const
Definition: DDTree.h:102
Definition: BW_BW.h:30
static ResonancePropertiesList * getMe(const std::string &prefix="", MINT::MinuitParameterSet *mps=0)
MINT::const_counted_ptr< DDTree< ValueType > > getDgtrTreePtr(int i) const
Definition: DDTree.h:114
const ParticleProperties * get(const std::string &name) const
static const double GeV
static const ParticlePropertiesList * getMe()
std::vector< const ValueType * > finalState() const
Definition: DDTree.h:293
int nDgtr() const
Definition: DDTree.h:96

◆ getRunningWidthFunction_Fermi()

TF1 * RunningWidthCalculator::getRunningWidthFunction_Fermi ( double  max_s_inGeV2,
double  lambda,
double  s0 
)

Definition at line 758 of file RunningWidthCalculator.cpp.

758  {
759 
760  // Define all parameters
761  const int nPar = 3;
762  Double_t par[nPar];
763  par[0] = lambda;
764  par[1] = s0;
765  par[2] = _min_s_inGeV2;
766 
767  TF1 *gamma = new TF1("Fermi_phaseSpace",Fermi_phaseSpace,0,max_s_inGeV2,nPar);
768  gamma->SetParameters(par);
769 
770  return gamma;
771 }
double Fermi_phaseSpace(double s, double lambda, double s0, double threshold)
double lambda(double x, double y, double z)
Definition: lambda.h:8

◆ getRunningWidthFunction_phaseSpace()

TF1 * RunningWidthCalculator::getRunningWidthFunction_phaseSpace ( double  max_s_inGeV2)

Definition at line 728 of file RunningWidthCalculator.cpp.

728  {
729 
730  if(_pat.size() != 4) {
731  cout << "ERROR in RunningWidthCalculator::makeHisto_phaseSpace: I can handle only 3 body decays but the pattern " << _pat
732  << " has " << _pat.size()-1 << " final state particles. I'll return 0." << endl;
733  return 0;
734  }
735 
736  const int nPar = 4;
737  Double_t par[nPar];
738  par[0] = ParticlePropertiesList::getMe()->get((int)_pat[0])->mass();
739  par[1] = ParticlePropertiesList::getMe()->get((int)_pat[1])->mass();
740  par[2] = ParticlePropertiesList::getMe()->get((int)_pat[2])->mass();
741  par[3] = ParticlePropertiesList::getMe()->get((int)_pat[3])->mass();
742 
743  TF1 *ps = new TF1("phaseSpaceIntegral",phaseSpaceIntegral,0,max_s_inGeV2,nPar);
744  ps->SetParameters(par);
745 
746  return ps;
747 }
const ParticleProperties * get(const std::string &name) const
unsigned int size() const
static const ParticlePropertiesList * getMe()
Double_t phaseSpaceIntegral(Double_t *x, Double_t *par)

◆ makeHisto_2body()

TH1D * RunningWidthCalculator::makeHisto_2body ( int  nBins,
double  max_m_inMeV,
const DecayTree thisDcy,
std::string  OutputFileName = "" 
)

Definition at line 615 of file RunningWidthCalculator.cpp.

615  {
616 
617  bool dbThis=false;
618 
619  // Some safety checks
620  if(thisDcy.finalState().size() != 2){
621  cout << "ERROR in RunningWidthCalculator::makeHisto_2body: I can handle only 2 body decays but the decay " << thisDcy
622  << " has " << thisDcy.finalState().size() << " final state particles. I'll return 0." << endl;
623  return 0;
624  }
625 
626  if(thisDcy.nDgtr() != 2){
627  cout << "ERROR in RunningWidthCalculator::makeHisto_2body: "
628  << " Mother should have 2 daughters, but it says it has "
629  << thisDcy.nDgtr() << ". I'll return 0." << endl;
630  return 0;
631  }
632 
633  if( ! _pat.compatibleWith(thisDcy)){
634  cout << "ERROR in RunningWidthCalculator::makeHisto_2body:"
635  << "DalitzEventPattern and DecayTree are not compatible. I'll return 0." << endl;
636  return 0;
637  }
638 
639  // Use the BW_BW class to add resonances to ResonanceProperitiesList
640  // and to get acces to angular momentum
641  AssociatingDecayTree associatingDecayTreeX(thisDcy);
642  const AssociatedDecayTree X = associatingDecayTreeX.getTree(_pat);
643  BW_BW BW_X(X);
644 
645  // Define all parameters
646  // 2 body decay : X -> 1 2
647  //const int nPar = 10;
648  //Double_t par[nPar];
649 
650  // Mother (X) radius
651  double r = ResonancePropertiesList::getMe()->get((int)_pat[0])->radius();
652  // Final state (1,2) masses:
653  double m1 = ParticlePropertiesList::getMe()->get((int) X.getDgtrTreePtr(0)->getVal())->mass();
654  double m2 = ParticlePropertiesList::getMe()->get((int) X.getDgtrTreePtr(1)->getVal())->mass();
655  // Angular momentum in X -> 1 2
656  double l = (BW_X.twoLPlusOne()-1)/2;
657 
658  if(OutputFileName=="")
659  OutputFileName = "RunningWidth_"+ParticlePropertiesList::getMe()->get(abs((int)_pat[0]))->name()+"_2body.root";
660  TFile* f= new TFile(OutputFileName.c_str(),"RECREATE");
661 
662  TH1D* h= new TH1D("RunningWidth",";s [GeV^2]; #Gamma (s) [a.u.]",nBins,_min_s_inGeV2,max_s_inGeV2);
663  for (int i=1; i<= h->GetNbinsX(); i++) {
664  h->SetBinContent(i, Gamma_2body( sqrt(h->GetXaxis()->GetBinCenter(i))*GeV , m1,m2, l, r));
665  }
666 
667  //h->Scale(1./h->Integral());
668  h->Write();
669  f->Write();
670  return h;
671  (void)dbThis;
672 }
bool compatibleWith(const DecayTree &tree) const
const ResonanceProperties * get(int i) const
Definition: BW_BW.h:30
static ResonancePropertiesList * getMe(const std::string &prefix="", MINT::MinuitParameterSet *mps=0)
MINT::const_counted_ptr< DDTree< ValueType > > getDgtrTreePtr(int i) const
Definition: DDTree.h:114
static const double m2
const ParticleProperties * get(const std::string &name) const
static const double GeV
std::string name() const
Double_t Gamma_2body(double M, double m1, double m2, int l, double r)
static const ParticlePropertiesList * getMe()
std::vector< const ValueType * > finalState() const
Definition: DDTree.h:293
int nDgtr() const
Definition: DDTree.h:96

◆ makeHisto_3body()

TH1D * RunningWidthCalculator::makeHisto_3body ( int  nBins,
double  max_m_inMeV,
const DecayTree thisDcy,
std::string  OutputFileName = "" 
)

Definition at line 196 of file RunningWidthCalculator.cpp.

196  {
197 
198  bool dbThis=false;
199 
200  // Some safety checks
201  if(thisDcy.finalState().size() != 3){
202  cout << "ERROR in RunningWidthCalculator::makeHisto_3body: I can handle only 3 body decays but the decay " << thisDcy
203  << " has " << thisDcy.finalState().size() << " final state particles. I'll return 0." << endl;
204  return 0;
205  }
206 
207  if(thisDcy.nDgtr() != 2){
208  cout << "ERROR in RunningWidthCalculator::makeHisto_3body: "
209  << " Mother should have 2 daughters, but it says it has "
210  << thisDcy.nDgtr() << ". I'll return 0." << endl;
211  return 0;
212  }
213 
214  if( ! _pat.compatibleWith(thisDcy)){
215  cout << "ERROR in RunningWidthCalculator::makeHisto_3body:"
216  << "DalitzEventPattern and DecayTree are not compatible. I'll return 0." << endl;
217  return 0;
218  }
219 
220  // Everything is fine, now search the resonance
222  for(int i=0; i< thisDcy.nDgtr(); i++){
224  if(dgtr->nDgtr() == 2) R = dgtr;
225  else bachelor = dgtr;
226  }
227 
228  if(0==R || 0== bachelor){
229  cout << "ERROR in RunningWidthCalculator::makeHisto_3body:"
230  << " Didn't find resonance or bachelor. I'll return 0. " << endl;
231  return 0;
232  }
233 
234  // Use the BW_BW class to add resonances to ResonanceProperitiesList
235  // and to get acces to angular momentum
236  AssociatingDecayTree associatingDecayTreeX(thisDcy);
237  const AssociatedDecayTree X = associatingDecayTreeX.getTree(_pat);
238 
239  BW_BW BW_X(X);
240  BW_BW BW_R(*R);
241 
242  // Define all parameters
243  // 3 body decay : X -> (R->1 2) 3
244  const int nPar = 10;
245  Double_t par[nPar];
246 
247  // Mother (X) radius
248  par[0] = ResonancePropertiesList::getMe()->get((int)_pat[0])->radius();
249  // Final state (1,2,3) masses:
250  par[1] = ParticlePropertiesList::getMe()->get((int) R->getDgtrTreePtr(0)->getVal())->mass();
251  par[2] = ParticlePropertiesList::getMe()->get((int) R->getDgtrTreePtr(1)->getVal())->mass();
252  par[3] = ParticlePropertiesList::getMe()->get((int) bachelor->getVal())->mass();
253  // Angular momentum in X -> R 3
254  par[4] = (BW_X.twoLPlusOne()-1)/2;
255  // Angular momentum in R -> 1 2
256  par[5] = (BW_R.twoLPlusOne()-1)/2;
257  // Resonance (R) mass, width and radius
258  par[6] = ResonancePropertiesList::getMe()->get((int) R->getVal())->mass();
259  par[7] = ResonancePropertiesList::getMe()->get((int) R->getVal())->width();
260  par[8] = ResonancePropertiesList::getMe()->get((int) R->getVal())->radius();
261  // Upper limit of s(1,2,3)
262  par[9] = max_s_inGeV2 * GeV *GeV;
263 
264  if(dbThis) for(int i=0; i<nPar; i++) cout << "Parameter " << i << " = " << par[i] << endl;
265 
266  if(OutputFileName=="")
267  OutputFileName = "RunningWidth_"+ParticlePropertiesList::getMe()->get(abs((int)_pat[0]))->name()+"_3body.root";
268  TFile* f= new TFile(OutputFileName.c_str(),"RECREATE");
269 
270  TF1 *gamma = new TF1("Gamma_mother_3body",Gamma_mother_3body,0,max_s_inGeV2,nPar);
271  gamma->SetParameters(par);
272 
273  TH1D* h= new TH1D("RunningWidth",";s [GeV^2]; #Gamma (s) [a.u.]",nBins,0,max_s_inGeV2);
274  for (int i=1; i<= h->GetNbinsX(); i++) {
275  h->SetBinContent(i,gamma->Eval(h->GetXaxis()->GetBinCenter(i) ));
276  }
277 
278  //h->Scale(1./h->Integral());
279  h->Write();
280  f->Write();
281  return h;
282 }
Double_t Gamma_mother_3body(Double_t *x, Double_t *par)
bool compatibleWith(const DecayTree &tree) const
const ResonanceProperties * get(int i) const
const ValueType & getVal() const
Definition: DDTree.h:102
Definition: BW_BW.h:30
static ResonancePropertiesList * getMe(const std::string &prefix="", MINT::MinuitParameterSet *mps=0)
MINT::const_counted_ptr< DDTree< ValueType > > getDgtrTreePtr(int i) const
Definition: DDTree.h:114
const ParticleProperties * get(const std::string &name) const
static const double GeV
std::string name() const
static const ParticlePropertiesList * getMe()
std::vector< const ValueType * > finalState() const
Definition: DDTree.h:293
int nDgtr() const
Definition: DDTree.h:96

◆ makeHisto_dalitz()

TH1D * RunningWidthCalculator::makeHisto_dalitz ( int  nBins,
double  max_m_inMeV,
int  nIntegrationEvents,
IFastAmplitudeIntegrable amps = 0,
std::string  OutputFileName = "" 
)

Definition at line 50 of file RunningWidthCalculator.cpp.

50  {
51 
52  if(_pat.size() != 4) {
53  cout << "ERROR in RunningWidthCalculator::makeHisto_dalitz: I can handle only 3 body decays but the pattern " << _pat
54  << " has " << _pat.size()-1 << " final state particles. I'll return 0." << endl;
55  return 0;
56  }
57 
58  if(amps==0) amps = new FitAmpSum(_pat);
59  //Important! Ensures everything is initialised
60  DalitzEventList eventTest;
61  eventTest.generatePhaseSpaceEvents(1,_pat);
62  amps->RealVal(eventTest[0]);
63 
64  if(OutputFileName=="")
65  OutputFileName = "RunningWidth_"+ParticlePropertiesList::getMe()->get(abs((int)_pat[0]))->name()+"_Dalitz.root";
66 
67  TFile* f= new TFile(OutputFileName.c_str(),"RECREATE");
68  TH1D* h= new TH1D("RunningWidth","RunningWidth",nBins,_min_s_inGeV2,max_s_inGeV2);
69 
72 
73  for (int b=1; b<= h->GetNbinsX(); b++) {
74  // Set mass to new value in ResonancePropertiesList
75  // and in ParticlePropertiesList !
76  // This is necessary since SignalGenerator uses the mass in ParticlePropertiesList
77  // but it should use the mass in ResonancePropertiesList. Fix some day.
78  rp->changeMassForDebug(sqrt(h->GetXaxis()->GetBinCenter(b))*GeV);
79  pp->setMass(sqrt(h->GetXaxis()->GetBinCenter(b))*GeV);
80 
81  // Generate integration events
82  SignalGenerator sg(_pat,amps);
83  sg.setWeighted();
84  sg.noPrintout();
85  DalitzEventList eventList;
86  // Maybe we should somehow scale the number of integration events with mass,
87  // i.e. the available phase space ?
88  sg.FillEventList(eventList, nIntegrationEvents);
89 
90  // Calculate the integral
91  double integral = 0.;
92  double sumw = 0.;
93  for (unsigned int i= 0; i< eventList.size(); i++) {
94  integral += amps->RealVal(eventList[i])*eventList[i].getWeight()/(eventList[i].getGeneratorPdfRelativeToPhaseSpace());
95  sumw += eventList[i].getWeight()/(eventList[i].getGeneratorPdfRelativeToPhaseSpace());
96  }
97 
99  double phaseSpace = ps.getVal(_pat);
100 
101  h->SetBinContent(b,integral*phaseSpace/sumw);
102  }
103 
104  h->Scale(h->GetNbinsX()/h->Integral());
105 
106  h->Write();
107  f->Write();
108 
109  return h;
110 }
void changeMassForDebug(double newVal) const
virtual double RealVal(EVENT_TYPE &evt)=0
const ResonanceProperties * get(int i) const
static ResonancePropertiesList * getMe(const std::string &prefix="", MINT::MinuitParameterSet *mps=0)
double getVal(const DalitzEventPattern &_pat)
void setMass(double m) const
const ParticleProperties * get(const std::string &name) const
static const double GeV
unsigned int size() const
virtual unsigned int size() const
Definition: EventList.h:59
std::string name() const
static const ParticlePropertiesList * getMe()
int generatePhaseSpaceEvents(int NumEvents, const DalitzEventPattern &pat, TRandom *rnd=0)
Double_t phaseSpace(Double_t *x, Double_t *par)
Definition: Histo_BW.cpp:79

◆ makeHisto_phaseSpace()

TH1D * RunningWidthCalculator::makeHisto_phaseSpace ( int  nBins,
double  max_m_inMeV,
std::string  OutputFileName = "" 
)

Definition at line 692 of file RunningWidthCalculator.cpp.

692  {
693 
694  if(_pat.size() != 4) {
695  cout << "ERROR in RunningWidthCalculator::makeHisto_phaseSpace: I can handle only 3 body decays but the pattern " << _pat
696  << " has " << _pat.size()-1 << " final state particles. I'll return 0." << endl;
697  return 0;
698  }
699 
700  if(OutputFileName=="")
701  OutputFileName = "RunningWidth_"+ParticlePropertiesList::getMe()->get(abs((int)_pat[0]))->name()+"_PhaseSpace.root";
702 
703 
704  TFile* f= new TFile(OutputFileName.c_str(),"RECREATE");
705  TH1D* h= new TH1D("RunningWidth","RunningWidth",nBins,_min_s_inGeV2,max_s_inGeV2);
706 
707  const int nPar = 4;
708  Double_t par[nPar];
709  par[0] = ParticlePropertiesList::getMe()->get((int)_pat[0])->mass();
710  par[1] = ParticlePropertiesList::getMe()->get((int)_pat[1])->mass();
711  par[2] = ParticlePropertiesList::getMe()->get((int)_pat[2])->mass();
712  par[3] = ParticlePropertiesList::getMe()->get((int)_pat[3])->mass();
713 
714  TF1 *ps = new TF1("phaseSpaceIntegral",phaseSpaceIntegral,_min_s_inGeV2,max_s_inGeV2,nPar);
715  ps->SetParameters(par);
716 
717  for (int i=1; i<= h->GetNbinsX(); i++) {
718  h->SetBinContent(i,ps->Eval(h->GetXaxis()->GetBinCenter(i)));
719  }
720 
721  h->Scale(h->GetNbinsX()/h->Integral());
722  h->Write();
723  f->Write();
724 
725  return h;
726 }
const ParticleProperties * get(const std::string &name) const
unsigned int size() const
std::string name() const
static const ParticlePropertiesList * getMe()
Double_t phaseSpaceIntegral(Double_t *x, Double_t *par)

◆ makeRunningMassHisto_3body()

TH1D * RunningWidthCalculator::makeRunningMassHisto_3body ( int  nBins,
double  max_s_inGeV2,
std::vector< TF1 * >  gamma,
std::vector< double >  g,
std::string  OutputFileName = "" 
)

Definition at line 515 of file RunningWidthCalculator.cpp.

515  {
516 
517  double absTol = 0.0001;
518  double relTol = 0.001;
519  unsigned int size = 1000;
520  int rule = 3;
521  double epsilon= 0.00001;
522 
523  if(OutputFileName=="")
524  OutputFileName = "RunningMass_"+ParticlePropertiesList::getMe()->get(abs((int)_pat[0]))->name()+"_3body.root";
525  TFile* f= new TFile(OutputFileName.c_str(),"RECREATE");
526  TH1D* h_m= new TH1D("RunningMass",";s [GeV^{2}]; m^{2} (s) [GeV^{2}]",nBins,_min_s_inGeV2,max_s_inGeV2);
527  for (int i=1; i<= h_m->GetNbinsX(); i++) {
528  double singularity = h_m->GetXaxis()->GetBinCenter(i);
529  if(singularity<_min_s_inGeV2){
530  h_m->SetBinContent(i,0);
531  continue;
532  }
533  Dispersion_Integrand integrand(gamma,g,singularity);
534  ROOT::Math::IntegratorOneDim integrator(integrand, ROOT::Math::IntegrationOneDim::kADAPTIVESINGULAR, absTol , relTol , size , rule ) ;
535  h_m->SetBinContent(i,(integrator.Integral(_min_s_inGeV2,singularity-epsilon) + integrator.Integral(singularity+epsilon,max_s_inGeV2*10000))/TMath::Pi());
536  }
537 
538  //h_m->Scale(h_m->GetNbinsX()/abs(h_m->Integral()));
539  h_m->Write();
540  f->Write();
541 
542  return h_m;
543  /*
544  double singularity = 1.4;
545 
546  Dispersion_Integrand integrand(gamma,singularity,100);
547  ROOT::Math::IntegratorOneDim integrator(integrand, ROOT::Math::IntegrationOneDim::kADAPTIVESINGULAR, absTol , relTol , size , rule ) ;
548  double singularPts[3] = {_min_m_squared,singularity,singularity};
549  std::vector<double> sp(singularPts, singularPts+3);
550 
551  cout << "Int = " << integrator.Integral(_min_m_squared,singularity-epsilon) + integrator.IntegralUp(singularity+epsilon) << endl;
552 
553 
554  Dispersion_Integrand_Subtraction integrand_sub(gamma,singularity);
555  ROOT::Math::IntegratorOneDim integrator_sub(integrand_sub, ROOT::Math::IntegrationOneDim::kADAPTIVESINGULAR, absTol , relTol , size , rule ) ;
556  double tmp = integrator_sub.Integral(_min_m_squared,3);
557 
558  cout << "Int = " << -1.*(tmp + gamma->Eval(singularity)* log( (3-singularity)/(singularity-_min_m_squared) ) ) + integrator.IntegralUp(3) << endl;
559  */
560 }
const ParticleProperties * get(const std::string &name) const
std::string name() const
static const ParticlePropertiesList * getMe()
static const double g

◆ set_min_s_inGeV2()

void RunningWidthCalculator::set_min_s_inGeV2 ( )
private

Definition at line 28 of file RunningWidthCalculator.cpp.

28  {
29  // Calculate lower phase space limit
30  double min_m = 0.;
31  for(unsigned int i= 1; i<_pat.size(); i++){
32  min_m += _pat[i].mass()/GeV;
33  }
34  _min_s_inGeV2 = min_m*min_m;
35 }
static const double GeV
unsigned int size() const

◆ setDalitzEventPattern()

void RunningWidthCalculator::setDalitzEventPattern ( const DalitzEventPattern pat)

Definition at line 44 of file RunningWidthCalculator.cpp.

44  {
45  _pat = pat;
47 }

Member Data Documentation

◆ _min_s_inGeV2

double RunningWidthCalculator::_min_s_inGeV2
private

Definition at line 16 of file RunningWidthCalculator.h.

◆ _pat

DalitzEventPattern RunningWidthCalculator::_pat
private

Definition at line 15 of file RunningWidthCalculator.h.


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