Skip to content
Snippets Groups Projects
SetupParser.hh 1.14 KiB
Newer Older
Matthias Steinke's avatar
Matthias Steinke committed
#pragma once
#include <vector>
Matthias Steinke's avatar
Matthias Steinke committed
#include <string>

#include <boost/config.hpp> // put this first to suppress some VC++ warnings
#include <boost/variant/recursive_variant.hpp>

class ParticleTable;
Matthias Steinke's avatar
Matthias Steinke committed

namespace decayGraph {
  struct EdgeList;
}
Matthias Steinke's avatar
Matthias Steinke committed
namespace setupGrammar {

  struct decay_tree;

  typedef
  boost::variant<
    boost::recursive_wrapper<decay_tree>
    , std::string
    >
  decay_node;

Matthias Steinke's avatar
Matthias Steinke committed
  struct decay_tree {
    std::string name;                        // mother particle name
    std::vector<decay_node> children;        // children
    std::vector<std::string> addParticle;
    std::vector<std::string> cloneParticle;
    std::vector<std::string> modParticle;
    std::vector<std::string> beamInput;
    std::vector<std::string> mcInput;
    std::vector<std::string> defineTuple;
    std::vector<std::string> fitVars;
    std::vector<std::string> initialProps;
  };

}
Matthias Steinke's avatar
Matthias Steinke committed

class SetupParser
{
public:

  SetupParser();
  ~SetupParser();

  bool parse(std::string& fileName, ParticleTable* pdtTable = 0);
  const setupGrammar::decay_tree* setup() const;
  const decayGraph::EdgeList* edgeList() const;

private:
  
  setupGrammar::decay_tree* thisDecay;
Matthias Steinke's avatar
Matthias Steinke committed
};