3 TString Filename =
"Sim_Geo43_E0.519MeV_Evts2860000_FileEvts11440_Gen1_ST12__248.root",
4 TString SubFolder =
"Sim_Geo43_E0.519MeV_Evts2860000_FileEvts11440_Gen1_ST12",
5 Bool_t OmegaQuadrupolMode = 1,
13 gROOT->LoadMacro(
"$VMCWORKDIR/gconfig/rootlogon.C");
15 gROOT->LoadMacro(
"$VMCWORKDIR/macro/hypGe/Marcell/SharedMacros/SharedMacroFunctions.C");
17 gSystem->Load(
"libHypGe");
18 gSystem->Load(
"librazhyp");
19 gSystem->Load(
"libHyp");
20 gSystem->Load(
"libSpectrum");
33 cout <<
"TargetSimulated " << TargetSimulated << endl;
34 if(Filename.EndsWith(
".root",1))
36 Filename.ReplaceAll(
".root",
"");
37 cout <<
"Filename ending chopped!" << endl;
40 TString CompleteParameterFilename =
"$SIMDATADIR/Gamma/"+SubFolder+
"/"+Filename+
"__Simparams.root";
42 Filename.ReplaceAll(
"Sim",
"Ana");
43 SubFolder.ReplaceAll(
"Sim",
"Ana");
45 TextAdd +=PeakWidthStretchfactor;
46 if (OmegaQuadrupolMode)
50 TString Path = getenv(
"SIMDATADIR");
51 TString FullPath= Path+
"/Gamma/Ana/"+SubFolder;
52 char CommandBuffer[400];
53 sprintf(CommandBuffer,
".!mkdir -p %s",FullPath.Data());
54 cout <<
"Processing " << CommandBuffer<< endl;
55 gROOT->ProcessLine(CommandBuffer);
58 if (OmegaQuadrupolMode)
61 outfile = FullPath +
"/" + Filename;
62 outfile.Insert(outfile.Index(
"__"),TextAdd.Data());
65 txtfileName = outfile+
".txt";
71 outfile = FullPath +
"/" + Filename +
".root";
72 txtfileName = FullPath +
"/" + Filename +
".txt";
75 FairRunAna *
fRun=
new FairRunAna();
76 fRun->SetInputFile(CompleteFilename.Data());
77 fRun->SetOutputFile(outfile.Data());
81 FairRuntimeDb*
rtdb = fRun->GetRuntimeDb();
82 FairParRootFileIo*
parInput1 =
new FairParRootFileIo();
83 parInput1->open(CompleteParameterFilename.Data());
86 rtdb->setFirstInput(parInput1);
92 GammaAna->SetVerbose(iVerbose);
94 if (OmegaQuadrupolMode)
99 fRun->AddTask(GammaAna);
104 fRun->Run(0,nEvents);
111 cout << endl << endl;
112 cout <<
"Macro finished succesfully." << endl;
113 cout <<
"Output file is " << outfile << endl;
114 cout <<
"Text file is " << txtfileName << endl;
116 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
" s" << endl;
void SetTarget(Bool_t TargetAvailable=1)
int GammaSpectraAnalysis_NoH_Task(TString Filename="Sim_Geo43_E0.519MeV_Evts2860000_FileEvts11440_Gen1_ST12__248.root", TString SubFolder="Sim_Geo43_E0.519MeV_Evts2860000_FileEvts11440_Gen1_ST12", Bool_t OmegaQuadrupolMode=1, Double_t PeakWidthStretchfactor=1)
void SetPeakWidtchStrechFactor(Double_t PeakWidtchStrechFactor_ext=1)
TString CompleteFilename(TString mu, TString Q, TString Psf)
void SetOmegaQuadrupolMode(Bool_t useOmegaQuadrupolMode_ext=1)
FairParRootFileIo * parInput1
Int_t GetNumberOfEventsInFileFromFilename(TString Filename)
Int_t GetIfTargetIsSimulated(TString Filename)
Double_t GetEnergyFromFilename(TString Filename)