SLHAea  0.1
containers for SUSY Les Houches Accord input/output
 All Classes Namespaces Files Functions Variables Typedefs
03_basic_manip.cpp

Since SLHAea::Coll, SLHAea::Block, and SLHAea::Line mimic STL containers, they can be used in algorithms like ordinary STL containers. This examples rotates all blocks until MINPAR is the first block, it reverses the order of all data lines in the SMINPUTS block, and comments the whole EXTPAR block:

#include <algorithm>
#include <fstream>
#include <iostream>
#include <slhaea.h>
using namespace std;
using namespace SLHAea;
int main()
{
ifstream ifs("slha1.txt");
Coll input(ifs);
rotate(input.begin(), input.find("MINPAR"), input.end());
reverse(input.at("SMINPUTS").begin()+1, input.at("SMINPUTS").end());
input.at("EXTPAR").comment();
cout << input;
}