Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:30

0001 /*******************************************************************************
0002  * Copyright (c) The JETSCAPE Collaboration, 2018
0003  *
0004  * Modular, task-based framework for simulating all aspects of heavy-ion collisions
0005  *
0006  * For the list of contributors see AUTHORS.
0007  *
0008  * Report issues at https://github.com/JETSCAPE/JETSCAPE/issues
0009  *
0010  * or via email to bugs.jetscape@gmail.com
0011  *
0012  * Distributed under the GNU General Public License 3.0 (GPLv3 or later).
0013  * See COPYING for details.
0014  ******************************************************************************/
0015 // ------------------------------------------------------------
0016 // JetScape Framework Brick Test Program with Pythia IS
0017 // (use either shared library (need to add paths; see setup.csh)
0018 // (or create static library and link in)
0019 // -------------------------------------------------------------
0020 
0021 #include <iostream>
0022 #include <time.h>
0023 
0024 // JetScape Framework includes ...
0025 #include "JetScape.h"
0026 #include "JetEnergyLoss.h"
0027 #include "JetEnergyLossManager.h"
0028 #include "JetScapeWriterStream.h"
0029 #ifdef USE_HEPMC
0030 #include "JetScapeWriterHepMC.h"
0031 #include "JetScapeWriterRootHepMC.h"
0032 #endif
0033 
0034 
0035 // User modules derived from jetscape framework clasess
0036 #include "TrentoInitial.h"
0037 #include "AdSCFT.h"
0038 #include "Matter.h"
0039 #include "LBT.h"
0040 #include "Martini.h"
0041 #include "Brick.h"
0042 #include "GubserHydro.h"
0043 #include "PythiaGun.h"
0044 #include "HadronizationManager.h"
0045 #include "Hadronization.h"
0046 #include "ColoredHadronization.h"
0047 #include "ColorlessHadronization.h"
0048 
0049 #include <chrono>
0050 #include <thread>
0051 
0052 using namespace std;
0053 
0054 using namespace Jetscape;
0055 
0056 // Forward declaration
0057 void Show();
0058 
0059 // -------------------------------------
0060 
0061 int main(int argc, char** argv)
0062 {
0063   clock_t t; t = clock();
0064   time_t start, end; time(&start);
0065 
0066   cout<<endl;
0067 
0068   // DEBUG=true by default and REMARK=false
0069   // can be also set also via XML file (at least partially)
0070   JetScapeLogger::Instance()->SetInfo(true);
0071   JetScapeLogger::Instance()->SetDebug(false);
0072   JetScapeLogger::Instance()->SetRemark(false);
0073   //SetVerboseLevel (9 a lot of additional debug output ...)
0074   //If you want to suppress it: use SetVerboseLevle(0) or max  SetVerboseLevle(9) or 10
0075   JetScapeLogger::Instance()->SetVerboseLevel(0);
0076 
0077 
0078   Show();
0079 
0080   auto jetscape = make_shared<JetScape>();
0081   jetscape->SetXMLMainFileName("../config/jetscape_main.xml");
0082   jetscape->SetXMLUserFileName("../config/jetscape_user_root_test.xml");
0083   jetscape->SetId("primary");
0084 
0085   // Initial conditions and hydro
0086   auto trento = make_shared<TrentoInitial>();
0087   auto pythiaGun= make_shared<PythiaGun> ();
0088   auto hydro = make_shared<Brick> ();
0089   jetscape->Add(trento);
0090   jetscape->Add(pythiaGun);
0091   jetscape->Add(hydro);
0092 
0093 
0094   // Energy loss
0095   auto jlossmanager = make_shared<JetEnergyLossManager> ();
0096   auto jloss = make_shared<JetEnergyLoss> ();
0097 
0098   auto matter = make_shared<Matter> ();
0099   // auto lbt = make_shared<LBT> ();
0100   auto martini = make_shared<Martini> ();
0101   // auto adscft = make_shared<AdSCFT> ();
0102 
0103   // Note: if you use Matter, it MUST come first (to set virtuality)
0104   jloss->Add(matter);
0105   // jloss->Add(lbt);  // go to 3rd party and ./get_lbtTab before adding this module
0106   // jloss->Add(martini);
0107   // jloss->Add(adscft);
0108   jlossmanager->Add(jloss);
0109   jetscape->Add(jlossmanager);
0110 
0111 
0112   // Hadronization
0113   auto hadroMgr = make_shared<HadronizationManager> ();
0114   auto hadro = make_shared<Hadronization> ();
0115   //auto hadroModule = make_shared<ColoredHadronization> ();
0116   //hadro->Add(hadroModule);
0117   auto colorless = make_shared<ColorlessHadronization> ();
0118   hadro->Add(colorless);
0119   hadroMgr->Add(hadro);
0120   jetscape->Add(hadroMgr);
0121 
0122 
0123   // Output
0124   auto writer= make_shared<JetScapeWriterAscii> ("test_out.dat");
0125   jetscape->Add(writer);
0126 #ifdef USE_GZIP
0127   // same as JetScapeWriterAscii but gzipped
0128   //auto writergz= make_shared<JetScapeWriterAsciiGZ> ("test_out.dat.gz");
0129   //jetscape->Add(writergz);
0130 #endif
0131   // HEPMC3
0132 #ifdef USE_HEPMC
0133   //auto hepmcwriter= make_shared<JetScapeWriterHepMC> ("test_out.hepmc");
0134   //jetscape->Add(hepmcwriter);
0135   auto hepmcwriterRoot= make_shared<JetScapeWriterRootHepMC> ("test_out_hepmc.root");
0136   jetscape->Add(hepmcwriterRoot);
0137 #endif
0138 
0139   // Initialize all modules tasks
0140   jetscape->Init();
0141 
0142   // Run JetScape with all task/modules as specified
0143   jetscape->Exec();
0144 
0145   // For the future, cleanup is mostly already done in write and clear
0146   jetscape->Finish();
0147 
0148   INFO_NICE<<"Finished!";
0149   cout<<endl;
0150 
0151   t = clock() - t;
0152   time(&end);
0153   printf ("CPU time: %f seconds.\n",((float)t)/CLOCKS_PER_SEC);
0154   printf ("Real time: %f seconds.\n",difftime(end,start));
0155 
0156   // Print pythia statistics
0157   // pythiaGun->stat();
0158 
0159   // // Demonstrate how to work with pythia statistics
0160   // //Pythia8::Info& info = pythiaGun->info;
0161   // cout << " nTried    = " << info.nTried() << endl;
0162   // cout << " nSelected = " << info.nSelected()  << endl;
0163   // cout << " nAccepted = " << info.nAccepted()  << endl;
0164   // cout << " sigmaGen  = " <<   info.sigmaGen()  << endl;
0165   // cout << " sigmaErr  = " <<   info.sigmaErr()  << endl;
0166 
0167   return 0;
0168 }
0169 
0170 // -------------------------------------
0171 
0172 void Show()
0173 {
0174   INFO_NICE<<"------------------------------------";
0175   INFO_NICE<<"| Brick Test JetScape Framework ... |";
0176   INFO_NICE<<"------------------------------------";
0177   INFO_NICE;
0178 }