NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
NcRandom.cxx
Go to the documentation of this file.
1
31
33
129
130#include "NcRandom.h"
131#include "Riostream.h"
132
133ClassImp(NcRandom); // Class implementation to enable ROOT I/O
134
137{
153
154 Int_t seed=53310452; // Default seed
155 Start(seed,0,0,0); // Start the sequence for this seed from scratch
156}
157
159{
185
186 Start(seed,0,0,ts); // Start the sequence for this seed from scratch
187}
188
189NcRandom::NcRandom(Int_t seed,Int_t cnt1,Int_t cnt2,NcTimestamp* ts)
190{
224
225 Start(seed,cnt1,cnt2,ts); // Start the sequence from a user defined point
226}
227
229{
235
236 if (fXa) delete [] fXa;
237 fXa=0;
238 if (fYa) delete [] fYa;
239 fYa=0;
240 if (fIbins) delete [] fIbins;
241 fIbins=0;
242}
243
244void NcRandom::Start(Int_t seed,Int_t cnt1,Int_t cnt2,NcTimestamp* ts)
245{
287
288 if (seed>921350143) seed=53310452;
289
290 // Use the provided c.q. current timestamp to create a seed value and start the sequence from scratch
291 if (seed<0)
292 {
293 cnt1=0;
294 cnt2=0;
295 Int_t jd,sec,ns;
296 if (ts)
297 {
298 ts->GetJD(jd,sec,ns);
299 }
300 else
301 {
302 NcTimestamp tx;
303 tx.GetJD(jd,sec,ns);
304 }
305 Int_t jd100=jd%100;
306 Int_t sec100=ns/10000000;
307 seed=10000*sec+100*sec100+jd100;
308 }
309
310// Reset the area function
311 fNa=0;
312 fXa=0;
313 fYa=0;
314 fIbins=0;
315
316// Clipping parameter to prevent overflow of the counting system
317 fClip=1000000;
318
319// Set the lags for the Fibonacci sequence of the first part
320// The sequence is set to F(97,33,*) (see article)
321 fI=97;
322 fJ=33;
323
324// Unpack the seed value and determine i, j, k and l
325 fSeed=seed;
326 Int_t i,j,k,l;
327 Unpack(seed,i,j,k,l);
328
329// Reset counters
330 fCnt1=0;
331 fCnt2=0;
332
333// Fill the starting table for the first part of the combination
334 Float_t s,t;
335 Int_t m;
336 for (Int_t ii=0; ii<97; ii++)
337 {
338 s=0.;
339 t=0.5;
340
341 for (Int_t jj=1; jj<=24; jj++)
342 {
343 m=(((i*j)%179)*k)%179;
344 i=j;
345 j=k;
346 k=m;
347 l=((53*l)+1)%169;
348 if ((l*m)%64 >= 32) s+=t;
349 t=0.5*t;
350 }
351 fU[ii]=s;
352 }
353
354// Initialise the second part of the combination
355 fC=362436./16777216.;
356 fCd=7654321./16777216.;
357 fCm=16777213./16777216.;
358
359// Generate random numbers upto the user selected starting point
360// on basis of the counting system
361 if (cnt1 > 0) Uniform(cnt1);
362 if (cnt2 > 0)
363 {
364 for (Int_t n=1; n<=cnt2; n++)
365 {
366 Uniform(fClip);
367 }
368 }
369}
370
371void NcRandom::Unpack(Int_t seed,Int_t& i,Int_t& j,Int_t& k,Int_t& l)
372{
405
406 if ((seed >= 0) && (seed <= 921350143)) // Check seed value
407 {
408 Int_t idum=seed;
409 Int_t imin2=idum/(176*176*169);
410 idum=idum%(176*176*169);
411 Int_t jmin2=idum/(176*169);
412 idum=idum%(176*169);
413 Int_t kmin2=idum/169;
414
415 i=imin2+2;
416 j=jmin2+2;
417 k=kmin2+2;
418 l=seed%169;
419 }
420 else
421 {
422 cout << " *NcRandom::unpack()* Unallowed seed value encountered."
423 << " seed = " << seed << endl;
424 cout << " Seed will be set to default value." << endl;
425
426 seed=53310452; // Default seed
427 Start(seed,0,0,0); // Start the sequence for this seed from scratch
428 }
429}
430
431Int_t NcRandom::GetSeed() const
432{
438
439 return fSeed;
440}
441
442Int_t NcRandom::GetCnt1() const
443{
449
450 return fCnt1;
451}
452
453Int_t NcRandom::GetCnt2() const
454{
460
461 return fCnt2;
462}
463
464void NcRandom::Data() const
465{
471
472 cout << " *NcRandom* seed = " << fSeed
473 << " cnt1 = " << fCnt1 << " cnt2 = " << fCnt2 << endl;
474}
475
477{
492
493// First part of the combination : F(97,33,*) (see article for explanation)
494 Float_t unirnu=fU[fI-1]-fU[fJ-1];
495 if (unirnu < 0) unirnu+=1.;
496 fU[fI-1]=unirnu;
497 fI-=1;
498 if (fI == 0) fI=97;
499 fJ-=1;
500 if (fJ == 0) fJ=97;
501
502// Second part of the combination (see article for explanation)
503 fC-=fCd;
504 if (fC < 0.) fC+=fCm;
505 unirnu-=fC;
506 if (unirnu < 0.) unirnu+=1.;
507
508// Update the counting system to enable sequence continuation
509// at an arbitrary starting position.
510// Two counters have been introduced to avoid overflow
511// fCnt1 : Counter which goes up to fClip
512// and is reset when fClip is reached
513// fCnt2 : Counts the number of times fClip has been reached
514 fCnt1+=1;
515 if (fCnt1 >= fClip)
516 {
517 fCnt1=0;
518 fCnt2+=1;
519 }
520
521 if (unirnu <= 0.) unirnu=Uniform(); // Exclude 0. from the range
522
523 return unirnu;
524}
525
526Float_t NcRandom::Uniform(Float_t a,Float_t b)
527{
533
534 Float_t rmin=a;
535 if (a > b) rmin=b;
536
537 Float_t rndm=Uniform();
538 rndm=rmin+fabs(rndm*(a-b));
539
540 return rndm;
541}
542
543void NcRandom::Uniform(Float_t* vec,Int_t n,Float_t a,Float_t b)
544{
563
564// Determine the minimum of a and b
565 Float_t rmin=a;
566 if (a > b) rmin=b;
567
568// First generate random numbers within <0,1>
569 if (n > 0) // Check n value
570 {
571 for (Int_t jvec=0; jvec<n; jvec++)
572 {
573 // First part of the combination : F(97,33,*)
574 Float_t unirnu=fU[fI-1]-fU[fJ-1];
575 if (unirnu < 0) unirnu+=1.;
576 fU[fI-1]=unirnu;
577 fI-=1;
578 if (fI == 0) fI=97;
579 fJ-=1;
580 if (fJ == 0) fJ=97;
581
582 // Second part of the combination
583 fC-=fCd;
584 if (fC < 0.) fC+=fCm;
585 unirnu-=fC;
586 if (unirnu < 0.) unirnu+=1.;
587
588 // Update the counting system to enable sequence continuation
589 // at an arbitrary starting position.
590 // Two counters have been introduced to avoid overflow
591 // fCnt1 : Counter which goes up to fClip
592 // and is reset when fClip is reached
593 // fCnt2 : Counts the number of times fClip has been reached
594 fCnt1+=1;
595 if (fCnt1 >= fClip)
596 {
597 fCnt1=0;
598 fCnt2+=1;
599 }
600
601 if (unirnu <= 0.) unirnu=Uniform(); // Exclude 0. from the range
602
603 // Fill the vector within the selected range
604 vec[jvec]=rmin+fabs(unirnu*(a-b));
605 }
606 }
607 else
608 {
609 cout << " *NcRandom::Uniform* Invalid value n = " << n << endl;
610 }
611}
612
613void NcRandom::Uniform(Float_t* vec,Int_t n)
614{
624
625 Uniform(vec,n,0.,1.);
626}
627
628void NcRandom::Uniform(Int_t n)
629{
651
652 if (n > 0) // Check n value
653 {
654 for (Int_t jvec=0; jvec<n; jvec++)
655 {
656 // First part of the combination : F(97,33,*)
657 Float_t unirnu=fU[fI-1]-fU[fJ-1];
658 if (unirnu < 0) unirnu+=1.;
659 fU[fI-1]=unirnu;
660 fI-=1;
661 if (fI == 0) fI=97;
662 fJ-=1;
663 if (fJ == 0) fJ=97;
664
665 // Second part of the combination
666 fC-=fCd;
667 if (fC < 0.) fC+=fCm;
668 unirnu-=fC;
669 if (unirnu < 0.) unirnu+=1.;
670
671 // Update the counting system to enable sequence continuation
672 // at an arbitrary starting position.
673 // Two counters have been introduced to avoid overflow
674 // fCnt1 : Counter which goes up to fClip
675 // and is reset when fClip is reached
676 // fCnt2 : Counts the number of times fClip has been reached
677 fCnt1+=1;
678 if (fCnt1 >= fClip)
679 {
680 fCnt1=0;
681 fCnt2+=1;
682 }
683 }
684 }
685 else
686 {
687 cout << " *NcRandom::Uniform* Invalid value n = " << n << endl;
688 }
689}
690
691Float_t NcRandom::Gauss(Float_t mean,Float_t sigma)
692{
715
716// Generate the two uniform random numbers q1 and q2 in <0,1>
717 Float_t q1,q2;
718 q1=Uniform();
719 q2=Uniform();
720
721// Use q1 and q2 to get the gaussian distributed random number
722 Float_t pi=acos(-1.);
723 Float_t unirng=mean+cos(2.*pi*q2)*sigma*sqrt(-2.*log(q1));
724
725 return unirng;
726}
727
729{
735
736 return Gauss(0.,1.);
737}
738
739void NcRandom::Gauss(Float_t* vec,Int_t n,Float_t mean,Float_t sigma)
740{
750
751 if (n > 0) // Check n value
752 {
753 // The vector to hold the q1 and q2 values.
754 // Two subsequent q[] values are used for q1 and q2
755 // in order to obtain identical random numbers in the vector
756 // as when generating n single ones.
757 Int_t m=2*n;
758 Float_t* q=new Float_t[m];
759 Uniform(q,m);
760
761 // Fill the vector with gaussian random numbers
762 Float_t pi=acos(-1.);
763 Float_t q1,q2;
764 for (Int_t jvec=0; jvec<n; jvec++)
765 {
766 q1=q[jvec*2]; // use two subsequent q[] values
767 q2=q[(jvec*2)+1];
768 vec[jvec]=mean+cos(2.*pi*q2)*sigma*sqrt(-2.*log(q1));
769 }
770 delete [] q;
771 }
772 else
773 {
774 cout << " *NcRandom::Gauss* Invalid value n = " << n << endl;
775 }
776}
777
778void NcRandom::Gauss(Float_t* vec,Int_t n)
779{
789
790 Gauss(vec,n,0.,1.);
791}
792
793Float_t NcRandom::Poisson(Float_t mean)
794{
809
810 Float_t unirnp=0.; // Initialise the random number value
811
812 if (mean <= 0.) // Check the mean value
813 {
814 cout << " *NcRandom::Poisson* Invalid value mean = " << mean
815 << " Should be positive." << endl;
816 }
817 else
818 {
819 if (mean > 80.) // Use gaussian dist. for high mean values to save time
820 {
821 Float_t grndm=Gauss();
822 Float_t rpois=mean+grndm*sqrt(mean);
823 Int_t npois=int(rpois);
824 if ((rpois-float(npois)) > 0.5) npois++;
825 unirnp=float(npois);
826 }
827 else // Construct a Poisson random number from a uniform one
828 {
829 Int_t npois=-1;
830 Float_t expxm=exp(-mean);
831 Float_t poitst=1.;
832 while (poitst > expxm)
833 {
834 Float_t rndm=Uniform();
835 npois++;
836 poitst=poitst*rndm;
837 }
838 unirnp=float(npois);
839 } // end of check for using Gauss method
840 } // end of mean validity checkn
841 return unirnp;
842}
843
844void NcRandom::Poisson(Float_t* vec,Int_t n,Float_t mean)
845{
864
865 if (n <= 0) // Check n value
866 {
867 cout << " *NcRandom::Poisson* Invalid value n = " << n << endl;
868 }
869 else
870 {
871 if (mean <= 0.) // Check the mean value
872 {
873 cout << " *NcRandom::Poisson* Invalid value mean = " << mean
874 << " Should be positive." << endl;
875 }
876 else
877 {
878 if (mean > 80.) // Use gaussian dist. for high mean values to save time
879 {
880 Float_t* grndm=new Float_t[n];
881 Gauss(grndm,n);
882 Int_t npois;
883 Float_t rpois;
884 for (Int_t jvec=0; jvec<n; jvec++)
885 {
886 rpois=mean+grndm[jvec]*sqrt(mean);
887 npois=int(rpois);
888 if ((rpois-float(npois)) > 0.5) npois++;
889 vec[jvec]=float(npois);
890 }
891 delete [] grndm;
892 }
893 else // Construct Poisson random numbers from a uniform ones
894 {
895 Float_t expxm=exp(-mean);
896 Int_t npois;
897 Float_t poitst;
898 for (Int_t jvec=0; jvec<n; jvec++)
899 {
900 npois=-1;
901 poitst=1.;
902 while (poitst > expxm)
903 {
904 Float_t rndm=Uniform();
905 npois++;
906 poitst=poitst*rndm;
907 }
908 vec[jvec]=float(npois);
909 }
910 } // end of check for using Gauss method
911 } // end of mean validity check
912 } // end of n validity check
913}
914
915void NcRandom::SetUser(Float_t a,Float_t b,Int_t n,Float_t (*f)(Float_t))
916{
927
928 fNa=n+1; // The number of bins for the area function
929 fXa=new Float_t[fNa]; // The binned x values of the area function
930 fYa=new Float_t[fNa]; // The corresponding summed f(x) values
931 fIbins=new Int_t[fNa]; // The bin numbers of the random x candidates
932
933 Float_t xmin=a;
934 if (a > b) xmin=b;
935 Float_t step=fabs(a-b)/float(n);
936
937 Float_t x;
938 Float_t extreme=0;
939 for (Int_t i=0; i<fNa; i++) // Fill bins of the area function
940 {
941 x=xmin+float(i)*step;
942 fXa[i]=x;
943 fYa[i]=f(x);
944 if (i > 0) fYa[i]+=fYa[i-1];
945 if (fabs(fYa[i]) > extreme) extreme=fabs(fYa[i]);
946 }
947 fYamin=fYa[0]/extreme;
948 fYamax=fYa[0]/extreme;
949 for (Int_t j=0; j<fNa; j++) // Normalise the area function
950 {
951 fYa[j]=fYa[j]/extreme;
952 if (fYa[j] < fYamin) fYamin=fYa[j];
953 if (fYa[j] > fYamax) fYamax=fYa[j];
954 }
955}
956
957void NcRandom::SetUser(Float_t* x,Float_t* y,Int_t n)
958{
969
970 fNa=n; // The number of bins for the area function
971 fXa=new Float_t[fNa]; // The binned x values of the area function
972 fYa=new Float_t[fNa]; // The corresponding summed y values
973 fIbins=new Int_t[fNa]; // The bin numbers of the random x candidates
974
975// Order input data with increasing x
976 fXa[0]=x[0];
977 fYa[0]=y[0];
978 for (Int_t i=1; i<fNa; i++) // Loop over x[]
979 {
980 for (Int_t j=0; j<i; j++) // Loop over xa[]
981 {
982 if (x[i] < fXa[j])
983 {
984 for (Int_t k=i; k>=j; k--) // Create empty position
985 {
986 fXa[k+1]=fXa[k];
987 fYa[k+1]=fYa[k];
988 }
989 fXa[j]=x[i]; // Put x[] value in empty position
990 fYa[j]=y[i]; // Put y[] value in empty position
991 break; // Go for next x[] value
992 }
993 if (j == i-1) // This x[] value is the largest so far
994 {
995 fXa[i]=x[i]; // Put x[] value at the end of x[]
996 fYa[i]=y[i]; // Put y[] value at the end of y[]
997 }
998 } // End loop over fXa[]
999 } // End loop over x[]
1000
1001 Float_t extreme=0;
1002 for (Int_t l=0; l<fNa; l++) // Fill area function
1003 {
1004 if (l > 0) fYa[l]+=fYa[l-1];
1005 if (fabs(fYa[l]) > extreme) extreme=fabs(fYa[l]);
1006 }
1007 fYamin=fYa[0]/extreme;
1008 fYamax=fYa[0]/extreme;
1009 for (Int_t m=0; m<fNa; m++) // Normalise the area function
1010 {
1011 fYa[m]=fYa[m]/extreme;
1012 if (fYa[m] < fYamin) fYamin=fYa[m];
1013 if (fYa[m] > fYamax) fYamax=fYa[m];
1014 }
1015}
1016
1018{
1032
1033 Float_t unirnf=0;
1034
1035 Float_t ra=Uniform(fYamin,fYamax); // Random value of the area function
1036 Float_t dmin=100.*fabs(fYamax-fYamin); // Init. the min. distance encountered
1037 Int_t ncand=0;
1038 Float_t dist;
1039 for (Int_t i=0; i<fNa; i++) // Search for fYa[] value(s) closest to ra
1040 {
1041 dist=fabs(ra-fYa[i]);
1042 if (dist <= dmin) // fYa[i] within smallest distance --> extra candidate
1043 {
1044 ncand++;
1045 if (dist < dmin) ncand=1; // Smallest distance so far --> THE candidate
1046 dmin=dist;
1047 fIbins[ncand-1]=i+1;
1048 }
1049 }
1050
1051 Int_t jbin=0; // The bin number to hold the required x value
1052 if (ncand == 1) jbin=fIbins[0];
1053
1054 if (ncand > 1) // Multiple x value candidates --> pick one randomly
1055 {
1056 Float_t cand=Uniform(1.,float(ncand));
1057 Int_t jcand=int(cand);
1058 if ((cand-float(jcand)) > 0.5) jcand++;
1059 jbin=fIbins[jcand-1];
1060 }
1061
1062 if (jbin > 0) // Pick randomly a value in this x-bin
1063 {
1064 Float_t xlow=fXa[jbin-1];
1065 if (jbin > 1) xlow=fXa[jbin-2];
1066 Float_t xup=fXa[jbin-1];
1067 if (jbin < fNa-1) xup=fXa[jbin];
1068 unirnf=Uniform(xlow,xup);
1069 }
1070
1071 if (ncand == 0) cout << " *NcRandom::User* No candidate found." << endl;
1072
1073 return unirnf;
1074}
1075
1076void NcRandom::User(Float_t* vec,Int_t n)
1077{
1095
1096 Float_t unirnf,ra,dmin,dist;
1097 Int_t ncand,jbin;
1098 for (Int_t jvec=0; jvec<n; jvec++)
1099 {
1100 unirnf=0;
1101 ra=Uniform(fYamin,fYamax); // Random value of the area function
1102 dmin=100.*fabs(fYamax-fYamin); // Init. the min. distance encountered
1103 ncand=0;
1104 for (Int_t i=0; i<fNa; i++) // Search for fYa[] value(s) closest to ra
1105 {
1106 dist=fabs(ra-fYa[i]);
1107 if (dist <= dmin) // fYa[i] within smallest distance --> extra candidate
1108 {
1109 ncand++;
1110 if (dist < dmin) ncand=1; // Smallest distance so far --> THE candidate
1111 dmin=dist;
1112 fIbins[ncand-1]=i+1;
1113 }
1114 }
1115
1116 jbin=0; // The bin number to hold the required x value
1117 if (ncand == 1) jbin=fIbins[0];
1118
1119 if (ncand > 1) // Multiple x value candidates --> pick one randomly
1120 {
1121 Float_t cand=Uniform(1.,float(ncand));
1122 Int_t jcand=int(cand);
1123 if ((cand-float(jcand)) > 0.5) jcand++;
1124 jbin=fIbins[jcand-1];
1125 }
1126
1127 if (jbin > 0) // Pick randomly a value in this x-bin
1128 {
1129 Float_t xlow=fXa[jbin-1];
1130 if (jbin > 1) xlow=fXa[jbin-2];
1131 Float_t xup=fXa[jbin-1];
1132 if (jbin < fNa-1) xup=fXa[jbin];
1133 unirnf=Uniform(xlow,xup);
1134 }
1135
1136 if (ncand == 0) cout << " *NcRandom::User* No candidate found." << endl;
1137
1138 vec[jvec]=unirnf;
1139
1140 }
1141}
1142
1143Double_t NcRandom::RanBm(Double_t nr,Double_t n,Int_t m,Double_t* p,Double_t* na,Double_t* psia,Double_t psi0,Int_t f,TH1* psih,Int_t ncut,Double_t* nrx)
1144{
1246
1247 if (nrx) *nrx=-1;
1248
1249 if (nr<0 || fabs(n)<1 || m<1 || nr>1e19 || fabs(n)>1e19) return -1;
1250 if (n<0 && !na) return -1;
1251
1252 Double_t retval=-1;
1253
1254 Double_t psi=-1;
1255 Double_t psimin=-1;
1256 Double_t npsi=0;
1257 Double_t pk=1./double(m);
1258 Double_t psum=0;
1259 Double_t* nk=new Double_t[m];
1260 Double_t* nsig=0;
1261
1262 NcMath math;
1263
1264 ULong64_t nrep=ULong64_t(nr);
1265 if (!nrep)
1266 {
1267 if (ncut)
1268 {
1269 nrep=ULong64_t(1.e19);
1270 }
1271 else
1272 {
1273 return -1;
1274 }
1275 }
1276
1277 ULong64_t ntrial=ULong64_t(fabs(n));
1278 ULong64_t jrep,jtrial;
1279 Int_t jm;
1280
1281 // Store the signal configuration, if specified.
1282 if (na && n<0)
1283 {
1284 nsig=new Double_t[m];
1285 ULong64_t isig;
1286 for (jm=0; jm<m; jm++)
1287 {
1288 isig=0;
1289 if (na[jm]>0) isig=ULong64_t(na[jm]);
1290 nsig[jm]=isig;
1291 }
1292 }
1293
1294 Float_t rndm;
1295 for (jrep=0; jrep<nrep; jrep++) // Repetition loop
1296 {
1297 if (psia) psia[jrep]=-1;
1298 for (jm=0; jm<m; jm++)
1299 {
1300 nk[jm]=0;
1301 if (na && jrep==0) na[jm]=0;
1302 }
1303
1304 for (jtrial=0; jtrial<ntrial; jtrial++) // Random trial loop
1305 {
1306 // Selecting randomly (according to p) a certain outcome
1307 rndm=Uniform();
1308 psum=0;
1309 for (jm=0; jm<m; jm++)
1310 {
1311 if (p) pk=p[jm];
1312 psum+=pk;
1313 if (rndm<psum) // Record this outcome jm
1314 {
1315 nk[jm]+=1;
1316 if (na) na[jm]+=1;
1317 break;
1318 }
1319 } // End of "m" loop
1320 } // End of "n" loop
1321
1322 // Now we have generated n independent random trials of B_m
1323
1324 // Superimpose a possibly specified signal configuration
1325 if (nsig)
1326 {
1327 for (jm=0; jm<m; jm++)
1328 {
1329 nk[jm]+=nsig[jm];
1330 na[jm]+=nsig[jm];
1331 }
1332 }
1333
1334 // Calculate corresponding statistics
1335 psi=math.PsiValue(m,nk,p,f);
1336 if (psi<psimin || psimin<0) psimin=psi;
1337 if (psi0>=0 && psi>=psi0) npsi+=1;
1338 if (psia) psia[jrep]=psi;
1339 if (psih) psih->Fill(psi);
1340
1341 // Check for cutting short the repetiton loop to save CPU time
1342 if (!ncut) continue;
1343 if (npsi>=ncut) break;
1344
1345 } // End of repetition loop
1346
1347 if (nrep==1) retval=psi;
1348 if (nrep>1 && psi0<0) retval=psimin;
1349 if (nrep>1 && psi0>=0) retval=npsi;
1350
1351 if (nrx)
1352 {
1353 *nrx=nrep;
1354 if (jrep<nrep) *nrx=jrep+1;
1355 }
1356
1357 if (nk) delete [] nk;
1358 if (nsig) delete [] nsig;
1359
1360 return retval;
1361}
1362
ClassImp(NcRandom)
Various mathematical tools for scientific analysis.
Definition NcMath.h:26
Double_t PsiValue(Int_t m, Int_t *n, Double_t *p=0, Int_t f=0) const
Definition NcMath.cxx:2829
Generate universal random numbers and sequences on all common machines.
Definition NcRandom.h:16
Float_t fYamax
! The min. and max. y values of the area function
Definition NcRandom.h:51
void Unpack(Int_t seed, Int_t &i, Int_t &j, Int_t &k, Int_t &l)
Definition NcRandom.cxx:371
Float_t Gauss()
Definition NcRandom.cxx:728
Int_t fI
Definition NcRandom.h:43
Int_t fCnt1
Definition NcRandom.h:43
Float_t * fXa
! The binned x values of the area function
Definition NcRandom.h:49
Int_t GetCnt2() const
Definition NcRandom.cxx:453
Double_t RanBm(Double_t nr, Double_t n, Int_t m, Double_t *p=0, Double_t *na=0, Double_t *psia=0, Double_t psi0=-1, Int_t f=0, TH1 *psih=0, Int_t ncut=0, Double_t *nrx=0)
Int_t fCnt2
Definition NcRandom.h:43
Float_t fCm
Definition NcRandom.h:44
void Start(Int_t seed, Int_t cnt1, Int_t cnt2, NcTimestamp *ts)
Definition NcRandom.cxx:244
Float_t * fYa
! The corresponding y values of the area function
Definition NcRandom.h:50
Float_t User()
void Data() const
Definition NcRandom.cxx:464
Int_t fClip
Definition NcRandom.h:43
Int_t GetCnt1() const
Definition NcRandom.cxx:442
Int_t GetSeed() const
Definition NcRandom.cxx:431
Int_t fJ
Definition NcRandom.h:43
virtual ~NcRandom()
Definition NcRandom.cxx:228
Float_t fU[97]
Definition NcRandom.h:44
void SetUser(Float_t a, Float_t b, Int_t n, Float_t(*f)(Float_t))
Definition NcRandom.cxx:915
Float_t fYamin
Definition NcRandom.h:51
Int_t * fIbins
! The bin numbers of the random x candidates
Definition NcRandom.h:52
Float_t fC
Definition NcRandom.h:44
Float_t Uniform()
Definition NcRandom.cxx:476
Float_t fCd
Definition NcRandom.h:44
Int_t fSeed
Definition NcRandom.h:43
Float_t Poisson(Float_t mean)
Definition NcRandom.cxx:793
Int_t fNa
! The number of bins of the area function
Definition NcRandom.h:48
Handling of timestamps for (astro)particle physics research.
Definition NcTimestamp.h:20
Double_t GetJD(Int_t y, Int_t m, Int_t d, Int_t hh, Int_t mm, Int_t ss, Int_t ns) const