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 "PartonPrinter.h"
0043 #include "HadronizationManager.h"
0044 #include "Hadronization.h"
0045 #include "ColoredHadronization.h"
0046 #include "ColorlessHadronization.h"
0047 #include "CausalLiquefier.h"
0048 
0049 #include <chrono>
0050 #include <thread>
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()->SetInfo(true);
0069   JetScapeLogger::Instance()->SetDebug(false);
0070   JetScapeLogger::Instance()->SetRemark(false);
0071   //SetVerboseLevel (9 adds a lot of additional debug output)
0072   //If you want to suppress it: use SetVerboseLevle(0) or max  SetVerboseLevle(9) or 10
0073   JetScapeLogger::Instance()->SetVerboseLevel(0);
0074    
0075   Show();
0076 
0077   auto jetscape = make_shared<JetScape>();
0078   jetscape->SetXMLMainFileName("../config/jetscape_main.xml");
0079   jetscape->SetXMLUserFileName("../config/jetscape_user.xml");
0080   jetscape->SetId("primary");
0081   
0082   // Initial conditions and hydro
0083   auto trento = make_shared<TrentoInitial>();
0084   auto pGun= make_shared<PGun> ();
0085   auto hydro = make_shared<Brick> ();
0086   auto myliquefier = make_shared<CausalLiquefier> ();
0087   jetscape->Add(trento);
0088   jetscape->Add(pGun);
0089   jetscape->Add(hydro);
0090 
0091   // Energy loss
0092   auto jlossmanager = make_shared<JetEnergyLossManager> ();
0093   auto jloss = make_shared<JetEnergyLoss> ();
0094   jloss->add_a_liqueifier(myliquefier);
0095 
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   // This helper module currently needs to be added for hadronization.
0113   // auto printer = make_shared<PartonPrinter> ();
0114   // jetscape->Add(printer);
0115   auto hadroMgr = make_shared<HadronizationManager> ();
0116   auto hadro = make_shared<Hadronization> ();
0117   auto hadroModule = make_shared<ColoredHadronization> ();
0118   hadro->Add(hadroModule);
0119   // auto colorless = make_shared<ColorlessHadronization> ();
0120   // hadro->Add(colorless);
0121   hadroMgr->Add(hadro);
0122   jetscape->Add(hadroMgr);
0123 
0124   // Output
0125   auto writer= make_shared<JetScapeWriterAscii> ("test_out.dat");
0126   // same as JetScapeWriterAscii but gzipped
0127   // auto writer= make_shared<JetScapeWriterAsciiGZ> ("test_out.dat.gz");
0128   // HEPMC3
0129 #ifdef USE_HEPMC
0130   // auto writer= make_shared<JetScapeWriterHepMC> ("test_out.hepmc");
0131 #endif
0132   jetscape->Add(writer);
0133 
0134   // Initialize all modules tasks
0135   jetscape->Init();
0136 
0137   // Run JetScape with all task/modules as specified
0138   jetscape->Exec();
0139 
0140   // For the future, cleanup is mostly already done in write and clear
0141   jetscape->Finish();
0142   
0143   INFO_NICE<<"Finished!";
0144   cout<<endl;
0145 
0146   t = clock() - t;
0147   time(&end);
0148   printf ("CPU time: %f seconds.\n",((float)t)/CLOCKS_PER_SEC);
0149   printf ("Real time: %f seconds.\n",difftime(end,start));
0150   return 0;
0151 }
0152 
0153 // -------------------------------------
0154 
0155 void Show()
0156 {
0157   INFO_NICE<<"------------------------------------";
0158   INFO_NICE<<"| Brick Test JetScape Framework ... |";
0159   INFO_NICE<<"------------------------------------";
0160   INFO_NICE;
0161 }