Newer
Older
#ifndef MYDEBUGTOOLS_H
#define MYDEBUGTOOLS_H
#include <map>
#include <iostream>
#include <iomanip>
#include <TMatrixD.h>
#include <assert.h>
#include <sstream>
#include <TMath.h>
#include <TVector3.h>
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using namespace std;
ofstream file("debug.txt");
void outputMatrix(TMatrixDSym matrix, std::string caption = "")
{
if (caption != "") file << caption << endl;
for (int i=0; i<matrix.GetNrows(); i++)
{
for (int j=0; j<matrix.GetNcols(); j++)
{
file << setw(12) << matrix[i][j] << " ";
}
file << endl;
}
}
void outputMatrix(TMatrixD matrix, std::string caption = "")
{
if (caption != "") file << caption << endl;
for (int i=0; i<matrix.GetNrows(); i++)
{
for (int j=0; j<matrix.GetNcols(); j++)
{
file << setw(12) << matrix[i][j] << " ";
}
file << endl;
}
}
void outputVector(TVectorD vector, std::string caption)
{
if (caption != "") file << caption << endl;
for (int i=0; i<vector.GetNoElements(); i++)
{
file << setw(12) << vector[i] << " ";
}
file << endl;
}
void outputVector(TVector3 vector, std::string caption)
{
if (caption != "") file << caption << endl;
for (int i=0; i<3; i++)
{
file << setw(12) << vector[i] << " ";
}
file << endl;
}