23 #ifndef Gw_EnsdfLevelSchemeReader
34 #ifndef ROOT_TObjArray
35 #include <TObjArray.h>
47 #ifndef GW_LEVELSCHEME_H
51 #ifndef GW_NUCLEARLEVEL_H
55 #ifndef GW_XGAMMALINK_H
78 TString EnsdfLevelSchemeReader::GetDsid()
82 if ( dsid.First(
' ') > 0 ) {
83 dsid.Remove(0,dsid.First(
' ')+1);
84 if ( dsid.Length() < 3 )
85 dsid =
"ADOPTED LEVELS, GAMMAS";
87 dsid =
"ADOPTED LEVELS, GAMMAS";
93 TString EnsdfLevelSchemeReader::GetNuclide()
97 if ( nuclide.First(
' ') > 0 ) {
98 nuclide.Remove(nuclide.First(
' '));
100 if (nuclide.Length() >= 5)
103 nuclide.Remove(nuclide.Length());
113 TString nuclide = GetNuclide();
114 TString dsid = GetDsid();
119 ENSDF ens;
unsigned int idset = 0;
124 if ( (idset = ens.
IsDataSet(nuclide.Data(),dsid.Data())) == 0 ) {
135 fLog <<
info << Form(
" ---> Reading %s in dataset %s \n",nuclide.Data(),dsid.Data()) <<
nline ;
147 if ( (level = ens.
GetLevel(record,tmp)) ) {
152 if ( tmp.Length() > 0 && tmp[0] !=
' ' ) {
154 TIter iter(&
fBand); TObject *obj; TString cname;
156 cname =
"Energy"; cname += tmp[0]; cascade = 0x0;
157 while ( (obj = iter() ) ) {
158 if ( cname == obj->GetName() ) {
159 cascade = (
Cascade *)obj;
break;
162 if ( cascade == 0x0 ) {
167 Int_t whichband =
fBand.IndexOf(cascade);
171 width = TMath::Abs(level->GetX2() - level->GetX1());
173 if ( whichband % 2 == 0 ) {
174 level->
SetX1(level->GetX1()-1.1*width*(1+whichband/2));
175 level->
SetX2(level->GetX2()-1.1*width*(1+whichband/2));
178 level->
SetX1(level->GetX1()+1.1*width*(1+whichband/2));
179 level->
SetX2(level->GetX2()+1.1*width*(1+whichband/2));
182 cascade->Add( level );
185 if ( tmp.Length() > 1 && tmp[1] !=
' ' ) {
187 TIter iter(&
fBand); TObject *obj; TString cname;
189 cname =
"Spin"; cname += tmp[1]; cascade = 0x0;
190 while ( (obj = iter() ) ) {
191 if ( cname == obj->GetName() ) {
192 cascade = (
Cascade *)obj;
break;
195 if ( cascade == 0x0 ) {
215 cascade->Add( level );
220 if ( (link = ens.
GetLink(record,tmp)) ) {
223 if (
fLevel.GetEntries() == 0 ) {
225 << Form(
"Gamma with no initial level \n") <<
"\n from record at line " << line <<
nline ;
233 link->
SetIL( initial );
238 Float_t emin, eini, efin, egamma;
240 egamma = ((
GammaLink*)link)->GetEnergy().Get();
247 for (
int i = 0; i <
fLevel.GetEntries(); i++ ) {
250 if (
final == initial )
253 efin =
final->GetEnergy().GetValue();
254 if ( TMath::Abs(eini-efin-egamma) < emin ) {
255 link->
SetFL(
final );
257 emin = TMath::Abs(eini-efin-egamma) ;
260 if ( link->
GetFL() == 0x0 ) {
262 << Form(
"Gamma [record at line %d] from level %f, does not have a final level",line,eini) <<
nline ;
287 TString nuclide = GetNuclide();
288 TString dsid = GetDsid();
290 fLog <<
info << Form(
" ... Reading dataset %s %s DONE", nuclide.Data(), dsid.Data()) <<
dolog;
292 levelScheme.
SetName(nuclide.Data());
293 dsid.Prepend(
"From ENSDF dataset ");
A BaseLevelSchemeReader class to read level scheme files.
virtual Int_t Check()
check file before imported level scheme
A cascade is a list of links.
interface to ENSDF Evaluated Nuclear Structure Data File
LogMessage & error(LogMessage &)
LogMessage & warning(LogMessage &)
virtual void SetName(const Char_t *name)
set level scheme name.
header file for a NuclearLevel
EnsdfLevelSchemeReader(const char *filename, Option_t *opt)
TString fFileName
name of level scheme file
LogMessage & nline(LogMessage &)
virtual unsigned int IsDataSet(const char *nuclide, const char *dsid="ADOPTED LEVELS, GAMMAS") const
look for a given data set
virtual Level * GetFL()
to get the final level
virtual bool Open(const char *fname)
virtual void SetPoints()
to set points from the levels and the Strength
A link between two levels.
virtual Link * GetLink(const char *, TString &)
to get a link from a record
Bool_t fIsChecked
flag for reading is ok
virtual Data_T Get() const
get the value, can be overloaded
LogMessage & info(LogMessage &)
manipulator to modify the LogMessage
TObjArray fLevel
list of levels
virtual void FillLabels(LevelScheme &levelScheme)
fill labels
Measure< Float_t > & GetEnergy()
ENSDF: Interface between ENSDF files and the GammaWare Nuclear data related objects.
LogMessage & dolog(LogMessage &)
virtual Level * GetLevel(const char *, TString &)
to get a NuclearLevel from a Level record
header file for a LevelScheme
virtual bool NextRecord(unsigned int, char *)
to get dataset's records
virtual std::string & GetProcessName()
To get the Process name.
virtual void SetX2(Double_t)
All labels are shifted when moving a level to another position.
virtual Level * SetFL(Level *final)
to change the final level - return the previous one
virtual void SetX1(Double_t)
All labels are shifted when moving a level to another position.
virtual void SetName(const Char_t *name)
to set only the cascade's name
TObjArray fLink
list of links
virtual void SetReference(const Char_t *)
set level scheme reference.
A GammaLink binds two nuclear levels.
virtual void SetProcessMethod(const char *)
To set the current method.
LogMessage fLog
log message
header file for a XGammaLink
static char * BlankRecord()
returns a proper empty record. It is the charge of the user to delete it
TObjArray fBand
list of cascades
virtual Level * SetIL(Level *initial)
to change the final level - return the previous one
virtual ~EnsdfLevelSchemeReader()
virtual bool FirstRecord(unsigned int which, char *record)
to init the records reading
Base class describing a general level.