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 #endif
0032 
0033 
0034 // User modules derived from jetscape framework clasess
0035 #include "TrentoInitial.h"
0036 #include "AdSCFT.h"
0037 #include "Matter.h"
0038 #include "LBT.h"
0039 #include "Martini.h"
0040 #include "Brick.h"
0041 #include "GubserHydro.h"
0042 #include "PythiaGun.h"
0043 #include "HadronizationManager.h"
0044 #include "Hadronization.h"
0045 #include "ColoredHadronization.h"
0046 #include "ColorlessHadronization.h"
0047 
0048 #include <chrono>
0049 #include <thread>
0050 
0051 using namespace std;
0052 
0053 using namespace Jetscape;
0054 
0055 // Forward declaration
0056 void Show();
0057 
0058 // -------------------------------------
0059 
0060 int main(int argc, char** argv)
0061 {
0062   clock_t t; t = clock();
0063   time_t start, end; time(&start);
0064 
0065   cout<<endl;
0066     
0067   // DEBUG=true by default and REMARK=false
0068   // can be also set also via XML file (at least partially)
0069   JetScapeLogger::Instance()->SetInfo(true);
0070   JetScapeLogger::Instance()->SetDebug(false);
0071   JetScapeLogger::Instance()->SetRemark(false);
0072   //SetVerboseLevel (9 a lot of additional debug output ...)
0073   //If you want to suppress it: use SetVerboseLevle(0) or max  SetVerboseLevle(9) or 10
0074   JetScapeLogger::Instance()->SetVerboseLevel(0);
0075 
0076   
0077   Show();
0078 
0079   auto jetscape = make_shared<JetScape>();
0080   jetscape->SetXMLMainFileName("../config/jetscape_main.xml");
0081   jetscape->SetXMLUserFileName("../config/jetscape_user.xml");
0082   jetscape->SetId("primary");
0083 
0084   // Initial conditions and hydro
0085   auto trento = make_shared<TrentoInitial>();
0086   auto pythiaGun= make_shared<PythiaGun> ();
0087   auto hydro = make_shared<Brick> ();
0088   jetscape->Add(trento);
0089   jetscape->Add(pythiaGun);
0090   jetscape->Add(hydro);
0091 
0092 
0093   // Energy loss
0094   auto jlossmanager = make_shared<JetEnergyLossManager> ();
0095   auto jloss = make_shared<JetEnergyLoss> ();
0096 
0097   auto matter = make_shared<Matter> ();
0098   // auto lbt = make_shared<LBT> ();
0099   auto martini = make_shared<Martini> ();
0100   // auto adscft = make_shared<AdSCFT> ();
0101 
0102   // Note: if you use Matter, it MUST come first (to set virtuality)
0103   jloss->Add(matter);
0104   // jloss->Add(lbt);  // go to 3rd party and ./get_lbtTab before adding this module
0105   // jloss->Add(martini);
0106   // jloss->Add(adscft);  
0107   jlossmanager->Add(jloss);  
0108   jetscape->Add(jlossmanager);
0109 
0110   
0111   // Hadronization
0112   auto hadroMgr = make_shared<HadronizationManager> ();
0113   auto hadro = make_shared<Hadronization> ();
0114   //auto hadroModule = make_shared<ColoredHadronization> ();
0115   //hadro->Add(hadroModule);
0116   auto colorless = make_shared<ColorlessHadronization> ();
0117   hadro->Add(colorless);
0118   hadroMgr->Add(hadro);
0119   jetscape->Add(hadroMgr);
0120 
0121   
0122   // Output
0123   auto writer= make_shared<JetScapeWriterAscii> ("test_out.dat");
0124   jetscape->Add(writer);
0125 #ifdef USE_GZIP
0126   // same as JetScapeWriterAscii but gzipped
0127   auto writergz= make_shared<JetScapeWriterAsciiGZ> ("test_out.dat.gz");
0128   jetscape->Add(writergz);
0129 #endif
0130   // HEPMC3
0131 #ifdef USE_HEPMC
0132   auto hepmcwriter= make_shared<JetScapeWriterHepMC> ("test_out.hepmc");
0133   jetscape->Add(hepmcwriter);
0134 #endif
0135 
0136   // Initialize all modules tasks
0137   jetscape->Init();
0138 
0139   // Run JetScape with all task/modules as specified
0140   jetscape->Exec();
0141 
0142   // For the future, cleanup is mostly already done in write and clear
0143   jetscape->Finish();
0144   
0145   INFO_NICE<<"Finished!";
0146   cout<<endl;
0147 
0148   t = clock() - t;
0149   time(&end);
0150   printf ("CPU time: %f seconds.\n",((float)t)/CLOCKS_PER_SEC);
0151   printf ("Real time: %f seconds.\n",difftime(end,start));
0152 
0153   // Print pythia statistics
0154   // pythiaGun->stat();
0155 
0156   // // Demonstrate how to work with pythia statistics
0157   // //Pythia8::Info& info = pythiaGun->info;
0158   // cout << " nTried    = " << info.nTried() << endl;
0159   // cout << " nSelected = " << info.nSelected()  << endl;
0160   // cout << " nAccepted = " << info.nAccepted()  << endl;
0161   // cout << " sigmaGen  = " <<   info.sigmaGen()  << endl;  
0162   // cout << " sigmaErr  = " <<   info.sigmaErr()  << endl;
0163    
0164   return 0;
0165 }
0166 
0167 // -------------------------------------
0168 
0169 void Show()
0170 {
0171   INFO_NICE<<"------------------------------------";
0172   INFO_NICE<<"| Brick Test JetScape Framework ... |";
0173   INFO_NICE<<"------------------------------------";
0174   INFO_NICE;
0175 }