Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • L LHCb
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 193
    • Issues 193
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Jira
    • Jira
  • Merge requests 42
    • Merge requests 42
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • LHCbLHCb
  • LHCb
  • Merge requests
  • !2993

Draft: Introduced infrastructure to read ROOT files in algorithms

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Sebastien Ponce requested to merge sponce_IOAlg into master Apr 01, 2021
  • Overview 37
  • Commits 4
  • Pipelines 15
  • Changes 31

Depends on gaudi/Gaudi!1197 (merged)

Goes together with Rec!2735 and Moore!927

This allows to get rid of the ancient Gaudi way of reading input in favor of Producer algorithms and introduces multithreading reads for all ROOT files (digi and dst ones in particular)

The customizable way to achieve it is to declare an algorithm in few lines, inheriting from LHCb::IO::RootIOAlgBase and only specifying what you're reading and from which branches of the ROOT file. One can find a fully working example in the test rootioalg. For the impatient ones, the code to read a single item, namely here the RawEvent looks like this in C++ :

struct RootIOAlgRaw : LHCb::IO::RootIOAlgBase<LHCb::RawEvent> {
  RootIOAlgRaw( const std::string& name, ISvcLocator* pSvcLocator )
    : RootIOAlgBase( name, pSvcLocator,
                     { KeyValue{"RawEventLocation", ""} } ){};
};
DECLARE_COMPONENT( RootIOAlgRaw )

And its python counter part is :

ioalg = RootIOAlgRaw("RootIOAlgRaw",
                     RawEventLocation=raw_event_location,
                     EventBufferLocation=raw_event_location + "Banks",
                     Input=qualifiers.filenames,
                     EventBranchNames = ("_Event_DAQ_RawEvent.",),
                     BufferNbEvents=20,
                     NSkip=20)

Note the different properties present on top of the ones you define directly. The first 3 are mandatory :

  • EventBufferLocation is the location where the buffer of events in which the current event lives will be stored (or a shared_ptr to it actually)
  • Input is simply a vector<string> listing the input files to be used
  • EventBranchNames is an array of strings matching the list of template arguments in RootIOAlgBase and specifying where each item resides
  • BufferNbEvents gives the number of events per buffer that the framework should target. Actually a maximum. If not given, will default to 20000
  • NSkip gives the number of events to skip at the start of the input. Obviously defaulting to 0

For classical input files, 4 predefined algorithms have been declared for direct usage :

  • LHCb::IO::RootIOAlgRAW will read the RawEvent only, whatever the format is
  • LHCb::IO::RootIOAlgDIGI reading all content of .digi files
  • LHCb::IO::RootIOAlgXDIGI reading all content of .xdigi files
  • LHCb::IO::RootIOAlgLDST reading all content of .ldst files
Edited Feb 10, 2022 by Sebastien Ponce
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: sponce_IOAlg