lhcb-ntuple-wizard-test 2.0.0 → 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/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 +19 -0
- 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 +33 -0
- 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 +15 -0
- 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 +15 -0
- 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/index.d.ts +11 -0
- package/dist/index.js +11 -0
- 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 +3 -2
|
@@ -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
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*****************************************************************************\
|
|
2
|
+
* (c) Copyright 2025 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 { NtupleWizard } from "./components/NtupleWizard.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*****************************************************************************\
|
|
2
|
+
* (c) Copyright 2025 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 { 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 {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { TupleTool } from "./tupleTool";
|
|
2
|
+
import { StrippingLine } from "./strippingLine";
|
|
3
|
+
/*****************************************************************************\
|
|
4
|
+
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
5
|
+
* *
|
|
6
|
+
* This software is distributed under the terms of the GNU General Public *
|
|
7
|
+
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
8
|
+
* *
|
|
9
|
+
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
10
|
+
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
11
|
+
* or submit itself to any jurisdiction. *
|
|
12
|
+
\*****************************************************************************/
|
|
13
|
+
export type ToolParamTypeMap = {
|
|
14
|
+
bool: boolean;
|
|
15
|
+
int: number;
|
|
16
|
+
uint: number;
|
|
17
|
+
float: number;
|
|
18
|
+
str: string;
|
|
19
|
+
text: string[];
|
|
20
|
+
"[int]": number[];
|
|
21
|
+
"[uint]": number[];
|
|
22
|
+
"[float]": number[];
|
|
23
|
+
"{str:str}": {
|
|
24
|
+
[key: string]: string;
|
|
25
|
+
};
|
|
26
|
+
"{str:[str]}": {
|
|
27
|
+
[key: string]: string[];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export interface ToolParamMetadata<K extends keyof ToolParamTypeMap> {
|
|
31
|
+
cpp_type: string;
|
|
32
|
+
default: ToolParamTypeMap[K];
|
|
33
|
+
description: string;
|
|
34
|
+
name: string;
|
|
35
|
+
type: K;
|
|
36
|
+
}
|
|
37
|
+
export interface ToolMetadata {
|
|
38
|
+
[key: string]: {
|
|
39
|
+
description: string;
|
|
40
|
+
documentation: string;
|
|
41
|
+
interface: ToolParamMetadata<keyof ToolParamTypeMap>[];
|
|
42
|
+
tags: string[];
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export type ToolParam<K extends keyof ToolParamTypeMap> = {
|
|
46
|
+
value: ToolParamTypeMap[K];
|
|
47
|
+
} & ToolParamMetadata<K>;
|
|
48
|
+
export type AnyToolParam = {
|
|
49
|
+
[K in keyof ToolParamTypeMap]: ToolParam<K>;
|
|
50
|
+
}[keyof ToolParamTypeMap];
|
|
51
|
+
export interface ToolConfig {
|
|
52
|
+
[toolParamName: string]: AnyToolParam;
|
|
53
|
+
}
|
|
54
|
+
export interface BranchConfig {
|
|
55
|
+
particle: string;
|
|
56
|
+
tools: {
|
|
57
|
+
[toolString: string]: ToolConfig;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export interface GroupConfig {
|
|
61
|
+
particles: string[];
|
|
62
|
+
tools: {
|
|
63
|
+
[toolString: string]: ToolConfig;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export interface DttConfig {
|
|
67
|
+
inputs?: string[];
|
|
68
|
+
descriptorTemplate?: string;
|
|
69
|
+
tools: {
|
|
70
|
+
[toolName: string]: ToolConfig;
|
|
71
|
+
};
|
|
72
|
+
branches: {
|
|
73
|
+
[particleId: string]: BranchConfig;
|
|
74
|
+
};
|
|
75
|
+
groups: {
|
|
76
|
+
[particleGroup: string]: GroupConfig;
|
|
77
|
+
};
|
|
78
|
+
name?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface Branch {
|
|
81
|
+
branch: string;
|
|
82
|
+
particle: string;
|
|
83
|
+
}
|
|
84
|
+
export type BranchMapItem = Branch | BranchMapItem[];
|
|
85
|
+
export default class Dtt {
|
|
86
|
+
config: DttConfig;
|
|
87
|
+
metadata: ToolMetadata;
|
|
88
|
+
constructor(config: DttConfig, toolMetadata: ToolMetadata);
|
|
89
|
+
private static getBranchConfigs;
|
|
90
|
+
static create(descriptorTemplate: string, branchItemsList: BranchMapItem[], inputs: string[], name: string, toolMetadata: ToolMetadata): Dtt;
|
|
91
|
+
withInputsFromLines(lines: StrippingLine[]): Dtt;
|
|
92
|
+
withName(name: string): Dtt;
|
|
93
|
+
withConfig(config: DttConfig): Dtt;
|
|
94
|
+
withAddedTool(tool: TupleTool, branch?: string[]): Dtt;
|
|
95
|
+
withUpdatedToolParam<K extends keyof ToolParamTypeMap>(branch: string[], tool: TupleTool, param: string, value: ToolParamTypeMap[K]): Dtt;
|
|
96
|
+
withRemovedTool(tool: TupleTool, branch?: string[]): Dtt;
|
|
97
|
+
getName(): string;
|
|
98
|
+
pruneGroups(): void;
|
|
99
|
+
getToolsByBranch(branch?: string[]): {
|
|
100
|
+
[toolString: string]: ToolConfig;
|
|
101
|
+
};
|
|
102
|
+
private static getToolsByBranchFromConfig;
|
|
103
|
+
getParticlesByBranchId(branchIds: string[]): string[];
|
|
104
|
+
private static getDefaultToolConfig;
|
|
105
|
+
getToolConfig(branch: string[], tool: TupleTool): ToolConfig;
|
|
106
|
+
listTools(branch?: string[]): TupleTool[];
|
|
107
|
+
toolExists(tool: TupleTool, branch?: string[]): boolean;
|
|
108
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { TupleTool } from "./tupleTool";
|
|
2
|
+
export default class Dtt {
|
|
3
|
+
config;
|
|
4
|
+
metadata;
|
|
5
|
+
/* Class for customising the configuration of a DecayTreeTuple algorithm.
|
|
6
|
+
* The output will be parsed by a custom parser in the AnalysisHelpers data-package.
|
|
7
|
+
*/
|
|
8
|
+
constructor(config, toolMetadata) {
|
|
9
|
+
this.config = config;
|
|
10
|
+
this.metadata = toolMetadata;
|
|
11
|
+
}
|
|
12
|
+
static getBranchConfigs(branchItemsList) {
|
|
13
|
+
const branches = {};
|
|
14
|
+
const walk = (item, parentId) => {
|
|
15
|
+
if (Array.isArray(item)) {
|
|
16
|
+
item.forEach((t) => walk(t, parentId));
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
branches[item.branch] = { particle: item.particle, tools: {} };
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
branchItemsList.forEach((bmap) => walk(bmap, null));
|
|
23
|
+
return branches;
|
|
24
|
+
}
|
|
25
|
+
static create(descriptorTemplate, branchItemsList, inputs, name, toolMetadata) {
|
|
26
|
+
const defaultTools = [
|
|
27
|
+
// default tool list in DaVinci v45r7
|
|
28
|
+
// TODO: load this from a file generated on deployment
|
|
29
|
+
"TupleToolKinematic",
|
|
30
|
+
"TupleToolPid",
|
|
31
|
+
"TupleToolANNPID",
|
|
32
|
+
"TupleToolGeometry",
|
|
33
|
+
"TupleToolEventInfo",
|
|
34
|
+
];
|
|
35
|
+
return new Dtt({
|
|
36
|
+
inputs,
|
|
37
|
+
descriptorTemplate,
|
|
38
|
+
tools: Object.fromEntries(defaultTools.map((tool) => [tool, Dtt.getDefaultToolConfig(toolMetadata, tool)])),
|
|
39
|
+
branches: Dtt.getBranchConfigs(branchItemsList),
|
|
40
|
+
groups: {},
|
|
41
|
+
name,
|
|
42
|
+
}, toolMetadata);
|
|
43
|
+
}
|
|
44
|
+
withInputsFromLines(lines) {
|
|
45
|
+
const inputs = lines.map(({ stream, line }) => {
|
|
46
|
+
const lineLocation = String(line).replace("Stripping", "");
|
|
47
|
+
return `/Event/${stream}/Phys/${lineLocation}/Particles`;
|
|
48
|
+
});
|
|
49
|
+
return new Dtt({ ...this.config, inputs }, this.metadata);
|
|
50
|
+
}
|
|
51
|
+
// Set the class+name combination
|
|
52
|
+
withName(name) {
|
|
53
|
+
const safeName = name.replace(/\W/g, "");
|
|
54
|
+
return new Dtt({ ...this.config, name: `DecayTreeTuple/${safeName}` }, this.metadata);
|
|
55
|
+
}
|
|
56
|
+
withConfig(config) {
|
|
57
|
+
return new Dtt(config, this.metadata);
|
|
58
|
+
}
|
|
59
|
+
withAddedTool(tool, branch) {
|
|
60
|
+
const nextConfig = structuredClone(this.config);
|
|
61
|
+
const tools = Dtt.getToolsByBranchFromConfig(nextConfig, branch);
|
|
62
|
+
const key = tool.toString();
|
|
63
|
+
if (tools[key])
|
|
64
|
+
return this; // already exists
|
|
65
|
+
tools[key] = Dtt.getDefaultToolConfig(this.metadata, tool.class);
|
|
66
|
+
return new Dtt(nextConfig, this.metadata);
|
|
67
|
+
}
|
|
68
|
+
withUpdatedToolParam(branch, tool, param, value) {
|
|
69
|
+
const nextConfig = structuredClone(this.config);
|
|
70
|
+
const tools = Dtt.getToolsByBranchFromConfig(nextConfig, branch);
|
|
71
|
+
tools[tool.toString()][param].value = value;
|
|
72
|
+
return new Dtt(nextConfig, this.metadata);
|
|
73
|
+
}
|
|
74
|
+
withRemovedTool(tool, branch) {
|
|
75
|
+
const nextConfig = structuredClone(this.config);
|
|
76
|
+
const tools = Dtt.getToolsByBranchFromConfig(nextConfig, branch);
|
|
77
|
+
delete tools[tool.toString()];
|
|
78
|
+
return new Dtt(nextConfig, this.metadata);
|
|
79
|
+
}
|
|
80
|
+
// Return the name of the DecayTreeTuple algorithm
|
|
81
|
+
getName() {
|
|
82
|
+
if (!this.config.name) {
|
|
83
|
+
return "";
|
|
84
|
+
}
|
|
85
|
+
return this.config.name.split("/")[1];
|
|
86
|
+
}
|
|
87
|
+
// Delete all groups with an empty tool list
|
|
88
|
+
pruneGroups() {
|
|
89
|
+
for (const [key, groupConfig] of Object.entries(this.config.groups)) {
|
|
90
|
+
if (Object.keys(groupConfig.tools).length === 0) {
|
|
91
|
+
delete this.config.groups[key];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// Find the appropriate object which has a "tools" list
|
|
96
|
+
getToolsByBranch(branch) {
|
|
97
|
+
this.pruneGroups();
|
|
98
|
+
return Dtt.getToolsByBranchFromConfig(this.config, branch);
|
|
99
|
+
}
|
|
100
|
+
static getToolsByBranchFromConfig(config, branch) {
|
|
101
|
+
if (!branch || branch?.length === 0) {
|
|
102
|
+
return config.tools;
|
|
103
|
+
}
|
|
104
|
+
if (branch.length === 1 && branch[0] in config.branches) {
|
|
105
|
+
return config.branches[branch[0]].tools;
|
|
106
|
+
}
|
|
107
|
+
const particleGroup = branch.join(",");
|
|
108
|
+
if (!(particleGroup in config.groups)) {
|
|
109
|
+
// Create the group if it doesn't exist
|
|
110
|
+
config.groups[particleGroup] = {
|
|
111
|
+
particles: branch.map((pid) => config.branches[pid].particle),
|
|
112
|
+
tools: {},
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
return config.groups[particleGroup].tools;
|
|
116
|
+
}
|
|
117
|
+
getParticlesByBranchId(branchIds) {
|
|
118
|
+
this.pruneGroups();
|
|
119
|
+
if (branchIds.length === 1 && branchIds[0] in this.config.branches) {
|
|
120
|
+
return [this.config.branches[branchIds[0]].particle];
|
|
121
|
+
}
|
|
122
|
+
const particleGroup = branchIds.join(",");
|
|
123
|
+
if (!(particleGroup in this.config.groups)) {
|
|
124
|
+
// Create the group if it doesn't exist
|
|
125
|
+
this.config.groups[particleGroup] = {
|
|
126
|
+
particles: branchIds.map((id) => this.config.branches[id].particle),
|
|
127
|
+
tools: {},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
return this.config.groups[particleGroup].particles;
|
|
131
|
+
}
|
|
132
|
+
// Return a dict containing the default configuration of a TupleTool
|
|
133
|
+
static getDefaultToolConfig(toolMetadata, toolClass) {
|
|
134
|
+
const paramMetadata = toolMetadata[toolClass].interface.filter((param) => param.name !== "Preambulo");
|
|
135
|
+
return Object.fromEntries(paramMetadata.map((metadata) => [metadata.name, { value: metadata.default, ...metadata }]));
|
|
136
|
+
}
|
|
137
|
+
// Return the current config dict of a tool, so it can be modified by the user
|
|
138
|
+
getToolConfig(branch, tool) {
|
|
139
|
+
const tools = this.getToolsByBranch(branch);
|
|
140
|
+
return tools[tool.toString()];
|
|
141
|
+
}
|
|
142
|
+
// Return a list of strings corresponding to the target's tool list
|
|
143
|
+
listTools(branch) {
|
|
144
|
+
return Object.keys(this.getToolsByBranch(branch)).map((toolString) => TupleTool.fromString(toolString));
|
|
145
|
+
}
|
|
146
|
+
toolExists(tool, branch) {
|
|
147
|
+
return tool.toString() in this.getToolsByBranch(branch);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Dtt from "./dtt.js";
|
|
2
|
+
import { DecayData } from "./decayData";
|
|
3
|
+
import { StrippingLine } from "./strippingLine.js";
|
|
4
|
+
export interface RowData {
|
|
5
|
+
id: number;
|
|
6
|
+
decay: DecayData;
|
|
7
|
+
dtt: Dtt | null;
|
|
8
|
+
editTree?: boolean;
|
|
9
|
+
lines: StrippingLine[];
|
|
10
|
+
paths: string[];
|
|
11
|
+
pathOptions: string[];
|
|
12
|
+
}
|
|
13
|
+
export type ConfiguredRow = RowData & {
|
|
14
|
+
dtt: NonNullable<RowData["dtt"]>;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class TupleTool {
|
|
2
|
+
class;
|
|
3
|
+
name;
|
|
4
|
+
constructor(toolClass, name) {
|
|
5
|
+
this.class = toolClass;
|
|
6
|
+
this.name = name;
|
|
7
|
+
}
|
|
8
|
+
toString() {
|
|
9
|
+
return this.name ? `${this.class}/${this.name}` : this.class;
|
|
10
|
+
}
|
|
11
|
+
static fromString(toolString) {
|
|
12
|
+
const [toolClass, name] = toolString.split("/");
|
|
13
|
+
return new TupleTool(toolClass, name || "");
|
|
14
|
+
}
|
|
15
|
+
equals(other) {
|
|
16
|
+
return this.toString() === other.toString();
|
|
17
|
+
}
|
|
18
|
+
}
|