Class Reference for E1039 Core & Analysis Software
Home page
Related Pages
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
convert.cxx
Go to the documentation of this file.
1
#include <iostream>
2
#include <fstream>
3
#include <sstream>
4
#include <string>
5
6
#include <TROOT.h>
7
#include <TFile.h>
8
#include <TTree.h>
9
10
using namespace
std;
11
12
int
main
(
int
argc,
char
* argv[])
13
{
14
ifstream fin(argv[1]);
15
string
line;
16
17
TFile saveFile(argv[2],
"recreate"
);
18
TTree* saveTree =
new
TTree(
"fieldmap"
,
"fieldmap"
);
19
20
float
x, y, z, bx, by, bz;
21
22
saveTree->Branch(
"x"
, &x,
"x/F"
);
23
saveTree->Branch(
"y"
, &y,
"y/F"
);
24
saveTree->Branch(
"z"
, &z,
"z/F"
);
25
saveTree->Branch(
"Bx"
, &bx,
"Bx/F"
);
26
saveTree->Branch(
"By"
, &by,
"By/F"
);
27
saveTree->Branch(
"Bz"
, &bz,
"Bz/F"
);
28
29
getline(fin, line);
//dummy read for the header
30
while
(getline(fin, line))
31
{
32
stringstream ss(line);
33
ss >> x >> y >> z >> bx >> by >> bz;
34
35
saveTree->Fill();
36
}
37
38
saveFile.cd();
39
saveTree->Write();
40
saveFile.Close();
41
42
return
0;
43
}
main
int main()
Definition:
eLut.cpp:86
e1039-core
packages
PHField
utils
convert.cxx
Built by
Haiwang Yu
. updated:
Wed May 26 2021 21:44:03
using
1.8.5 with
SeaQuest GitHub integration