Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #include <fun4all/Fun4AllDstInputManager.h>
0002 #include <fun4all/Fun4AllInputManager.h>
0003 #include <fun4all/Fun4AllServer.h>
0004 #include <fun4all/SubsysReco.h>
0005 
0006 #include <TSystem.h>
0007 
0008 #include <anatutorial/AnaTutorial.h>
0009 
0010 R__LOAD_LIBRARY(libanatutorial.so)
0011 
0012 R__LOAD_LIBRARY(libfun4all.so)
0013 
0014 //! Simple macro to readback previous generated simulation DSTs to analyze with `AnaTutorial`
0015 void Fun4All_AnaTutorial_DSTReadBack(const int nevnt = 0, const std::string & inputfile = "G4sPHENIX.root")
0016 {
0017   gSystem->Load("libg4dst");
0018   Fun4AllServer *se = Fun4AllServer::instance();
0019 
0020   AnaTutorial *anaTutorial = new AnaTutorial("anaTutorial", inputfile + "_anaTutorial.root");
0021   anaTutorial->setMinJetPt(4.);
0022   anaTutorial->Verbosity(0);
0023   anaTutorial->analyzeTracks(true);
0024   anaTutorial->analyzeClusters(true);
0025   anaTutorial->analyzeJets(true);
0026   anaTutorial->analyzeTruth(false);
0027   se->registerSubsystem(anaTutorial);
0028 
0029   Fun4AllInputManager *in = new Fun4AllDstInputManager("DSTin");
0030   in->fileopen(inputfile);
0031   // or
0032   // in->AddListFile(inputfile);
0033   se->registerInputManager(in);
0034 
0035   se->run(nevnt);
0036   se->End();
0037   delete se;
0038 
0039   cout <<"All done. Exiting..."<<endl;
0040 
0041   gSystem->Exit(0);
0042 }