lhcb-ntuple-wizard-test 1.3.3 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/dist/App.d.ts +12 -0
- package/dist/App.js +22 -0
- package/dist/components/ConfigFilesUploadingAlert.d.ts +1 -0
- package/dist/components/ConfigFilesUploadingAlert.js +5 -0
- package/dist/components/DatasetEventTypeBadge.d.ts +5 -0
- package/dist/components/DatasetEventTypeBadge.js +23 -0
- package/dist/components/DatasetInfo.d.ts +5 -0
- package/dist/components/DatasetInfo.js +21 -0
- package/dist/components/DecayLatex.d.ts +7 -0
- package/dist/components/DecayLatex.js +103 -0
- package/dist/components/DecayList.d.ts +8 -0
- package/dist/components/DecayList.js +37 -0
- package/dist/components/DecayListItem.d.ts +11 -0
- package/dist/components/DecayListItem.js +23 -0
- package/dist/components/DecayTagBadge.d.ts +5 -0
- package/dist/components/DecayTagBadge.js +21 -0
- package/dist/components/DecayTreeCard.d.ts +7 -0
- package/dist/components/DecayTreeCard.js +43 -0
- package/dist/components/DecayTreeCardHeader.d.ts +7 -0
- package/dist/components/DecayTreeCardHeader.js +5 -0
- package/dist/components/DecayTreeGraph.d.ts +9 -0
- package/dist/components/DecayTreeGraph.js +89 -0
- package/dist/components/DeleteButton.d.ts +9 -0
- package/dist/components/DeleteButton.js +16 -53
- package/dist/components/DttNameInput.d.ts +9 -0
- package/dist/components/DttNameInput.js +73 -0
- package/dist/components/LineTableRow.d.ts +9 -0
- package/dist/components/LineTableRow.js +123 -0
- package/dist/components/LoadingIndicator.d.ts +6 -0
- package/dist/components/LoadingIndicator.js +5 -0
- package/dist/components/NtupleWizard.d.ts +26 -0
- package/dist/components/NtupleWizard.js +28 -137
- package/dist/components/NumStrippingLinesBadge.d.ts +8 -0
- package/dist/components/NumStrippingLinesBadge.js +10 -0
- package/dist/components/ParticleDropdown.d.ts +8 -0
- package/dist/components/ParticleDropdown.js +33 -0
- package/dist/components/ParticleTagBadge.d.ts +9 -0
- package/dist/components/ParticleTagBadge.js +22 -0
- package/dist/components/ParticleTagFilters.d.ts +6 -0
- package/dist/components/ParticleTagFilters.js +51 -0
- package/dist/components/PolarityBadge.d.ts +5 -0
- package/dist/components/PolarityBadge.js +13 -33
- package/dist/components/StrippingLineBadge.d.ts +7 -0
- package/dist/components/StrippingLineBadge.js +29 -0
- package/dist/components/StrippingLineInfo.d.ts +8 -0
- package/dist/components/StrippingLineInfo.js +17 -0
- package/dist/components/SubmitRequestButton.d.ts +11 -0
- package/dist/components/SubmitRequestButton.js +39 -0
- package/dist/components/TagDropdown.d.ts +12 -0
- package/dist/components/TagDropdown.js +31 -0
- package/dist/components/TupleToolDocsAccordion.d.ts +5 -0
- package/dist/components/TupleToolDocsAccordion.js +14 -0
- package/dist/components/TupleToolDropdown.d.ts +21 -0
- package/dist/components/TupleToolDropdown.js +29 -0
- package/dist/components/TupleToolGroup.d.ts +6 -0
- package/dist/components/TupleToolGroup.js +22 -0
- package/dist/components/TupleToolLabel.d.ts +6 -0
- package/dist/components/TupleToolLabel.js +20 -0
- package/dist/components/TupleToolList.d.ts +7 -0
- package/dist/components/TupleToolList.js +38 -0
- package/dist/components/YearBadge.d.ts +5 -0
- package/dist/components/YearBadge.js +13 -33
- package/dist/components/modals/AddTupleToolModal.d.ts +7 -0
- package/dist/components/modals/AddTupleToolModal.js +32 -0
- package/dist/components/modals/ConfigureTupleToolModal.d.ts +8 -0
- package/dist/components/modals/ConfigureTupleToolModal.js +43 -0
- package/dist/components/modals/ReasonForRequestModal.d.ts +8 -0
- package/dist/components/modals/ReasonForRequestModal.js +49 -0
- package/dist/components/modals/UploadDttConfigModal.d.ts +7 -0
- package/dist/components/modals/UploadDttConfigModal.js +35 -0
- package/dist/components/modals/UploadProdConfigModal.d.ts +5 -0
- package/dist/components/modals/UploadProdConfigModal.js +27 -0
- package/dist/components/tupleToolParams/BoolParamInput.d.ts +16 -0
- package/dist/components/tupleToolParams/BoolParamInput.js +15 -0
- package/dist/components/tupleToolParams/DictParamInput.d.ts +14 -0
- package/dist/components/tupleToolParams/DictParamInput.js +31 -0
- package/dist/components/tupleToolParams/ListParamInput.d.ts +14 -0
- package/dist/components/tupleToolParams/ListParamInput.js +46 -0
- package/dist/components/tupleToolParams/NumParamInput.d.ts +18 -0
- package/dist/components/tupleToolParams/NumParamInput.js +25 -0
- package/dist/components/tupleToolParams/StrParamInput.d.ts +19 -0
- package/dist/components/tupleToolParams/StrParamInput.js +22 -0
- package/dist/config.d.ts +78 -0
- package/dist/config.js +72 -0
- package/dist/{style/DecaysList.css → index.d.ts} +2 -6
- package/dist/index.js +2 -11
- package/dist/models/bkPath.d.ts +11 -0
- package/dist/models/bkPath.js +40 -0
- package/dist/models/blobFile.d.ts +12 -0
- package/dist/models/blobFile.js +1 -0
- package/dist/models/decayData.d.ts +15 -0
- package/dist/models/decayData.js +1 -0
- package/dist/models/dropdownOption.d.ts +5 -0
- package/dist/models/dropdownOption.js +1 -0
- package/dist/models/dtt.d.ts +108 -0
- package/dist/models/dtt.js +149 -0
- package/dist/models/jobConfig.d.ts +7 -0
- package/dist/models/jobConfig.js +1 -0
- package/dist/models/particle.d.ts +12 -0
- package/dist/models/particle.js +1 -0
- package/dist/models/particleTag.d.ts +4 -0
- package/dist/models/particleTag.js +1 -0
- package/dist/models/rowData.d.ts +15 -0
- package/dist/models/rowData.js +1 -0
- package/dist/models/strippingLine.d.ts +5 -0
- package/dist/models/strippingLine.js +1 -0
- package/dist/models/strippingLineOption.d.ts +6 -0
- package/dist/models/strippingLineOption.js +1 -0
- package/dist/models/tupleTool.d.ts +8 -0
- package/dist/models/tupleTool.js +18 -0
- package/dist/models/tupleTreeGraphData.d.ts +20 -0
- package/dist/models/tupleTreeGraphData.js +1 -0
- package/dist/models/yamlFile.d.ts +11 -0
- package/dist/models/yamlFile.js +78 -0
- package/dist/pages/DecaySearchPage.d.ts +5 -0
- package/dist/pages/DecaySearchPage.js +197 -0
- package/dist/pages/DecayTreeConfigPage.d.ts +5 -0
- package/dist/pages/DecayTreeConfigPage.js +63 -0
- package/dist/pages/LinesTablePage.d.ts +14 -0
- package/dist/pages/LinesTablePage.js +120 -0
- package/dist/providers/DttProvider.d.ts +24 -0
- package/dist/providers/DttProvider.js +77 -0
- package/dist/providers/MetadataProvider.d.ts +87 -0
- package/dist/providers/MetadataProvider.js +50 -0
- package/dist/providers/ProductionConfigProvider.d.ts +14 -0
- package/dist/providers/ProductionConfigProvider.js +76 -0
- package/dist/providers/RequestProvider.d.ts +15 -0
- package/dist/providers/RequestProvider.js +35 -0
- package/dist/providers/RowsProvider.d.ts +14 -0
- package/dist/providers/RowsProvider.js +31 -0
- package/dist/utils/mathjaxUtils.d.ts +12 -0
- package/dist/utils/mathjaxUtils.js +24 -0
- package/dist/utils/utils.d.ts +31 -0
- package/dist/utils/utils.js +80 -0
- package/package.json +43 -21
- package/dist/components/App.js +0 -99
- package/dist/components/ConfigDict.js +0 -103
- package/dist/components/ConfigList.js +0 -94
- package/dist/components/ConfigNode.js +0 -320
- package/dist/components/ConfigValue.js +0 -86
- package/dist/components/Dataset.js +0 -67
- package/dist/components/Decay.js +0 -50
- package/dist/components/DecayItem.js +0 -101
- package/dist/components/DecayTag.js +0 -52
- package/dist/components/DecayTree.js +0 -451
- package/dist/components/DecaysList.js +0 -107
- package/dist/components/DescriptorsSearch.js +0 -352
- package/dist/components/EventTypeBadge.js +0 -45
- package/dist/components/ItemSearch.js +0 -120
- package/dist/components/LinesTable.js +0 -1105
- package/dist/components/ParticleTag.js +0 -54
- package/dist/components/SearchItem.js +0 -99
- package/dist/components/SelectParticle.js +0 -61
- package/dist/components/SelectTag.js +0 -66
- package/dist/components/SelectTool.js +0 -59
- package/dist/components/SelectVariables.js +0 -106
- package/dist/components/StrippingBadge.js +0 -64
- package/dist/components/StrippingLine.js +0 -50
- package/dist/components/TupleTool.js +0 -46
- package/dist/components/VariablesSearch.js +0 -128
- package/dist/config.json +0 -72
- package/dist/contexts/MetadataContext.js +0 -135
- package/dist/lib/BKPath.js +0 -58
- package/dist/lib/DTTConfig.js +0 -178
- package/dist/lib/mathjax.js +0 -35
- package/dist/lib/utils.js +0 -191
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Form, Modal } from "react-bootstrap";
|
|
3
|
+
import yaml from "js-yaml";
|
|
4
|
+
import Dtt from "../../models/dtt";
|
|
5
|
+
import { useRows } from "../../providers/RowsProvider";
|
|
6
|
+
export function UploadDttConfigModal({ row, onClose }) {
|
|
7
|
+
const { setRows } = useRows();
|
|
8
|
+
const uploadConfig = (files) => {
|
|
9
|
+
const reader = new FileReader();
|
|
10
|
+
reader.onload = (e) => {
|
|
11
|
+
if (!e.target) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const text = e.target.result;
|
|
15
|
+
const config = yaml.load(text);
|
|
16
|
+
if (config.descriptorTemplate === row.decay.descriptors.template) {
|
|
17
|
+
const dtt = new Dtt(config, {});
|
|
18
|
+
setRows((prev) => {
|
|
19
|
+
return prev.map((r) => (r.id === row.id ? { ...r, dtt: dtt.withInputsFromLines(row.lines) } : r));
|
|
20
|
+
});
|
|
21
|
+
onClose();
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
alert("Make sure to upload a previously downloaded configuration file for the same decay.");
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
reader.readAsText(files[0]);
|
|
28
|
+
};
|
|
29
|
+
return (_jsxs(Modal, { show: true, animation: false, children: [_jsx(Modal.Header, { children: _jsx(Modal.Title, { children: " Upload configuration file " }) }), _jsx(Modal.Body, { children: _jsx(Form.Group, { controlId: "formFile1", className: "mb-3", children: _jsx(Form.Control, { type: "file", onChange: (event) => {
|
|
30
|
+
if (!event.target.files)
|
|
31
|
+
return;
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
uploadConfig(event.target.files);
|
|
34
|
+
} }) }) }), _jsx(Modal.Footer, { children: _jsx(Button, { variant: "secondary", onClick: onClose, children: "Close" }) })] }));
|
|
35
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Form, Modal } from "react-bootstrap";
|
|
3
|
+
import { useMetadata } from "../../providers/MetadataProvider";
|
|
4
|
+
import { useProductionConfig } from "../../providers/ProductionConfigProvider";
|
|
5
|
+
import { useRows } from "../../providers/RowsProvider";
|
|
6
|
+
import { useRequest } from "../../providers/RequestProvider";
|
|
7
|
+
export function UploadProdConfigModal({ onClose }) {
|
|
8
|
+
const metadata = useMetadata();
|
|
9
|
+
const { parseProductionFiles } = useProductionConfig();
|
|
10
|
+
const { setRows } = useRows();
|
|
11
|
+
const { setContactEmails } = useRequest();
|
|
12
|
+
if (!metadata) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return (_jsxs(Modal, { show: true, animation: false, children: [_jsx(Modal.Header, { children: _jsx(Modal.Title, { children: " Upload configuration file " }) }), _jsx(Modal.Body, { children: _jsx(Form.Group, { controlId: "formFile2", className: "mb-3", children: _jsx(Form.Control, { type: "file", multiple: true, onChange: (event) => {
|
|
16
|
+
const files = event.target.files;
|
|
17
|
+
if (!files) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
parseProductionFiles(Array.from(files), metadata)
|
|
21
|
+
.then(({ rows, emails }) => {
|
|
22
|
+
setRows(rows);
|
|
23
|
+
setContactEmails(emails);
|
|
24
|
+
})
|
|
25
|
+
.catch(console.error);
|
|
26
|
+
} }) }) }), _jsx(Modal.Footer, { children: _jsx(Button, { variant: "secondary", onClick: onClose, children: "Close" }) })] }));
|
|
27
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*****************************************************************************\
|
|
2
|
+
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
3
|
+
* *
|
|
4
|
+
* This software is distributed under the terms of the GNU General Public *
|
|
5
|
+
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
6
|
+
* *
|
|
7
|
+
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
8
|
+
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
9
|
+
* or submit itself to any jurisdiction. *
|
|
10
|
+
\*****************************************************************************/
|
|
11
|
+
interface Props {
|
|
12
|
+
value: boolean;
|
|
13
|
+
onChange: (v: boolean) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function BoolParamInput({ onChange, value }: Props): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*****************************************************************************\
|
|
3
|
+
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
4
|
+
* *
|
|
5
|
+
* This software is distributed under the terms of the GNU General Public *
|
|
6
|
+
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
7
|
+
* *
|
|
8
|
+
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
9
|
+
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
10
|
+
* or submit itself to any jurisdiction. *
|
|
11
|
+
\*****************************************************************************/
|
|
12
|
+
import { Form } from "react-bootstrap";
|
|
13
|
+
export function BoolParamInput({ onChange, value }) {
|
|
14
|
+
return _jsx(Form.Check, { type: "switch", checked: value, onChange: () => onChange(!value) });
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
value: {
|
|
3
|
+
[key: string]: string;
|
|
4
|
+
} | {
|
|
5
|
+
[key: string]: string[];
|
|
6
|
+
};
|
|
7
|
+
onChange: (value: {
|
|
8
|
+
[key: string]: string;
|
|
9
|
+
} | {
|
|
10
|
+
[key: string]: string[];
|
|
11
|
+
}) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function DictParamInput({ onChange, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*****************************************************************************\
|
|
3
|
+
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
4
|
+
* *
|
|
5
|
+
* This software is distributed under the terms of the GNU General Public *
|
|
6
|
+
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
7
|
+
* *
|
|
8
|
+
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
9
|
+
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
10
|
+
* or submit itself to any jurisdiction. *
|
|
11
|
+
\*****************************************************************************/
|
|
12
|
+
import { useState } from "react";
|
|
13
|
+
import { Alert, Button, ButtonGroup, Card, FormControl } from "react-bootstrap";
|
|
14
|
+
export function DictParamInput({ onChange, ...props }) {
|
|
15
|
+
const [value, setValue] = useState(JSON.stringify(props.value, null, 2));
|
|
16
|
+
const [editMode, setEditMode] = useState(false);
|
|
17
|
+
const [error, setError] = useState(null);
|
|
18
|
+
const handleSave = () => {
|
|
19
|
+
try {
|
|
20
|
+
const json = JSON.parse(value);
|
|
21
|
+
onChange(json);
|
|
22
|
+
setError(null);
|
|
23
|
+
setEditMode(false);
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
console.error("JSON parsing error:", e);
|
|
27
|
+
setError("Invalid JSON");
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
return (_jsx(Card, { children: _jsxs(Card.Body, { children: [error && _jsx(Alert, { variant: "danger", children: error }), _jsx(FormControl, { as: "textarea", value: value, onChange: (e) => setValue(e.target.value), disabled: !editMode }), _jsxs(ButtonGroup, { children: [editMode && (_jsx(Button, { variant: "primary", onClick: handleSave, children: "Save" })), _jsx(Button, { variant: "outline-secondary", onClick: () => setEditMode(!editMode), children: editMode ? "Cancel" : "Edit" })] })] }) }));
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
interface Props<T> {
|
|
3
|
+
onChange: (value: T[]) => void;
|
|
4
|
+
initialValues: T[];
|
|
5
|
+
defaultValues: T[];
|
|
6
|
+
newItemValue: T;
|
|
7
|
+
buildInnerInput: (props: {
|
|
8
|
+
value: T;
|
|
9
|
+
onChange: (value: T) => void;
|
|
10
|
+
defaultValue?: T;
|
|
11
|
+
}) => ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function ListParamInput<T>({ onChange, initialValues, defaultValues, newItemValue, buildInnerInput }: Props<T>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*****************************************************************************\
|
|
3
|
+
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
4
|
+
* *
|
|
5
|
+
* This software is distributed under the terms of the GNU General Public *
|
|
6
|
+
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
7
|
+
* *
|
|
8
|
+
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
9
|
+
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
10
|
+
* or submit itself to any jurisdiction. *
|
|
11
|
+
\*****************************************************************************/
|
|
12
|
+
import { Button, CloseButton, InputGroup, ListGroup } from "react-bootstrap";
|
|
13
|
+
import { PlusLg } from "react-bootstrap-icons";
|
|
14
|
+
import { useEffect, useState } from "react";
|
|
15
|
+
export function ListParamInput({ onChange, initialValues, defaultValues, newItemValue, buildInnerInput }) {
|
|
16
|
+
const [value, setValue] = useState(initialValues);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
// Don't run on the first render
|
|
19
|
+
if (initialValues === value) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
onChange(value);
|
|
23
|
+
}, [value]);
|
|
24
|
+
const handleAdd = () => {
|
|
25
|
+
if (value.length < defaultValues.length) {
|
|
26
|
+
setValue((prev) => [...prev, defaultValues[prev.length]]);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
setValue((prev) => [...prev, newItemValue]);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const handleRemove = (index) => {
|
|
33
|
+
setValue((prev) => prev.filter((_, i) => i !== index));
|
|
34
|
+
};
|
|
35
|
+
return (_jsxs(_Fragment, { children: [_jsx(ListGroup, { variant: "flush", children: value.map((value, i) => (_jsx(ListGroup.Item, { children: _jsxs(InputGroup, { children: [buildInnerInput({
|
|
36
|
+
value,
|
|
37
|
+
onChange: (newValue) => {
|
|
38
|
+
setValue((prev) => {
|
|
39
|
+
const next = [...prev];
|
|
40
|
+
next[i] = newValue;
|
|
41
|
+
return next;
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
defaultValue: i < defaultValues.length ? defaultValues[i] : undefined,
|
|
45
|
+
}), _jsx(CloseButton, { onClick: () => handleRemove(i) })] }) }, i))) }), _jsx(Button, { variant: "success", size: "sm", onClick: handleAdd, children: _jsx(PlusLg, {}) })] }));
|
|
46
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*****************************************************************************\
|
|
2
|
+
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
3
|
+
* *
|
|
4
|
+
* This software is distributed under the terms of the GNU General Public *
|
|
5
|
+
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
6
|
+
* *
|
|
7
|
+
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
8
|
+
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
9
|
+
* or submit itself to any jurisdiction. *
|
|
10
|
+
\*****************************************************************************/
|
|
11
|
+
interface Props {
|
|
12
|
+
type: "int" | "uint" | "float";
|
|
13
|
+
value: number;
|
|
14
|
+
defaultValue?: number;
|
|
15
|
+
onChange: (v: number) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function NumParamInput({ type, onChange, value, defaultValue }: Props): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*****************************************************************************\
|
|
3
|
+
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
4
|
+
* *
|
|
5
|
+
* This software is distributed under the terms of the GNU General Public *
|
|
6
|
+
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
7
|
+
* *
|
|
8
|
+
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
9
|
+
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
10
|
+
* or submit itself to any jurisdiction. *
|
|
11
|
+
\*****************************************************************************/
|
|
12
|
+
import { Form } from "react-bootstrap";
|
|
13
|
+
export function NumParamInput({ type, onChange, value, defaultValue }) {
|
|
14
|
+
return (_jsx(Form.Control, { type: "number", value: value, placeholder: defaultValue?.toString(), onChange: (event) => {
|
|
15
|
+
const value = event.target.value;
|
|
16
|
+
let n = Number(value);
|
|
17
|
+
if (type === "int") {
|
|
18
|
+
n = Math.trunc(n);
|
|
19
|
+
}
|
|
20
|
+
else if (type === "uint") {
|
|
21
|
+
n = Math.trunc(Math.abs(n));
|
|
22
|
+
}
|
|
23
|
+
onChange(n);
|
|
24
|
+
}, ...(type === "int" || type === "uint" ? { step: 1 } : {}), ...(type === "uint" ? { min: 0 } : {}) }));
|
|
25
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*****************************************************************************\
|
|
2
|
+
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
3
|
+
* *
|
|
4
|
+
* This software is distributed under the terms of the GNU General Public *
|
|
5
|
+
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
6
|
+
* *
|
|
7
|
+
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
8
|
+
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
9
|
+
* or submit itself to any jurisdiction. *
|
|
10
|
+
\*****************************************************************************/
|
|
11
|
+
export declare function sanitizeStrTupleToolParam(value: string): string;
|
|
12
|
+
interface Props {
|
|
13
|
+
value: string;
|
|
14
|
+
defaultValue?: string;
|
|
15
|
+
onChange: (value: string) => void;
|
|
16
|
+
param?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function StrParamInput({ onChange, value, defaultValue, param }: Props): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*****************************************************************************\
|
|
3
|
+
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
4
|
+
* *
|
|
5
|
+
* This software is distributed under the terms of the GNU General Public *
|
|
6
|
+
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
7
|
+
* *
|
|
8
|
+
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
9
|
+
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
10
|
+
* or submit itself to any jurisdiction. *
|
|
11
|
+
\*****************************************************************************/
|
|
12
|
+
import { Form } from "react-bootstrap";
|
|
13
|
+
export function sanitizeStrTupleToolParam(value) {
|
|
14
|
+
// Allow letters, numbers, _, :, and -
|
|
15
|
+
return value.replaceAll(/[^\w:-]/g, "");
|
|
16
|
+
}
|
|
17
|
+
export function StrParamInput({ onChange, value, defaultValue, param }) {
|
|
18
|
+
return (_jsx(_Fragment, { children: _jsx(Form.Control, { type: "text", value: value, placeholder: defaultValue?.toString(), onChange: (event) => {
|
|
19
|
+
const value = event.target.value;
|
|
20
|
+
onChange(param === "ExtraName" ? value.replaceAll(/\W/g, "") : sanitizeStrTupleToolParam(value));
|
|
21
|
+
} }) }));
|
|
22
|
+
}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export declare const config: {
|
|
2
|
+
metadata_baseurl: string;
|
|
3
|
+
metadata_files: {
|
|
4
|
+
particleProperties: string;
|
|
5
|
+
lokiVariables: string;
|
|
6
|
+
decays: string;
|
|
7
|
+
stripping: string;
|
|
8
|
+
strippingHints: string;
|
|
9
|
+
userHints: string;
|
|
10
|
+
tupleTools: string;
|
|
11
|
+
dataset: string;
|
|
12
|
+
kgdoc: string;
|
|
13
|
+
embedding: string;
|
|
14
|
+
};
|
|
15
|
+
batch_size: number;
|
|
16
|
+
particleTagGroupStyles: {
|
|
17
|
+
category: string;
|
|
18
|
+
charge: string;
|
|
19
|
+
flavour: string;
|
|
20
|
+
spin: string;
|
|
21
|
+
lifetime: string;
|
|
22
|
+
};
|
|
23
|
+
dttGraphOptions: {
|
|
24
|
+
layout: {
|
|
25
|
+
hierarchical: {
|
|
26
|
+
sortMethod: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
nodes: {
|
|
30
|
+
borderWidth: number;
|
|
31
|
+
borderWidthSelected: number;
|
|
32
|
+
imagePadding: number;
|
|
33
|
+
font: {
|
|
34
|
+
strokeWidth: number;
|
|
35
|
+
background: string;
|
|
36
|
+
};
|
|
37
|
+
color: {
|
|
38
|
+
background: string;
|
|
39
|
+
highlight: {
|
|
40
|
+
background: string;
|
|
41
|
+
};
|
|
42
|
+
hover: {
|
|
43
|
+
background: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
scaling: {
|
|
47
|
+
min: number;
|
|
48
|
+
max: number;
|
|
49
|
+
};
|
|
50
|
+
value: number;
|
|
51
|
+
shape: string;
|
|
52
|
+
shapeProperties: {
|
|
53
|
+
useBorderWithImage: boolean;
|
|
54
|
+
useImageSize: boolean;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
edges: {
|
|
58
|
+
color: string;
|
|
59
|
+
width: number;
|
|
60
|
+
selectionWidth: number;
|
|
61
|
+
hoverWidth: number;
|
|
62
|
+
};
|
|
63
|
+
physics: {
|
|
64
|
+
enabled: boolean;
|
|
65
|
+
};
|
|
66
|
+
interaction: {
|
|
67
|
+
dragNodes: boolean;
|
|
68
|
+
multiselect: boolean;
|
|
69
|
+
selectConnectedEdges: boolean;
|
|
70
|
+
hoverConnectedEdges: boolean;
|
|
71
|
+
hover: boolean;
|
|
72
|
+
zoomView: boolean;
|
|
73
|
+
};
|
|
74
|
+
height: string;
|
|
75
|
+
autoResize: boolean;
|
|
76
|
+
width: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export const config = {
|
|
2
|
+
metadata_baseurl: "https://lbwizard-metadata.web.cern.ch/3.1.0/",
|
|
3
|
+
metadata_files: {
|
|
4
|
+
particleProperties: "particle_properties",
|
|
5
|
+
lokiVariables: "loki",
|
|
6
|
+
decays: "decays",
|
|
7
|
+
stripping: "stripping",
|
|
8
|
+
strippingHints: "stripping_hints",
|
|
9
|
+
userHints: "user_hints",
|
|
10
|
+
tupleTools: "tupletools",
|
|
11
|
+
dataset: "dataset",
|
|
12
|
+
kgdoc: "kgdoc",
|
|
13
|
+
embedding: "embedding",
|
|
14
|
+
},
|
|
15
|
+
batch_size: 10,
|
|
16
|
+
particleTagGroupStyles: {
|
|
17
|
+
category: "dark",
|
|
18
|
+
charge: "primary",
|
|
19
|
+
flavour: "success",
|
|
20
|
+
spin: "danger",
|
|
21
|
+
lifetime: "secondary",
|
|
22
|
+
},
|
|
23
|
+
dttGraphOptions: {
|
|
24
|
+
layout: {
|
|
25
|
+
hierarchical: { sortMethod: "directed" },
|
|
26
|
+
},
|
|
27
|
+
nodes: {
|
|
28
|
+
borderWidth: 0,
|
|
29
|
+
borderWidthSelected: 0,
|
|
30
|
+
imagePadding: 10,
|
|
31
|
+
font: {
|
|
32
|
+
strokeWidth: 20,
|
|
33
|
+
background: "white",
|
|
34
|
+
},
|
|
35
|
+
color: {
|
|
36
|
+
background: "white",
|
|
37
|
+
highlight: { background: "white" },
|
|
38
|
+
hover: { background: "#eee" },
|
|
39
|
+
},
|
|
40
|
+
scaling: {
|
|
41
|
+
min: 32,
|
|
42
|
+
max: 32,
|
|
43
|
+
},
|
|
44
|
+
value: 1,
|
|
45
|
+
shape: "image",
|
|
46
|
+
shapeProperties: {
|
|
47
|
+
useBorderWithImage: true,
|
|
48
|
+
useImageSize: false,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
edges: {
|
|
52
|
+
color: "black",
|
|
53
|
+
width: 1,
|
|
54
|
+
selectionWidth: 0,
|
|
55
|
+
hoverWidth: 0,
|
|
56
|
+
},
|
|
57
|
+
physics: {
|
|
58
|
+
enabled: false,
|
|
59
|
+
},
|
|
60
|
+
interaction: {
|
|
61
|
+
dragNodes: false,
|
|
62
|
+
multiselect: true,
|
|
63
|
+
selectConnectedEdges: false,
|
|
64
|
+
hoverConnectedEdges: false,
|
|
65
|
+
hover: true,
|
|
66
|
+
zoomView: false,
|
|
67
|
+
},
|
|
68
|
+
height: "500px",
|
|
69
|
+
autoResize: true,
|
|
70
|
+
width: "100%",
|
|
71
|
+
},
|
|
72
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*****************************************************************************\
|
|
2
|
-
* (c) Copyright
|
|
2
|
+
* (c) Copyright 2025 CERN for the benefit of the LHCb Collaboration *
|
|
3
3
|
* *
|
|
4
4
|
* This software is distributed under the terms of the GNU General Public *
|
|
5
5
|
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
@@ -8,8 +8,4 @@
|
|
|
8
8
|
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
9
9
|
* or submit itself to any jurisdiction. *
|
|
10
10
|
\*****************************************************************************/
|
|
11
|
-
|
|
12
|
-
.decaysListClass {
|
|
13
|
-
height: 540px;
|
|
14
|
-
overflow-y: scroll;
|
|
15
|
-
}
|
|
11
|
+
export { NtupleWizard } from "./components/NtupleWizard.js";
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _client = require("react-dom/client");
|
|
4
|
-
var _App = _interopRequireDefault(require("./components/App"));
|
|
5
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
6
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
1
|
/*****************************************************************************\
|
|
8
|
-
* (c) Copyright
|
|
2
|
+
* (c) Copyright 2025 CERN for the benefit of the LHCb Collaboration *
|
|
9
3
|
* *
|
|
10
4
|
* This software is distributed under the terms of the GNU General Public *
|
|
11
5
|
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
@@ -14,7 +8,4 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
14
8
|
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
15
9
|
* or submit itself to any jurisdiction. *
|
|
16
10
|
\*****************************************************************************/
|
|
17
|
-
|
|
18
|
-
const container = document.getElementById("root");
|
|
19
|
-
const root = (0, _client.createRoot)(container);
|
|
20
|
-
root.render(/*#__PURE__*/(0, _jsxRuntime.jsx)(_App.default, {}));
|
|
11
|
+
export { NtupleWizard } from "./components/NtupleWizard.js";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export default class BkPath {
|
|
2
|
+
path;
|
|
3
|
+
isMC;
|
|
4
|
+
constructor(path) {
|
|
5
|
+
this.path = path;
|
|
6
|
+
this.isMC = path.split("/")[1] === "MC";
|
|
7
|
+
}
|
|
8
|
+
getStrippingVersion() {
|
|
9
|
+
return this.path.split("/")[this.isMC ? 7 : 6].replace("Stripping", "").replace("NoPrescalingFlagged", "");
|
|
10
|
+
}
|
|
11
|
+
getYear() {
|
|
12
|
+
return this.path.split("/")[2].replace("Collision", "20");
|
|
13
|
+
}
|
|
14
|
+
getPolarity() {
|
|
15
|
+
const matchingPolarities = ["MagUp", "MagDown"].filter((polarity) => this.path.includes(polarity));
|
|
16
|
+
return matchingPolarities.length === 1 ? matchingPolarities[0] : null;
|
|
17
|
+
}
|
|
18
|
+
getFilename() {
|
|
19
|
+
return this.path.split("/")[this.isMC ? 9 : 8];
|
|
20
|
+
}
|
|
21
|
+
getEventType() {
|
|
22
|
+
return this.path.split("/")[this.isMC ? 8 : 7];
|
|
23
|
+
}
|
|
24
|
+
isValid() {
|
|
25
|
+
const bkArray = this.path.split("/");
|
|
26
|
+
if (bkArray[0] !== "") {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
if (!this.path.toLowerCase().endsWith("dst")) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
if (bkArray.length === 9 && bkArray[1] === "LHCb") {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
else if (bkArray.length === 10 && bkArray[1] === "MC") {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BranchMapItem } from "./dtt.js";
|
|
2
|
+
export interface DecayDescriptors {
|
|
3
|
+
plain: string;
|
|
4
|
+
latex: string;
|
|
5
|
+
template: string;
|
|
6
|
+
mapped_list: BranchMapItem[];
|
|
7
|
+
list: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface DecayData {
|
|
10
|
+
descriptors: DecayDescriptors;
|
|
11
|
+
lines: {
|
|
12
|
+
[key: string]: string[];
|
|
13
|
+
};
|
|
14
|
+
tags: string[];
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|