25 #include <TStopwatch.h>
29 #include <TDatabasePDG.h>
52 void LStoSToGS1(
const char *pathtoLS, Int_t nbcas = 100,
const char *rfilename =
"PrimariesFromGW.root")
55 Random::Instance()->SetCurrent(
"large_clock");
61 const Int_t nb_residu = 6;
63 TString filename[nb_residu], nucleusname[nb_residu];
65 Float_t sigma[nb_residu] = { 29.7, 47.1, 19.3, 19.3, 0.4, 1.31 };
66 Int_t neutrons[nb_residu] = { 5, 4, 3, 4, 3, 4 };
67 Int_t protons[nb_residu] = { 0, 0, 0, 1, 0, 0 };
68 Int_t alphas [nb_residu] = { 0, 0, 0, 0, 1, 1 };
72 filename[0] = pathtoLS; filename[0] +=
"DY_ENSDF.ens"; nucleusname[0] =
"151DY";
73 filename[1] = pathtoLS; filename[1] +=
"152DY.ags"; nucleusname[1] =
"152DY";
74 filename[2] = pathtoLS; filename[2] +=
"DY_ENSDF.ens"; nucleusname[2] =
"153DY";
75 filename[3] = pathtoLS; filename[3] +=
"TB_ENSDF.ens"; nucleusname[3] =
"151TB";
76 filename[4] = pathtoLS; filename[4] +=
"GD_ENSDF.ens"; nucleusname[4] =
"149GD";
77 filename[5] = pathtoLS; filename[5] +=
"148GD.ags"; nucleusname[5] =
"148GD";
81 for (
int i = 0; i < nb_residu; i++ ) {
82 ok += nucleus[i].
Import(filename[i],nucleusname[i]);
85 if ( ok != nb_residu ) {
86 cout <<
" A Level Scheme is missing !! " <<
endl;
91 for (
int i = 0; i < nb_residu; i++ )
92 channel.
Add(nucleus+i,sigma[i]);
95 TFile rf(rfilename,
"UPDATE"); TTree *tree_primary =
new TTree(
"GWLS_to_SToGS",
"Primaries from GW");
99 tree_primary->Branch(
"Pr.",&pr_event);
102 TH1F *hnbgamma =
new TH1F(
"NbGamma",
"NbGamma",100,0,100); TH1F *hegamma =
new TH1F(
"GammaSpectrum",
"Gamma Spectrum",8192,0,4096);
103 Int_t gPDG = TDatabasePDG::Instance()->GetParticle(
"gamma")->PdgCode();
104 TH1F *hnbprotons =
new TH1F(
"NbProtons",
"NbProtons",100,0,100); TH1F *heprotons =
new TH1F(
"ProtonSpectrum",
"Proton Spectrum",8192,0,4096);
105 Int_t pPDG = TDatabasePDG::Instance()->GetParticle(
"proton")->PdgCode();
106 TH1F *hnbneutrons =
new TH1F(
"NbNeutrons",
"NbNeutrons",100,0,100); TH1F *heneutrons =
new TH1F(
"NeutronSpectrum",
"Neutron Spectrum",8192,0,4096);
107 Int_t nPDG = TDatabasePDG::Instance()->GetParticle(
"neutron")->PdgCode();
111 TH1F *hnbalphas =
new TH1F(
"NbAlphas",
"NbAlphas",100,0,100); TH1F *healphas =
new TH1F(
"AlphaSpectrum",
"Alpha Spectrum",8192,0,4096);
112 Int_t aPDG = 1000020040;
115 cout <<
"Initialisation time " <<
endl; watch.Print();
122 for (Int_t i = 0; i < nbcas; i++ ) {
132 MULTTOT += cas.GetSize();
133 for (Int_t j = 0; j < MULTTOT; j++ ) {
144 Random::Instance()->Current()->Sphere(stogshit->
fPX,stogshit->
fPY,stogshit->
fPZ,1.0);
148 stogshit->
fPDG = gPDG;
152 hegamma->Fill(stogshit->
fE); ESUM += stogshit->
fE;
154 hnbgamma->Fill(MULTTOT) ;
157 MULTTOT += neutrons[which];
158 for (Int_t j = 0; j < neutrons[which]; j++) {
162 stogshit->
fE = 1000.0;
167 Random::Instance()->Current()->Sphere(stogshit->
fPX,stogshit->
fPY,stogshit->
fPZ,1.0);
171 stogshit->
fPDG = nPDG;
175 heneutrons->Fill(stogshit->
fE);; ESUM += stogshit->
fE;
177 hnbneutrons->Fill(neutrons[which]) ;
180 MULTTOT += protons[which];
181 for (Int_t j = 0; j < protons[which]; j++) {
185 stogshit->
fE = 2000.0;
190 Random::Instance()->Current()->Sphere(stogshit->
fPX,stogshit->
fPY,stogshit->
fPZ,1.0);
194 stogshit->
fPDG = pPDG;
198 heprotons->Fill(stogshit->
fE);; ESUM += stogshit->
fE;
200 hnbprotons->Fill(protons[which]) ;
203 MULTTOT += alphas[which];
204 for (Int_t j = 0; j < alphas[which]; j++) {
213 Random::Instance()->Current()->Sphere(stogshit->
fPX,stogshit->
fPY,stogshit->
fPZ,1.0);
217 stogshit->
fPDG = aPDG;
221 healphas->Fill(stogshit->
fE);; ESUM += stogshit->
fE;
223 hnbalphas->Fill(alphas[which]) ;
226 tree_primary->Fill();
232 cout <<
"Monte-Carlo time " <<
endl; watch.Print();
250 void testGEM(
const char *pathtoLS, Int_t nbcas = 100)
257 const Int_t nb_residu = 6;
259 GEM nucleus[nb_residu];
261 TString filename[nb_residu];
262 TString nucleusname[nb_residu];
264 Float_t sigma[nb_residu] = { 29.7, 47.1, 19.3, 19.3, 0.4, 1.31 };
266 filename[0] = pathtoLS; filename[0] +=
"DY_ENSDF.ens"; nucleusname[0] =
"151DY";
267 filename[1] = pathtoLS; filename[1] +=
"152DY.ags"; nucleusname[1] =
"152DY";
268 filename[2] = pathtoLS; filename[2] +=
"DY_ENSDF.ens"; nucleusname[2] =
"153DY";
269 filename[3] = pathtoLS; filename[3] +=
"TB_ENSDF.ens"; nucleusname[3] =
"151TB";
270 filename[4] = pathtoLS; filename[4] +=
"GD_ENSDF.ens"; nucleusname[4] =
"149GD";
271 filename[5] = pathtoLS; filename[5] +=
"148GD.ags"; nucleusname[5] =
"148GD";
275 for (
int i = 0; i < nb_residu; i++ ) {
276 ok += nucleus[i].
Import(filename[i],nucleusname[i]);
281 if ( ok != nb_residu ) {
282 cout <<
" A Level Scheme is missing !! " <<
endl;
return;
286 for (
int i = 0; i < nb_residu; i++ ) channel.
Add(nucleus+i,sigma[i]);
289 TH1F *K =
new TH1F(
"GEM_K",
"K",100,0,100);
290 TH1F *projtot =
new TH1F(
"GEM",
"GEM",8192,0,4096);
293 cout <<
"Initialisation time " <<
endl; watch.Print();
296 watch.Reset(); watch.Start();
298 for (Int_t i = 0; i < nbcas; i++ ) {
303 K->Fill(cas.GetSize()) ;
304 for (Int_t j = 0; j < cas.GetSize(); j++ ) {
309 cout <<
"Monte-Carlo time " <<
endl; watch.Print();
332 void testGammaFilter1(
const char *pathtoLS, Int_t nbcas = 100,
const char *filtername =
"AGATA_FILTER.root")
339 const Int_t nb_residu = 6;
343 TString filename[nb_residu];
344 TString nucleusname[nb_residu];
346 Float_t sigma[nb_residu] = { 29.7, 47.1, 19.3, 19.3, 0.4, 1.31 };
348 filename[0] = pathtoLS; filename[0] +=
"DY_ENSDF.ens"; nucleusname[0] =
"151DY";
349 filename[1] = pathtoLS; filename[1] +=
"152DY.ags"; nucleusname[1] =
"152DY";
350 filename[2] = pathtoLS; filename[2] +=
"DY_ENSDF.ens"; nucleusname[2] =
"153DY";
351 filename[3] = pathtoLS; filename[3] +=
"TB_ENSDF.ens"; nucleusname[3] =
"151TB";
352 filename[4] = pathtoLS; filename[4] +=
"GD_ENSDF.ens"; nucleusname[4] =
"149GD";
353 filename[5] = pathtoLS; filename[5] +=
"148GD.ags"; nucleusname[5] =
"148GD";
357 for (
int i = 0; i < nb_residu; i++ )
358 { ok += nucleus[i].
Import(filename[i],nucleusname[i]); }
360 if ( ok != nb_residu ) {
361 cout <<
" A Level Scheme is missing !! " <<
endl;
return;
365 for (
int i = 0; i < nb_residu; i++ ) channel.
Add(nucleus+i,sigma[i]);
373 TH1F *K =
new TH1F(
"GammaFilter1_K",
"K",100,0,100);
374 TH1F *projtot =
new TH1F(
"GammaFilter1",
"GammaFilter1",8192,0,4096);
377 cout <<
"Initialisation time " <<
endl; watch.Print();
380 watch.Reset(); watch.Start();
382 for (Int_t i = 0; i < nbcas; i++ ) {
388 Int_t nbgamma = filter.
ApplyE(cas,e);
391 for (Int_t j = 0; j < nbgamma; j++ ) {
396 cout <<
"Monte-Carlo time " <<
endl; watch.Print();
420 void testGammaFilter2(
const char *pathtoLS, Int_t nbcas = 100,
const char *filtername =
"AGATA_FILTER.root")
427 const Int_t nb_residu = 6;
429 GEM nucleus[nb_residu];
431 TString filename[nb_residu];
432 TString nucleusname[nb_residu];
434 Float_t sigma[nb_residu] = { 29.7, 47.1, 19.3, 19.3, 0.4, 1.31 };
436 filename[0] = pathtoLS; filename[0] +=
"DY_ENSDF.ens"; nucleusname[0] =
"151DY";
437 filename[1] = pathtoLS; filename[1] +=
"152DY.ags"; nucleusname[1] =
"152DY";
438 filename[2] = pathtoLS; filename[2] +=
"DY_ENSDF.ens"; nucleusname[2] =
"153DY";
439 filename[3] = pathtoLS; filename[3] +=
"TB_ENSDF.ens"; nucleusname[3] =
"151TB";
440 filename[4] = pathtoLS; filename[4] +=
"GD_ENSDF.ens"; nucleusname[4] =
"149GD";
441 filename[5] = pathtoLS; filename[5] +=
"148GD.ags"; nucleusname[5] =
"148GD";
445 for (
int i = 0; i < nb_residu; i++ ) {
446 ok += nucleus[i].
Import(filename[i],nucleusname[i]);
451 if ( ok != nb_residu ) {
452 cout <<
" A Level Scheme is missing !! " <<
endl;
return;
456 for (
int i = 0; i < nb_residu; i++ ) channel.
Add(nucleus+i,sigma[i]);
459 Int_t nbgamma; Float_t e[1000];
464 TH1F *K =
new TH1F(
"GammaFilter2_K",
"K",100,0,100);
465 TH1F *projtot =
new TH1F(
"GammaFilter2",
"GammaFilter2",8192,0,4096);
468 TFile fileout(
"SimuDY.root",
"recreate");
471 treeout = (TTree *)fileout.Get(
"SimuDY");
472 if ( treeout == NULL ) {
473 treeout =
new TTree(
"SimuDY",
"FromGammaFilter2");
474 treeout->Branch(
"mult",&nbgamma,
"nbgamma/I"); treeout->Branch(
"e",e,
"e[nbgamma]/F");
482 cout <<
"Initialisation time " <<
endl; watch.Print();
485 watch.Reset(); watch.Start();
487 for (Int_t i = 0; i < nbcas; i++ ) {
493 nbgamma = filter.
ApplyE(cas,e);
496 for (Int_t j = 0; j < nbgamma; j++ ) {
506 cout <<
"Monte-Carlo time " <<
endl; watch.Print();
virtual TObject * Rand()
it returns a pointer to a randomly selected object from the collection
void LStoSToGS1(const char *pathtoLS, Int_t nbcas=100, const char *rfilename="PrimariesFromGW.root")
Function to generate discret gamma-rays between several level schemes.
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.
SToGS Base Root Polarized Hit.
Class to get randomly cascades (with lateral feeding) of gammas on the basis of a level scheme...
void testGammaFilter1(const char *pathtoLS, Int_t nbcas=100, const char *filtername="AGATA_FILTER.root")
Function to generate tracked like events.
Bool_t InitFilter(const char *)
to modifiy the efficency curve.
SBRPHit * AddHit()
add a hit to the current event
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")
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)
virtual Measure< Float_t > & GetEnergy()
to get/modify the gamma-ray energy and its error
void testGEM(const char *pathtoLS, Int_t nbcas=100)
Function to generate discret gamma-rays between several level schemes ...
virtual void Clear(Option_t *opt)
clear the collection of hits, set H, K to 0
virtual Int_t DoCascade(TSeqCollection &cascade, Option_t *opt="")
cascade simulation
ADF::LogMessage & endl(ADF::LogMessage &log)
Bool_t IsEffective()
check out if it has been correctly initiated
void testGammaFilter2(const char *pathtoLS, 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 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
void SetEMult(Double_t h, Int_t k)