29 , _A_plus_Abar(A+Abar)
32 , _sumASq(0), _sumASqSquared(0)
33 , _sumAbarSq(0), _sumAbarSqSquared(0)
34 , _sumAxAbarStar(0,0), _sumAxAbarStarSquared(0,0)
35 , _histoA(), _histoAbar(), _histoBoth()
42 if(0 ==
_eff)
return 1.0;
80 if(
s == 0)
return -9999;
83 double varAsq = (msq -
m*
m)/((
double)
_Nevents);
85 return 0.5 * varAsq / fabs(
s);
99 double v = meanOfSq - mean*mean;
106 double v = meanOfSq - mean*mean;
111 , complex<double> s_sq
115 complex<double> mos = s_sq / ((double)
_Nevents);
116 complex<double> som(
m.real()*
m.real(),
m.imag()*
m.imag());
117 return (mos - som)/((double)
_Nevents);
123 complex<double>
m =
Rval();
124 complex<double> som(
m.real()*
m.real(),
m.imag()*
m.imag());
127 if(den <= 0)
return complex<double>(-9999,-9999);
131 complex<double> a(ar, ai);
137 cout <<
"var() = " << a <<
" + " << b <<
" + " << c
138 <<
" = " << a + b + c << endl;
144 return complex<double>(sqrt(fabs(
var().real())), sqrt(fabs(
var().imag())));
147 double a =
var().real() * 2*fabs(
Rval().real()/norm(
Rval()));
148 double b =
var().imag() * 2*fabs(
Rval().imag()/norm(
Rval()));
153 if(va < 0)
return -9999;
157 double a= fabs(
Rval().real());
158 double b= fabs(
Rval().imag());
159 double den = a*a + b*b;
160 if(den <= 0)
return -9999;
162 return var().real()*b/den +
var().imag()*a/den;
169 if(va < 0)
return -9999;
174 if(va < 0)
return -9999;
183 os <<
"Integrals from CoherenceFactorStoreAndEvaluate\n" 188 os <<
"\n\t int |Abar|^2/rB^2 " <<
integAbarSq()/rBSq;
194 os <<
"\n\n Coherence factor result (same result, different formats):" 195 <<
"\n\tR exp(i xi) = " <<
Rval() <<
" +/- " <<
sigma()
196 <<
"\n\tR exp(i xi) = " << abs(
Rval())
197 <<
" * exp( i * " << arg(
Rval()) <<
" )" 200 <<
"\n\tR exp(i xi) = " << abs(
Rval())
201 <<
" * exp( i * " << arg(
Rval())*180.0/
pi <<
" deg )" 205 cout <<
"\n\tR exp(i xi) = " << abs(
Rval())
206 <<
" * exp( i * " << arg(
Rval())*180.0/
pi + 360. <<
" deg )" 213 ,
const std::string& pref)
const{
214 os << pref <<
"\t int |A| = " << this->
integA()
215 <<
"\t int |Abar| = " << this->
integAbar()
217 <<
'\n' << pref <<
"\tR exp(i xi) = " << abs(
Rval())
218 <<
" * exp( i * " << arg(
Rval())*180.0/
pi <<
" deg )" 219 <<
"\n" << pref <<
"\t sig(R) = " <<
sigmaAbs()
229 return arg(
Rval())*180.0/
pi;
237 if(dbThis) cout <<
"CoherenceFactorStoreAndEvaluate::Abar_Value" << endl;
239 if(dbThis) cout <<
"got value: " << val << endl;
246 if(dbThis) cout <<
"Hello from CoherenceFactorStoreAndEvaluate::getCVal()" 252 bool printout =
false;
255 if(dbThis) cout <<
"WARNING in CoherenceFactorStoreAndEvaluate::getR()" 256 <<
" got evtPtr = " << evtPtr << endl;
261 cout <<
"=======================\n";
262 cout <<
"all A amplitudes\n";
264 cout <<
"all Abar ampltiudes\n";
280 complex<double> c_abar=
283 double d_a = norm(c_a);
284 double d_abar = norm(c_abar);
296 complex<double> c_prod = c_a * conj(c_abar);
298 complex<double> c_prodSquared(c_prod.real() * c_prod.real()
299 , c_prod.imag() * c_prod.imag()
306 cout <<
" DalitzEvent::EventCounter() " 309 cout <<
"INFO from CoherenceFactorStoreAndEvaluate::getR()" 310 <<
"\n\t _tries: " <<
_tries <<
", for " <<
_Nevents <<
" events." 318 cout <<
" --------------------------------- " << endl;
350 ,
const std::string& fname
361 ,
const std::string& fname
std::complex< double > sigma() const
std::complex< double > Abar_Value(IDalitzEvent &evt)
double sigmaAngleDeg() const
std::complex< double > complexVar(std::complex< double > s, std::complex< double > s_sq) const
virtual double getWeight() const =0
bool drawHistoRatios(const CoherenceFactorStoreAndEvaluate &other, const std::string &fname="CoherenceFactorHistosWith", double sf=1) const
void printLong(std::ostream &os=std::cout) const
MINT::IReturnComplexForEvent< IDalitzEvent > * A()
virtual void printAllAmps(std::ostream &os=std::cout) const
const DalitzHistoSet & getHistoBoth() const
double estimatedPrecision() const
virtual double RealVal(EVENT_TYPE &evt)=0
static long int eventCounter()
const DalitzHistoSet & getHistoAbar() const
std::complex< double > _sumAxAbarStarSquared
bool drawWithFit(const DalitzHistoSet &fit, const std::string &baseName="", const std::string &format="eps", const std::string &fitDrawOpt="HIST C SAME") const
std::complex< double > cvarAxAbarStar() const
std::complex< double > Rval() const
DalitzHistoSet _histoBoth
bool draw(const std::string &baseName="", const std::string &drawOpt="", const std::string &format="eps") const
double getEff(IDalitzEvent &evt)
std::complex< double > integAxAbarStar() const
void print(std::ostream &os=std::cout, const std::string &pref="") const
double sigmaAngle() const
std::complex< double > A_Value(IDalitzEvent &evt)
virtual double getGeneratorPdfRelativeToPhaseSpace() const =0
void addEvent(const IDalitzEvent &evt, double weight=1)
double realAorAbarVar(double s, double sq) const
double varAngleDeg() const
std::complex< double > var() const
CoherenceFactorStoreAndEvaluate(FitAmpSum &A, FitAmpSum &Abar, double CSAbs=1, double CSPhase=0.0, MINT::IReturnRealForEvent< IDalitzEvent > *eff=0, double prec=1.e-3)
bool addEvent(MINT::counted_ptr< IDalitzEvent > &evtPtr)
MINT::IReturnRealForEvent< IDalitzEvent > * _eff
const DalitzHistoSet & getHistoA() const
virtual std::complex< double > ComplexVal(EVENT_TYPE &evt)=0
MINT::IReturnComplexForEvent< IDalitzEvent > * Abar()
bool drawHistosWith(const CoherenceFactorStoreAndEvaluate &other, const std::string &fname="CoherenceFactorHistosWith", double sf=1) const
bool save(const std::string &filename="DalitzHistos.root") const
bool saveHistos(const std::string &fname="CoherenceFactorHistos") const
std::complex< double > _sumAxAbarStar
bool drawHistos(const std::string &fname="CoherenceFactorHistos") const
double integAbarSq() const
void scaleHistos(double sf=1)
DalitzHistoSet _histoAbar