Skip to content
Snippets Groups Projects

Improvements for QA function of CbmSeedFinderSlidingWindow

Closed Dominik Smith requested to merge d.smith/cbmroot:ImproveSeedFinderQa into master

-The QA functionality of CbmSeedFinderSlidingWindow is now encapsulated in a separate class CbmSeedFinderQa.

-Histograms and a summary canvas were added to this class for visualization.

-The time offset between triggers and MC event times are now computed and stored in a histogram.

Contains all commits from !690 (merged)

Update:

-A constant offset which is applied to all trigger times can now be set.

@v.friese

Edited by Dominik Smith

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • @d.smith,

    could you pleae try if std::size_t instead of size_t solves the compiler errors on Debian8

    In file included from /tmp/custom-executor722683254/builds/d.smith/cbmroot/reco/eventbuilder/digis/CbmSeedFinderSlidingWindow.cxx:5:0:
    /tmp/custom-executor722683254/builds/d.smith/cbmroot/reco/eventbuilder/digis/CbmSeedFinderSlidingWindow.h:65:3: error: ‘size_t’ does not name a type
       size_t GetNofSeeds() { return fvSeedTimes->size(); }
       ^
  • Dominik Smith added 1 commit

    added 1 commit

    • c9d2a461 - CbmSeedFinderQa: Added histogram for difference between trigger time and MC event time.

    Compare with previous version

  • Dominik Smith added 8 commits

    added 8 commits

    • c9d2a461...4daece7d - 4 commits from branch computing:master
    • b8f9f690 - Modified CbmBuildEventsQa and QA function in CbmSeedFinderSlidingWindow to...
    • 0e7a9a54 - Moved QA functionality from CbmSeedFinderSlidingWindow to new class CbmSeedFinderQa.
    • 88423f16 - CbmSeedFinderQa: Added histograms and canvas to output.
    • d806287b - CbmSeedFinderQa: Added histogram for difference between trigger time and MC event time.

    Compare with previous version

  • Dominik Smith added 1 commit

    added 1 commit

    • 2a560fdf - CbmSeedFinderQa: Added histogram for difference between trigger time and MC event time.

    Compare with previous version

  • assigned to @v.friese

  • Dear @d.smith,

    you have been identified as code owner of at least one file which was changed with this merge request.

    Please check the changes and approve them or request changes.

  • Dominik Smith added 7 commits

    added 7 commits

    • 2a560fdf...618e6fc6 - 2 commits from branch computing:master
    • 4c17c459 - Modified CbmBuildEventsQa and QA function in CbmSeedFinderSlidingWindow to...
    • 398607cc - Moved QA functionality from CbmSeedFinderSlidingWindow to new class CbmSeedFinderQa.
    • b0ad2b7d - CbmSeedFinderQa: Added histograms and canvas to output.
    • 031e3501 - CbmSeedFinderQa: Added histogram for difference between trigger time and MC event time.
    • 6fb1c787 - CbmSeedFinderQa: Completed implementation of time offset measurement.

    Compare with previous version

    • Author Maintainer

      @se.gorbunov @p.-a.loizeau @v.friese @f.uhlig

      Ok the solution to to my problem was a super weird feature of Root or FairRoot:

      Apparently it is necessary to fetch the pointer to the CbmMCEventList from the FairRootManager, i.e. call

      CbmMCEventList* eventList = FairRootManager::Instance()->GetObject("MCEventList.");

      during during the "Init()" step of the FairTask execution, and no later. If one fetches it during "Exec()" it doesn't point to the right data. Or rather, it is necessary to fetch this pointer at least once during Init(). It doesn't actually matter if one fetches it again at a later point, and then uses the second instance.

      The suggestion to look into CbmTrackerInputQaTrd.cxx was crucial to understand this. What was weird is that the event fetching in my class (CbmSeedFinderQa) worked properly, just as long as CbmTrackerInputQaTrd was also added to FairRunAna.

      Why? Because CbmTrackerInputQaTrd fetches the event list once during Init(), and hence triggers whatever initialization the FairRootManager is silently carrying out in the background. My class can then fetch it again at will.

      My initial suspicion that the CbmMCDataManager plays a role was wrong, or at least only tangentially related. What happens is that CbmTrackerInputQaTrd only does the event list fetching if it finds the CbmMCDataManager. So removing the later also triggered the bug in my class.

      I wonder whether this behavior is really desirable, but that is a separate topic. Ready to merge in my opinion. Removing the WIP flag.

    • But this is the normal procedure to get a branch from the ROOT tree. Only in this case, the branch is not a TClonesArray or vector, but a single object (CbmMEventList). Nevertheless, it is different for each tree entry, and the object in memory addressed by the pointer is updated on each call to TTree::Read(). That's the basic working principle, so I do not see what should be weird here.

      CbmMCEventList comprises all MC events which have contributed through digis to a given time slice.

    • Author Maintainer

      Yes. But one would naively expect that one could call

      FairRootManager::Instance()->GetObject();

      at any point during execution to obtain data related to the current tree entry.

      This function returns a pointer, and if this pointer is called during Init(), then it remains immutable during the entire runtime of the program (that is, the address remains the same, not the data). I can call the function again at a later time and get the same address, only different data will be found at that address.

      Now what happens if I fail to call GetObject() during Init(), but decide to call it at some later stage in the execution, after some tree entries have already been read? I also get a valid pointer, only it doesn't seem to point to the data of the current branch.

      What is counter intuitive, is that GetObject() seems to display persistent behavior as long as it is called once during Init(). But if one calls it for the first time at a later stage, either the address is different, or there isn't any data at the address (I haven't checked which of these two options is actually the case).

    • FairRootManager interfaces to the ROOT TTree in Init(). What a call to GetObject() does later (in Exec()) I really cannot tell. Maybe @f.uhlig knows more.

    • Author Maintainer

      The problem was triggered in my case by attempting to avoid the use of a global (i.e. class-wide) variable to store the MC event list. I figured that I can equivalently call GetObject() once during each call of Exec() and use a local variable to store the pointer.

      It is anyway an academic question at this point. The problem has been solved for the purpose of this MR.

    • Author Maintainer

      @v.friese It just occured to me that it would be simple to include the constant time-offset shift for the triggers in this MR. I will add another commit shortly. It is only minor changes. In principle now everything is in place for the tuning of this offset.

    • Author Maintainer

      Done.

    • Author Maintainer

      I just tested the time-offset functionality. The basic idea is to call the seed finder QA once, look at the histogram of offsets, then take the mean value and subtract it globally for the next run.

      Edited by Dominik Smith
    • Author Maintainer

      Sorry, I pushed another commit which added some diagnostic output requested by S. Roy.

    • Author Maintainer

      @v.friese After the discussions in the event builder meeting, I would like to also add a fix for the digi weight issue to this MR. The changes will be minor.

    • Author Maintainer

      @v.friese Also, one thing I forgot to mention during the event builder meeting: Right now we choose the mean value of the window boundaries as the trigger time, in the trigger algorithm. A possible alternative would be to take the mean value of all digis in the window. This would be slightly slower, but perhaps a better choice. What do you think?

    • Author Maintainer

      @v.friese Event matching has been changed, such that all digi-to-MC event links are assigned the same weight. I will inform S. Roy.

    • Please register or sign in to reply
  • Dominik Smith marked this merge request as ready

    marked this merge request as ready

  • Dominik Smith added 1 commit

    added 1 commit

    • 71eed734 - CbmSeedFinderQa: Completed implementation of time offset measurement.

    Compare with previous version

  • Dominik Smith resolved all threads

    resolved all threads

  • Dominik Smith added 8 commits

    added 8 commits

    • 71eed734...28c69b23 - 2 commits from branch computing:master
    • fae27250 - Modified CbmBuildEventsQa and QA function in CbmSeedFinderSlidingWindow to...
    • 3ab0a424 - Moved QA functionality from CbmSeedFinderSlidingWindow to new class CbmSeedFinderQa.
    • 5c004c00 - CbmSeedFinderQa: Added histograms and canvas to output.
    • 6b97bd06 - CbmSeedFinderQa: Added histogram for difference between trigger time and MC event time.
    • 2e4f2c7a - CbmSeedFinderQa: Completed implementation of time offset measurement.
    • 2bd3b896 - CbmSeedFinderSlidingWindow: Applying a constant offset to all trigger times is now supported.

    Compare with previous version

  • Dominik Smith changed the description

    changed the description

  • Dominik Smith added 1 commit

    added 1 commit

    • c213f01a - CbmTaskBuildRawEvents: Total number of trigger times per file is now reported when applicable.

    Compare with previous version

  • Dominik Smith added 13 commits

    added 13 commits

    • c213f01a...65681a81 - 5 commits from branch computing:master
    • d417b8cd - Modified CbmBuildEventsQa and QA function in CbmSeedFinderSlidingWindow to...
    • 094f04aa - Moved QA functionality from CbmSeedFinderSlidingWindow to new class CbmSeedFinderQa.
    • 14133a99 - CbmSeedFinderQa: Added histograms and canvas to output.
    • 79262b83 - CbmSeedFinderQa: Added histogram for difference between trigger time and MC event time.
    • bbb69869 - CbmSeedFinderQa: Completed implementation of time offset measurement.
    • 1b92ef0c - CbmSeedFinderSlidingWindow: Applying a constant offset to all trigger times is now supported.
    • b6be601d - CbmTaskBuildRawEvents: Total number of trigger times per file is now reported when applicable.
    • d69a5bfd - CbmSeedFinderQa and CbmBuildEventsQa: All links are now assigned the same...

    Compare with previous version

  • David Emschermann added 15 commits

    added 15 commits

    • d69a5bfd...01e5e5ae - 7 commits from branch computing:master
    • 94341040 - Modified CbmBuildEventsQa and QA function in CbmSeedFinderSlidingWindow to...
    • 0f5d2561 - Moved QA functionality from CbmSeedFinderSlidingWindow to new class CbmSeedFinderQa.
    • 009c1cd3 - CbmSeedFinderQa: Added histograms and canvas to output.
    • 8ad6c8e2 - CbmSeedFinderQa: Added histogram for difference between trigger time and MC event time.
    • c0556130 - CbmSeedFinderQa: Completed implementation of time offset measurement.
    • d903764b - CbmSeedFinderSlidingWindow: Applying a constant offset to all trigger times is now supported.
    • 2d4513cd - CbmTaskBuildRawEvents: Total number of trigger times per file is now reported when applicable.
    • 22bdda02 - CbmSeedFinderQa and CbmBuildEventsQa: All links are now assigned the same...

    Compare with previous version

  • @d.smith,

    please rebase locally and push again.

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading