Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 7f34bd39 authored by ulrich_y's avatar ulrich_y
Browse files

Added observable to vegas

parent 7e7b891f
No related branches found
No related tags found
No related merge requests found
...@@ -42,19 +42,23 @@ LoadTarFile::nenough="`1` is not enough datasets"; ...@@ -42,19 +42,23 @@ LoadTarFile::nenough="`1` is not enough datasets";
Options[LoadTarFile]={Prefactor\[Rule]1(*conv \[Alpha]em^2*)};*) Options[LoadTarFile]={Prefactor\[Rule]1(*conv \[Alpha]em^2*)};*)
BuildPattern::usage="BuildPattern[whichpiece, flavour, folder] creates a regular expression to match the correct files. If folder is omitted, all folders are searched"; BuildPattern::usage="BuildPattern[whichpiece, flavour] creates a regular expression to match the correct files.";
WithPattern::usage="WithPattern[whichpiece, folder, <expr>] creates an enviroment where \[Sigma] can be used to build the pattern"; WithPattern::usage="WithPattern[whichpiece, ... , expr] creates an enviroment where \[Sigma] can be used to build the pattern. Avaible options include the folder to search (i.e. Folder->\"nnlo/out\") and the obserable (Observable->\"30\").";
Observable::usage="The observable as specified by the O variable of the vegas file";
Folder::usage="The folder to search. This can be a pattern.";
Begin["`Private`"]; Begin["`Private`"];
BuildPattern[whichpiece_,flavour_,folder_:".*"]:=RegularExpression[folder<>"/"<>whichpiece<>"_"<>flavour<>"_S\\d*X([\\d\\.]*.)D([\\d\\.]*).*"]->"{$1,$2}" BuildPattern[whichpiece_,flavour_,folder_String]:=RegularExpression[folder<>"/"<>whichpiece<>"_"<>flavour<>"_S\\d*X([\\d\\.]*.)D([\\d\\.]*).*"]->"{$1,$2}"
BuildPattern[whichpiece_,flavour_,opts___Rule]:=Module[{folder, obs},
folder = Folder/.{opts}; If[folder === Folder, folder=".*"];
obs = Observable/.{opts}; If[obs === Observable, obs=".*", obs="O"<>obs<>"\.vegas"];
RegularExpression[folder<>"/"<>whichpiece<>"_"<>flavour<>"_S\\d*X([\\d\\.]*.)D([\\d\\.]*)_.*"<>obs]->"{$1,$2}"
]
Attributes[WithPattern]={HoldAll}; Attributes[WithPattern]={HoldAll};
WithPattern[flavour_,folder_,body_]:=body/.{Global`\[Sigma][x_]:>BuildPattern[x,flavour,folder]} WithPattern[conf__,body_]:=body/.{Global`\[Sigma][x_]:>BuildPattern[x,conf]}
WithPattern[flavour_,body_]:=body/.{Global`\[Sigma][x_]:>BuildPattern[x,flavour]}
AddTarLists[{"value"->v1_,"chi2a"->c1_,"plots"->p1_},{"value"->v2_,"chi2a"->c2_,"plots"->p2_}]/; p1[[;;,1]]===p2[[;;,1]] :={ AddTarLists[{"value"->v1_,"chi2a"->c1_,"plots"->p1_},{"value"->v2_,"chi2a"->c2_,"plots"->p2_}]/; p1[[;;,1]]===p2[[;;,1]] :={
...@@ -114,7 +118,7 @@ MergeTarLists[a:{(_List->_) ..}] /; Equal@@("plots"/.a[[;;,2]])[[;;,;;,1]] :=Mod ...@@ -114,7 +118,7 @@ MergeTarLists[a:{(_List->_) ..}] /; Equal@@("plots"/.a[[;;,2]])[[;;,;;,1]] :=Mod
} }
] ]
If[10<$VersionNumber<11.3, If[10<$VersionNumber<11.4,
addCompletion = FE`Evaluate[FEPrivate`AddSpecialArgCompletion[#]] &, addCompletion = FE`Evaluate[FEPrivate`AddSpecialArgCompletion[#]] &,
(* else *) (* else *)
addCompletion[x_] := Null; addCompletion[x_] := Null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment