Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • rrabadan/LHCb
  • talin/LHCb
  • imjelde/LHCb
  • mstahl/LHCb
  • padeken/LHCb
  • mimazure/LHCb
  • roiser/LHCb
  • conrad/LHCb
  • kklimasz/LHCb
  • rcurrie/LHCb
  • wkrzemie/LHCb
  • fkeizer/LHCb
  • valassi/LHCb
  • hschrein/LHCb
  • anstahll/LHCb
  • jonrob/LHCb
  • graven/LHCb
  • clemenci/LHCb
  • chaen/LHCb
  • sstahl/LHCb
  • lhcb/LHCb
21 results
Show changes
Commits on Source (3)
......@@ -186,6 +186,13 @@ namespace LHCb {
10000 // The last official flag value. Private user variables should use flags greater than this value
};
// functions necessary for AdditionalInfo to work with Gaudi::Property
friend std::string toString( additionalInfo e );
friend std::ostream& toStream( additionalInfo e, std::ostream& os ) {
return os << std::quoted( toString( e ), '\'' );
}
friend StatusCode parse( additionalInfo& bt, std::string in );
/// Copy constructor. Creates a new ProtoParticle with the same physics information
ProtoParticle( const LHCb::ProtoParticle& proto )
: KeyedObject<int>()
......
......@@ -20,6 +20,25 @@
//-----------------------------------------------------------------------------
namespace LHCb {
std::string toString( ProtoParticle::additionalInfo e ) {
const auto& table = ProtoParticle::s_additionalInfoTypMap();
auto i = std::find_if( table.begin(), table.end(), [&]( const auto& entry ) { return entry.second == e; } );
if ( i == table.end() ) throw std::invalid_argument{"invalid value for ProtoParticle::addtionalInfo"};
return i->first;
}
StatusCode parse( ProtoParticle::additionalInfo& ai, std::string in ) {
if ( in.size() > 1 && in.front() == in.back() && ( in.front() == '\'' || in.front() == '\"' ) ) {
in = in.substr( 1, in.size() - 2 );
}
const auto& table = ProtoParticle::s_additionalInfoTypMap();
auto iter = table.find( in );
if ( iter == table.end() ) return StatusCode::FAILURE;
ai = iter->second;
return StatusCode::SUCCESS;
}
} // namespace LHCb
// Fillstream method
std::ostream& LHCb::ProtoParticle::fillStream( std::ostream& s ) const {
s << "{"
......