Update to last working version.

This commit is contained in:
2018-09-11 10:19:01 +02:00
parent 2a848ed5f3
commit 09111b659d

View File

@ -27,10 +27,11 @@ my $SUMM_DIR="/afs/psi.ch/project/nemu/data/summ/";
my %DBDIR=("LEM","/afs/psi.ch/project/nemu/data/log/", my %DBDIR=("LEM","/afs/psi.ch/project/nemu/data/log/",
"GPS","/afs/psi.ch/project/bulkmusr/olddata/list/", "GPS","/afs/psi.ch/project/bulkmusr/olddata/list/",
"Dolly","/afs/psi.ch/project/bulkmusr/olddata/list/", "Dolly","/afs/psi.ch/project/bulkmusr/olddata/list/",
"GPD","/afs/psi.ch/project/bulkmusr/olddata/list/", "GPD","/afs/psi.ch/project/bulkmusr/olddata/list/",
"ALC","/afs/psi.ch/project/bulkmusr/olddata/list/", "ALC","/afs/psi.ch/project/bulkmusr/olddata/list/",
"HAL","/afs/psi.ch/project/bulkmusr/olddata/list/", "HAL","/afs/psi.ch/project/bulkmusr/olddata/list/",
"LTF","/afs/psi.ch/project/bulkmusr/olddata/list/"); "LTF","/afs/psi.ch/project/bulkmusr/olddata/list/",
"ALL","/afs/psi.ch/project/bulkmusr/olddata/list/");
# Information available since # Information available since
my %MinYears=("LEM","2001", my %MinYears=("LEM","2001",
@ -56,7 +57,7 @@ sub CreateMSRUni {
# #
# Input in %All # Input in %All
# Required: # Required:
# $All{"FitType1/2/3"} - Function types, 3 components # $All{"FitTypei"} - Function types, i components
# $All{"LRBF"} - Histograms, comma separated # $All{"LRBF"} - Histograms, comma separated
# $All{"Tis"} # $All{"Tis"}
# $All{"Tfs"} # $All{"Tfs"}
@ -86,10 +87,11 @@ sub CreateMSRUni {
my $DEBUG = ""; my $DEBUG = "";
# Start with empty array # Start with empty array
my @FitTypes = (); my @FitTypes = ();
# loop over fitTypes
foreach ($All{"FitType1"},$All{"FitType2"},$All{"FitType3"}) { if (!defined($All{"numComps"})) {$All{"numComps"}=3;}
if ($_ ne "None") { for (my $i=1;$i<=$All{"numComps"};$i++) {
@FitTypes=(@FitTypes,$_); if ( defined($All{"FitType$i"}) &&$All{"FitType$i"} ne "None" ) {
push( @FitTypes, $All{"FitType$i"} );
} }
} }
@ -123,8 +125,8 @@ sub CreateMSRUni {
# replaced by Func_T_Block # replaced by Func_T_Block
my $FUNCTIONS_Block = $EMPTY; my $FUNCTIONS_Block = $EMPTY;
if ($All{"FunctionsBlock"} ne $EMPTY) { if ($All{"FunctionsBlock"} ne $EMPTY) {
$FUNCTIONS_Block = "FUNCTIONS\n###############################################################\n".$All{"FunctionsBlock"}."\n"; $FUNCTIONS_Block = "FUNCTIONS\n###############################################################\n".$All{"FunctionsBlock"}."\n";
$Full_T_Block=$All{"Func_T_Block"}; $Full_T_Block=$All{"Func_T_Block"};
# remove all _N to end (may fail with large number of parameters) # remove all _N to end (may fail with large number of parameters)
$Full_T_Block =~ s/_\d\b//g; $Full_T_Block =~ s/_\d\b//g;
} }
@ -661,12 +663,13 @@ sub CreateTheory {
# Start from this theory line for the different fitting functions # Start from this theory line for the different fitting functions
my %THEORY = ( my %THEORY = (
"asymmetry", "Asy", "asymmetry", "Asy",
"simplExpo", "Lam", "simplExpo", "Lam",
"generExpo", "Lam Bet", "generExpo", "Lam Bet",
"simpleGss", "Sgm", "abragam", "Del Lam",
"statGssKT", "Sgm", "simpleGss", "Sgm",
"statGssKTLF", "Frqg Sgm", "statGssKT", "Sgm",
"statGssKTLF", "Frqg Sgm",
"dynGssKTLF", "Frql Sgm Lam", "dynGssKTLF", "Frql Sgm Lam",
"statExpKT", "Lam", "statExpKT", "Lam",
"statExpKTLF", "Frq Aa", "statExpKTLF", "Frq Aa",
@ -675,13 +678,13 @@ sub CreateTheory {
"spinGlass", "Lam gam q", "spinGlass", "Lam gam q",
"rdAnisoHf", "Frq Lam", "rdAnisoHf", "Frq Lam",
"TFieldCos", "Phi Frq", "TFieldCos", "Phi Frq",
"Bessel", "Phi Frq",
"internFld", "Alp Phi Frq LamT LamL", "internFld", "Alp Phi Frq LamT LamL",
"Bessel", "Phi Frq", "Bessel", "Phi Frq",
"internBsl", "Alp Phi Frq LamT LamL", "internBsl", "Alp Phi Frq LamT LamL",
"abragam", "Sgm gam", "Meissner", "Phi Energy Field DeadLayer Lambda",
"Meissner", "Phi Energy Field DeadLayer Lambda", "skewedGss", "Phi Frq Sgmm Sgmp"
"skewedGss", "Phi Frq Sgmm Sgmp" );
);
####################################################################### #######################################################################
# Generate the full THEORY block # Generate the full THEORY block
@ -734,7 +737,7 @@ sub CreateTheory {
$Parameters = join( $SPACE, $Parameters, $THEORY{'TFieldCos'} ); $Parameters = join( $SPACE, $Parameters, $THEORY{'TFieldCos'} );
} }
# Oscillationg gaussian # Oscillationg Gaussian
elsif ( $FitType eq "GaussianCos" ) { elsif ( $FitType eq "GaussianCos" ) {
$T_Block = $T_Block . "\n" . "simpleGss " . $THEORY{'simpleGss'}; $T_Block = $T_Block . "\n" . "simpleGss " . $THEORY{'simpleGss'};
$Parameters = join( $SPACE, $Parameters, $THEORY{'simpleGss'} ); $Parameters = join( $SPACE, $Parameters, $THEORY{'simpleGss'} );
@ -750,12 +753,28 @@ sub CreateTheory {
$Parameters = join( $SPACE, $Parameters, $THEORY{'TFieldCos'} ); $Parameters = join( $SPACE, $Parameters, $THEORY{'TFieldCos'} );
} }
# Oscillationg Gaussian # Oscillationg Abragam function
elsif ( $FitType eq "GaussianCos" ) { elsif ( $FitType eq "AbragamCos" ) {
$T_Block = $T_Block . "\n" . "simpelGss " . $THEORY{'simpelGss'}; $T_Block = $T_Block . "\n" . "abragam " . $THEORY{'abragam'};
$Parameters = join( $SPACE, $Parameters, $THEORY{'simpleGss'} ); $Parameters = join( $SPACE, $Parameters, $THEORY{'abragam'} );
$T_Block = $T_Block . "\n" . "TFieldCos " . $THEORY{'TFieldCos'}; $T_Block = $T_Block . "\n" . "TFieldCos " . $THEORY{'TFieldCos'};
$Parameters = join( $SPACE, $Parameters, $THEORY{'TFieldCos'} ); $Parameters = join( $SPACE, $Parameters, $THEORY{'TFieldCos'} );
}
# Oscillationg Bessel Gaussian
elsif ( $FitType eq "GaussianBessel" ) {
$T_Block = $T_Block . "\n" . "simpleGss " . $THEORY{'simpleGss'};
$Parameters = join( $SPACE, $Parameters, $THEORY{'simpleGss'} );
$T_Block = $T_Block . "\n" . "Bessel " . $THEORY{'Bessel'};
$Parameters = join( $SPACE, $Parameters, $THEORY{'Bessel'} );
}
# Oscillationg Bessel Exponential
elsif ( $FitType eq "ExponentialBessel" ) {
$T_Block = $T_Block . "\n" . "simplExpo " . $THEORY{'simplExpo'};
$Parameters = join( $SPACE, $Parameters, $THEORY{'simplExpo'} );
$T_Block = $T_Block . "\n" . "Bessel " . $THEORY{'Bessel'};
$Parameters = join( $SPACE, $Parameters, $THEORY{'Bessel'} );
} }
# Static Lorentzian KT # Static Lorentzian KT
@ -1005,8 +1024,16 @@ sub T0BgData {
($RV{"t0"},$RV{"Bg1"},$RV{"Bg2"},$RV{"Data1"},$RV{"Data2"})=split(/,/,$HistParams); ($RV{"t0"},$RV{"Bg1"},$RV{"Bg2"},$RV{"Data1"},$RV{"Data2"})=split(/,/,$HistParams);
} }
elsif ($BeamLine eq "GPS") { elsif ($BeamLine eq "GPS") {
my $HistParams=$GPS{$Hists[0]}; my $HistParams=$GPS{$Hists[0]};
($RV{"t0"},$RV{"Bg1"},$RV{"Bg2"},$RV{"Data1"},$RV{"Data2"})=split(/,/,$HistParams); ($RV{"t0"},$RV{"Bg1"},$RV{"Bg2"},$RV{"Data1"},$RV{"Data2"})=split(/,/,$HistParams);
}
elsif ($BeamLine eq "GPD") {
my $HistParams=$GPD{$Hists[0]};
($RV{"t0"},$RV{"Bg1"},$RV{"Bg2"},$RV{"Data1"},$RV{"Data2"})=split(/,/,$HistParams);
}
else {
my $HistParams=$GPS{$Hists[0]};
($RV{"t0"},$RV{"Bg1"},$RV{"Bg2"},$RV{"Data1"},$RV{"Data2"})=split(/,/,$HistParams);
} }
return $RV{$Name}; return $RV{$Name};
@ -1047,10 +1074,15 @@ sub PrepParamTable {
} }
my @Hists = split( /,/, $All{"LRBF"} ); my @Hists = split( /,/, $All{"LRBF"} );
my @FitTypes =(); my @FitTypes = ();
foreach my $FitType ($All{"FitType1"}, $All{"FitType2"}, $All{"FitType3"}) { # loop over fitTypes
if ( $FitType ne "None" ) { push( @FitTypes, $FitType ); } if (!defined($All{"numComps"})) {$All{"numComps"}=3;}
for (my $i=1;$i<=$All{"numComps"};$i++) {
if ( defined($All{"FitType$i"}) &&$All{"FitType$i"} ne "None" ) {
push( @FitTypes, $All{"FitType$i"} );
}
} }
# Get theory block to determine the size of the table # Get theory block to determine the size of the table
my ($Full_T_Block,$Paramcomp_ref)= MSR::CreateTheory(@FitTypes); my ($Full_T_Block,$Paramcomp_ref)= MSR::CreateTheory(@FitTypes);
# For now the line below does not work. Why? # For now the line below does not work. Why?
@ -1239,10 +1271,15 @@ sub ExportParams {
} }
my @Hists = split( /,/, $All{"LRBF"} ); my @Hists = split( /,/, $All{"LRBF"} );
my @FitTypes =(); my @FitTypes = ();
foreach my $FitType ($All{"FitType1"}, $All{"FitType2"}, $All{"FitType3"}) { # loop over fitTypes
if ( $FitType ne "None" ) { push( @FitTypes, $FitType ); } if (!defined($All{"numComps"})) {$All{"numComps"}=3;}
for (my $i=1;$i<=$All{"numComps"};$i++) {
if ( defined($All{"FitType$i"}) &&$All{"FitType$i"} ne "None" ) {
push( @FitTypes, $All{"FitType$i"} );
}
} }
# Get theory block to determine the size of the table # Get theory block to determine the size of the table
my ($Full_T_Block,$Paramcomp_ref)= MSR::CreateTheory(@FitTypes); my ($Full_T_Block,$Paramcomp_ref)= MSR::CreateTheory(@FitTypes);
# For now the line below does not work. Why? # For now the line below does not work. Why?