matrixSaver

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
/** \class matrixSaver

    \brief save (read) CLHEP::HepMatrix to (from) text files 

*/

#ifndef __CINT__
#ifndef matrixSaver_h
#define matrixSaver_h

//#include <memory>
#include <vector>

#include <string>
#include <fstream>
#include <iostream>

#include "CLHEP/Matrix/GenMatrix.h"
#include "CLHEP/Matrix/Matrix.h"
#include "CLHEP/Matrix/Vector.h"

class matrixSaver {
public:
  matrixSaver();
  ~matrixSaver();

  int saveMatrix(std::string outputFileName, const CLHEP::HepGenMatrix* saveMe);

  int saveMatrixVector(std::string outputFileName, const std::vector<CLHEP::HepGenMatrix*>& saveMe);

  bool touch(std::string inputFileName);

  CLHEP::HepGenMatrix* getMatrix(std::string inputFileName);

  std::vector<CLHEP::HepGenMatrix*>* getMatrixVector(std::string inputFileName);

  std::vector<CLHEP::HepMatrix> getConcreteMatrixVector(std::string inputFileName);

private:
};

std::istream& operator>>(std::istream& input, CLHEP::HepGenMatrix& matrix);

std::ostream& operator<<(std::ostream& outputFile, const CLHEP::HepGenMatrix& saveMe);

#endif
#endif