14 #include <boost/algorithm/string.hpp>
33 namespace MD = MultiDimensional;
35 ProvidersRepo::ProvidersRepo(
const SchemeDefinitions* schemeDefs) : _schemeDefs{schemeDefs} {
60 elem.second->setSettingsHandler(sh);
62 for (
auto& elem :
_rates) {
63 elem.second->setSettingsHandler(sh);
66 for (
auto& elem2 : elem.second) {
67 elem2->setSettingsHandler(sh);
79 auto info = elem.second->getWCInfo();
82 _WCProviders.insert({info.first, {info.second, elem.second.get()}});
90 for(
auto& elem2: elem.second) {
91 auto info = elem2->getFFErrInfo();
102 const vector<PdgId>& granddaughters)
const {
107 return &(*it->second);
113 return &(*it->second);
121 auto it =
_rates.find(
id);
123 return &(*it->second);
129 return &(*it->second);
139 return &(it->second);
145 return &(it->second);
151 vector<FormFactorBase*> res{};
154 for (
auto& elem : it->second) {
155 res.push_back(&(*elem));
173 map<HashId, vector<string>> FFAssocs;
175 auto res = FFAssocs.insert({elem.first, vector<string>{}});
177 for (
auto& elem2 : elem.second) {
178 res.first->second.push_back(elem2->group());
189 if(settings !=
nullptr) {
194 for (
auto& elem :
_rates) {
198 auto itDups = formFactDups.find(elem.first);
199 size_t initsize = elem.second.size();
200 for(
size_t i=0; i < initsize; ++i) {
201 if (itDups != formFactDups.end()) {
202 auto itList = itDups->second.find(elem.second[i]->group());
203 if(itList != itDups->second.end()) {
204 for(
auto& token: itList->second) {
210 for(
auto& elem2 : elem.second){
225 for(
auto elem2: schemes) {
226 auto prefgroup = elem.second[elem2.second]->getFFErrPrefixGroup();
230 for(
auto& elem: _formFactors) {
231 for(
auto& elem2: elem.second) {
241 if(index < it->second.size()) {
242 FFIndex newpos = it->second.size();
243 it->second.push_back(unique_ptr<FormFactorBase>(it->second[index]->clone(newLabel)));
256 if(settings !=
nullptr) {
258 string prefix = elem.second->getWCInfo().first;
262 if(coeffs.size() > coeffsNum.size()) {
263 auto it1 = coeffs.begin();
264 auto it2 = coeffsNum.begin();
265 while (it1 != coeffs.end() && it2 != coeffsNum.end()) {
280 if(coeffs.size() > coeffsDen.size()) {
281 auto it1 = coeffs.begin();
282 auto it2 = coeffsDen.begin();
283 while (it1 != coeffs.end() && it2 != coeffsDen.end()) {
308 for(
auto& elem2: elem.second) {
309 if (elem2->getFFErrPrefixGroup() == value) {
326 map<IndexLabel, AmplitudeBase*> results;
328 results.insert(elem.second);
341 std::map<IndexLabel, SchemeDict<FormFactorBase*>>
343 map<IndexLabel, SchemeDict<FormFactorBase*>> results;
346 for(
auto& elem2: schemeNames) {
347 results[elem.second.first][elem2] = elem.second.second;
PDG codes to UID functions.
std::map< IndexLabel, AmplitudeBase * > getAllWCProviders() const
WCPrefixDict< std::pair< IndexLabel, AmplitudeBase * > > _WCProviders
Base class for amplitudes.
virtual SchemeDict< FFIndex > getFFSchemesForProcess(HadronicUID id) const
bool checkFFPrefixAndGroup(const FFPrefixGroup &value) const
std::vector< PdgId > combineDaughters(const std::vector< PdgId > &daughters, const std::vector< PdgId > &subDaughters)
combine list of codes of daughters and grandaughters (for processes which parameterise two subsequent...
std::map< IndexLabel, SchemeDict< FormFactorBase * > > getAllFFErrProviders() const
VertexIdDict< double > _partialWidths
Known partial widths.
FFIndex duplicateFormFactor(HadronicUID processId, FFIndex baseIndex, const std::string &newLabel)
Clones a FF parametrization.
Setting * cloneSetting(const std::string &path, const std::string &name, const Setting &value, WTerm group=WTerm::COMMON)
AmplitudeIdDict< std::unique_ptr< AmplitudeBase > > _amplitudes
Known amplitudes.
Setting * resetSetting(const std::string &path, const std::string &name, WTerm group=WTerm::COMMON)
HadronicIdDict< std::vector< std::string > > getFFGroups() const
FFPrefixGroupDict< std::set< std::string > > _schemeNamesFromPrefixGroup
Interface class for amplitudes, rates, FFs dictionary container.
const SchemeDefinitions * _schemeDefs
Message logging routines.
Hammer base amplitude class.
#define ADD_FORMFACTORS(CONT)
IndexLabel getWCLabel(const std::string &wcPrefix) const
virtual std::vector< FormFactorBase * > getFormFactor(HadronicUID processId) const
virtual AmplitudeBase * getAmplitude(PdgId parent, const std::vector< PdgId > &daughters, const std::vector< PdgId > &granddaughters={}) const
static Log & getLog(const std::string &name)
Get a logger with the given name.
std::vector< PdgId > flipSigns(const std::vector< PdgId > &list)
return the PDG codes of the conjugate particles (itself if self-conjugate) for all the PDG codes in a...
ValueType getOrDefault(const std::map< KeyType, ValueType > &data, KeyType key, ValueType fallback)
virtual ~ProvidersRepo() noexcept
virtual RateBase * getRate(PdgId parent, const std::vector< PdgId > &daughters, const std::vector< PdgId > &granddaughters={}) const
Obtains a rate class.
virtual void setSettingsHandler(SettingsHandler &sh)
set link to settings repository handler.
virtual void setSettingsHandler(SettingsHandler &sh)
set link to settings repository handler.
Setting * getEntry(const std::string &path, const std::string &name, WTerm group)
virtual const double * getPartialWidth(PdgId parent, const std::vector< PdgId > &daughters, const std::vector< PdgId > &granddaughters={}) const
Obtains a partial width.
PdgId flipSign(const PdgId &id)
return the PDG code of the conjugate particle (itself if self-conjugate)
IndexLabel getFFErrLabel(const FFPrefixGroup &process) const
Order-0 tensor data container.
IndexLabel
label identifiers of tensor indices they are used to determine which indices can be contracted togeth...
Hammer class for dealing with particle data.
void initPostSchemeDefs()
Hammer particle data class.
SettingsHandler * getSettingsHandler() const
provide the pointer to the repository handler
Container class for Scheme Definitions.
Hammer settings manager class.
HadronicIdDict< NewLabelsByGroup > getFFDuplicates() const
FormFactorBase * getFFErrProvider(const FFPrefixGroup &process) const
HadronicIdDict< std::vector< std::unique_ptr< FormFactorBase > > > _formFactors
Known formfactors.
HashId processID(PdgId parent, const std::vector< PdgId > &allDaughters)
compute a unique ID for a given process based on the PDG codes of the parent particle and the ordered...
AmplitudeBase * getWCProvider(const std::string &wcPrefix) const
#define ADD_AMPLITUDES(CONT)
virtual void defineSettings()
purely virtual function for a class to define new settings
VertexIdDict< std::unique_ptr< RateBase > > _rates
Known rates.
Hammer available modules header.
int getLevel() const
Get the priority level of this logger.
std::set< std::string > getSettings(const std::string &path="", WTerm group=WTerm::COMMON) const
access the list of registered settings
Serialization related typedefs and includes.
Hammer settings manager class.
const std::set< std::string > schemeNamesFromPrefixAndGroup(const FFPrefixGroup &value) const
std::map< HashId, double > getPartialWidths()
get partial Widths
FFPrefixGroupDict< std::pair< IndexLabel, FormFactorBase * > > _FFErrProviders
static void setLevel(const std::string &name, int level)
Set the log levels.