Draft: DevelopmentTagger enum and string conversion
Adds enum for the old DevelopmentTagger that is reenabled for future FT WG Run2 Tuple Production.
Note: TaggerTypeToString and TaggerTypeToType are only called in BTaggingTool.cpp in Phys in few places, therefore impact is small.
Modernization was needed because previous static map implementation behaved strangely with lb-checkout LHCb/branch_with_changes Event
: Newly implemented tagger types in the string-type mapping were unavailable in Phys/FlavourTagging
and only the old ones were found. At the same time, all other methods implemented in Tagger.h behaved as expected. This implementation ties the static map to the Tagger class, which seems to solve this issue.
Merge request reports
Activity
added Flavour tagging legacy lhcb-run2-patches labels
added 1 commit
- a1c2712c - Modernized Tagger.h, hopefully fixed lb-dev linking
added modernisation label
- [2025-03-22 01:04] Validation started with lhcb-run2-patches#1687
- [2025-03-22 01:10] Validation started with lhcb-run2-patches#1687
- [2025-03-22 01:16] Validation started with lhcb-run2-patches#1687
- [2025-03-22 17:11] Validation started with lhcb-run2-patches#1687
- [2025-03-22 17:19] Validation started with lhcb-run2-patches#1687
- [2025-03-24 01:03] Validation started with lhcb-run2-patches#1688
- [2025-03-25 01:04] Validation started with lhcb-run2-patches#1689
Edited by Software for LHCb- Resolved by Vukan Jevtic
117 120 static LHCb::Tagger::TaggerType TaggerTypeToType( const std::string& aName ); 118 121 119 122 /// conversion to string for enum type TaggerType 120 static const std::string& TaggerTypeToString( int aEnum ); 123 static const std::string& TaggerTypeToString( Tagger::TaggerType aEnum ); The fact that the argument is a
TaggerType
makes the name somewhat redundant. Better to just call itand be consistent with lots of other enums.
I fully agree with the reasoning, but if I did this, this would require changing all single tagger definitions and be inconsistent with the code on master which uses the verbose naming style. Would you still like me to apply this change with a follow-up MR to master? (Also I would suggest to replace the growing switch statement on master with my implementation to keep things simpler.)
- Resolved by Vukan Jevtic
- Resolved by Vukan Jevtic
- Resolved by Vukan Jevtic
- Resolved by Vukan Jevtic
Modernization was needed because previous static map implementation behaved strangely with
lb-checkout LHCb/branch_with_changes Event
: Newly implemented tagger types in the string-type mapping were unavailable inPhys/FlavourTagging
and only the old ones were found. At the same time, all other methods implemented in Tagger.h behaved as expected. This implementation ties the static map to the Tagger class, which seems to solve this issue.The above is not a surprise: when changing something in a public header in eg. LHCb, all code which includes that header has to be (re)compiled consistently, as any code that is not compiled with this version of the header will have been compiled with the old version of the header. And since the string-type mapping was in the header, there must have been code that should have been recompiled, but wasn't. This is the what makes
lb-dev
a double-edged knife: it uses less space / time because it compiles much less code, but sometimes, it doesn't compile enough code.