23 #ifndef Gw_RadLevelSchemeReader
36 #ifndef ROOT_TObjArray
37 #include <TObjArray.h>
49 #ifndef GW_LEVELSCHEME_H
53 #ifndef GW_NUCLEARLEVEL_H
57 #ifndef GW_XGAMMALINK_H
84 static const UInt_t kMaxLengthLine = 120;
97 Int_t j, j1; Char_t line[kMaxLengthLine];
99 Int_t z, nblevel, nbgamma, nbband, nbtext;
100 Float_t sizex, sizey, aspect_ratio, maxtan, maxdist,
101 cascadewidth, cascadesep, arroww, arrowl;
103 Int_t band, flag, sflag, elflag;
104 Float_t e, de, dxl, dxr, sldx, sldy, eldx, eldy;
106 Char_t eol, jpi[16], kay[16];
108 Int_t li, lf, flg, elflg;
109 Float_t intensity, dintensity, branching, conv, mix, dconv, dmix, dbranching, x1, x2;
126 for (
int j = 0; j < 5; ++j) {
127 fgets(line, kMaxLengthLine, file);
130 fgets(line, kMaxLengthLine, file);
131 if (strncmp(line,
" ASCII GLS file format version 1.0", 34)) {
137 fgets(line, kMaxLengthLine, file);
140 fgets(line, kMaxLengthLine, file);
141 if (sscanf(line,
"%i%i%i%i%i%f%f%f",
143 &nblevel, &nbgamma, &nbband, &nbtext,
144 &sizex, &sizey, &aspect_ratio) != 8) {
151 fLog <<
info << Form(
"\t %d levels, %d gammas and %d bands supposed to be in this level scheme \n",
152 nblevel,nbgamma,nbband) <<
nline;;
154 fLink.Expand(nbgamma);
155 fBand.Expand(nbband);
156 fText.Expand(nbtext);
160 fgets(line, kMaxLengthLine, file);
161 fgets(line, kMaxLengthLine, file);
162 if (sscanf(line,
"%f%f%f%f%f%f",
164 &cascadewidth, &cascadesep,
165 &arroww, &arrowl) != 6) {
174 fgets(line, kMaxLengthLine, file);
175 fgets(line, kMaxLengthLine, file);
177 Float_t arrowbreak, levelbreak, lsl_csx, lsl_csy, lel_csx, lel_csy, gel_csx, gel_csy;
178 if (sscanf(line,
"%f%f%f%f%f%f%f%f",
179 &arrowbreak, &levelbreak,
182 &gel_csx, &gel_csy) != 8) {
188 fgets(line, kMaxLengthLine, file);
189 fgets(line, kMaxLengthLine, file);
194 for (j = 0; j < nblevel; j++) {
198 fgets(line, kMaxLengthLine, file);
199 if (sscanf(line,
"%*6c%f%f%8c%6c%i%i%i%i %c",
202 &sflag, &elflag, &eol) != 9) {
214 fgets(line, kMaxLengthLine, file);
215 if (sscanf(line,
"%*2c%f%f%f%f%f%f",
239 if (
fBand.At(band) == NULL ) {
251 if ( flag == 2 ) level->SetLineWidth(2*gStyle->GetLineWidth());
253 sscanf(jpi,
"%i", &j1);
254 if (!strncmp(jpi + 5,
"/2", 2)) {
285 lab = jpi; lab.Insert(6,
")"); lab.Insert(0,
"("); level->
SetLabel(lab.Data(),0);
290 lab = jpi; lab.Insert(8,
")"); lab.Insert(6,
"("); level->
SetLabel(lab.Data(),0);
295 lab = jpi; lab.Insert(8,
")"); lab.Insert(0,
"("); level->
SetLabel(lab.Data(),0);
300 lab = jpi; lab.Remove(7,1); level->
SetLabel(lab.Data(),0);
305 lab = jpi; lab.Remove(7,1); lab.Insert(6,
")"); lab.Insert(0,
"("); level->
SetLabel(lab.Data(),0);
310 lab =
"-?"; level->
SetLabel(lab.Data(),0);
350 fLog <<
info << Form(
"\t %d levels correctly read in %d bands \n",
353 fgets(line, kMaxLengthLine, file);
356 char name[8]; Float_t x0, nx;
357 for (j = 0; j < nbband; ++j) {
359 fgets(line, kMaxLengthLine, file);
360 if (sscanf(line,
"%*6c%8c%f%f%f%f%f%f",
363 &eldx, &eldy) != 7) {
375 TLatex &lat = cascade->
GetLatex(
"name");
377 while (tmp[0] ==
' ') tmp.Remove(0,1);
378 Float_t textSize = sizey/(nx*5);
379 lat.SetText(x0, sizey,tmp.Data()); lat.SetTextSize(textSize);
384 for( j1 = 0; j1 < cascade->GetSize() ; j1++){
389 level->
SetX1( x0 - nx/2 + level->GetX1() );
390 level->
SetX2( x0 + nx/2 + level->GetX2() );
394 fLog <<
info << Form(
"\t %d bands correctly read \n",
fBand.GetSize()) << nline;
398 fgets(line, kMaxLengthLine, file);
399 fgets(line, kMaxLengthLine, file);
400 fgets(line, kMaxLengthLine, file);
402 for (j = 0; j < nbgamma; ++j) {
405 fgets(line, kMaxLengthLine, file);
407 intensity = dintensity = 0.0f;
408 if (sscanf(line,
"%*6c%f%f%*3c%c%*c%c%i%i%f%f %c",
409 &e, &de, &em, &clamba,
411 &intensity, &dintensity, &eol) < 6) {
418 if (clamba ==
' ') clamba =
'0';
423 fgets(line, kMaxLengthLine, file);
424 if (sscanf(line,
"%*2c%f%f%f%f%f%f %c",
426 &branching, &dbranching,
427 &mix, &dmix, &eol) != 7) {
435 branching = dbranching = 0.0f;
440 fgets(line, kMaxLengthLine, file);
441 if (sscanf(line,
"%*2c%f%f%f%f%i%i",
444 &flg, &elflg) != 6) {
455 if ( li >=
fLevel.GetEntries() ) {
456 fLog <<
error << Form(
"- ! - gamma-ray %d associated with a non-existing initial level %d \n",j,li) <<
dolog;
461 if ( lf >=
fLevel.GetEntries() ) {
462 fLog <<
error << Form(
" - ! - gamma-ray %d associated with a non-existing final level %d \n",j,lf) <<
dolog;
477 fLink.AddAt(gamma,j);
492 gamma->
SetEM(lab.Data());
497 if ( gamma->
GetIL() != NULL || gamma->
GetFL() != NULL ) {
498 Double_t xi = (gamma->
GetIL()->GetX2()+gamma->
GetIL()->GetX1())/2.0;
499 Double_t xf = (gamma->
GetFL()->GetX2()+gamma->
GetFL()->GetX1())/2.0;
500 if ( x1 == 0.00 && x2 != 0.00 ) {
501 xi = (x2 - TMath::Abs(gamma->
GetIL()->GetX2()-gamma->
GetIL()->GetX1()))/2.0;
502 xf = (x2 - TMath::Abs(gamma->
GetIL()->GetX2()-gamma->
GetIL()->GetX1()))/2.0;
504 if ( x1 != 0.00 && x2 != 0.00 ) {
505 xi = x1 - TMath::Abs(gamma->
GetIL()->GetX2()-gamma->
GetIL()->GetX1()) / 2.0;
506 xf = x2 - TMath::Abs(gamma->
GetIL()->GetX2()-gamma->
GetIL()->GetX1()) / 2.0;
519 fLog <<
info << Form(
"\t %d gammas correctly read \n",
fLink.GetEntries()) << nline;
522 Char_t text[40]; Int_t dumi; Float_t
size, x, y;
524 fgets(line, kMaxLengthLine, file);
525 fgets(line, kMaxLengthLine, file);
526 for (j = 0; j < nbtext; ++j) {
527 fgets(line, kMaxLengthLine, file);
528 if (sscanf(line,
"%*7c%40c%i", text, &dumi) != 2) {
535 fgets(line, kMaxLengthLine, file);
536 if (sscanf(line,
"%*2c%f%f%f%f",
537 &size, &size,&x, &y) != 4) {
544 TLatex *latex =
new TLatex(x,y,text); latex->SetTextSize(size);
fText.AddAt(latex,j);
546 fLog <<
info << Form(
"\t %d extra comments correctly read \n",
fText.GetEntries()) << nline;
562 TString lab =
"From Radware AGS file "; lab +=
fFileName.Data();
A BaseLevelSchemeReader class to read level scheme files.
static void SetDefaultLabelSize(Float_t size)
virtual void SetColor(EDefaultColor color)
Set color.
A cascade is a list of links.
virtual void Set(Data_T data)
set the measure and its error (default err=0)
virtual Int_t Check()
check file before imported level scheme
void Set(Int_t n, Int_t d=1)
To set the spin.
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.
static void SetDefaultLabelSize(Float_t size)
virtual Measure< Float_t > & GetMixing()
to get/modify the mixing ratio and its error
header file for a NuclearLevel
TString fFileName
name of level scheme file
TObjArray fText
list of texts
virtual Level * GetIL()
to get the initial level
LogMessage & nline(LogMessage &)
virtual Level * GetFL()
to get the final level
void SetExtraLineX2(Double_t)
virtual void SetDefaultLabels()
Set default labels.
virtual void SetEM(const char *em="E2")
to set the multipolarity
virtual void SetPoints()
to set points from the levels and the Strength
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
Parity & GetParity()
get the parity and modify it if it is needed
TObjArray fLevel
list of levels
Measure< Float_t > & GetEnergy()
virtual TLatex & GetLabel(Int_t)
All labels are shifted when moving a level to another position.
LogMessage & dolog(LogMessage &)
virtual void SetDefaultLabels()
Set default labels.
RadLevelSchemeReader(const char *filename, Option_t *opt)
virtual Measure< Float_t > & GetEnergy()
to get/modify the gamma-ray energy and its error
virtual Measure< Float_t > & GetConversion()
to get/modify the conversion coefficient and its error
void Set(Parity::EParity)
header file for a LevelScheme
LogMessage & debug(LogMessage &)
virtual Measure< Float_t > & GetStrength()
to get the strength and modify it if it is needed
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 void FillLabels(LevelScheme &levelScheme)
fill labels
virtual void SetY1(Double_t)
All labels are shifted when moving a level to another position.
virtual ~RadLevelSchemeReader()
virtual Level * SetFL(Level *final)
to change the final level - return the previous one
virtual void SetLabel(const char *, Int_t)
to set labels
virtual void SetX1(Double_t)
All labels are shifted when moving a level to another position.
Spin & GetSpin()
to get the spin and modify it if it is needed
TObjArray fLink
list of links
virtual void SetInfo(InfoData::EData)
to set some information about this data
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.
virtual TLatex & GetLatex(Option_t *opt="name")
to get and modify the displayed properties of name and type
LogMessage fLog
log message
virtual void SetY2(Double_t)
All labels are shifted when moving a level to another position.
header file for a XGammaLink
virtual void SetStyle(EDefaultStyle style)
Set style.
void SetExtraLineX1(Double_t)
TObjArray fBand
list of cascades
virtual Level * SetIL(Level *initial)
to change the final level - return the previous one
Base class describing a general level.