27 #include "TSystemDirectory.h"
29 #include "TObjArray.h"
30 #include "TObjString.h"
34 #include "BashColor.h"
46 fInnerDataBaseName(
"Inner"),
47 fGammaSourcesName(
"GammaSources"),
48 fListOfGammaSourceFiles(0x0),
56 fInnerDataBaseName(
"Inner"),
57 fGammaSourcesName(
"GammaSources"),
58 fListOfGammaSourceFiles(0x0),
90 cout<<
"[DataBaseError] Inner DataBase path: "<<fInnerDataBaseName<<
" not found in "<<
fDataBasePath<<
"; ==> Default one \"Inner\" is taken !"<<
endl;
91 fInnerDataBaseName =
"Inner";
98 if(
fVerbose) cout<<
"[DataBaseInfo] "<<fInnerDataBaseName<<
" DataBase: loaded !"<<
endl;
106 cout<<
"[DataBaseError] No Gamma sources directory named: "<<fGammaSourcesName<<
"; ==> Default one \"GammaSources\" is taken !"<<
endl;
107 fGammaSourcesName =
"GammaSources";
114 if(
fVerbose) cout<<
"[DataBaseInfo] Gamma source files are located in ${DataBase}/"<<fInnerDataBaseName<<
"/"<<fGammaSourcesName<<
endl;
131 TSystemDirectory Dir;
142 TString StrOpt = option;
143 if(StrOpt ==
"*" || StrOpt.Contains(
"GammaSources"))
146 cout<<
"List of available Sources:"<<
endl;
155 if(!gSystem->IsFileInIncludePath(SourceFilePath))
159 Print(
"GammaSources");
160 return std::vector < Gw::GammaSourceRay* >();
164 std::ifstream FileIn;
165 FileIn.open (SourceFilePath.Data(), std::ifstream::in);
169 const char* tab =
"\t";
171 std::vector < Gw::GammaSourceRay* > ListOfGammas;
175 getline(FileIn,line);
179 if(Buffer.BeginsWith(
"#") || Buffer.BeginsWith(
"A"))
continue;
183 TObjArray *loa=Buffer.Tokenize(tab);
186 while((os=(TObjString *)next()))
188 toto[i] = os->GetString();
192 TString DecayMode = toto[4].ReplaceAll(
" ",
"").ReplaceAll(tab,
"");
193 TString Daughter = toto[7].ReplaceAll(
" ",
"").ReplaceAll(tab,
"");
194 TString RadSubType = toto[9].ReplaceAll(
" ",
"").ReplaceAll(tab,
"");
195 double LifeTime = toto[6].ReplaceAll(
" ",
"").ReplaceAll(tab,
"").Atof();
196 double E = toto[10].ReplaceAll(
" ",
"").ReplaceAll(tab,
"").Atof();
197 double dE = toto[11].ReplaceAll(
" ",
"").ReplaceAll(tab,
"").Atof();
198 double I = toto[14].ReplaceAll(
" ",
"").ReplaceAll(tab,
"").Atof();
199 double dI = toto[15].ReplaceAll(
" ",
"").ReplaceAll(tab,
"").Atof();
203 if(Opt.Contains(
"NoXR") && RadSubType.Contains(
"XR"))
continue;
234 ListOfGammas.push_back(Gamma);
244 std::ofstream FileOut(FileName.Data());
246 FileOut<<
"#List of gamma named : "<<ListName<<
endl;
248 FileOut<<
"#created on : "<<date.AsString()<<
endl;
249 for(
unsigned int i=0 ; i<Energies.size() ; i++)
251 FileOut<<Energies[i]<<
endl;
256 cout<<
"Peak list saved in "<<FileName<<
endl;
264 std::vector <double> Energies;
266 if(!gSystem->IsFileInIncludePath(FileName))
269 cout<<FileName<<
" not found !"<<
endl;
272 TSystemDirectory Dir;
274 TList *l = Dir.GetListOfFiles();
276 for(
int i=0 ; i<l->GetSize() ; i++)
278 if(((TString)l->At(i)->GetName()).EndsWith(
".peaklist"))
280 cout<<((TString)l->At(i)->GetName()).ReplaceAll(
".peaklist",
"")<<
endl;
287 std::ifstream FileIn(FileName.Data());
294 getline(FileIn,line);
296 if(Buffer==
"")
break;
297 double E = Buffer.Atof();
298 if(E!=0) Energies.push_back(E);
302 cout<<FileName<<
" loaded !"<<
endl;
TString fInnerDataBasePath
void SetValue(Data_T data)
set the value, cannot be overloaded
Measure< Double_t > * LifeTime
TString fInnerDataBaseName
void SetInnerDataBase(TString name)
virtual void Print(const char *option="*") const
TList * fListOfGammaSourceFiles
std::vector< Gw::GammaSourceRay * > GetGammaSource(TString SourceName, double EMin=100., double IMin=1., TString Opt="")
Measure< Double_t > * Energy
TString fGammaSourcesPath
void GetListOfSourceFiles()
ADF::LogMessage & endl(ADF::LogMessage &log)
to get information about the gammaware configuration
Measure< Double_t > * Intensity
TString fGammaSourcesName
std::vector< double > LoadGammaList(TString ListName)
void SaveGammaList(TString ListName, std::vector< double > Energies)
static const char * GetPath(const char *)
to get a particular GW environment variable
InnerNDB(Bool_t verbose=true)
virtual void SetError(Data_T derr)
set the error of this value