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
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 #endif
0032 
0033 // User modules derived from jetscape framework clasess
0034 #include "TrentoInitial.h"
0035 #include "AdSCFT.h"
0036 #include "Matter.h"
0037 #include "LBT.h"
0038 #include "Martini.h"
0039 #include "Brick.h"
0040 #include "GubserHydro.h"
0041 #include "PGun.h"
0042 #include "HadronizationManager.h"
0043 #include "Hadronization.h"
0044 #include "ColoredHadronization.h"
0045 #include "ColorlessHadronization.h"
0046 
0047 #include <chrono>
0048 #include <thread>
0049 
0050 using namespace std;
0051 
0052 using namespace Jetscape;
0053 
0054 // Forward declaration
0055 void Show();
0056 
0057 // -------------------------------------
0058 
0059 int main(int argc, char** argv)
0060 {
0061   clock_t t; t = clock();
0062   time_t start, end; time(&start);
0063   
0064   cout<<endl;
0065     
0066   // DEBUG=true by default and REMARK=false
0067   // can be also set also via XML file (at least partially)
0068   JetScapeLogger::Instance()->SetDebug(false);
0069   JetScapeLogger::Instance()->SetRemark(false);
0070   //SetVerboseLevel (9 a lot of additional debug output ...)
0071   //If you want to suppress it: use SetVerboseLevle(0) or max  SetVerboseLevle(9) or 10
0072   JetScapeLogger::Instance()->SetVerboseLevel(8);
0073    
0074   Show();
0075 
0076   auto jetscape = make_shared<JetScape>();
0077   jetscape->SetXMLMainFileName("../config/jetscape_main.xml");
0078   jetscape->SetXMLUserFileName("../config/jetscape_user.xml");
0079   jetscape->SetId("primary");
0080 
0081   // Initial conditions and hydro
0082   auto trento = make_shared<TrentoInitial>();
0083   auto pGun= make_shared<PGun> ();
0084   auto hydro = make_shared<Brick> ();
0085   jetscape->Add(trento);
0086   jetscape->Add(pGun);
0087   jetscape->Add(hydro);
0088 
0089   // Energy loss
0090   auto jlossmanager = make_shared<JetEnergyLossManager> ();
0091   auto jloss = make_shared<JetEnergyLoss> ();
0092   auto lbt = make_shared<LBT> ();
0093   jloss->Add(lbt);
0094   jlossmanager->Add(jloss);  
0095   jetscape->Add(jlossmanager);
0096 
0097   // Hadronization
0098   auto hadroMgr = make_shared<HadronizationManager> ();
0099   auto hadro = make_shared<Hadronization> ();
0100   auto hadroModule = make_shared<ColoredHadronization> ();
0101   hadro->Add(hadroModule);
0102   // auto colorless = make_shared<ColorlessHadronization> ();
0103   // hadro->Add(colorless);
0104   hadroMgr->Add(hadro);
0105   jetscape->Add(hadroMgr);
0106 
0107   // Output
0108   auto writer= make_shared<JetScapeWriterAscii> ("test_out.dat");
0109   // same as JetScapeWriterAscii but gzipped
0110   // auto writer= make_shared<JetScapeWriterAsciiGZ> ("test_out.dat.gz");
0111   // HEPMC3
0112 #ifdef USE_HEPMC
0113   // auto writer= make_shared<JetScapeWriterHepMC> ("test_out.hepmc");
0114 #endif
0115   jetscape->Add(writer);
0116 
0117   
0118   // Initialize all modules tasks
0119   jetscape->Init();
0120 
0121   // Run JetScape with all task/modules as specified ...
0122   jetscape->Exec();
0123 
0124   // "dummy" so far ...
0125   // Most thinkgs done in write and clear ...
0126   jetscape->Finish();
0127   
0128   INFO_NICE<<"Finished!";
0129   cout<<endl;
0130 
0131   // wait for 5s
0132   //std::this_thread::sleep_for(std::chrono::milliseconds(500000));
0133 
0134   t = clock() - t;
0135   time(&end);
0136   printf ("CPU time: %f seconds.\n",((float)t)/CLOCKS_PER_SEC);
0137   printf ("Real time: %f seconds.\n",difftime(end,start));
0138   //printf ("Real time: %f seconds.\n",(start-end));
0139   return 0;
0140 }
0141 
0142 // -------------------------------------
0143 
0144 void Show()
0145 {
0146   INFO_NICE<<"------------------------------------";
0147   INFO_NICE<<"| Brick Test JetScape Framework ... |";
0148   INFO_NICE<<"------------------------------------";
0149   INFO_NICE;
0150 }