15# if defined(__EXTENSIONS__)
18# define __EXTENSIONS__
22#elif defined(__GNUC__)
23# if defined(_XOPEN_SOURCE)
32#if defined(__SUNPRO_CC)
62 unsigned layer =
id/64;
69 if(
id >= 127 )
id -= 64;
70 if( (
id-6)%8 == 0 )
return (
id-6)/8 + 0.5;
71 else return int((
id+1)/8);
75 if(
id <= 129 )
id += 64;
92 for (i = 0; i <
f - l; i++) {
93 if ((i % 8) == 0) std::cout <<
" ";
94 std::cout << (val >> (
f - i)) % 2;
107 double c0x = c2.x() - c1.x() ;
108 double c0y = c2.y() - c1.y() ;
109 double c0 = sqrt ( c0x*c0x + c0y*c0y ) ;
110 double rr1 =
abs(r1) ;
111 double rr2 =
abs(r2) ;
112 double Radd = rr1 + rr2 ;
113 double Rsub =
abs( rr1 - rr2 ) ;
117 if ( c0 > Radd +
eps || c0 < 0.001 || c0 < Rsub -
eps ) {
127 if ( c0 > Radd -
eps ) {
128 x1.setX(c1.x() + rr1*c0x/c0);
129 x1.setY(c1.y() + rr1*c0y/c0);
141 double chg =
abs(r1) / r1 ;
142 double cosPsi = ( c0*c0 + rr1*rr1 - rr2*rr2 ) / (2.*c0*rr1 ) ;
143 double sinPsi = - ( chg/
abs(chg) ) * sqrt(1.0 - cosPsi*cosPsi) ;
144 x1.setX(c1.x() + ( rr1/c0 )*( cosPsi*c0x - sinPsi*c0y ));
145 x1.setY(c1.y() + ( rr1/c0 )*( cosPsi*c0y + sinPsi*c0x ));
146 x2.setX(c1.x() + ( rr1/c0 )*( cosPsi*c0x + sinPsi*c0y ));
147 x2.setY(c1.y() + ( rr1/c0 )*( cosPsi*c0y - sinPsi*c0x ));
157#define SRTOPI 0.7978846
159#define ROOT2I 0.70710678
165 double temp_i,temp_n;
168 if((
n <= 0)||(chi2 < 0.0)){
173 srty = sqrt(chi2) - sqrt(temp_n-0.5);
175 prob = 0.5*erfc(srty);
183 sum =
exp( -0.5 * chi2 );
185 m = (int)floor(
n/2.);
194 term = 0.5*chi2*term/(temp_i-1.0);
208 prob =
SRTOPI*srty*sum + prob;
214 term = term*chi2/(2.0*temp_i + 1.0);
217 prob =
SRTOPI*srty*sum + prob;
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
EvtComplex exp(const EvtComplex &c)
EvtTensor3C eps(const EvtVector3R &v)
HepGeom::Point3D< double > HepPoint3D
int intersection(const HepPoint3D &c1, double r1, const HepPoint3D &c2, double r2, double eps, HepPoint3D &x1, HepPoint3D &x2)
Circle utilities.
void bitDisplay(unsigned val)
const HepPoint3D ORIGIN
Constants.
double chisq2confLevel(int n, double chi2)
ALPHA = 10000. / 2.99792458 / 15.
float CathodeSectorId(unsigned id)
geocdc utilities