crab_bindefs_plusminus.cpp 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /* Set ABSOLUTE_MAXMOM so that program won't bother calculating correlations
  2. when rel. mom. is greater than ABSOLUTE_MAXMOM. This is ignored if
  3. "MIXED_PAIRS_FOR_DENOM" is defined in crab.cpp below */
  4. #define ABSOLUTE_MAXMOM 50
  5. /* Four Examples are presented here (A-D). For each binning, modifications
  6. must be made in four locations in this file as illustrated. One can
  7. add as many binnings as desired. Binnings are of two types: one-d, where
  8. the answer will be given as C(x), and three-d, where the answer will
  9. be given as C(x,y,z). */
  10. /* One of the included routines is 'decompose(p1,p2,vs,
  11. long_comoving_boost,x_along_p,outwards_boost,
  12. &kmag,&kx,&ky,&kz)'. This routine returns the 3-dimensions of the
  13. relative momentum. ( If one only uses Qinv, one can skip calling this
  14. function since 'mom' equals 'Qinv' and is already fed into 'binner'. )
  15. When one calls decompose, three additional arguments,
  16. long_comoving_boost,x_along_p,outwards_boost, are used to determine the
  17. reference frame, (both relativistically and rotationally).
  18. 1.) If one chooses 'long_comoving_boost' equal to one,
  19. one boosts along the beam axis to the frame where pz1+pz2=0.
  20. If 'long_comoving_boost' is not equal to one, the longitudinal frame
  21. will be set by the value of 'vs'.
  22. 2.) If one chooses 'x_along_p' equal to one,
  23. one performs a rotation, in the reaction plane defined by the pairs
  24. momentum, such that the x-axis is parallel to the total momentum.
  25. 3.) If one chooses outwards_boost equal to one,
  26. one also boost along the direction of p1+p2 to the pair's c.o.m. frame.
  27. /* Example A: Bin the correlation function according to Qinv */
  28. /* Example B: Bin the correlation function according to Qinv
  29. in 10 different pt bins */
  30. /* Example C: Bin the correlation function according to |Q|, where Q is
  31. determined in the longitudinally comoving frame. Make three binnings for
  32. three different directional cuts. */
  33. /* Example D: Save the correlation function in a 3-d binning, according
  34. to Qx, Qy, and Qz.
  35. /* ********************************************************* */
  36. /* First define the binnings you will do. */
  37. /* A. */
  38. onedbin_class *qinv;
  39. /* C */
  40. onedbin_class *q_plus;
  41. onedbin_class *q_minus;
  42. /* ********************************************************* */
  43. /* Initialize binning objects with desired mesh sizes and momentum ranges */
  44. void bininit(void){
  45. int ipt,nkmax,nkxmax,nkymax,nkzmax;
  46. int nptmax;
  47. double maxmom,kxmax,kymax,kzmax;
  48. double pt;
  49. char title[80];
  50. /* A */
  51. nkmax=50;
  52. maxmom=50.0;
  53. qinv=new onedbin_class(nkmax,maxmom,"qinv.dat");
  54. /* B */
  55. nkmax=50;
  56. maxmom=50.0;
  57. q_plus=new onedbin_class(nkmax,maxmom,"q_plus.dat");
  58. q_minus=new onedbin_class(nkmax,maxmom,"q_minus.dat");
  59. }
  60. /* ********************************************************* */
  61. /* Bin |phi|^2 according to p1 and p2 */
  62. /* Use the routine "decompose" to get projections of rel. mom. if desired */
  63. void binner(int inumden,double mom,double corr,double *p1,double *p2){
  64. double pt,kx,ky,kz,kmag;
  65. int ipt;
  66. /* These 3 variables define conv.s used by decompose, 0=no, 1=yes */
  67. int long_comoving_boost,x_along_p,outwards_boost;
  68. double vs=0.0;
  69. /* A */
  70. qinv->bincorr(inumden,mom,corr);
  71. /* B */
  72. kx=p2[1]-p1[1];
  73. ky=p2[2]-p1[2];
  74. kz=p2[3]-p1[3];
  75. if(fabs(ky)<3.0 && fabs(kx)<3.0 && kz>0.0)
  76. q_plus->bincorr(inumden,mom,corr);
  77. if(fabs(ky)<3.0 && fabs(kx)<3.0 && kz<0.0)
  78. q_minus->bincorr(inumden,mom,corr);
  79. }
  80. void printstatements(int onlyzerob){
  81. int ipt;
  82. /* A */
  83. qinv->printcorr(onlyzerob);
  84. /* B */
  85. q_plus->printcorr(onlyzerob);
  86. q_minus->printcorr(onlyzerob);
  87. }