Skip to content

Commit

Permalink
show filters only on mc view
Browse files Browse the repository at this point in the history
  • Loading branch information
brauliorivas committed Jul 7, 2024
1 parent 4806d73 commit de191b1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
7 changes: 7 additions & 0 deletions js/filter/nofilter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export function setupNoFilter() {
const manipulationTools =
document.getElementsByClassName("manipulation-tool");
for (const tool of manipulationTools) {
tool.style.display = "none";
}
}
8 changes: 4 additions & 4 deletions js/menu/filter/reconnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ export function reconnect(criteriaFunction, loadedObjects) {

emptyCopyObject(loadedObjects, filteredObjects);

for (const [key, value] of Object.entries(loadedObjects.datatypes)) {
const filterFunction = objectTypes[key].filter;
const filterFunction = objectTypes["edm4hep::MCParticle"].filter;

filterFunction(value, filteredObjects.datatypes, criteriaFunction);
}
const mcParticles = loadedObjects.datatypes["edm4hep::MCParticle"];

filterFunction(mcParticles, filteredObjects.datatypes, criteriaFunction);

return filteredObjects;
}
15 changes: 8 additions & 7 deletions js/views/views-dictionary.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
recoClusterTrack,
preFilterRecoClusterTrack,
} from "./recoclustertrack.js";
import { setupNoFilter } from "../filter/nofilter.js";

export const views = {
"Monte Carlo Particle Tree": {
Expand All @@ -23,43 +24,43 @@ export const views = {
preFilterFunction: preFilterMCTree,
},
"Reconstructed Particle Tree": {
filters: () => {},
filters: setupNoFilter,
viewFunction: recoParticleTree,
scrollFunction: scrollTopLeft,
preFilterFunction: preFilterRecoTree,
},
"Track Tree": {
filters: () => {},
filters: setupNoFilter,
viewFunction: trackTree,
scrollFunction: scrollTopCenter,
preFilterFunction: preFilterTrackTree,
},
"Cluster Tree": {
filters: () => {},
filters: setupNoFilter,
viewFunction: clusterTree,
scrollFunction: scrollTopCenter,
preFilterFunction: preFilterClusterTree,
},
"Reco Particle-Cluster-Track": {
filters: () => {},
filters: setupNoFilter,
viewFunction: recoClusterTrack,
scrollFunction: scrollTopCenter,
preFilterFunction: preFilterRecoClusterTrack,
},
"Monte Carlo-Reconstructed Particle": {
filters: () => {},
filters: setupNoFilter,
viewFunction: mcRecoAssociation,
scrollFunction: scrollTopCenter,
preFilterFunction: preFilterMCReco,
},
"Monte Carlo Particle-Track": {
filters: () => {},
filters: setupNoFilter,
viewFunction: mcTrackAssociation,
scrollFunction: scrollTopCenter,
preFilterFunction: preFilterMCTrack,
},
"Monte Carlo Particle-Cluster": {
filters: () => {},
filters: setupNoFilter,
viewFunction: mcClusterAssociation,
scrollFunction: scrollTopCenter,
preFilterFunction: preFilterMCCluster,
Expand Down

0 comments on commit de191b1

Please sign in to comment.