Belle II Software development
EvtGenUtilities.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9/* Own header. */
10#include <generators/evtgen/EvtGenUtilities.h>
11
12/* Basf2 headers. */
13#include <framework/logging/Logger.h>
14#include <framework/utilities/FileSystem.h>
15
16bool Belle2::generators::checkEvtGenDecayFile(
17 const std::string& decayFile)
18{
19 const std::string defaultDecFile =
20 FileSystem::findFile("decfiles/dec/DECAY_BELLE2.DEC", true);
21 if (decayFile.empty()) {
22 B2ERROR("No global decay file defined, please make sure "
23 "the decay-file parameter is set correctly.");
24 return false;
25 }
26 if (defaultDecFile.empty()) {
27 B2WARNING("Cannot find default decay file.");
28 } else if (defaultDecFile != decayFile) {
29 B2INFO("Using non-standard decay file \"" << decayFile << "\".");
30 }
31 return true;
32}