25 #include <TStopwatch.h>
35 #define MAX_STRING_LENGTH 50
56 const Int_t nb_residu = 6;
60 TString filename[nb_residu];
61 TString nucleusname[nb_residu];
63 Float_t sigma[nb_residu] = { 29.7, 47.1, 19.3, 19.3, 0.4, 1.31 };
65 filename[0] = pathtodata; filename[0] +=
"DY_ENSDF.ens"; nucleusname[0] =
"151DY";
66 filename[1] = pathtodata; filename[1] +=
"152DY.ags"; nucleusname[1] =
"152DY";
67 filename[2] = pathtodata; filename[2] +=
"DY_ENSDF.ens"; nucleusname[2] =
"153DY";
68 filename[3] = pathtodata; filename[3] +=
"TB_ENSDF.ens"; nucleusname[3] =
"151TB";
69 filename[4] = pathtodata; filename[4] +=
"GD_ENSDF.ens"; nucleusname[4] =
"149GD";
70 filename[5] = pathtodata; filename[5] +=
"148GD.ags"; nucleusname[5] =
"148GD";
74 for (
int i = 0; i < nb_residu; i++ )
75 { ok += nucleus[i].
Import(filename[i],nucleusname[i]); }
77 if ( ok != nb_residu ) {
78 cout <<
" A Level Scheme is missing !! " <<
endl;
return;
82 for (
int i = 0; i < nb_residu; i++ ) channel.
Add(nucleus+i,sigma[i]);
85 TH1F *K =
new TH1F(
"BaseGEM_K",
"K",100,0,100);
86 TH1F *projtot =
new TH1F(
"BaseGEM",
"BaseGEM",8192,0,4096);
89 cout <<
"Initialisation time " <<
endl; watch.Print();
92 watch.Reset(); watch.Start();
94 for (Int_t i = 0; i < nbcas; i++ ) {
99 K->Fill(cas.GetSize()) ;
100 for (Int_t j = 0; j < cas.GetSize(); j++ ) {
105 cout <<
"Monte-Carlo time " <<
endl; watch.Print();
124 void testGEM(
const char *pathtodata, Int_t nbcas = 100)
131 const Int_t nb_residu = 6;
133 GEM nucleus[nb_residu];
135 TString filename[nb_residu];
136 TString nucleusname[nb_residu];
138 Float_t sigma[nb_residu] = { 29.7, 47.1, 19.3, 19.3, 0.4, 1.31 };
140 filename[0] = pathtodata; filename[0] +=
"DY_ENSDF.ens"; nucleusname[0] =
"151DY";
141 filename[1] = pathtodata; filename[1] +=
"152DY.ags"; nucleusname[1] =
"152DY";
142 filename[2] = pathtodata; filename[2] +=
"DY_ENSDF.ens"; nucleusname[2] =
"153DY";
143 filename[3] = pathtodata; filename[3] +=
"TB_ENSDF.ens"; nucleusname[3] =
"151TB";
144 filename[4] = pathtodata; filename[4] +=
"GD_ENSDF.ens"; nucleusname[4] =
"149GD";
145 filename[5] = pathtodata; filename[5] +=
"148GD.ags"; nucleusname[5] =
"148GD";
149 for (
int i = 0; i < nb_residu; i++ ) {
150 ok += nucleus[i].
Import(filename[i],nucleusname[i]);
155 if ( ok != nb_residu ) {
156 cout <<
" A Level Scheme is missing !! " <<
endl;
return;
160 for (
int i = 0; i < nb_residu; i++ ) channel.
Add(nucleus+i,sigma[i]);
163 TH1F *K =
new TH1F(
"GEM_K",
"K",100,0,100);
164 TH1F *projtot =
new TH1F(
"GEM",
"GEM",8192,0,4096);
167 cout <<
"Initialisation time " <<
endl; watch.Print();
170 watch.Reset(); watch.Start();
172 for (Int_t i = 0; i < nbcas; i++ ) {
177 K->Fill(cas.GetSize()) ;
178 for (Int_t j = 0; j < cas.GetSize(); j++ ) {
183 cout <<
"Monte-Carlo time " <<
endl; watch.Print();
206 void testGammaFilter1(
const char *pathtodata, Int_t nbcas = 100,
const char *filtername =
"AGATA_FILTER.root")
213 const Int_t nb_residu = 6;
217 TString filename[nb_residu];
218 TString nucleusname[nb_residu];
220 Float_t sigma[nb_residu] = { 29.7, 47.1, 19.3, 19.3, 0.4, 1.31 };
222 filename[0] = pathtodata; filename[0] +=
"DY_ENSDF.ens"; nucleusname[0] =
"151DY";
223 filename[1] = pathtodata; filename[1] +=
"152DY.ags"; nucleusname[1] =
"152DY";
224 filename[2] = pathtodata; filename[2] +=
"DY_ENSDF.ens"; nucleusname[2] =
"153DY";
225 filename[3] = pathtodata; filename[3] +=
"TB_ENSDF.ens"; nucleusname[3] =
"151TB";
226 filename[4] = pathtodata; filename[4] +=
"GD_ENSDF.ens"; nucleusname[4] =
"149GD";
227 filename[5] = pathtodata; filename[5] +=
"148GD.ags"; nucleusname[5] =
"148GD";
231 for (
int i = 0; i < nb_residu; i++ )
232 { ok += nucleus[i].
Import(filename[i],nucleusname[i]); }
234 if ( ok != nb_residu ) {
235 cout <<
" A Level Scheme is missing !! " <<
endl;
return;
239 for (
int i = 0; i < nb_residu; i++ ) channel.
Add(nucleus+i,sigma[i]);
247 TH1F *K =
new TH1F(
"GammaFilter1_K",
"K",100,0,100);
248 TH1F *projtot =
new TH1F(
"GammaFilter1",
"GammaFilter1",8192,0,4096);
251 cout <<
"Initialisation time " <<
endl; watch.Print();
254 watch.Reset(); watch.Start();
256 for (Int_t i = 0; i < nbcas; i++ ) {
262 Int_t nbgamma = filter.
ApplyE(cas,e);
265 for (Int_t j = 0; j < nbgamma; j++ ) {
270 cout <<
"Monte-Carlo time " <<
endl; watch.Print();
294 void testGammaFilter2(
const char *pathtodata, Int_t nbcas = 100,
const char *filtername =
"AGATA_FILTER.root")
301 const Int_t nb_residu = 6;
303 GEM nucleus[nb_residu];
305 TString filename[nb_residu];
306 TString nucleusname[nb_residu];
308 Float_t sigma[nb_residu] = { 29.7, 47.1, 19.3, 19.3, 0.4, 1.31 };
310 filename[0] = pathtodata; filename[0] +=
"DY_ENSDF.ens"; nucleusname[0] =
"151DY";
311 filename[1] = pathtodata; filename[1] +=
"152DY.ags"; nucleusname[1] =
"152DY";
312 filename[2] = pathtodata; filename[2] +=
"DY_ENSDF.ens"; nucleusname[2] =
"153DY";
313 filename[3] = pathtodata; filename[3] +=
"TB_ENSDF.ens"; nucleusname[3] =
"151TB";
314 filename[4] = pathtodata; filename[4] +=
"GD_ENSDF.ens"; nucleusname[4] =
"149GD";
315 filename[5] = pathtodata; filename[5] +=
"148GD.ags"; nucleusname[5] =
"148GD";
319 for (
int i = 0; i < nb_residu; i++ ) {
320 ok += nucleus[i].
Import(filename[i],nucleusname[i]);
325 if ( ok != nb_residu ) {
326 cout <<
" A Level Scheme is missing !! " <<
endl;
return;
330 for (
int i = 0; i < nb_residu; i++ ) channel.
Add(nucleus+i,sigma[i]);
333 Int_t nbgamma; Float_t e[1000];
338 TH1F *K =
new TH1F(
"GammaFilter2_K",
"K",100,0,100);
339 TH1F *projtot =
new TH1F(
"GammaFilter2",
"GammaFilter2",8192,0,4096);
342 TFile fileout(
"SimuDY.root",
"recreate");
345 treeout = (TTree *)fileout.Get(
"SimuDY");
346 if ( treeout == NULL ) {
347 treeout =
new TTree(
"SimuDY",
"FromGammaFilter2");
348 treeout->Branch(
"mult",&nbgamma,
"nbgamma/I"); treeout->Branch(
"e",e,
"e[nbgamma]/F");
356 cout <<
"Initialisation time " <<
endl; watch.Print();
359 watch.Reset(); watch.Start();
361 for (Int_t i = 0; i < nbcas; i++ ) {
367 nbgamma = filter.
ApplyE(cas,e);
370 for (Int_t j = 0; j < nbgamma; j++ ) {
380 cout <<
"Monte-Carlo time " <<
endl; watch.Print();
virtual TObject * Rand()
it returns a pointer to a randomly selected object from the collection
void SetExI(Float_t E, Float_t I)
starting point in the ExI plan from which starts the gamma-ray emission
A cascade is a list of links.
virtual Int_t ApplyE(const TSeqCollection &, TBuffer &)
Apply this filter to the list of gamma-rays.
Class to get randomly cascades (with lateral feeding) of gammas on the basis of a level scheme...
Bool_t InitFilter(const char *)
to modifiy the efficency curve.
Class to get randomly cascades of gammas on the basis of a level scheme.
A class to select randomly an object in a TObjArray of objects.
Link * SetFeeding(const char *feedingtype="TestFeeding")
void testGEM(const char *pathtodata, Int_t nbcas=100)
Function to generate discret gamma-rays between several level schemes ...
virtual Data_T Get() const
get the value, can be overloaded
virtual void Add(TObject *, Float_t)
it adds an object with a weight to this collection.
header file for a GEM (gamma-rays generator)
Standard filter for gamma-rays (EUROBALL-like appproach)
void testGammaFilter1(const char *pathtodata, Int_t nbcas=100, const char *filtername="AGATA_FILTER.root")
Function to generate tracked like events.
virtual Measure< Float_t > & GetEnergy()
to get/modify the gamma-ray energy and its error
void testGammaFilter2(const char *pathtodata, Int_t nbcas=100, const char *filtername="AGATA_FILTER.root")
Function to generate tracked like events and store them in a ROOT TTree.
virtual Int_t DoCascade(TSeqCollection &cascade, Option_t *opt="")
cascade simulation
void testBaseGEM(const char *pathtodata, Int_t nbcas=100)
Function to generate discret gamma-rays between several level schemes.
ADF::LogMessage & endl(ADF::LogMessage &log)
Bool_t IsEffective()
check out if it has been correctly initiated
virtual Int_t Import(const Char_t *, Option_t *opt="152DY")
Load the level scheme and init the Monte-Carlo.
A GammaLink binds two nuclear levels.
header file for a XGammaLink