Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
nutools
nutools
EventGeneratorBase
evgenbase.h
Go to the documentation of this file.
1
#ifndef EVGENBASE_H
2
#define EVGENBASE_H
3
4
#include "TRandom3.h"
5
6
/// Physics generators for neutrinos, cosmic rays, and others
7
namespace
evgb
{
8
/// Enumerate mother codes for primary particles.
9
///
10
/// Normally the mother code for a primary particle would be set to
11
/// some arbitrary invalid value like -1, however, we can use this
12
/// to mark the source of the particle as being either, eg.,
13
/// neutrino induced or from cosmic-rays.
14
enum
{
15
kNeutrinoGenerator
= -100,
16
kCosmicRayGenerator
= -200
17
};
18
19
unsigned
int
GetRandomNumberSeed
();
20
}
21
22
inline
unsigned
int
evgb::GetRandomNumberSeed
()
23
{
24
25
// the maximum allowed seed for the art::RandomNumberGenerator
26
// is 900000000. Use the system random number generator to get a pseudo-random
27
// number for the seed value, and take the modulus of the maximum allowed
28
// seed to ensure we don't ever go over that maximum
29
30
// Set gRandom to be a TRandom3 based on this state in case we need to pull
31
// random values from histograms, etc
32
TRandom3 *rand =
new
TRandom3(0);
33
gRandom = rand;
34
return
rand->Integer(900000000);
35
}
36
37
#endif
evgb::kCosmicRayGenerator
Definition:
evgenbase.h:16
evgb::kNeutrinoGenerator
Definition:
evgenbase.h:15
evgb::GetRandomNumberSeed
unsigned int GetRandomNumberSeed()
Definition:
evgenbase.h:22
evgb
Physics generators for neutrinos, cosmic rays, and others.
Definition:
CRYHelper.cxx:33
Generated by
1.8.11