-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprintData.cc
More file actions
36 lines (24 loc) · 786 Bytes
/
printData.cc
File metadata and controls
36 lines (24 loc) · 786 Bytes
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
void printData() {
gErrorIgnoreLevel = kError;
float x, y, z, r, phi;
float B, Bx, By, Bz;
TFile *f = new TFile( "ISS_Field_Map_total.root", "READ");
TTree *tree = (TTree*)f->Get("Bmap");
tree->SetBranchAddress( "x", &x );
tree->SetBranchAddress( "y", &y );
tree->SetBranchAddress( "z", &z );
tree->SetBranchAddress( "r", &r );
tree->SetBranchAddress( "phi", &phi );
tree->SetBranchAddress( "B", &B );
tree->SetBranchAddress( "Bx", &Bx );
tree->SetBranchAddress( "By", &By );
tree->SetBranchAddress( "Bz", &Bz );
cout << "z\tr\tphi\tBz\n";
int nentries = tree->GetEntries();
for( int i = 0; i < nentries; i++ ) {
tree->GetEntry(i);
if( z > -100. && z < 100. )
cout << z << "\t" << r << "\t" << phi << "\t" << Bz << endl;
}
return;
}