19 void toGEANT1(
const Char_t *nameAGS, Int_t nbcas = 100,
const Char_t *nameOUT =
"toGEANT101.event")
24 if ( random.InitAGS(nameAGS) == 0 ) {
25 cout <<
" GLS level Scheme not correctly loaded " <<
endl;
return;
29 FILE *fileOUT = fopen(nameOUT,
"w");
30 if ( fileOUT == NULL ) {
31 printf(
" Cannot open file %s \n",nameOUT);
return;
33 fprintf(fileOUT,
"FORMAT 4 4 \n");
34 fprintf(fileOUT,
"# \n");
35 fprintf(fileOUT,
"# GAMMAS GENERATED FROM THE %s LEVEL SCHEME \n",nameAGS);
36 fprintf(fileOUT,
"# \n");
37 fprintf(fileOUT,
"REACTION %d %d %d %d %.1f\n", 1, 1, 6, 12, 0.0);
38 fprintf(fileOUT,
"# \n");
39 fprintf(fileOUT,
"EMITTED 1 1 \n");
40 fprintf(fileOUT,
"# \n");
43 TFile *froot = (TFile*)gROOT->GetListOfFiles()->FindObject(
"toGEANT101.root");
44 if ( froot == NULL ) { froot =
new TFile(
"toGEANT101.root",
"UPDATE"); }
46 TH1F *K =
new TH1F(
"K",
"Multiplicity Distribution",100,0,100);
47 TH1F *h =
new TH1F(nameAGS,
"Gamma-ray spectrum",8192,0,4096);
52 for (Int_t i = 0; i < nbcas; i++ ) {
56 K->Fill(cas.GetSize()) ;
58 fprintf(fileOUT,
"$ \n -101 \n ");
60 for (Int_t j = 0; j < cas.GetSize(); j++ ) {
64 fprintf(fileOUT,
"1 %.1f 0. %.1f \n ",gam->
GetEnergy().
Get(),8);
69 K->Write(); h->Write(); froot->Close();
72 fprintf(fileOUT,
"# \n"); fclose(fileOUT);
printf("******************************************************************** \n")
A cascade is a list of links.
Class to get randomly cascades of gammas on the basis of a level scheme.
void toGEANT1(const Char_t *nameAGS, Int_t nbcas=100, const Char_t *nameOUT="toGEANT101.event")
To produce sequences of gamma-ray energies and format them to Enrico's program.
virtual Data_T Get() const
get the value, can be overloaded
virtual Measure< Float_t > & GetEnergy()
to get/modify the gamma-ray energy and its error
virtual Int_t DoCascade(TSeqCollection &cascade, Option_t *opt="")
cascade simulation
ADF::LogMessage & endl(ADF::LogMessage &log)
A GammaLink binds two nuclear levels.