Ticket #11319 (new)

Opened 6 years ago

Last modified 5 years ago

Speed up asymmetry calculation

Reported by: Raquel Alvarez Banos Owned by: Raquel Alvarez Banos
Priority: major Milestone: Backlog
Component: Muon Keywords:
Cc: Blocked By: #9215
Blocking: Tester:

Description (last modified by Raquel Alvarez Banos) (diff)

PlotAsymmetryByLogValue loads a set of muon runs and computes the asymmetry as a function of some log value. Currently, the data loading and the asymmetry calculation are performed within the same loop. These tasks should be carried out separately so that users can play with asymmetry parameters (for instance integration limits) without having to load all the datasets every time.

Change History

comment:1 Changed 6 years ago by Raquel Alvarez Banos

  • Description modified (diff)

The main loop currently reads:

  for (size_t i = is; i <= ie; i++) {

    // Load run, apply dead time corrections and detector grouping
    Workspace_sptr loadedWs = doLoad(i);

    // Analyse loadedWs
    doAnalysis (loadedWs, i-is);

    progress.report();
  }

We could add an if statment to check whether the loadedWs were already loaded or not. It seems that the best option is to add the temporary workspaces to the ADS, and end up with something like this:

  for (size_t i = is; i <= ie; i++) {

    if ( loadedWs is not in ADS ) {

      Workspace_sptr loadedWs = doLoad(i);
      Add_loadedWs_to_ADS;
    
    } else {

      loadedWs = ADS.retrieve( loadedWs_name );
    }

    // Analyse loadedWs
    doAnalysis (loadedWs, i-is);

    progress.report();
  }

Two boolean flags should be added to:

  • Hide/show the temporary workspaces
  • Keep/remove loaded workspaces

comment:2 Changed 6 years ago by Raquel Alvarez Banos

  • Description modified (diff)

comment:3 Changed 5 years ago by Raquel Alvarez Banos

  • Blocking 6931 removed

(In #6931) I have attached a script I have been using to test the changes, which the tester may find useful. It includes descriptions (comments) of what I would expect in each successive execution of the algorithm.

comment:4 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 12158

Note: See TracTickets for help on using tickets.