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

#include <FitAmpPair.h>

Inheritance diagram for FitAmpPair:
MINT::FitParDependent MINT::IFitParRegister MINT::PolymorphVector< FitParRef > MINT::IFitParDependent

Public Member Functions

 FitAmpPair ()
 
 FitAmpPair (FitAmplitude &a1, FitAmplitude &a2)
 
 FitAmpPair (const FitAmpPair &other)
 
bool add (const FitAmpPair &other)
 
const std::string & name () const
 
const std::string & name ()
 
const std::string & dirName () const
 
const std::string & dirName ()
 
bool save (const std::string &asSubdirOf=".") const
 
bool retrieve (const std::string &asSubdirOf=".")
 
bool isSingleAmp () const
 
bool hasMatchingPattern () const
 
double reAdd (IDalitzEvent &evt, double weight=1, double efficiency=1)
 
double add (IDalitzEvent &evt, double weight=1, double efficiency=1)
 
double add (IDalitzEvent *evt, double weight=1, double efficiency=1)
 
double add (const MINT::counted_ptr< IDalitzEvent > &evt, double weight=1, double efficiency=1)
 
std::complex< double > valNoFitPars () const
 
std::complex< double > complexVal () const
 
double integral () const
 
double variance () const
 
double weightSum () const
 
long int N () const
 
void reset ()
 
bool needToReIntegrate () const
 
void startReIntegration ()
 
void startIntegration ()
 
void endIntegration ()
 
bool acceptEvents () const
 
std::complex< double > lastEntry () const
 
DalitzHistoSet histoSetRe () const
 
DalitzHistoSet histoSetIm () const
 
DalitzHistoSet histoSet () const
 
FitAmplitudefitAmp1 ()
 
FitAmplitudefitAmp2 ()
 
const FitAmplitudefitAmp1 () const
 
const FitAmplitudefitAmp2 () const
 
AmplituderawAmp1 ()
 
AmplituderawAmp2 ()
 
const AmplituderawAmp1 () const
 
const AmplituderawAmp2 () const
 
void setSlow ()
 
void setFast ()
 
bool slow () const
 
bool fast () const
 
virtual void print (std::ostream &os=std::cout) const
 
virtual ~FitAmpPair ()
 
FitAmpPairoperator+= (const FitAmpPair &other)
 
FitAmpPair operator+ (const FitAmpPair &other) const
 
- 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
 

Private Member Functions

std::complex< double > ampValue (IDalitzEvent &evtPtr)
 
std::complex< double > fitParValue () const
 
int oneOrTwo () const
 
const DalitzHistoSethistosRe () const
 
const DalitzHistoSethistosIm () const
 
DalitzHistoSethistosRe ()
 
DalitzHistoSethistosIm ()
 
void addToHistograms (IDalitzEvent *evtPtr, const std::complex< double > &c)
 
const std::string & makeName ()
 
const std::string & makeDirName ()
 
bool makeDirectory (const std::string &asSubdirOf=".") const
 
std::string valueFileName (const std::string &asSubdirOf) const
 
std::string histoReFileName (const std::string &asSubdirOf) const
 
std::string histoImFileName (const std::string &asSubdirOf) const
 
bool saveValues (const std::string &asSubdirOf=".") const
 
bool retrieveValues (const std::string &fromDirectory=".")
 
bool saveHistos (const std::string &asSubdirOf=".") const
 
bool retrieveHistos (const std::string &asSubdirOf=".")
 
bool isCompatibleWith (const FitAmpPair &other) const
 
void rememberEventDependentParameters ()
 

Private Attributes

FitAmplitude_fitA1
 
FitAmplitude_fitA2
 
bool _slow
 
bool _beingIntegrated
 
MINT::FitParDependent _eventDependentParameters
 
std::complex< double > _sum
 
std::string _sumName
 
std::complex< double > _sumsq
 
std::string _sumSqName
 
long int _Nevents
 
std::string _NName
 
double _weightSum
 
std::string _weightSumName
 
DalitzHistoSet _hsRe
 
DalitzHistoSet _hsIm
 
std::string _name
 
std::string _dirName
 
std::complex< double > _lastEntry
 

Friends

class FitAmpPairCovariance
 

Additional Inherited Members

- Protected Attributes inherited from MINT::PolymorphVector< FitParRef >
std::vector< FitParRef_vec
 

Detailed Description

Definition at line 22 of file FitAmpPair.h.

Constructor & Destructor Documentation

◆ FitAmpPair() [1/3]

FitAmpPair::FitAmpPair ( )

Definition at line 24 of file FitAmpPair.cpp.

25  : _fitA1(0)
26  , _fitA2(0)
27  , _slow(true)
28  , _beingIntegrated(true)
30  , _sum(0)
31  , _sumName("FitAmpPair._sum")
32  , _sumsq(0)
33  , _sumSqName("FitAmpPair._sumSq")
34  , _Nevents(0)
35  , _NName("FitAmpPair._N")
36  , _weightSum(0)
37  , _weightSumName("FitAmpPair._weightSum")
38  , _hsRe()
39  , _hsIm()
40  , _name("")
41  , _dirName("")
42  , _lastEntry(0)
43 {
44 }
std::string _sumName
Definition: FitAmpPair.h:32
std::string _sumSqName
Definition: FitAmpPair.h:35
bool _slow
Definition: FitAmpPair.h:27
FitAmplitude * _fitA1
Definition: FitAmpPair.h:24
std::string _dirName
Definition: FitAmpPair.h:47
MINT::FitParDependent _eventDependentParameters
Definition: FitAmpPair.h:29
std::complex< double > _sumsq
Definition: FitAmpPair.h:34
std::complex< double > _lastEntry
Definition: FitAmpPair.h:49
std::string _name
Definition: FitAmpPair.h:46
DalitzHistoSet _hsRe
Definition: FitAmpPair.h:43
std::string _NName
Definition: FitAmpPair.h:38
double _weightSum
Definition: FitAmpPair.h:40
long int _Nevents
Definition: FitAmpPair.h:37
bool _beingIntegrated
Definition: FitAmpPair.h:28
std::string _weightSumName
Definition: FitAmpPair.h:41
FitAmplitude * _fitA2
Definition: FitAmpPair.h:25
DalitzHistoSet _hsIm
Definition: FitAmpPair.h:44
std::complex< double > _sum
Definition: FitAmpPair.h:31

◆ FitAmpPair() [2/3]

FitAmpPair::FitAmpPair ( FitAmplitude a1,
FitAmplitude a2 
)

Definition at line 46 of file FitAmpPair.cpp.

47  : _fitA1(&a1)
48  , _fitA2(&a2)
49  , _slow(true)
50  , _beingIntegrated(true)
52  , _sum(0)
53  , _sumName("FitAmpPair._sum")
54  , _sumsq(0)
55  , _sumSqName("FitAmpPair._sumSq")
56  , _Nevents(0)
57  , _NName("FitAmpPair._N")
58  , _weightSum(0)
59  , _weightSumName("FitAmpPair._weightSum")
60  , _hsRe()
61  , _hsIm()
62  , _name("")
63  , _dirName("")
64  , _lastEntry(0)
65 {
66 
67  std::string name_1 = _fitA1->name();
68  std::string name_2 = _fitA2->name();
69  if(name_1 > name_2) std::swap(_fitA1, _fitA2);
70  // this ensures that the amplitudes are always stored in
71  // a well-defined order. Determines sign of imagninary part.
72  // Since we want Re(A1 A2*), this doesn't matter, however
73  // we have to be consistent when we save and retrive and then add to this.
74  // Also ensures consistent file and directory naming etc.
75  makeName();
76  makeDirName();
77 
80  _eventDependentParameters.registerFitParDependence(fitAmp1().eventDependentPrefactors());
81  _eventDependentParameters.registerFitParDependence(fitAmp2().eventDependentPrefactors());
82 }
std::string _sumName
Definition: FitAmpPair.h:32
std::string _sumSqName
Definition: FitAmpPair.h:35
bool _slow
Definition: FitAmpPair.h:27
FitAmplitude * _fitA1
Definition: FitAmpPair.h:24
std::string _dirName
Definition: FitAmpPair.h:47
MINT::FitParDependent _eventDependentParameters
Definition: FitAmpPair.h:29
std::complex< double > _sumsq
Definition: FitAmpPair.h:34
std::string name() const
Definition: FitAmplitude.h:213
const std::string & makeDirName()
Definition: FitAmpPair.cpp:140
std::complex< double > _lastEntry
Definition: FitAmpPair.h:49
std::string _name
Definition: FitAmpPair.h:46
Amplitude & rawAmp1()
Definition: FitAmpPair.h:170
DalitzHistoSet _hsRe
Definition: FitAmpPair.h:43
FitAmplitude & fitAmp2()
Definition: FitAmpPair.h:160
const std::string & makeName()
Definition: FitAmpPair.cpp:135
virtual bool registerFitParDependence(const IFitParDependent &fpd)
FitAmplitude & fitAmp1()
Definition: FitAmpPair.h:153
std::string _NName
Definition: FitAmpPair.h:38
Amplitude & rawAmp2()
Definition: FitAmpPair.h:171
double _weightSum
Definition: FitAmpPair.h:40
long int _Nevents
Definition: FitAmpPair.h:37
bool _beingIntegrated
Definition: FitAmpPair.h:28
std::string _weightSumName
Definition: FitAmpPair.h:41
FitAmplitude * _fitA2
Definition: FitAmpPair.h:25
DalitzHistoSet _hsIm
Definition: FitAmpPair.h:44
std::complex< double > _sum
Definition: FitAmpPair.h:31

◆ FitAmpPair() [3/3]

FitAmpPair::FitAmpPair ( const FitAmpPair other)

Definition at line 83 of file FitAmpPair.cpp.

84  : FitParDependent(other)
85  , _fitA1(other._fitA1)
86  , _fitA2(other._fitA2)
87  , _slow(other._slow)
90  , _sum(other._sum)
91  , _sumName(other._sumName)
92  , _sumsq(other._sumsq)
93  , _sumSqName(other._sumSqName)
94  , _Nevents(other._Nevents)
95  , _NName(other._NName)
96  , _weightSum(other._weightSum)
98  , _hsRe(other._hsRe)
99  , _hsIm(other._hsIm)
100  , _name(other._name)
101  , _dirName(other._dirName)
102  , _lastEntry(other._lastEntry)
103 {
104 }
std::string _sumName
Definition: FitAmpPair.h:32
FitParDependent(IFitParRegister *daddy=0)
std::string _sumSqName
Definition: FitAmpPair.h:35
bool _slow
Definition: FitAmpPair.h:27
FitAmplitude * _fitA1
Definition: FitAmpPair.h:24
std::string _dirName
Definition: FitAmpPair.h:47
MINT::FitParDependent _eventDependentParameters
Definition: FitAmpPair.h:29
std::complex< double > _sumsq
Definition: FitAmpPair.h:34
std::complex< double > _lastEntry
Definition: FitAmpPair.h:49
std::string _name
Definition: FitAmpPair.h:46
DalitzHistoSet _hsRe
Definition: FitAmpPair.h:43
std::string _NName
Definition: FitAmpPair.h:38
double _weightSum
Definition: FitAmpPair.h:40
long int _Nevents
Definition: FitAmpPair.h:37
bool _beingIntegrated
Definition: FitAmpPair.h:28
std::string _weightSumName
Definition: FitAmpPair.h:41
FitAmplitude * _fitA2
Definition: FitAmpPair.h:25
DalitzHistoSet _hsIm
Definition: FitAmpPair.h:44
std::complex< double > _sum
Definition: FitAmpPair.h:31

◆ ~FitAmpPair()

virtual FitAmpPair::~FitAmpPair ( )
inlinevirtual

Definition at line 184 of file FitAmpPair.h.

184 {}

Member Function Documentation

◆ acceptEvents()

bool FitAmpPair::acceptEvents ( ) const

Definition at line 520 of file FitAmpPair.cpp.

520  {
521  return _beingIntegrated;
522 }
bool _beingIntegrated
Definition: FitAmpPair.h:28

◆ add() [1/4]

bool FitAmpPair::add ( const FitAmpPair other)

Definition at line 110 of file FitAmpPair.cpp.

110  {
111  if(! isCompatibleWith(other)){
112  cout << "ERROR in FitAmpPair::add "
113  << "trying to add two incompatible FitAmpPairs: "
114  << "\n " << this->name() << " + " << other.name()
115  << endl;
116  return false;
117  }
118 
119  _sum += other._sum;
120  _sumsq += other._sumsq;
121  _Nevents += other._Nevents;
122  _weightSum += other._weightSum;
123 
124  _hsRe += other._hsRe;
125  _hsIm += other._hsIm;
126 
127  return true;
128 }
std::complex< double > _sumsq
Definition: FitAmpPair.h:34
DalitzHistoSet _hsRe
Definition: FitAmpPair.h:43
double _weightSum
Definition: FitAmpPair.h:40
long int _Nevents
Definition: FitAmpPair.h:37
DalitzHistoSet _hsIm
Definition: FitAmpPair.h:44
std::complex< double > _sum
Definition: FitAmpPair.h:31
const std::string & name() const
Definition: FitAmpPair.cpp:605
bool isCompatibleWith(const FitAmpPair &other) const
Definition: FitAmpPair.cpp:106

◆ add() [2/4]

double FitAmpPair::add ( IDalitzEvent evt,
double  weight = 1,
double  efficiency = 1 
)

Definition at line 343 of file FitAmpPair.cpp.

346  {
347 // bool dbThis=false;
348 
349  _Nevents++;
350 
351  double ps = evt.phaseSpace();
352  if(ps <= 0.0000){
353  if(!(_Nevents%100000)){
354  cout << "WARNING in FitAmpPair::addToHistograms"
355  << " event with phase space = " << ps << endl;
356  }
357  return 0; // should not happen.
358  }
359 
360  double w = evt.getWeight()
362  w *= weight;
363 
364  _weightSum += w;// / ps;
365 
366 // if(dbThis){
367 // cout << " FitAmpPair::add, for pair "
368 // << fitAmp1().name() << " / " << fitAmp2().name()
369 // << endl;
370 // }
371 
372  complex<double> c=ampValue(evt) * efficiency * w;
373  _lastEntry = c;
374  _sum += c;
375 
376  if(slow() && 0.0 != c) this->addToHistograms(&evt, c);
377 
378 // if(dbThis){
379 // cout << "\t c = " << c
380 // << " _sum " << _sum
381 // << endl;
382 // }
383  complex<double> csq(c.real()*c.real(), c.imag()*c.imag());
384  _sumsq += csq;
385 
386  return (c * fitParValue()).real();
387 }
std::complex< double > fitParValue() const
Definition: FitAmpPair.h:58
virtual double getWeight() const =0
virtual double phaseSpace() const =0
std::complex< double > _sumsq
Definition: FitAmpPair.h:34
std::complex< double > _lastEntry
Definition: FitAmpPair.h:49
double _weightSum
Definition: FitAmpPair.h:40
long int _Nevents
Definition: FitAmpPair.h:37
virtual double getGeneratorPdfRelativeToPhaseSpace() const =0
bool slow() const
Definition: FitAmpPair.h:179
void addToHistograms(IDalitzEvent *evtPtr, const std::complex< double > &c)
Definition: FitAmpPair.cpp:129
std::complex< double > _sum
Definition: FitAmpPair.h:31
std::complex< double > ampValue(IDalitzEvent &evtPtr)
Definition: FitAmpPair.h:51

◆ add() [3/4]

double FitAmpPair::add ( IDalitzEvent evt,
double  weight = 1,
double  efficiency = 1 
)

Definition at line 336 of file FitAmpPair.cpp.

339  {
340  if(0 == evtPtr) return 0;
341  return add(*evtPtr, weight, efficiency);
342 }
bool add(const FitAmpPair &other)
Definition: FitAmpPair.cpp:110

◆ add() [4/4]

double FitAmpPair::add ( const MINT::counted_ptr< IDalitzEvent > &  evt,
double  weight = 1,
double  efficiency = 1 
)

Definition at line 437 of file FitAmpPair.cpp.

440  {
441  return add(evtPtr.get(), weight, efficiency);
442 }
bool add(const FitAmpPair &other)
Definition: FitAmpPair.cpp:110

◆ addToHistograms()

void FitAmpPair::addToHistograms ( IDalitzEvent evtPtr,
const std::complex< double > &  c 
)
private

Definition at line 129 of file FitAmpPair.cpp.

130  {
131  _hsRe.addEvent(*evtPtr, c.real());
132  _hsIm.addEvent(*evtPtr, c.imag());
133 }
DalitzHistoSet _hsRe
Definition: FitAmpPair.h:43
void addEvent(const IDalitzEvent &evt, double weight=1)
DalitzHistoSet _hsIm
Definition: FitAmpPair.h:44

◆ ampValue()

std::complex<double> FitAmpPair::ampValue ( IDalitzEvent evtPtr)
inlineprivate

Definition at line 51 of file FitAmpPair.h.

51  {
52  std::complex<double> c1 = rawAmp1().getVal(evtPtr);
53  if(0.0 == c1) return 0;
54  std::complex<double> c2 = rawAmp2().getVal(evtPtr);
55  return (c1 * conj(c2)); // c1 x c2*
56  }
Amplitude & rawAmp1()
Definition: FitAmpPair.h:170
virtual std::complex< double > getVal(IDalitzEvent &evt)
Definition: Amplitude.h:122
Amplitude & rawAmp2()
Definition: FitAmpPair.h:171

◆ complexVal()

std::complex<double> FitAmpPair::complexVal ( ) const
inline

Definition at line 126 of file FitAmpPair.h.

126  {
127  return valNoFitPars() * fitParValue();
128  }
std::complex< double > fitParValue() const
Definition: FitAmpPair.h:58
std::complex< double > valNoFitPars() const
Definition: FitAmpPair.cpp:447

◆ dirName() [1/2]

const std::string & FitAmpPair::dirName ( ) const

Definition at line 613 of file FitAmpPair.cpp.

613  {
614  return _dirName;
615 }
std::string _dirName
Definition: FitAmpPair.h:47

◆ dirName() [2/2]

const std::string & FitAmpPair::dirName ( )

Definition at line 609 of file FitAmpPair.cpp.

609  {
610  if("" == _dirName) makeDirName();
611  return _dirName;
612 }
std::string _dirName
Definition: FitAmpPair.h:47
const std::string & makeDirName()
Definition: FitAmpPair.cpp:140

◆ endIntegration()

void FitAmpPair::endIntegration ( )

Definition at line 515 of file FitAmpPair.cpp.

515  {
516  _beingIntegrated=false;
518 }
bool _beingIntegrated
Definition: FitAmpPair.h:28
void rememberEventDependentParameters()
Definition: FitAmpPair.cpp:503

◆ fast()

bool FitAmpPair::fast ( ) const
inline

Definition at line 180 of file FitAmpPair.h.

180 {return !_slow;}
bool _slow
Definition: FitAmpPair.h:27

◆ fitAmp1() [1/2]

FitAmplitude& FitAmpPair::fitAmp1 ( )
inline

Definition at line 153 of file FitAmpPair.h.

153  {
154  if(0 == _fitA1){
155  std::cout << "ERROR in FitAmpPair::fitAmp1: zero pointer " << std::endl;
156  throw "zero ptr";
157  }
158  return *_fitA1;
159  }
FitAmplitude * _fitA1
Definition: FitAmpPair.h:24

◆ fitAmp1() [2/2]

const FitAmplitude& FitAmpPair::fitAmp1 ( ) const
inline

Definition at line 167 of file FitAmpPair.h.

167 {return *_fitA1;}
FitAmplitude * _fitA1
Definition: FitAmpPair.h:24

◆ fitAmp2() [1/2]

FitAmplitude& FitAmpPair::fitAmp2 ( )
inline

Definition at line 160 of file FitAmpPair.h.

160  {
161  if(0 == _fitA2){
162  std::cout << "ERROR in FitAmpPair::fitAmp2: zero pointer " << std::endl;
163  throw "zero ptr";
164  }
165  return *_fitA2;
166  }
FitAmplitude * _fitA2
Definition: FitAmpPair.h:25

◆ fitAmp2() [2/2]

const FitAmplitude& FitAmpPair::fitAmp2 ( ) const
inline

Definition at line 168 of file FitAmpPair.h.

168 {return *_fitA2;}
FitAmplitude * _fitA2
Definition: FitAmpPair.h:25

◆ fitParValue()

std::complex<double> FitAmpPair::fitParValue ( ) const
inlineprivate

Definition at line 58 of file FitAmpPair.h.

58  {
59  std::complex<double> c1 = fitAmp1().AmpPhase();
60  if(0.0 == c1) return 0;
61  std::complex<double> c2 = fitAmp2().AmpPhase();
62  return c1* conj(c2); // c1 x c2*
63  }
std::complex< double > AmpPhase() const
Definition: FitAmplitude.h:153
FitAmplitude & fitAmp2()
Definition: FitAmpPair.h:160
FitAmplitude & fitAmp1()
Definition: FitAmpPair.h:153

◆ hasMatchingPattern()

bool FitAmpPair::hasMatchingPattern ( ) const

Definition at line 594 of file FitAmpPair.cpp.

594  {
595  if(_fitA1->theBareDecay().getVal() == _fitA2->theBareDecay().getVal() )return true;
596  return false;
597 }
FitAmplitude * _fitA1
Definition: FitAmpPair.h:24
DecayTree theBareDecay() const
Definition: FitAmplitude.h:166
const ValueType & getVal() const
Definition: DDTree.h:102
FitAmplitude * _fitA2
Definition: FitAmpPair.h:25

◆ histoImFileName()

std::string FitAmpPair::histoImFileName ( const std::string &  asSubdirOf) const
private

Definition at line 240 of file FitAmpPair.cpp.

240  {
241  return asSubdirOf + "/" + dirName() + "/histoIm";
242 }
const std::string & dirName() const
Definition: FitAmpPair.cpp:613

◆ histoReFileName()

std::string FitAmpPair::histoReFileName ( const std::string &  asSubdirOf) const
private

Definition at line 237 of file FitAmpPair.cpp.

237  {
238  return asSubdirOf + "/" + dirName() + "/histoRe";
239 }
const std::string & dirName() const
Definition: FitAmpPair.cpp:613

◆ histoSet()

DalitzHistoSet FitAmpPair::histoSet ( ) const
inline

Definition at line 151 of file FitAmpPair.h.

151 {return histoSetRe();} // ..this is.
DalitzHistoSet histoSetRe() const
Definition: FitAmpPair.cpp:529

◆ histoSetIm()

DalitzHistoSet FitAmpPair::histoSetIm ( ) const

Definition at line 551 of file FitAmpPair.cpp.

551  {
552  // needed by Lauren's code, only
553  bool dbThis=false;
554  if(dbThis){
555  cout << " FitAmpPair::histograms, for pair "
556  << fitAmp1().name() << " / " << fitAmp2().name()
557  << endl;
558  cout << " r " << fitParValue().real() << ", "
559  << histosRe().begin()->second.histo()->Integral()
560  << " i " << fitParValue().imag() << ", "
561  << histosIm().begin()->second.histo()->Integral()
562  << endl;
563  }
564 
565  return ( // this calculates a DalitzHistoSet:
566  oneOrTwo() *
567  (fitParValue().real() * histosIm()
568  + fitParValue().imag() * histosRe())
569  )/_weightSum;// / ((double)_Nevents);
570 
571  // total /= (double)_Nevents;
572 }
std::complex< double > fitParValue() const
Definition: FitAmpPair.h:58
const DalitzHistoSet & histosRe() const
Definition: FitAmpPair.h:73
std::string name() const
Definition: FitAmplitude.h:213
const DalitzHistoSet & histosIm() const
Definition: FitAmpPair.h:74
FitAmplitude & fitAmp2()
Definition: FitAmpPair.h:160
FitAmplitude & fitAmp1()
Definition: FitAmpPair.h:153
double _weightSum
Definition: FitAmpPair.h:40
int oneOrTwo() const
Definition: FitAmpPair.h:65
std::map< Key, Val >::iterator begin()
Definition: PolymorphMap.h:26

◆ histoSetRe()

DalitzHistoSet FitAmpPair::histoSetRe ( ) const

Definition at line 529 of file FitAmpPair.cpp.

529  {
530  bool dbThis=false;
531  if(dbThis){
532  cout << " FitAmpPair::histograms, for pair "
533  << fitAmp1().name() << " / " << fitAmp2().name()
534  << endl;
535  cout << " r " << fitParValue().real() << ", "
536  << histosRe().begin()->second.histo()->Integral()
537  << " i " << fitParValue().imag() << ", "
538  << histosIm().begin()->second.histo()->Integral()
539  << endl;
540  }
541 
542 
543  return ( // this calculates a DalitzHistoSet:
544  oneOrTwo() *
545  (fitParValue().real() * histosRe()
546  - fitParValue().imag() * histosIm())
547  )/_weightSum;// / ((double)_Nevents);
548 
549  // total /= (double)_Nevents;
550 }
std::complex< double > fitParValue() const
Definition: FitAmpPair.h:58
const DalitzHistoSet & histosRe() const
Definition: FitAmpPair.h:73
std::string name() const
Definition: FitAmplitude.h:213
const DalitzHistoSet & histosIm() const
Definition: FitAmpPair.h:74
FitAmplitude & fitAmp2()
Definition: FitAmpPair.h:160
FitAmplitude & fitAmp1()
Definition: FitAmpPair.h:153
double _weightSum
Definition: FitAmpPair.h:40
int oneOrTwo() const
Definition: FitAmpPair.h:65
std::map< Key, Val >::iterator begin()
Definition: PolymorphMap.h:26

◆ histosIm() [1/2]

const DalitzHistoSet& FitAmpPair::histosIm ( ) const
inlineprivate

Definition at line 74 of file FitAmpPair.h.

74 {return _hsIm;}
DalitzHistoSet _hsIm
Definition: FitAmpPair.h:44

◆ histosIm() [2/2]

DalitzHistoSet& FitAmpPair::histosIm ( )
inlineprivate

Definition at line 76 of file FitAmpPair.h.

76 {return _hsIm;}
DalitzHistoSet _hsIm
Definition: FitAmpPair.h:44

◆ histosRe() [1/2]

const DalitzHistoSet& FitAmpPair::histosRe ( ) const
inlineprivate

Definition at line 73 of file FitAmpPair.h.

73 {return _hsRe;}
DalitzHistoSet _hsRe
Definition: FitAmpPair.h:43

◆ histosRe() [2/2]

DalitzHistoSet& FitAmpPair::histosRe ( )
inlineprivate

Definition at line 75 of file FitAmpPair.h.

75 {return _hsRe;}
DalitzHistoSet _hsRe
Definition: FitAmpPair.h:43

◆ integral()

double FitAmpPair::integral ( ) const

Definition at line 476 of file FitAmpPair.cpp.

476  {
477 
478  return complexVal().real();
479 }
std::complex< double > complexVal() const
Definition: FitAmpPair.h:126

◆ isCompatibleWith()

bool FitAmpPair::isCompatibleWith ( const FitAmpPair other) const
private

Definition at line 106 of file FitAmpPair.cpp.

106  {
107  return (fitAmp1().name() == other.fitAmp1().name() &&
108  fitAmp2().name() == other.fitAmp2().name());
109 }
std::string name() const
Definition: FitAmplitude.h:213
FitAmplitude & fitAmp2()
Definition: FitAmpPair.h:160
FitAmplitude & fitAmp1()
Definition: FitAmpPair.h:153
const std::string & name() const
Definition: FitAmpPair.cpp:605

◆ isSingleAmp()

bool FitAmpPair::isSingleAmp ( ) const

Definition at line 590 of file FitAmpPair.cpp.

590  {
591  return _fitA1 == _fitA2;
592 }
FitAmplitude * _fitA1
Definition: FitAmpPair.h:24
FitAmplitude * _fitA2
Definition: FitAmpPair.h:25

◆ lastEntry()

complex< double > FitAmpPair::lastEntry ( ) const

Definition at line 443 of file FitAmpPair.cpp.

443  {
444  return _lastEntry;
445 }
std::complex< double > _lastEntry
Definition: FitAmpPair.h:49

◆ makeDirectory()

bool FitAmpPair::makeDirectory ( const std::string &  asSubdirOf = ".") const
private

Definition at line 171 of file FitAmpPair.cpp.

171  {
172  /*
173  A mode is created from or'd permission bit masks defined
174  in <sys/stat.h>:
175  #define S_IRWXU 0000700 RWX mask for owner
176  #define S_IRUSR 0000400 R for owner
177  #define S_IWUSR 0000200 W for owner
178  #define S_IXUSR 0000100 X for owner
179 
180  #define S_IRWXG 0000070 RWX mask for group
181  #define S_IRGRP 0000040 R for group
182  #define S_IWGRP 0000020 W for group
183  #define S_IXGRP 0000010 X for group
184 
185  #define S_IRWXO 0000007 RWX mask for other
186  #define S_IROTH 0000004 R for other
187  #define S_IWOTH 0000002 W for other
188  #define S_IXOTH 0000001 X for other
189 
190  #define S_ISUID 0004000 set user id on execution
191  #define S_ISGID 0002000 set group id on execution
192  #define S_ISVTX 0001000 save swapped text even after use
193  */
194 
195  mode_t mode = S_IRWXU | S_IRWXG | S_IRWXO
196  | S_ISUID | S_ISGID;
197  // see above for meaning. I want everybody to be allowed to read/write/exec.
198  // Not sure about the last two bits.
199 
200  int zeroForSuccess = 0;
201  zeroForSuccess |= mkdir( (asSubdirOf ).c_str(), mode );
202  zeroForSuccess |= mkdir( (asSubdirOf + "/" + dirName() ).c_str(), mode );
203  return (0 == zeroForSuccess);
204 }
const std::string & dirName() const
Definition: FitAmpPair.cpp:613

◆ makeDirName()

const std::string & FitAmpPair::makeDirName ( )
private

Definition at line 140 of file FitAmpPair.cpp.

140  {
141  _dirName="";
142  if("" == _name) makeName();
143 
144  std::string::const_iterator preEnd = _name.end();
145  preEnd--;
146 
147  for(std::string::const_iterator it = _name.begin();
148  it != _name.end(); it++){
149  if(it != preEnd){
150  std::string::const_iterator next = it; next++;
151  if('-' == *it && '>' == *next){
152  _dirName += "_to_";
153  it++;
154  continue;
155  }
156  }
157  if('*' == *it) _dirName += "star";
158  else if(' ' == *it) _dirName += "_";
159  // else if('(' == *it) _dirName +="_bra_";
160  // else if(')'==*it) _dirName +="_ket_";
161  else if('['==*it) _dirName += "_sqbra_";
162  else if(']'==*it) _dirName += "_sqket_";
163  // else if(','==*it) _dirName += "_comma_";
164  // else if('-' == *it) _dirName += "min";
165  // else if('+' == *it) _dirName += "pls";
166  else _dirName += *it;
167  }
168  return _dirName;
169 }
std::string _dirName
Definition: FitAmpPair.h:47
std::string _name
Definition: FitAmpPair.h:46
const std::string & makeName()
Definition: FitAmpPair.cpp:135

◆ makeName()

const std::string & FitAmpPair::makeName ( )
private

Definition at line 135 of file FitAmpPair.cpp.

135  {
136  _name = "A(" + fitAmp1().name() + ")_x_fitA(" + fitAmp2().name() + ")*";
137  return _name;
138 }
std::string name() const
Definition: FitAmplitude.h:213
std::string _name
Definition: FitAmpPair.h:46
FitAmplitude & fitAmp2()
Definition: FitAmpPair.h:160
FitAmplitude & fitAmp1()
Definition: FitAmpPair.h:153

◆ N()

long int FitAmpPair::N ( ) const

Definition at line 485 of file FitAmpPair.cpp.

485  {
486  return _Nevents;
487 }
long int _Nevents
Definition: FitAmpPair.h:37

◆ name() [1/2]

const std::string & FitAmpPair::name ( ) const

Definition at line 605 of file FitAmpPair.cpp.

605  {
606  return _name;
607 }
std::string _name
Definition: FitAmpPair.h:46

◆ name() [2/2]

const std::string & FitAmpPair::name ( )

Definition at line 599 of file FitAmpPair.cpp.

599  {
600  if("" == _name) makeName();
601  return _name;
602  // if(isSingleAmp()) return "| " + _fitA1->name() + " |^2";
603  // else return "(" + _fitA1->name() +") * (" + _fitA2->name() + ")*";
604 }
std::string _name
Definition: FitAmpPair.h:46
const std::string & makeName()
Definition: FitAmpPair.cpp:135

◆ needToReIntegrate()

bool FitAmpPair::needToReIntegrate ( ) const

Definition at line 500 of file FitAmpPair.cpp.

500  {
502 }
virtual bool changedSinceLastCall() const
MINT::FitParDependent _eventDependentParameters
Definition: FitAmpPair.h:29

◆ oneOrTwo()

int FitAmpPair::oneOrTwo ( ) const
inlineprivate

Definition at line 65 of file FitAmpPair.h.

65  {
66  if(isSingleAmp()) return 1;
67  else return 2;
68  }
bool isSingleAmp() const
Definition: FitAmpPair.cpp:590

◆ operator+()

FitAmpPair FitAmpPair::operator+ ( const FitAmpPair other) const

Definition at line 666 of file FitAmpPair.cpp.

666  {
667  FitAmpPair returnVal(*this);
668  returnVal += other;
669  return returnVal;
670 }

◆ operator+=()

FitAmpPair & FitAmpPair::operator+= ( const FitAmpPair other)

Definition at line 662 of file FitAmpPair.cpp.

662  {
663  this->add(other);
664  return *this;
665 }
bool add(const FitAmpPair &other)
Definition: FitAmpPair.cpp:110

◆ print()

void FitAmpPair::print ( std::ostream &  os = std::cout) const
virtual

Definition at line 634 of file FitAmpPair.cpp.

634  {
635  os << "FitAmpPair " << name()
636  << ": N=" << N() << ", integral=" << integral();
637 }
double integral() const
Definition: FitAmpPair.cpp:476
long int N() const
Definition: FitAmpPair.cpp:485
const std::string & name() const
Definition: FitAmpPair.cpp:605

◆ rawAmp1() [1/2]

Amplitude& FitAmpPair::rawAmp1 ( )
inline

Definition at line 170 of file FitAmpPair.h.

170 {return fitAmp1().amp();}
FitAmplitude & fitAmp1()
Definition: FitAmpPair.h:153
Amplitude & amp()
Definition: FitAmplitude.h:163

◆ rawAmp1() [2/2]

const Amplitude& FitAmpPair::rawAmp1 ( ) const
inline

Definition at line 172 of file FitAmpPair.h.

172 {return fitAmp1().amp();}
FitAmplitude & fitAmp1()
Definition: FitAmpPair.h:153
Amplitude & amp()
Definition: FitAmplitude.h:163

◆ rawAmp2() [1/2]

Amplitude& FitAmpPair::rawAmp2 ( )
inline

Definition at line 171 of file FitAmpPair.h.

171 {return fitAmp2().amp();}
FitAmplitude & fitAmp2()
Definition: FitAmpPair.h:160
Amplitude & amp()
Definition: FitAmplitude.h:163

◆ rawAmp2() [2/2]

const Amplitude& FitAmpPair::rawAmp2 ( ) const
inline

Definition at line 173 of file FitAmpPair.h.

173 {return fitAmp2().amp();}
FitAmplitude & fitAmp2()
Definition: FitAmpPair.h:160
Amplitude & amp()
Definition: FitAmplitude.h:163

◆ reAdd()

double FitAmpPair::reAdd ( IDalitzEvent evt,
double  weight = 1,
double  efficiency = 1 
)

Definition at line 389 of file FitAmpPair.cpp.

392  {
393 // bool dbThis=false;
394 
395  _Nevents++;
396 
397  double ps = evt.phaseSpace();
398  if(ps <= 0.0000){
399  if(!(_Nevents%100000)){
400  cout << "WARNING in FitAmpPair::addToHistograms"
401  << " event with phase space = " << ps << endl;
402  }
403  return 0; // should not happen.
404  }
405 
406  double w = evt.getWeight()
408  w *= weight;
409 
410  _weightSum += w;// / ps;
411 
412 // if(dbThis){
413 // cout << " FitAmpPair::add, for pair "
414 // << fitAmp1().name() << " / " << fitAmp2().name()
415 // << endl;
416 // }
417 
418  complex<double> c=ampValue(evt) * efficiency * w;
419  _lastEntry = c;
420  _sum += c;
421 
422  if(slow() && 0.0 != c) this->addToHistograms(&evt, c);
423 
424 // if(dbThis){
425 // cout << "\t c = " << c
426 // << " _sum " << _sum
427 // << endl;
428 // }
429 
430  complex<double> csq(c.real()*c.real(), c.imag()*c.imag());
431  _sumsq += csq;
432 
433  return (c * fitParValue()).real();
434 }
std::complex< double > fitParValue() const
Definition: FitAmpPair.h:58
virtual double getWeight() const =0
virtual double phaseSpace() const =0
std::complex< double > _sumsq
Definition: FitAmpPair.h:34
std::complex< double > _lastEntry
Definition: FitAmpPair.h:49
double _weightSum
Definition: FitAmpPair.h:40
long int _Nevents
Definition: FitAmpPair.h:37
virtual double getGeneratorPdfRelativeToPhaseSpace() const =0
bool slow() const
Definition: FitAmpPair.h:179
void addToHistograms(IDalitzEvent *evtPtr, const std::complex< double > &c)
Definition: FitAmpPair.cpp:129
std::complex< double > _sum
Definition: FitAmpPair.h:31
std::complex< double > ampValue(IDalitzEvent &evtPtr)
Definition: FitAmpPair.h:51

◆ rememberEventDependentParameters()

void FitAmpPair::rememberEventDependentParameters ( )
private

Definition at line 503 of file FitAmpPair.cpp.

503  {
505 }
MINT::FitParDependent _eventDependentParameters
Definition: FitAmpPair.h:29
virtual void rememberFitParValues()

◆ reset()

void FitAmpPair::reset ( )

Definition at line 489 of file FitAmpPair.cpp.

489  {
490  _beingIntegrated = true;
491  _sum = 0;
492  _sumsq = 0;
493  _Nevents = 0;
494  _weightSum = 0;
495  if(slow()) _hsRe.clearAllHistos();
496  if(slow()) _hsIm.clearAllHistos();
497  _lastEntry = 0;
498 }
std::complex< double > _sumsq
Definition: FitAmpPair.h:34
std::complex< double > _lastEntry
Definition: FitAmpPair.h:49
DalitzHistoSet _hsRe
Definition: FitAmpPair.h:43
double _weightSum
Definition: FitAmpPair.h:40
long int _Nevents
Definition: FitAmpPair.h:37
bool _beingIntegrated
Definition: FitAmpPair.h:28
bool slow() const
Definition: FitAmpPair.h:179
DalitzHistoSet _hsIm
Definition: FitAmpPair.h:44
std::complex< double > _sum
Definition: FitAmpPair.h:31

◆ retrieve()

bool FitAmpPair::retrieve ( const std::string &  asSubdirOf = ".")

Definition at line 218 of file FitAmpPair.cpp.

218  {
219  bool dbThis=false;
220  bool success=true;
221 
222  success &= retrieveValues(asSubdirOf);
223  if(slow()) success &= retrieveHistos(asSubdirOf);
224 
225  if(dbThis && slow()){
226  cout << "after FitAmpPair::retrieve: pat = "
227  << histosRe().begin()->second.pattern() << ", "
228  << histosIm().begin()->second.pattern() << endl;
229  }
230  return success;
231 }
const DalitzHistoSet & histosRe() const
Definition: FitAmpPair.h:73
const DalitzHistoSet & histosIm() const
Definition: FitAmpPair.h:74
bool retrieveHistos(const std::string &asSubdirOf=".")
Definition: FitAmpPair.cpp:250
bool retrieveValues(const std::string &fromDirectory=".")
Definition: FitAmpPair.cpp:299
std::map< Key, Val >::iterator begin()
Definition: PolymorphMap.h:26
bool slow() const
Definition: FitAmpPair.h:179

◆ retrieveHistos()

bool FitAmpPair::retrieveHistos ( const std::string &  asSubdirOf = ".")
private

Definition at line 250 of file FitAmpPair.cpp.

250  {
251  bool sc = true;
252  sc |= histosRe().retrieveFromDir(histoReFileName(asSubdirOf));
253  sc |= histosIm().retrieveFromDir(histoImFileName(asSubdirOf));
254  return sc;
255 }
std::string histoReFileName(const std::string &asSubdirOf) const
Definition: FitAmpPair.cpp:237
const DalitzHistoSet & histosRe() const
Definition: FitAmpPair.h:73
const DalitzHistoSet & histosIm() const
Definition: FitAmpPair.h:74
std::string histoImFileName(const std::string &asSubdirOf) const
Definition: FitAmpPair.cpp:240
bool retrieveFromDir(const std::string &asSubDirOf=".")

◆ retrieveValues()

bool FitAmpPair::retrieveValues ( const std::string &  fromDirectory = ".")
private

Definition at line 299 of file FitAmpPair.cpp.

299  {
300  bool dbThis=false;
301  std::string fname = valueFileName(fromDirectory);
302  if(dbThis)cout << "trying to retreive values from: " << fname << endl;
303  if(dbThis)cout << "current sum " << _sum << endl;
304 
305  NamedParameter<double> n_sumRe(_sumName + ".real()", fname.c_str()
306  );
307  n_sumRe.reloadFile(fname.c_str());
308  NamedParameter<double> n_sumIm(_sumName + ".imag()", fname.c_str()
309  );//,NamedParameterBase::QUIET);
310  NamedParameter<double> n_sumSqRe(_sumSqName + ".real()", fname.c_str()
311  );//, NamedParameterBase::QUIET);
312  NamedParameter<double> n_sumSqIm(_sumSqName + ".imag()", fname.c_str()
313  );//, NamedParameterBase::QUIET);
314  NamedParameter<long int> n_Nevents(_NName, fname.c_str()
315  );// , NamedParameterBase::QUIET);
316  NamedParameter<double> n_weightSum(_weightSumName, fname.c_str()
317  );//, NamedParameterBase::QUIET);
318 
319  complex<double> n_sum(n_sumRe, n_sumIm);
320 
321  if(dbThis) cout << "n_sumRe " << n_sumRe << "n_sum " << n_sum << endl;
322  _sum = n_sum;
323  if(dbThis) cout << "_sum = " << _sum << endl;
324  complex<double> n_sumsq(n_sumSqRe, n_sumSqIm);
325  _sumsq = n_sumsq;
326  _Nevents = n_Nevents;
327  _weightSum = n_weightSum;
328 
329  return true;
330 }
std::string _sumName
Definition: FitAmpPair.h:32
std::string _sumSqName
Definition: FitAmpPair.h:35
std::complex< double > _sumsq
Definition: FitAmpPair.h:34
std::string valueFileName(const std::string &asSubdirOf) const
Definition: FitAmpPair.cpp:234
std::string _NName
Definition: FitAmpPair.h:38
double _weightSum
Definition: FitAmpPair.h:40
long int _Nevents
Definition: FitAmpPair.h:37
bool reloadFile(const std::string &id)
std::string _weightSumName
Definition: FitAmpPair.h:41
std::complex< double > _sum
Definition: FitAmpPair.h:31

◆ save()

bool FitAmpPair::save ( const std::string &  asSubdirOf = ".") const

Definition at line 206 of file FitAmpPair.cpp.

206  {
207  bool success=true;
208  makeDirectory(asSubdirOf); // ignore error codes from mkdir, they could
209  // be because directory already exists - if
210  // not, we'll pick it up when we try to save
211  // the files.
212 
213  success &= saveValues(asSubdirOf);
214  success &= saveHistos(asSubdirOf);
215 
216  return success;
217 }
bool saveHistos(const std::string &asSubdirOf=".") const
Definition: FitAmpPair.cpp:244
bool saveValues(const std::string &asSubdirOf=".") const
Definition: FitAmpPair.cpp:257
bool makeDirectory(const std::string &asSubdirOf=".") const
Definition: FitAmpPair.cpp:171

◆ saveHistos()

bool FitAmpPair::saveHistos ( const std::string &  asSubdirOf = ".") const
private

Definition at line 244 of file FitAmpPair.cpp.

244  {
245  bool sc = true;
246  sc |= histosRe().saveAsDir(histoReFileName(asSubdirOf));
247  sc |= histosIm().saveAsDir(histoImFileName(asSubdirOf));
248  return sc;
249 }
std::string histoReFileName(const std::string &asSubdirOf) const
Definition: FitAmpPair.cpp:237
const DalitzHistoSet & histosRe() const
Definition: FitAmpPair.h:73
const DalitzHistoSet & histosIm() const
Definition: FitAmpPair.h:74
std::string histoImFileName(const std::string &asSubdirOf) const
Definition: FitAmpPair.cpp:240
bool saveAsDir(const std::string &asSubdirOf=".") const

◆ saveValues()

bool FitAmpPair::saveValues ( const std::string &  asSubdirOf = ".") const
private

Definition at line 257 of file FitAmpPair.cpp.

257  {
258 
259  NamedParameter<double> n_sumRe(_sumName + ".real()"
260  , NamedParameterBase::QUIET);
261  NamedParameter<double> n_sumIm(_sumName + ".imag()"
262  ,NamedParameterBase::QUIET);
263  NamedParameter<double> n_sumSqRe(_sumSqName + ".real()"
264  , NamedParameterBase::QUIET);
265  NamedParameter<double> n_sumSqIm(_sumSqName + ".imag()"
266  , NamedParameterBase::QUIET);
268  , NamedParameterBase::QUIET);
270  , NamedParameterBase::QUIET);
271 
272  n_sumRe = _sum.real();
273  n_sumIm = _sum.imag();
274  n_sumSqRe = _sumsq.real();
275  n_sumSqIm = _sumsq.imag();
276  n_Nevents = _Nevents;
277  n_weightSum = _weightSum;
278 
279  std::string fname = valueFileName(asSubdirOf);
280  ofstream os(fname.c_str());
281  if(os.bad()){
282  cout << "ERROR in FitAmpPair::saveValues of \n\t" << name()
283  << "\n\t unable to create file: "
284  << "\n\t" << fname << endl;
285  return false;
286  }
287  os << setprecision(20)
288  << name()
289  << '\n' << n_sumRe
290  << '\n' << n_sumIm
291  << '\n' << n_sumSqRe
292  << '\n' << n_sumSqIm
293  << '\n' << n_Nevents
294  << '\n' << n_weightSum
295  << endl;
296  os.close();
297  return true;
298 }
std::string _sumName
Definition: FitAmpPair.h:32
std::string _sumSqName
Definition: FitAmpPair.h:35
std::complex< double > _sumsq
Definition: FitAmpPair.h:34
std::string valueFileName(const std::string &asSubdirOf) const
Definition: FitAmpPair.cpp:234
std::string _NName
Definition: FitAmpPair.h:38
double _weightSum
Definition: FitAmpPair.h:40
long int _Nevents
Definition: FitAmpPair.h:37
std::string _weightSumName
Definition: FitAmpPair.h:41
std::complex< double > _sum
Definition: FitAmpPair.h:31
const std::string & name() const
Definition: FitAmpPair.cpp:605

◆ setFast()

void FitAmpPair::setFast ( )
inline

Definition at line 177 of file FitAmpPair.h.

177 {_slow = false;}
bool _slow
Definition: FitAmpPair.h:27

◆ setSlow()

void FitAmpPair::setSlow ( )
inline

Definition at line 176 of file FitAmpPair.h.

176 {_slow = true;}
bool _slow
Definition: FitAmpPair.h:27

◆ slow()

bool FitAmpPair::slow ( ) const
inline

Definition at line 179 of file FitAmpPair.h.

179 {return _slow;}
bool _slow
Definition: FitAmpPair.h:27

◆ startIntegration()

void FitAmpPair::startIntegration ( )

Definition at line 511 of file FitAmpPair.cpp.

511  {
512  _beingIntegrated=true;
513 }
bool _beingIntegrated
Definition: FitAmpPair.h:28

◆ startReIntegration()

void FitAmpPair::startReIntegration ( )

Definition at line 507 of file FitAmpPair.cpp.

507  {
508  reset();
509  _beingIntegrated=true;
510 }
void reset()
Definition: FitAmpPair.cpp:489
bool _beingIntegrated
Definition: FitAmpPair.h:28

◆ valNoFitPars()

std::complex< double > FitAmpPair::valNoFitPars ( ) const

Definition at line 447 of file FitAmpPair.cpp.

447  {
448 /* bool dbThis=false;
449  if(dbThis){
450  cout << " FitAmpPair::sumWithoutFitPars for pair "
451  << fitAmp1().name() << " / " << fitAmp2().name()
452  << endl;
453  }*/
454  double dN = (double) _Nevents;
455  std::complex<double> total = ((std::complex<double>)oneOrTwo()) * _sum;
456  std::complex<double> returnVal;
457 
458  if(0.0 == total) return 0.0;
459 
460  if(_weightSum > 0){
461  returnVal = total/_weightSum;
462  }else{
463  returnVal = total/dN;
464  }
465 
466 /* if(dbThis){
467  cout << "\t returning " << returnVal << endl;
468  cout << "\t = Real( " << oneOrTwo()
469  << " * " << _sum
470  << " / " << _Nevents
471  << " )"
472  << endl;
473  }*/
474  return returnVal;
475 }
double _weightSum
Definition: FitAmpPair.h:40
int oneOrTwo() const
Definition: FitAmpPair.h:65
long int _Nevents
Definition: FitAmpPair.h:37
std::complex< double > _sum
Definition: FitAmpPair.h:31

◆ valueFileName()

std::string FitAmpPair::valueFileName ( const std::string &  asSubdirOf) const
private

Definition at line 234 of file FitAmpPair.cpp.

234  {
235  return asSubdirOf + "/" + dirName() + "/value.txt";
236 }
const std::string & dirName() const
Definition: FitAmpPair.cpp:613

◆ variance()

double FitAmpPair::variance ( ) const

Definition at line 574 of file FitAmpPair.cpp.

574  {
575  if(_Nevents <=0) return 0;
576  double dN = (double) _Nevents;
577  complex<double> mean = _sum/dN;
578  complex<double> meansq = _sumsq/dN;
579 
580  complex<double> var(meansq.real() - mean.real()*mean.real()
581  , meansq.imag() - mean.imag()*mean.imag());
582 
583  var /= dN;
584 
585  if(_weightSum > 0) var *= dN*dN/(_weightSum*_weightSum);
586 
587  return oneOrTwo() * (fitParValue() * var).real();
588 }
std::complex< double > fitParValue() const
Definition: FitAmpPair.h:58
std::complex< double > _sumsq
Definition: FitAmpPair.h:34
double _weightSum
Definition: FitAmpPair.h:40
int oneOrTwo() const
Definition: FitAmpPair.h:65
long int _Nevents
Definition: FitAmpPair.h:37
std::complex< double > _sum
Definition: FitAmpPair.h:31

◆ weightSum()

double FitAmpPair::weightSum ( ) const

Definition at line 480 of file FitAmpPair.cpp.

480  {
481  if(_weightSum > 0) return _weightSum;
482  else return (double) _Nevents;
483 }
double _weightSum
Definition: FitAmpPair.h:40
long int _Nevents
Definition: FitAmpPair.h:37

Friends And Related Function Documentation

◆ FitAmpPairCovariance

friend class FitAmpPairCovariance
friend

Definition at line 189 of file FitAmpPair.h.

Member Data Documentation

◆ _beingIntegrated

bool FitAmpPair::_beingIntegrated
private

Definition at line 28 of file FitAmpPair.h.

◆ _dirName

std::string FitAmpPair::_dirName
private

Definition at line 47 of file FitAmpPair.h.

◆ _eventDependentParameters

MINT::FitParDependent FitAmpPair::_eventDependentParameters
private

Definition at line 29 of file FitAmpPair.h.

◆ _fitA1

FitAmplitude* FitAmpPair::_fitA1
private

Definition at line 24 of file FitAmpPair.h.

◆ _fitA2

FitAmplitude* FitAmpPair::_fitA2
private

Definition at line 25 of file FitAmpPair.h.

◆ _hsIm

DalitzHistoSet FitAmpPair::_hsIm
private

Definition at line 44 of file FitAmpPair.h.

◆ _hsRe

DalitzHistoSet FitAmpPair::_hsRe
private

Definition at line 43 of file FitAmpPair.h.

◆ _lastEntry

std::complex<double> FitAmpPair::_lastEntry
private

Definition at line 49 of file FitAmpPair.h.

◆ _name

std::string FitAmpPair::_name
private

Definition at line 46 of file FitAmpPair.h.

◆ _Nevents

long int FitAmpPair::_Nevents
private

Definition at line 37 of file FitAmpPair.h.

◆ _NName

std::string FitAmpPair::_NName
private

Definition at line 38 of file FitAmpPair.h.

◆ _slow

bool FitAmpPair::_slow
private

Definition at line 27 of file FitAmpPair.h.

◆ _sum

std::complex<double> FitAmpPair::_sum
private

Definition at line 31 of file FitAmpPair.h.

◆ _sumName

std::string FitAmpPair::_sumName
private

Definition at line 32 of file FitAmpPair.h.

◆ _sumsq

std::complex<double> FitAmpPair::_sumsq
private

Definition at line 34 of file FitAmpPair.h.

◆ _sumSqName

std::string FitAmpPair::_sumSqName
private

Definition at line 35 of file FitAmpPair.h.

◆ _weightSum

double FitAmpPair::_weightSum
private

Definition at line 40 of file FitAmpPair.h.

◆ _weightSumName

std::string FitAmpPair::_weightSumName
private

Definition at line 41 of file FitAmpPair.h.


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