Cleanup, remove duplicate functions
This commit is contained in:
parent
ec385b1d3a
commit
5a2e407433
114
src/external/MuSRFitGUI/MSR.pm
vendored
114
src/external/MuSRFitGUI/MSR.pm
vendored
@ -47,8 +47,13 @@ my $erradd = "d";
|
|||||||
my $minadd = "_min";
|
my $minadd = "_min";
|
||||||
my $maxadd = "_max";
|
my $maxadd = "_max";
|
||||||
|
|
||||||
|
# Subroutine to create a clean run block
|
||||||
|
# Needs: Run number, year and beamline (or manual)
|
||||||
|
sub CreateRUNBlk {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
# CreateMSR
|
# CreateMSR
|
||||||
#
|
#
|
||||||
@ -94,6 +99,7 @@ sub CreateMSR {
|
|||||||
|
|
||||||
my @Hists = split( /,/, $All{"LRBF"} );
|
my @Hists = split( /,/, $All{"LRBF"} );
|
||||||
# TODO
|
# TODO
|
||||||
|
# : to separate twoo sets of asymmetries with same parameters
|
||||||
# Check the number of histograms
|
# Check the number of histograms
|
||||||
# should be 2 or 4 histograms
|
# should be 2 or 4 histograms
|
||||||
# should be checked in GUI
|
# should be checked in GUI
|
||||||
@ -277,7 +283,7 @@ FUNCTIONS
|
|||||||
$RUN = $RUNS[ $iRun - 1 ];
|
$RUN = $RUNS[ $iRun - 1 ];
|
||||||
|
|
||||||
if ($All{"RUNSType"}) {
|
if ($All{"RUNSType"}) {
|
||||||
$RUN_Line = MSR::RUNFileNameMan($RUN);
|
$RUN_Line = MSR::RUNFileNameAuto($RUN,"0000",$EMPTY);
|
||||||
} else {
|
} else {
|
||||||
$RUN_Line = MSR::RUNFileNameAuto($RUN,$YEAR,$BeamLine);
|
$RUN_Line = MSR::RUNFileNameAuto($RUN,$YEAR,$BeamLine);
|
||||||
}
|
}
|
||||||
@ -315,20 +321,20 @@ FUNCTIONS
|
|||||||
# Put T0_Line Bg_Line and Data_Line together if not empty
|
# Put T0_Line Bg_Line and Data_Line together if not empty
|
||||||
my $T0DataBg=$EMPTY;
|
my $T0DataBg=$EMPTY;
|
||||||
if ($T0_Line ne "t0") {
|
if ($T0_Line ne "t0") {
|
||||||
$T0DataBg = $T0DataBg."\n".$T0_Line;
|
$T0DataBg = $T0DataBg.$T0_Line."\n";
|
||||||
}
|
}
|
||||||
if ($Bg_Line ne "background") {
|
if ($Bg_Line ne "background") {
|
||||||
$T0DataBg = $T0DataBg."\n".$Bg_Line;
|
$T0DataBg = $T0DataBg.$Bg_Line."\n";
|
||||||
}
|
}
|
||||||
if ($Data_Line ne "data") {
|
if ($Data_Line ne "data") {
|
||||||
$T0DataBg = $T0DataBg."\n".$Data_Line;
|
$T0DataBg = $T0DataBg.$Data_Line."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$FRANGE_Line = "fit TINI TFIN";
|
$FRANGE_Line = "fit TINI TFIN";
|
||||||
$PAC_Line = "packing BINNING";
|
$PAC_Line = "packing BINNING";
|
||||||
|
|
||||||
$Single_RUN =
|
$Single_RUN =
|
||||||
"$RUN_Line\n$Type_Line\n$Alpha_Line$Hist_Lines\n$T0DataBg\n$MAP_Line\n$FRANGE_Line\n$PAC_Line\n\n";
|
"$RUN_Line\n$Type_Line\n$Alpha_Line$Hist_Lines\n$T0DataBg$MAP_Line\n$FRANGE_Line\n$PAC_Line\n\n";
|
||||||
|
|
||||||
# Now add the appropriate values of fit range and packing
|
# Now add the appropriate values of fit range and packing
|
||||||
my $Range_Min = 8;
|
my $Range_Min = 8;
|
||||||
@ -682,7 +688,7 @@ FUNCTIONS
|
|||||||
$RUN = $RUNS[ $iRun - 1 ];
|
$RUN = $RUNS[ $iRun - 1 ];
|
||||||
|
|
||||||
if ($All{"RUNSType"}) {
|
if ($All{"RUNSType"}) {
|
||||||
$RUN_Line = MSR::RUNFileNameMan($RUN);
|
$RUN_Line = MSR::RUNFileNameAuto($RUN,"0000",$EMPTY);
|
||||||
} else {
|
} else {
|
||||||
$RUN_Line = MSR::RUNFileNameAuto($RUN,$YEAR,$BeamLine);
|
$RUN_Line = MSR::RUNFileNameAuto($RUN,$YEAR,$BeamLine);
|
||||||
}
|
}
|
||||||
@ -1663,63 +1669,55 @@ sub RUNFileNameAuto {
|
|||||||
# Take this information as input arguments
|
# Take this information as input arguments
|
||||||
(my $RUN, my $YEAR, my $BeamLine) = @_;
|
(my $RUN, my $YEAR, my $BeamLine) = @_;
|
||||||
|
|
||||||
my $DATADIR = $DATADIRS{$BeamLine};
|
my $RUN_Line=$EMPTY;
|
||||||
my $RUNtmp=sprintf("%04d",$RUN);
|
# if BeamLine is empty assume manual name
|
||||||
|
if ($BeamLine eq $EMPTY) {
|
||||||
# Get current year
|
my %EXTs = ("root","ROOT-NPP",
|
||||||
my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) =
|
"bin","PSI-BIN",
|
||||||
localtime( time() );
|
"msr","MUD");
|
||||||
my $current_year = $year + 1900;
|
|
||||||
|
|
||||||
if ( $BeamLine eq "LEM" || $BeamLine eq "LEM (PPC)") {
|
|
||||||
$RUN_File_Name = "lem" . substr( $YEAR, 2 ) . "_his_" . $RUNtmp;
|
|
||||||
$RUNFILE = "$DATADIR/$YEAR/$RUN_File_Name";
|
|
||||||
}
|
|
||||||
elsif ( $BeamLine eq "GPS" ) {
|
|
||||||
$RUN_File_Name = "deltat_tdc_gps_" . $RUNtmp;
|
|
||||||
$RUNFILE = "$DATADIR/d$YEAR/tdc/$RUN_File_Name";
|
|
||||||
}
|
|
||||||
elsif ( $BeamLine eq "LTF" ) {
|
|
||||||
$RUN_File_Name = "deltat_tdc_ltf_" . $RUNtmp;
|
|
||||||
$RUNFILE = "$DATADIR/d$YEAR/tdc/$RUN_File_Name";
|
|
||||||
}
|
|
||||||
elsif ( $BeamLine eq "Dolly" ) {
|
|
||||||
$RUN_File_Name = "deltat_tdc_dolly_" . $RUNtmp;
|
|
||||||
$RUNFILE = "$DATADIR/d$YEAR/tdc/$RUN_File_Name";
|
|
||||||
}
|
|
||||||
elsif ( $BeamLine eq "GPD" ) {
|
|
||||||
$RUN_File_Name = "deltat_tdc_gpd_" . $RUNtmp;
|
|
||||||
$RUNFILE = "$DATADIR/d$YEAR/tdc/$RUN_File_Name";
|
|
||||||
}
|
|
||||||
my $RUN_Line = join( $SPACE,
|
|
||||||
"RUN", $RUNFILE, $BeamLines{$BeamLine}, "PSI",
|
|
||||||
$Def_Format{$BeamLine} );
|
|
||||||
return $RUN_Line;
|
|
||||||
}
|
|
||||||
|
|
||||||
########################
|
|
||||||
# RUNFileNameMan
|
|
||||||
# Function return the RUN_Line for a given RUN
|
|
||||||
# input should be
|
|
||||||
# $RUN is the run number
|
|
||||||
# $YEAR is the year
|
|
||||||
# $BeamLine in the name of beamline
|
|
||||||
########################
|
|
||||||
sub RUNFileNameMan {
|
|
||||||
my %EXTs = ("root","ROOT-NPP",
|
|
||||||
"bin","PSI-BIN",
|
|
||||||
"msr","MUD");
|
|
||||||
|
|
||||||
# Take this information as input arguments
|
# Take this information as input arguments
|
||||||
(my $RUN) = @_;
|
(my $RUN) = @_;
|
||||||
my @tmp = split(/\./,$RUN);
|
my @tmp = split(/\./,$RUN);
|
||||||
my $EXT = @tmp[$#tmp];
|
my $EXT = @tmp[$#tmp];
|
||||||
|
|
||||||
$RUN =~ s/\.[^.]+$//;
|
$RUN =~ s/\.[^.]+$//;
|
||||||
|
|
||||||
my $RUN_Line = join( $SPACE,
|
$RUN_Line = join( $SPACE,
|
||||||
"RUN", $RUN, "MUE4", "PSI",$EXTs{$EXT});
|
"RUN", $RUN, "MUE4", "PSI",$EXTs{$EXT});
|
||||||
|
} else {
|
||||||
|
my $DATADIR = $DATADIRS{$BeamLine};
|
||||||
|
my $RUNtmp=sprintf("%04d",$RUN);
|
||||||
|
|
||||||
|
# Get current year
|
||||||
|
my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) =
|
||||||
|
localtime( time() );
|
||||||
|
my $current_year = $year + 1900;
|
||||||
|
|
||||||
|
if ( $BeamLine eq "LEM" || $BeamLine eq "LEM (PPC)") {
|
||||||
|
$RUN_File_Name = "lem" . substr( $YEAR, 2 ) . "_his_" . $RUNtmp;
|
||||||
|
$RUNFILE = "$DATADIR/$YEAR/$RUN_File_Name";
|
||||||
|
}
|
||||||
|
elsif ( $BeamLine eq "GPS" ) {
|
||||||
|
$RUN_File_Name = "deltat_tdc_gps_" . $RUNtmp;
|
||||||
|
$RUNFILE = "$DATADIR/d$YEAR/tdc/$RUN_File_Name";
|
||||||
|
}
|
||||||
|
elsif ( $BeamLine eq "LTF" ) {
|
||||||
|
$RUN_File_Name = "deltat_tdc_ltf_" . $RUNtmp;
|
||||||
|
$RUNFILE = "$DATADIR/d$YEAR/tdc/$RUN_File_Name";
|
||||||
|
}
|
||||||
|
elsif ( $BeamLine eq "Dolly" ) {
|
||||||
|
$RUN_File_Name = "deltat_tdc_dolly_" . $RUNtmp;
|
||||||
|
$RUNFILE = "$DATADIR/d$YEAR/tdc/$RUN_File_Name";
|
||||||
|
}
|
||||||
|
elsif ( $BeamLine eq "GPD" ) {
|
||||||
|
$RUN_File_Name = "deltat_tdc_gpd_" . $RUNtmp;
|
||||||
|
$RUNFILE = "$DATADIR/d$YEAR/tdc/$RUN_File_Name";
|
||||||
|
}
|
||||||
|
$RUN_Line = join( $SPACE,
|
||||||
|
"RUN", $RUNFILE, $BeamLines{$BeamLine}, "PSI",
|
||||||
|
$Def_Format{$BeamLine} );
|
||||||
|
}
|
||||||
return $RUN_Line;
|
return $RUN_Line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
src/external/MuSRFitGUI/MuSRFit
vendored
2
src/external/MuSRFitGUI/MuSRFit
vendored
@ -2,6 +2,6 @@
|
|||||||
# Copyright 2009 by Zaher Salman and the LEM Group.
|
# Copyright 2009 by Zaher Salman and the LEM Group.
|
||||||
|
|
||||||
export MUSRBIN=$ROOTSYS/bin/
|
export MUSRBIN=$ROOTSYS/bin/
|
||||||
export PERLLIB=$HOME/analysis/musrfit/src/external/MuSRFitGUI
|
export PERLLIB=$HOME/LEM/musrfit/src/external/MuSRFitGUI
|
||||||
perl $PERLLIB/MuSRFit.pl
|
perl $PERLLIB/MuSRFit.pl
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user