FairRoot/PandaRoot
Classes | Functions
PndPiPiGenerator.h File Reference
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <time.h>
#include "ranlxs.h"
#include "ranlxd.h"
#include "mzparameters.h"
#include "mzfunctions.h"
#include "mzfunctions_pp_to_pipi_vandewi.h"
#include "FairGenerator.h"

Go to the source code of this file.

Classes

class  PndPiPiGenerator
 

Functions

void ranlxs (float r[], int n)
 
void ranlxd (double r[], int n)
 
void rlxs_init (int level, int seed)
 
void rlxd_init (int level, int seed)
 

Function Documentation

void ranlxd ( double  r[],
int  n 
)

Definition at line 571 of file ranlxd.cxx.

572 {
573  int k;
574 
575  if (init==0)
576  rlxd_init(1,1);
577 
578  for (k=0;k<n;k++)
579  {
580  is=next[is];
581  if (is==is_old)
582  update();
583  r[k]=one_bit*((double)(x.num[is+4])+one_bit*(double)(x.num[is]));
584  }
585 }
void rlxd_init(int level, int seed)
Definition: ranlxd.cxx:501
double r
Definition: RiemannTest.C:14
static double one_bit
Definition: ranlxd.cxx:375
static void update(void)
Definition: ranlxd.cxx:453
int n
static int init
Definition: ranlxd.cxx:374
static int is
Definition: ranlxd.cxx:374
Double_t x
static int is_old
Definition: ranlxd.cxx:374
static int next[96]
Definition: ranlxd.cxx:374
void ranlxs ( float  r[],
int  n 
)
Author
Manuel Zambrana zambr.nosp@m.ana@.nosp@m.kph.u.nosp@m.ni-m.nosp@m.ainz..nosp@m.de and Dmitry Khaneftd khane.nosp@m.ftd@.nosp@m.kph.u.nosp@m.ni-m.nosp@m.ainz..nosp@m.de

Mainz, May 2011

Definition at line 566 of file ranlxs.cxx.

567 {
568  int k;
569 
570  if (init==0)
571  rlxs_init(0,1);
572 
573  for (k=0;k<n;k++)
574  {
575  is=next[is];
576  if (is==is_old)
577  update();
578  r[k]=one_bit*(float)(x.num[is]);
579  }
580 }
double r
Definition: RiemannTest.C:14
static float one_bit
Definition: ranlxs.cxx:373
int n
static int is_old
Definition: ranlxs.cxx:372
static int init
Definition: ranlxd.cxx:374
static int is
Definition: ranlxs.cxx:372
Double_t x
static void update(void)
Definition: ranlxs.cxx:451
void rlxs_init(int level, int seed)
Definition: ranlxs.cxx:495
static int next[96]
Definition: ranlxs.cxx:372
void rlxd_init ( int  level,
int  seed 
)

Definition at line 501 of file ranlxd.cxx.

502 {
503  int i,k,l;
504  int ibit,jbit,xbit[31];
505  int ix,iy;
506 
507  if ((INT_MAX<2147483647)||(FLT_RADIX!=2)||(FLT_MANT_DIG<24)||
508  (DBL_MANT_DIG<48))
509  error(0);
510 
512 
513  if (level==1)
514  pr=202;
515  else if (level==2)
516  pr=397;
517  else
518  error(1);
519 
520  i=seed;
521 
522  for (k=0;k<31;k++)
523  {
524  xbit[k]=i%2;
525  i/=2;
526  }
527 
528  if ((seed<=0)||(i!=0))
529  error(2);
530 
531  ibit=0;
532  jbit=18;
533 
534  for (i=0;i<4;i++)
535  {
536  for (k=0;k<24;k++)
537  {
538  ix=0;
539 
540  for (l=0;l<24;l++)
541  {
542  iy=xbit[ibit];
543  ix=2*ix+iy;
544 
545  xbit[ibit]=(xbit[ibit]+xbit[jbit])%2;
546  ibit=(ibit+1)%31;
547  jbit=(jbit+1)%31;
548  }
549 
550  if ((k%4)!=i)
551  ix=16777215-ix;
552 
553  x.num[4*k+i]=ix;
554  }
555  }
556 
557  carry.c1=0;
558  carry.c2=0;
559  carry.c3=0;
560  carry.c4=0;
561 
562  ir=0;
563  jr=7;
564  is=91;
565  is_old=0;
566  prm=pr%12;
567  init=1;
568 }
static int jr
Definition: ranlxd.cxx:374
static int prm
Definition: ranlxd.cxx:374
Int_t i
Definition: run_full.C:25
int c2
Definition: ranlxd.cxx:366
int c4
Definition: ranlxd.cxx:366
static void error(int no)
Definition: ranlxd.cxx:419
static int init
Definition: ranlxd.cxx:374
int c3
Definition: ranlxd.cxx:366
unsigned int seed
int c1
Definition: ranlxd.cxx:366
static void define_constants(void)
Definition: ranlxd.cxx:486
static int is
Definition: ranlxd.cxx:374
Double_t x
static int is_old
Definition: ranlxd.cxx:374
static vec_t carry
Definition: ranlxd.cxx:376
static int pr
Definition: ranlxd.cxx:374
static int ir
Definition: ranlxd.cxx:374
void rlxs_init ( int  level,
int  seed 
)

Definition at line 495 of file ranlxs.cxx.

496 {
497  int i,k,l;
498  int ibit,jbit,xbit[31];
499  int ix,iy;
500 
501  if ((INT_MAX<2147483647)||(FLT_RADIX!=2)||(FLT_MANT_DIG<24))
502  error(0);
503 
505 
506  if (level==0)
507  pr=109;
508  else if (level==1)
509  pr=202;
510  else if (level==2)
511  pr=397;
512  else
513  error(1);
514 
515  i=seed;
516 
517  for (k=0;k<31;k++)
518  {
519  xbit[k]=i%2;
520  i/=2;
521  }
522 
523  if ((seed<=0)||(i!=0))
524  error(2);
525 
526  ibit=0;
527  jbit=18;
528 
529  for (i=0;i<4;i++)
530  {
531  for (k=0;k<24;k++)
532  {
533  ix=0;
534 
535  for (l=0;l<24;l++)
536  {
537  iy=xbit[ibit];
538  ix=2*ix+iy;
539 
540  xbit[ibit]=(xbit[ibit]+xbit[jbit])%2;
541  ibit=(ibit+1)%31;
542  jbit=(jbit+1)%31;
543  }
544 
545  if ((k%4)==i)
546  ix=16777215-ix;
547 
548  x.num[4*k+i]=ix;
549  }
550  }
551 
552  carry.c1=0;
553  carry.c2=0;
554  carry.c3=0;
555  carry.c4=0;
556 
557  ir=0;
558  jr=7;
559  is=95;
560  is_old=0;
561  prm=pr%12;
562  init=1;
563 }
Int_t i
Definition: run_full.C:25
static int prm
Definition: ranlxs.cxx:372
static int ir
Definition: ranlxs.cxx:372
int c2
Definition: ranlxd.cxx:366
static int is_old
Definition: ranlxs.cxx:372
int c4
Definition: ranlxd.cxx:366
static int init
Definition: ranlxd.cxx:374
static int is
Definition: ranlxs.cxx:372
static void define_constants(void)
Definition: ranlxs.cxx:484
int c3
Definition: ranlxd.cxx:366
static void error(int no)
Definition: ranlxs.cxx:417
static int jr
Definition: ranlxs.cxx:372
unsigned int seed
static vec_t carry
Definition: ranlxs.cxx:374
int c1
Definition: ranlxd.cxx:366
static int pr
Definition: ranlxs.cxx:372
Double_t x