RawbankView for createODIN
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
Merge request reports
Activity
added 4 commits
-
107596cd...aa73ae9c - 2 commits from branch
master
- 2e20904c - Merge remote-tracking branch 'origin/master' into sevda-rawevent
- aee14d6b - update odin decoder
-
107596cd...aa73ae9c - 2 commits from branch
- Resolved by Sevda Esen
added 18 commits
-
aee14d6b...048ae28b - 17 commits from branch
master
- 7052dbc3 - Merge branch 'master' into sevda-rawevent
-
aee14d6b...048ae28b - 17 commits from branch
added 19 commits
-
6bfd5f9e...1c996bbd - 18 commits from branch
master
- cd02a9be - Merge branch 'master' into sevda-rawevent
-
6bfd5f9e...1c996bbd - 18 commits from branch
- Resolved by Sevda Esen
added 1 commit
- af5f8933 - modified gaudi property for raw bank type name
added 7 commits
-
373b0bbd...bbcc16b1 - 6 commits from branch
master
- ac6c0d74 - Merge branch 'master' into 'sevda-rawevent'
-
373b0bbd...bbcc16b1 - 6 commits from branch
- Resolved by Sevda Esen
- Resolved by Sevda Esen
mentioned in merge request Moore!844 (merged)
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"