// sample program of forming invariant mass of opposit charge states, 2008.5.26 T. Kondo #include #include #include double rand01(); int main() { std::vector m_p[4]; // 4 momentum vector std::vector m_ch; //stuck for charge double p[4],mass,invmass; int i,j,k,charge,max; rand01(); // dummy call to avoid 0.0 max = 2+rand()%8; //rand()%8 dives integer 0-8 for(i = 0; i < max; ++i ) { p[0]=10.*rand01(); p[1]=10.*rand01(); p[2]=10.*rand01(); mass=0.938; p[3]=sqrt(p[1]*p[1]+p[2]*p[2]+p[0]*p[0]+mass*mass); if(rand01() < 0.5) charge=-1; else charge=1; std::cout<