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,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
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface TupleTreeGraphData {
|
|
2
|
+
nodes: TupleTreeNode[];
|
|
3
|
+
edges: TupleTreeEdge[];
|
|
4
|
+
}
|
|
5
|
+
interface TupleTreeEdge {
|
|
6
|
+
from: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
to: string;
|
|
9
|
+
}
|
|
10
|
+
interface TupleTreeNode {
|
|
11
|
+
id: string;
|
|
12
|
+
label: string;
|
|
13
|
+
title: HTMLSpanElement;
|
|
14
|
+
shape: string;
|
|
15
|
+
image: {
|
|
16
|
+
selected: string;
|
|
17
|
+
unselected: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Dtt from "./dtt";
|
|
2
|
+
import { RowData } from "./rowData";
|
|
3
|
+
import { MetadataContext } from "../providers/MetadataProvider";
|
|
4
|
+
export declare class YamlFile {
|
|
5
|
+
name: string;
|
|
6
|
+
content: string;
|
|
7
|
+
constructor(name: string, content: string);
|
|
8
|
+
static fromDtt(dtt: Dtt): YamlFile;
|
|
9
|
+
private static reformatTools;
|
|
10
|
+
static createInfoYaml(rows: RowData[], metadata: MetadataContext): YamlFile;
|
|
11
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import yaml from "js-yaml";
|
|
2
|
+
import { sanitizeFilename } from "../utils/utils";
|
|
3
|
+
export class YamlFile {
|
|
4
|
+
name;
|
|
5
|
+
content;
|
|
6
|
+
constructor(name, content) {
|
|
7
|
+
this.name = sanitizeFilename(name);
|
|
8
|
+
this.content = content;
|
|
9
|
+
}
|
|
10
|
+
static fromDtt(dtt) {
|
|
11
|
+
const yamlContent = {
|
|
12
|
+
...dtt.config,
|
|
13
|
+
tools: YamlFile.reformatTools(dtt.config.tools),
|
|
14
|
+
branches: Object.fromEntries(Object.entries(dtt.config.branches).map(([branchId, branchConfig]) => [
|
|
15
|
+
branchId,
|
|
16
|
+
{
|
|
17
|
+
...branchConfig,
|
|
18
|
+
tools: YamlFile.reformatTools(branchConfig.tools),
|
|
19
|
+
},
|
|
20
|
+
])),
|
|
21
|
+
groups: Object.fromEntries(Object.entries(dtt.config.groups).map(([groupId, groupConfig]) => [
|
|
22
|
+
groupId,
|
|
23
|
+
{
|
|
24
|
+
...groupConfig,
|
|
25
|
+
tools: YamlFile.reformatTools(groupConfig.tools),
|
|
26
|
+
},
|
|
27
|
+
])),
|
|
28
|
+
};
|
|
29
|
+
return new YamlFile(`${dtt.getName()}.yaml`, yaml.dump(yamlContent));
|
|
30
|
+
}
|
|
31
|
+
static reformatTools(tools) {
|
|
32
|
+
return Object.entries(tools).map(([toolName, toolConfig]) => ({
|
|
33
|
+
[toolName]: Object.fromEntries(Object.entries(toolConfig).map(([paramName, param]) => [paramName, param.value])),
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
static createInfoYaml(rows, metadata) {
|
|
37
|
+
const uniquePathSet = new Set(rows.flatMap((row) => row.paths));
|
|
38
|
+
const uniquePaths = [...uniquePathSet].sort();
|
|
39
|
+
const pathIndex = new Map(uniquePaths.map((p, i) => [p, i]));
|
|
40
|
+
const info = {
|
|
41
|
+
defaults: {
|
|
42
|
+
application: `DaVinci/${metadata.tupleTools.applicationInfo.DaVinci}`,
|
|
43
|
+
wg: "OpenData",
|
|
44
|
+
inform: [],
|
|
45
|
+
automatically_configure: true,
|
|
46
|
+
output: "DVNtuple.root",
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
for (const row of rows) {
|
|
50
|
+
if (!row.dtt)
|
|
51
|
+
continue;
|
|
52
|
+
for (const path of row.paths) {
|
|
53
|
+
const jobID = pathIndex.get(path);
|
|
54
|
+
if (jobID === undefined)
|
|
55
|
+
continue;
|
|
56
|
+
const key = `job${jobID}`;
|
|
57
|
+
const dttFile = row.dtt.getName();
|
|
58
|
+
if (key in info) {
|
|
59
|
+
info[key].options.push(dttFile);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const job = {
|
|
63
|
+
input: { bk_query: path },
|
|
64
|
+
options: [dttFile],
|
|
65
|
+
};
|
|
66
|
+
if (path.includes("MDST")) {
|
|
67
|
+
const stream = row.lines[0]?.stream;
|
|
68
|
+
if (stream) {
|
|
69
|
+
job.root_in_tes = `/Event/${stream}`;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
info[key] = job;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return new YamlFile("info.yaml", yaml.dump(info));
|
|
77
|
+
}
|
|
78
|
+
}
|