23 #include <TStopwatch.h>
42 void CheckLS(
const Char_t *name =
"197Pb.ags")
57 void CheckX(
const Char_t *name =
"simu2.ags")
62 if ( lev.
GetLinks().GetSize() == 0 ) {
printf(
"No links in %s \n",name); }
68 if ( link->InheritsFrom(
"XGammaLink") ) count++;
70 printf(
"%d x-links found in %s \n",count,name);
84 Int_t i, iend, nb_in, flag[200];
86 iend = cas->GetSize(); nb_in = 0;
87 for (i = 0; i < iend; i++ ) {
92 if ( gam->GetEnergy().Get() > g1 && gam->GetEnergy().Get() < g2 ) { nb_in++; flag[i] = 1; }
94 if ( nb_in == 0 )
return;
96 for (i = 0; i < iend; i++ ) {
98 if ( flag[i] == 0 ) spgated->Fill(gam->GetEnergy().Get());
101 for (i = 0; i < iend; i++ ) {
102 gam = (
GammaLink *)cas->At(i); spgated->Fill(gam->GetEnergy().Get());
127 const Char_t nameAGS[] =
"simu2.ags";
128 Float_t gl1 = 572, gr1 = 574, gl2 = 656, gr2 = 657;
132 if ( random.InitAGS(nameAGS) == 0 ) {
133 cout <<
" GLS level Scheme not correctly loaded " <<
endl;
return;
137 TH1F *K =
new TH1F(
"K",
"K",100,0,100);
138 TH1F *h =
new TH1F(
"ProjTot",
"ProjTot",8192,0,4096);
139 TH1F *hg1 =
new TH1F(
"Gated1",
"Gated1",8192,0,4096); TH1F *hg2 =
new TH1F(
"Gated2",
"Gated2",8192,0,4096);
143 for (Int_t i = 0; i < nbcas; i++ ) {
147 K->Fill(cas.GetSize()) ;
148 for (Int_t j = 0; j < cas.GetSize(); j++ ) {
151 CGate(hg1,&cas,gl1,gr1);
CGate(hg2,&cas,gl2,gr2);
174 void oneLS(
const Char_t *nameAGS, Int_t nbcas = 100)
178 if ( random.InitAGS(nameAGS) == 0 ) {
179 cout <<
" AGS level Scheme not correctly loaded " <<
endl;
return;
183 TH1F *K =
new TH1F(
"K",
"K",100,0,100);
184 TH1F *h =
new TH1F(
"ProjTot",
"ProjTot",8192,0,4096);
188 for (Int_t i = 0; i < nbcas; i++ ) {
192 K->Fill(cas.GetSize()) ;
193 for (Int_t j = 0; j < cas.GetSize(); j++ ) {
230 if ( pb197.InitAGS(
"197Pb.ags") == 0 ) {
231 cout <<
" 197Pb.ags level Scheme not correctly loaded " <<
endl;
return;
233 if ( pb198.InitAGS(
"198Pb.ags") == 0 ) {
234 cout <<
" 198Pb.ags level Scheme not correctly loaded " <<
endl;
return;
238 channel.
Add(&pb197,0.9);channel.
Add(&pb198,0.1);
241 TH1F *hpb197 =
new TH1F(
"Pb197",
"Pb197",8192,0,4096); hpb197->SetLineColor(2);
242 TH1F *hpb198 =
new TH1F(
"Pb198",
"Pb198",8192,0,4096); hpb198->SetLineColor(4);
246 for (Int_t i = 0; i < nbcas; i++ ) {
251 if ( gem == &pb197 ) {
252 for (Int_t j = 0; j < cas.GetSize(); j++ ) {
256 for (Int_t j = 0; j < cas.GetSize(); j++ ) {
261 hpb197->
Draw(); hpb198->Draw(
"same");
273 const Char_t nameAGS[] =
"197Pb.ags";
274 Float_t spin_min = 0, spin_max = 50, e_min = 0, e_max = 10000;
278 if ( random.InitAGS(nameAGS) == 0 ) {
279 cout << nameAGS <<
" level Scheme not correctly loaded " <<
endl;
return;
283 TH2F *bidim =
new TH2F(
"I*E",
"I*E",50,spin_min,spin_max,100,e_min,e_max);
290 for (Int_t i = 0; i < nbcas; i++ ) {
295 for (Int_t j = 0; j < li_gamma.GetSize(); j++ ) {
303 bidim->Fill(spin,max_e);
326 const Char_t nameAGS[] =
"simu1.ags";
330 if ( random.InitAGS(nameAGS) == 0 ) {
331 cout <<
" GLS level Scheme not correctly loaded " <<
endl;
return;
334 TF1 bg(
"background",
"100-100*x/4096",0,4096);
338 channel.
Add(&random,0.001);channel.
Add(&bg,0.999);
341 TH1F *h =
new TH1F(
"ProjTot",
"ProjTot",8192,0,4096);
346 Cascade cas; Int_t which_channel;
347 for (Int_t i = 0; i < nbcas; i++ ) {
349 obj = channel.
Rand(which_channel);
351 if ( which_channel == 0 ) {
355 for (Int_t j = 0; j < cas.GetSize(); j++ ) {
360 h->Fill(bg.GetRandom(1,4096));
390 const Char_t nameAGS[] =
"simu2.ags";
392 Float_t xe[nbx] = { 80, 82 }; Float_t xi[nbx] = { 80, 20 };
396 if ( random.InitAGS(nameAGS) == 0 ) {
397 cout <<
" GLS level Scheme not correctly loaded " <<
endl;
return;
402 while ( obj = iter() ) {
403 if ( obj->InheritsFrom(
"XGammaLink") ) {
409 TH1F *h =
new TH1F(
"ProjTot",
"ProjTot",8192,0,4096);
413 for (Int_t i = 0; i < nbcas; i++ ) {
417 for (Int_t j = 0; j < cas.GetSize(); j++ ) {
virtual TObject * Rand()
it returns a pointer to a randomly selected object from the collection
void simu1(Int_t nbcas=100)
Function to test BaseGEM.
printf("******************************************************************** \n")
A cascade is a list of links.
virtual Int_t InitAGS(const Char_t *filename, Option_t *opt="152Dy")
BETTER TO USE Import - To init this level scheme with a Radford AGS file.
virtual void Draw(Option_t *opt="")
to draw this level scheme
Class to get randomly cascades of gammas on the basis of a level scheme.
A XGammaLink is a converted gamma-ray link.
Float_t Get() const
To get the spin as a float.
virtual Level * GetIL()
to get the initial level
A class to select randomly an object in a TObjArray of objects.
void simu1X(Int_t nbcas=100000)
Same as simu1() but X-rays are added to the converted 417 keV.
const TList & GetLinks()
to get the list of links
void CGate(TH1 *spgated, Cascade *cas, Int_t g1, Int_t g2)
Function to gate on a cascade.
void simu1BG(Int_t nbcas=100000)
Same as simu1() but with another source of gamma-ray that produces a continuous background.
void CheckX(const Char_t *name="simu2.ags")
function to check if a AGS file is correctly read by looking for XGammaLink
virtual Data_T Get() const
get the value, can be overloaded
Measure< Float_t > & GetEnergy()
virtual void Add(TObject *, Float_t)
it adds an object with a weight to this collection.
void CheckLS(const Char_t *name="197Pb.ags")
function to check if a AGS file is correctly read by drawing it
const LevelScheme * GetLS() const
To set the intensity of the lowest link of the level scheme.
virtual Measure< Float_t > & GetEnergy()
to get/modify the gamma-ray energy and its error
virtual void Draw(Option_t *opt="")
virtual Int_t DoCascade(TSeqCollection &cascade, Option_t *opt="")
cascade simulation
ADF::LogMessage & endl(ADF::LogMessage &log)
void twoLS(Int_t nbcas=100)
Function to make a Monte Carlo on two AGS files.
void showIE(Int_t nbcas=100)
Function to display the entry point distribution in a (spin,excitation energy) plan.
Spin & GetSpin()
to get the spin and modify it if it is needed
A GammaLink binds two nuclear levels.
header file for a XGammaLink
void oneLS(const Char_t *nameAGS, Int_t nbcas=100)
Function to make a monte carlo on any AGS file.
void SetX(Int_t, Float_t *, Float_t *)
it initialises the list of X-rays associated with this link