MINT2
FitAmpPair.cpp
Go to the documentation of this file.
1 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
2 // status: Mon 9 Feb 2009 19:18:03 GMT
3 #include "Mint/FitAmpPair.h"
4 #include "Mint/FitAmplitude.h"
5 #include "Mint/IDalitzEvent.h"
6 #include "Mint/NamedParameter.h"
7 
8 #include <iostream>
9 #include <iomanip>
10 #include <fstream>
11 
12 #include <complex>
13 #include <algorithm>
14 
15 //#include <boost/filesystem>
16 #include <sys/types.h>
17 #include <sys/stat.h>
18 
19 //#include "boost/filesystem.hpp"
20 
21 using namespace std;
22 using namespace MINT;
23 
25  : _fitA1(0)
26  , _fitA2(0)
27  , _slow(true)
28  , _beingIntegrated(true)
29  , _eventDependentParameters(this)
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 }
45 
47  : _fitA1(&a1)
48  , _fitA2(&a2)
49  , _slow(true)
50  , _beingIntegrated(true)
51  , _eventDependentParameters(this)
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 }
84  : FitParDependent(other)
85  , _fitA1(other._fitA1)
86  , _fitA2(other._fitA2)
87  , _slow(other._slow)
88  , _beingIntegrated(other._beingIntegrated)
89  , _eventDependentParameters(other._eventDependentParameters)
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)
97  , _weightSumName(other._weightSumName)
98  , _hsRe(other._hsRe)
99  , _hsIm(other._hsIm)
100  , _name(other._name)
101  , _dirName(other._dirName)
102  , _lastEntry(other._lastEntry)
103 {
104 }
105 
106 bool FitAmpPair::isCompatibleWith(const FitAmpPair& other) const{
107  return (fitAmp1().name() == other.fitAmp1().name() &&
108  fitAmp2().name() == other.fitAmp2().name());
109 }
110 bool FitAmpPair::add(const FitAmpPair& other){
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 }
130  , const std::complex<double>& c){
131  _hsRe.addEvent(*evtPtr, c.real());
132  _hsIm.addEvent(*evtPtr, c.imag());
133 }
134 
135 const std::string& FitAmpPair::makeName(){
136  _name = "A(" + fitAmp1().name() + ")_x_fitA(" + fitAmp2().name() + ")*";
137  return _name;
138 }
139 
140 const std::string& FitAmpPair::makeDirName(){
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 }
170 
171 bool FitAmpPair::makeDirectory(const std::string& asSubdirOf)const{
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 }
205 
206 bool FitAmpPair::save(const std::string& asSubdirOf) const{
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 }
218 bool FitAmpPair::retrieve(const std::string& asSubdirOf){
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 }
232 
233 
234 std::string FitAmpPair::valueFileName(const std::string& asSubdirOf)const{
235  return asSubdirOf + "/" + dirName() + "/value.txt";
236 }
237 std::string FitAmpPair::histoReFileName(const std::string& asSubdirOf)const{
238  return asSubdirOf + "/" + dirName() + "/histoRe";
239 }
240 std::string FitAmpPair::histoImFileName(const std::string& asSubdirOf)const{
241  return asSubdirOf + "/" + dirName() + "/histoIm";
242 }
243 
244 bool FitAmpPair::saveHistos(const std::string& asSubdirOf) const{
245  bool sc = true;
246  sc |= histosRe().saveAsDir(histoReFileName(asSubdirOf));
247  sc |= histosIm().saveAsDir(histoImFileName(asSubdirOf));
248  return sc;
249 }
250 bool FitAmpPair::retrieveHistos(const std::string& asSubdirOf){
251  bool sc = true;
252  sc |= histosRe().retrieveFromDir(histoReFileName(asSubdirOf));
253  sc |= histosIm().retrieveFromDir(histoImFileName(asSubdirOf));
254  return sc;
255 }
256 
257 bool FitAmpPair::saveValues(const std::string& asSubdirOf) const{
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 }
299 bool FitAmpPair::retrieveValues(const std::string& fromDirectory){
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 }
331 
332 //bool FitAmpPair::saveHistograms(const std::string& asSubdirOf) const;
333 //}
334 
335 
337  , double weight
338  , double efficiency
339  ){
340  if(0 == evtPtr) return 0;
341  return add(*evtPtr, weight, efficiency);
342 }
344  , double weight
345  , double efficiency
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 }
388 
390  , double weight
391  , double efficiency
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 }
435 
436 
438  , double weight
439  , double efficiency
440  ){
441  return add(evtPtr.get(), weight, efficiency);
442 }
443 complex<double> FitAmpPair::lastEntry() const{
444  return _lastEntry;
445 }
446 
447 std::complex<double> FitAmpPair::valNoFitPars() const{
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 }
476 double FitAmpPair::integral() const{
477 
478  return complexVal().real();
479 }
480 double FitAmpPair::weightSum() const{
481  if(_weightSum > 0) return _weightSum;
482  else return (double) _Nevents;
483 }
484 
485 long int FitAmpPair::N() const{
486  return _Nevents;
487 }
488 
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 }
499 
502 }
505 }
506 
508  reset();
509  _beingIntegrated=true;
510 }
512  _beingIntegrated=true;
513 }
514 
516  _beingIntegrated=false;
518 }
519 
521  return _beingIntegrated;
522 }
523 /* now inline:
524 DalitzHistoSet FitAmpPair::histoSet() const{
525  return histoSetRe();
526 }
527 */
528 
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 }
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 }
573 
574 double FitAmpPair::variance() const{
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 }
589 
591  return _fitA1 == _fitA2;
592 }
593 
595  if(_fitA1->theBareDecay().getVal() == _fitA2->theBareDecay().getVal() )return true;
596  return false;
597 }
598 
599 const std::string& FitAmpPair::name(){
600  if("" == _name) makeName();
601  return _name;
602  // if(isSingleAmp()) return "| " + _fitA1->name() + " |^2";
603  // else return "(" + _fitA1->name() +") * (" + _fitA2->name() + ")*";
604 }
605 const std::string& FitAmpPair::name() const{
606  return _name;
607 }
608 
609 const std::string& FitAmpPair::dirName(){
610  if("" == _dirName) makeDirName();
611  return _dirName;
612 }
613 const std::string& FitAmpPair::dirName() const{
614  return _dirName;
615 }
616 
617 /*
618 // the following routines are needed to
619 // calculate the variance
620 double FitAmpPair::ReSquared() const{
621  return pow(oneOrTwo() * fitParValue().real(), 2)*_sumsq.real();
622 }
623 double FitAmpPair::ImSquared() const{
624  return pow(oneOrTwo() * fitParValue().imag(), 2)*_sumsq.imag();
625 }
626 double FitAmpPair::ImRe() const{
627  return oneOrTwo() * oneOrTwo()
628  * fitParValue().real()*_sum.real()
629  * fitParValue().imag()*_sum.imag();
630 
631 }
632 */
633 
634 void FitAmpPair::print(std::ostream& os) const{
635  os << "FitAmpPair " << name()
636  << ": N=" << N() << ", integral=" << integral();
637 }
639  , const FitAmpPair& b) const{
640  return a.integral() < b.integral();
641 }
642 
644 
645  if(0 == a && 0==b) return false;
646  if(0 == a && 0!=b) return true;
647  if(0 !=a && 0==b) return false;
648  return a->integral() < b->integral();
649 }
650 bool lessByFitAmpPairIntegral_ptr_int_pair::operator()(const std::pair<FitAmpPair*, int>& apair
651  , const std::pair<FitAmpPair*, int>& bpair) const{
652  const FitAmpPair* a = apair.first;
653  const FitAmpPair* b = bpair.first;
654 
655  if(0 == a && 0==b) return false;
656  if(0 == a && 0!=b) return true;
657  if(0 !=a && 0==b) return false;
658  return a->integral() < b->integral();
659 }
660 
661 
663  this->add(other);
664  return *this;
665 }
667  FitAmpPair returnVal(*this);
668  returnVal += other;
669  return returnVal;
670 }
671 
672 std::ostream& operator<<(std::ostream& os, const FitAmpPair& fap){
673  fap.print(os);
674  return os;
675 }
676 //
std::string _sumName
Definition: FitAmpPair.h:32
std::string histoReFileName(const std::string &asSubdirOf) const
Definition: FitAmpPair.cpp:237
std::string _sumSqName
Definition: FitAmpPair.h:35
bool acceptEvents() const
Definition: FitAmpPair.cpp:520
virtual bool changedSinceLastCall() const
std::complex< double > fitParValue() const
Definition: FitAmpPair.h:58
void startIntegration()
Definition: FitAmpPair.cpp:511
virtual void print(std::ostream &os=std::cout) const
Definition: FitAmpPair.cpp:634
const DalitzHistoSet & histosRe() const
Definition: FitAmpPair.h:73
virtual double getWeight() const =0
FitAmplitude * _fitA1
Definition: FitAmpPair.h:24
std::string _dirName
Definition: FitAmpPair.h:47
MINT::FitParDependent _eventDependentParameters
Definition: FitAmpPair.h:29
virtual double phaseSpace() const =0
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 > complexVal() const
Definition: FitAmpPair.h:126
bool add(const FitAmpPair &other)
Definition: FitAmpPair.cpp:110
std::complex< double > _lastEntry
Definition: FitAmpPair.h:49
bool operator()(const std::pair< FitAmpPair *, int > &a, const std::pair< FitAmpPair *, int > &b) const
Definition: FitAmpPair.cpp:650
std::string _name
Definition: FitAmpPair.h:46
double integral() const
Definition: FitAmpPair.cpp:476
void reset()
Definition: FitAmpPair.cpp:489
bool operator()(const FitAmpPair &a, const FitAmpPair &b) const
Definition: FitAmpPair.cpp:638
Amplitude & rawAmp1()
Definition: FitAmpPair.h:170
std::string valueFileName(const std::string &asSubdirOf) const
Definition: FitAmpPair.cpp:234
const DalitzHistoSet & histosIm() const
Definition: FitAmpPair.h:74
double variance() const
Definition: FitAmpPair.cpp:574
bool retrieve(const std::string &asSubdirOf=".")
Definition: FitAmpPair.cpp:218
DalitzHistoSet _hsRe
Definition: FitAmpPair.h:43
DecayTree theBareDecay() const
Definition: FitAmplitude.h:166
std::complex< double > lastEntry() const
Definition: FitAmpPair.cpp:443
const ValueType & getVal() const
Definition: DDTree.h:102
const std::string & dirName() const
Definition: FitAmpPair.cpp:613
FitAmplitude & fitAmp2()
Definition: FitAmpPair.h:160
bool saveHistos(const std::string &asSubdirOf=".") const
Definition: FitAmpPair.cpp:244
const std::string & makeName()
Definition: FitAmpPair.cpp:135
DalitzHistoSet histoSetRe() const
Definition: FitAmpPair.cpp:529
std::string histoImFileName(const std::string &asSubdirOf) const
Definition: FitAmpPair.cpp:240
bool retrieveHistos(const std::string &asSubdirOf=".")
Definition: FitAmpPair.cpp:250
bool operator()(const FitAmpPair *a, const FitAmpPair *b) const
Definition: FitAmpPair.cpp:643
bool retrieveFromDir(const std::string &asSubDirOf=".")
virtual bool registerFitParDependence(const IFitParDependent &fpd)
FitAmplitude & fitAmp1()
Definition: FitAmpPair.h:153
std::string _NName
Definition: FitAmpPair.h:38
bool hasMatchingPattern() const
Definition: FitAmpPair.cpp:594
Amplitude & rawAmp2()
Definition: FitAmpPair.h:171
double _weightSum
Definition: FitAmpPair.h:40
DalitzHistoSet histoSetIm() const
Definition: FitAmpPair.cpp:551
int oneOrTwo() const
Definition: FitAmpPair.h:65
double weightSum() const
Definition: FitAmpPair.cpp:480
long int _Nevents
Definition: FitAmpPair.h:37
bool _beingIntegrated
Definition: FitAmpPair.h:28
bool retrieveValues(const std::string &fromDirectory=".")
Definition: FitAmpPair.cpp:299
virtual double getGeneratorPdfRelativeToPhaseSpace() const =0
void addEvent(const IDalitzEvent &evt, double weight=1)
bool needToReIntegrate() const
Definition: FitAmpPair.cpp:500
bool reloadFile(const std::string &id)
std::map< Key, Val >::iterator begin()
Definition: PolymorphMap.h:26
virtual void rememberFitParValues()
bool saveValues(const std::string &asSubdirOf=".") const
Definition: FitAmpPair.cpp:257
std::ostream & operator<<(std::ostream &os, const FitAmpPair &fap)
Definition: FitAmpPair.cpp:672
void rememberEventDependentParameters()
Definition: FitAmpPair.cpp:503
FitAmpPair & operator+=(const FitAmpPair &other)
Definition: FitAmpPair.cpp:662
std::string _weightSumName
Definition: FitAmpPair.h:41
void startReIntegration()
Definition: FitAmpPair.cpp:507
void endIntegration()
Definition: FitAmpPair.cpp:515
bool isSingleAmp() const
Definition: FitAmpPair.cpp:590
bool saveAsDir(const std::string &asSubdirOf=".") const
bool makeDirectory(const std::string &asSubdirOf=".") const
Definition: FitAmpPair.cpp:171
bool slow() const
Definition: FitAmpPair.h:179
FitAmplitude * _fitA2
Definition: FitAmpPair.h:25
void addToHistograms(IDalitzEvent *evtPtr, const std::complex< double > &c)
Definition: FitAmpPair.cpp:129
DalitzHistoSet _hsIm
Definition: FitAmpPair.h:44
std::complex< double > _sum
Definition: FitAmpPair.h:31
long int N() const
Definition: FitAmpPair.cpp:485
std::complex< double > valNoFitPars() const
Definition: FitAmpPair.cpp:447
const std::string & name() const
Definition: FitAmpPair.cpp:605
X * get() const
Definition: counted_ptr.h:123
double reAdd(IDalitzEvent &evt, double weight=1, double efficiency=1)
Definition: FitAmpPair.cpp:389
bool isCompatibleWith(const FitAmpPair &other) const
Definition: FitAmpPair.cpp:106
std::complex< double > ampValue(IDalitzEvent &evtPtr)
Definition: FitAmpPair.h:51
bool save(const std::string &asSubdirOf=".") const
Definition: FitAmpPair.cpp:206
FitAmpPair operator+(const FitAmpPair &other) const
Definition: FitAmpPair.cpp:666