Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:21:36

0001 #ifndef MACRO_READFIELDMAP_C
0002 #define MACRO_READFIELDMAP_C
0003 
0004 #include <fun4all/Fun4AllInputManager.h>
0005 #include <fun4all/Fun4AllDstInputManager.h>
0006 #include <fun4all/Fun4AllDummyInputManager.h>
0007 #include <fun4all/Fun4AllServer.h>
0008 
0009 #include <fieldmapreadback/FieldMapReadBack.h>
0010 
0011 R__LOAD_LIBRARY(libfieldmapreadbackread.so)
0012 
0013 // reads fieldmap from the DST. Needs only one event to force the opening
0014 // and reading of the runwise information, running more just wastes your time
0015 
0016 FieldMapReadBack *ReadFieldMap(const int nEvents = 1, const std::string &filename="DST_TRKR_CLUSTER_sHijing_0_20fm_50kHz_bkg_0_20fm-0000000001-04001.root")
0017 {
0018   gSystem->Load("libg4dst.so");
0019   Fun4AllServer *se = Fun4AllServer::instance();
0020   se->Verbosity(); // set it to 1 if you want event printouts
0021   FieldMapReadBack *fmap = new FieldMapReadBack();
0022   se->registerSubsystem(fmap);
0023   Fun4AllInputManager *in = new Fun4AllDstInputManager("DSTin");
0024   in->fileopen(filename);
0025   se->registerInputManager(in);
0026   if (nEvents < 0)
0027   {
0028     return;
0029   }
0030   se->run(nEvents);
0031   return fmap;
0032 }
0033 
0034 
0035 #endif