delphi-edm4hep
DELPHI SDST/FDST -> EDM4hep converter
Loading...
Searching...
No Matches
BankPrefix.h
Go to the documentation of this file.
1// SPDX-License-Identifier: same-as-repo
2// BankPrefix.h
3//
4// Collection names follow <prefix>_<BANK>_<ReadableName>.
5//
6// The prefix names the kind of DELPHI input file that supplies the bank, so a
7// collection name states what a reader needs in order to have the data:
8//
9// sDST kept by every DST flavour
10// xsDST kept by the extended shortDST and the longDST, but not by a plain
11// shortDST
12// lDST kept by the longDST only
13// fDST written by the fullDST pass
14//
15// Which PA modules a file carries is fixed by the production description deck
16// it was written with (shortdst.des, longdst.des, DESCRIP), not by the year or
17// the reprocessing tag. Collections are emitted whether or not the input
18// carries the module, and are empty when it does not; the prefix says which
19// inputs can fill them.
20//
21// This header is the single source of truth for the prefix and for what a
22// bank mnemonic means in a collection name.
23//
24// No state, no Fortran linkage.
25
26#pragma once
27
28#include <string>
29#include <string_view>
30
32
33// Which conversion pass is writing. The fullDST pass reads a different input
34// file, so everything it writes carries the fDST prefix regardless of bank.
35enum class Pass { Sdst, Fdst };
36
37// Prefix for `bank` when written by `pass`.
38std::string_view prefixFor(Pass pass, std::string_view bank);
39
40// Build "<prefix>_<bank>_<readable_name>". One allocation; called at
41// frame.put time only.
42std::string make(Pass pass, std::string_view bank, std::string_view readable_name);
43
44} // namespace delphi_edm4hep::bank
std::string_view prefixFor(Pass pass, std::string_view bank)
std::string make(Pass pass, std::string_view bank, std::string_view readable_name)