Skip to content
Snippets Groups Projects

RawbankView for createODIN

Merged Sevda Esen requested to merge sevda-rawevent into master

Use RawBank::View as input to createODIN and MuonRawToCoord instead of RawEvent, and adapt PyConf accordingly

Idea is "to not pass RawEvent around (as a RawEvent is about 'ownership' of RawBanks which most 'consumers' of RawBanks do not care about), but to 'hide' the use of RawEvent and instead pass around RawBank::View. Such a 'view' would contain a range of RawBanks (but not 'own' them) and consumers would just ask for a RawBank::View"

Based upon of MR !2972 (closed) by Gerhard (can be closed once this is merged).

Merge with Moore!844 (merged) Rec!2527 (merged) MooreAnalysis!47 (merged) Allen!637 (merged) Brunel!1164 (merged)

also see #5

Edited by Gerhard Raven

Merge request reports

Pipeline #2977241 passed

Pipeline passed for dd90664d on sevda-rawevent

Merged by Christoph HasseChristoph Hasse 3 years ago (Sep 2, 2021 8:52am UTC)

Loading

Pipeline #2980113 passed

Pipeline passed for aa3ab50c on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Sevda Esen added 18 commits

    added 18 commits

    Compare with previous version

  • Sevda Esen added 1 commit
  • Sevda Esen resolved all threads

    resolved all threads

  • Sevda Esen added 19 commits

    added 19 commits

    Compare with previous version

  • Sevda Esen added 1 commit

    added 1 commit

    • ec6f7a8c - fix for RawBankType in UnpackRawEvent

    Compare with previous version

  • Sevda Esen added 1 commit

    added 1 commit

    • af5f8933 - modified gaudi property for raw bank type name

    Compare with previous version

  • Sevda Esen added 1 commit

    added 1 commit

    Compare with previous version

  • Sevda Esen added 7 commits

    added 7 commits

    Compare with previous version

  • Sevda Esen added 1 commit

    added 1 commit

    • d476de3c - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Sevda Esen resolved all threads

    resolved all threads

  • Sevda Esen resolved all threads

    resolved all threads

  • Sevda Esen added 1 commit

    added 1 commit

    Compare with previous version

  • Sevda Esen mentioned in merge request Moore!844 (merged)

    mentioned in merge request Moore!844 (merged)

  • Sevda Esen changed the description

    changed the description

  • Here is an alternative solution which also works:

    diff --git a/DAQ/DAQUtils/src/UnpackRawEvent.cpp b/DAQ/DAQUtils/src/UnpackRawEvent.cpp
    index aab74ae174..8cbbe5bd36 100644
    --- a/DAQ/DAQUtils/src/UnpackRawEvent.cpp
    +++ b/DAQ/DAQUtils/src/UnpackRawEvent.cpp
    @@ -11,26 +11,38 @@
     #include "Event/RawBank.h"
     #include "Event/RawEvent.h"
     #include "GaudiKernel/ParsersFactory.h"
    +#include "GaudiKernel/GaudiException.h"
     #include <algorithm>
     #include <vector>
     
    -namespace Gaudi {
    -  namespace Parsers {
    +namespace Gaudi::Parsers {
     
    -    template <typename Iterator, typename Skipper>
    -    struct RawBankTypeGrammar : qi::grammar<Iterator, LHCb::RawBank::BankType(), Skipper> {
    -      typedef LHCb::RawBank::BankType ResultT;
    -      RawBankTypeGrammar() : RawBankTypeGrammar::base_type( literal ) {
    -        for ( auto i : LHCb::RawBank::types() ) {
    -          literal |= ( qi::lit( LHCb::RawBank::typeName( i ) ) )[qi::_val = i];
    -        }
    -      }
    -      qi::rule<Iterator, ResultT(), Skipper> literal;
    -    };
    -    REGISTER_GRAMMAR( LHCb::RawBank::BankType, RawBankTypeGrammar );
    +  StatusCode parse( LHCb::RawBank::BankType& bt, const std::string& in ) {
    +    constexpr auto tps = LHCb::RawBank::types();
    +    auto i = std::find_if (tps.begin(), tps.end(), [&](auto tp) {
    +        return in == LHCb::RawBank::typeName( tp );
    +    });
    +    if ( i == tps.end() ) return StatusCode::FAILURE;
    +    bt = *i;
    +    return StatusCode::SUCCESS;
    +  }
     
    -  } // namespace Parsers
    -} // namespace Gaudi
    +  StatusCode parse( std::vector<LHCb::RawBank::BankType>& v, const std::string& in ) {
    +    v.clear();
    +    std::vector<std::string> vs;
    +    return parse( vs, in ).andThen( [&]()->StatusCode{
    +      v.reserve( vs.size() );
    +      try {
    +        std::transform( vs.begin(), vs.end(), std::back_inserter( v ), []( const std::string& s ) {
    +          LHCb::RawBank::BankType t{};
    +          parse( t, s ).orThrow( "Bad Parse", "" );
    +          return t;
    +        } );
    +        return StatusCode::SUCCESS;
    +      } catch ( const GaudiException& ge ) { return ge.code(); }
    +    } );
    +  }
    +}
     
     #include "GaudiAlg/SplittingTransformer.h"
     
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading