Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
genE.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file genE.cc
1 #include <iostream>
2 #include <fstream>
3 #include <string>
4 #include <TMath.h>
5 #include "FieldMaps.h"
6 #include "FieldMapsLaplace.h"
7 
8 int main(int nvar, char ** cvar) {
9  std::string kFileNameRoot="rho";
10  float kInnerRadius = 30; //cm
11  float kOutterRadius = 80; //cm
12  float kHalfLength = 80; //cm
13  int kNRadialSteps = 50;
14  int kNAzimuthalSteps = 1;
15  int kNLongitudinalSteps = 160;
16 
17  std::cout << "fetching geo.dat..." << std::endl;
18  std::ifstream ifile("geo.dat");
19  ifile >> kFileNameRoot;
20  ifile >> kInnerRadius; //cm
21  ifile >> kOutterRadius; //cm
22  ifile >> kHalfLength; //cm
23  ifile >> kNRadialSteps;
24  ifile >> kNAzimuthalSteps;
25  ifile >> kNLongitudinalSteps;
26  ifile.close();
27 
28  int binR = -1;
29  TString par;
30  if(nvar>1) {
31  par = cvar[1];
32  binR = par.Atoi();
33  if(TMath::IsNaN(binR)) binR = -1;
34  }
35  std::cout << "routine for binR = " << binR << std::endl;
36 
37  FieldMaps *map;
38  map = new FieldMapsLaplace();
39  map->SetDebugLevel(1);
40  map->OutputFileName(kFileNameRoot);
41  map->TPCDimensions( kInnerRadius, kOutterRadius, kHalfLength );
42  map->TPCGridSize( kNRadialSteps, kNAzimuthalSteps, kNLongitudinalSteps );
43  map->MirrorZ();
44  map->Make( binR );
45 
46  delete map;
47  return 0;
48 }