27 , _A_plus_Abar(A+Abar)
28 , _myOwnGenAplusAbar(0)
31 , _sumASq(0), _sumASqSquared(0)
32 , _sumAbarSq(0), _sumAbarSqSquared(0)
33 , _sumAxAbarStar(0,0), _sumAxAbarStarSquared(0,0)
42 if(dbThis) cout <<
"CoherenceFactor::getGenerator(): " 43 <<
"making generator" << endl;
48 if(dbThis) cout <<
"made generator." << endl;
58 if(0 ==
_eff)
return 1.0;
96 if(
s == 0)
return -9999;
99 double varAsq = (msq -
m*
m)/((
double)
_Nevents);
101 return 0.5 * varAsq / fabs(
s);
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);
124 complex<double>
m =
Rval();
125 complex<double> som(
m.real()*
m.real(),
m.imag()*
m.imag());
128 if(den <= 0)
return complex<double>(-9999,-9999);
132 complex<double> a(ar, ai);
138 cout <<
"var() = " << a <<
" + " << b <<
" + " << c
139 <<
" = " << a + b + c << endl;
145 return complex<double>(sqrt(fabs(
var().real())), sqrt(fabs(
var().imag())));
148 double a =
var().real() * 2*fabs(
Rval().real()/norm(
Rval()));
149 double b =
var().imag() * 2*fabs(
Rval().imag()/norm(
Rval()));
154 if(va < 0)
return -9999;
158 double a= fabs(
Rval().real());
159 double b= fabs(
Rval().imag());
160 double den = a*a + b*b;
161 if(den <= 0)
return -9999;
163 return var().real()*b/den +
var().imag()*a/den;
167 if(va < 0)
return -9999;
176 os <<
"Integrals from CoherenceFactor\n" 181 os <<
"\n\t int |Abar|^2/rB^2 " <<
integAbarSq()/rBSq;
187 os <<
"\n\n Coherence factor result (same result, different formats):" 188 <<
"\n\tR exp(i xi) = " <<
Rval() <<
" +/- " <<
sigma()
189 <<
"\n\tR exp(i xi) = " << abs(
Rval())
190 <<
" * exp( i * " << arg(
Rval()) <<
" )" 193 <<
"\n\tR exp(i xi) = " << abs(
Rval())
194 <<
" * exp( i * " << arg(
Rval())*180.0/
pi <<
" deg )" 198 cout <<
"\n\tR exp(i xi) = " << abs(
Rval())
199 <<
" * exp( i * " << arg(
Rval())*180.0/
pi + 360. <<
" deg )" 211 if(dbThis) cout <<
"CoherenceFactor::Abar_Value" << endl;
213 if(dbThis) cout <<
"got value: " << val << endl;
219 if(dbThis) cout <<
"Hello from CoherenceFactor::getCVal()" << endl;
220 long int rediculousNumber = 1000000000;
223 int printEvery = 10000;
226 for(
int i=0; i < 1000; i++){
228 bool printout = tries < 10 || (0 == tries%printEvery);
233 if(dbThis) cout <<
"WARNING in CoherenceFactor::getR()" 234 <<
" got evtPtr = " << evtPtr << endl;
251 complex<double> c_abar=
254 double d_a = norm(c_a);
255 double d_abar = norm(c_abar);
263 complex<double> c_prod = c_a * conj(c_abar);
265 complex<double> c_prodSquared(c_prod.real() * c_prod.real()
266 , c_prod.imag() * c_prod.imag()
273 cout <<
" DalitzEvent::EventCounter() " 276 cout <<
"INFO from CoherenceFactor::getR()" 277 <<
"\n\t tries: " << tries <<
", for " <<
_Nevents <<
" events." 285 cout <<
" --------------------------------- " << endl;
MINT::IReturnComplexForEvent< IDalitzEvent > * Abar()
double sigmaAngle() const
DalitzEventPattern getTreePattern() const
virtual FitAmplitude * getAmpPtr(unsigned int i)
virtual double getWeight() const =0
std::complex< double > _sumAxAbarStarSquared
void printResult(std::ostream &os=std::cout) const
std::complex< double > _sumAxAbarStar
std::complex< double > var() const
std::complex< double > cvarAxAbarStar() const
virtual double RealVal(EVENT_TYPE &evt)=0
static long int eventCounter()
MINT::counted_ptr< IDalitzEvent > newEvent()
std::complex< double > sigma() const
std::complex< double > Rval() const
std::complex< double > integAxAbarStar() const
MINT::counted_ptr< MINT::IEventGenerator< IDalitzEvent > > getGenerator()
CoherenceFactor(FitAmpSum &A, FitAmpSum &Abar, double CSAbs=1, double CSPhase=0.0, MINT::IReturnRealForEvent< IDalitzEvent > *eff=0, double prec=1.e-3)
virtual DalitzBWBoxSet makeBWBoxes(const DalitzEventPattern &pat, TRandom *rnd=gRandom)
virtual counted_ptr< RETURN_TYPE > newEvent()=0
std::complex< double > complexVar(std::complex< double > s, std::complex< double > s_sq) const
MINT::IReturnRealForEvent< IDalitzEvent > * _eff
virtual double getGeneratorPdfRelativeToPhaseSpace() const =0
double realAorAbarVar(double s, double sq) const
std::complex< double > getCVal()
MINT::IReturnComplexForEvent< IDalitzEvent > * A()
MINT::counted_ptr< MINT::IEventGenerator< IDalitzEvent > > _myOwnGenAplusAbar
double estimatedPrecision() const
std::complex< double > Abar_Value(IDalitzEvent &evt)
double integAbarSq() const
virtual std::complex< double > ComplexVal(EVENT_TYPE &evt)=0
double getEff(IDalitzEvent &evt)
std::complex< double > A_Value(IDalitzEvent &evt)
virtual unsigned int size() const