Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ReadFieldMap.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ReadFieldMap.C
1 #ifndef MACRO_READFIELDMAP_C
2 #define MACRO_READFIELDMAP_C
3 
8 
9 #include <fieldmapreadback/FieldMapReadBack.h>
10 
11 R__LOAD_LIBRARY(libfieldmapreadbackread.so)
12 
13 // reads fieldmap from the DST. Needs only one event to force the opening
14 // and reading of the runwise information, running more just wastes your time
15 
16 FieldMapReadBack *ReadFieldMap(const int nEvents = 1, const std::string &filename="DST_TRKR_CLUSTER_sHijing_0_20fm_50kHz_bkg_0_20fm-0000000001-04001.root")
17 {
18  gSystem->Load("libg4dst.so");
20  se->Verbosity(); // set it to 1 if you want event printouts
21  FieldMapReadBack *fmap = new FieldMapReadBack();
22  se->registerSubsystem(fmap);
24  in->fileopen(filename);
25  se->registerInputManager(in);
26  if (nEvents < 0)
27  {
28  return;
29  }
30  se->run(nEvents);
31  return fmap;
32 }
33 
34 
35 #endif