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 
0017 #include <iostream>
0018 #include <time.h>
0019 
0020 // Add includes here to test if it breaks anything
0021 #include "JetScape.h"
0022 #include "JetEnergyLoss.h"
0023 #include "JetEnergyLossManager.h"
0024 #include "JetScapeWriterStream.h"
0025 #ifdef USE_HEPMC
0026 #include "JetScapeWriterHepMC.h"
0027 #endif
0028 
0029 #include "Brick.h"
0030 #include "PGun.h"
0031 #include "ElossValidation.h"
0032 #include "HadronizationManager.h"
0033 #include "Hadronization.h"
0034 #include "ColoredHadronization.h"
0035 
0036 #include <chrono>
0037 
0038 using namespace Jetscape;
0039 
0040 // Forward declaration
0041 void Show();
0042 
0043 // -------------------------------------
0044 
0045 int main(int argc, char** argv)
0046 {
0047   clock_t t; t = clock();
0048   time_t start, end; time(&start);
0049   
0050   JetScapeLogger::Instance()->SetInfo(true);
0051   JetScapeLogger::Instance()->SetDebug(false);
0052   JetScapeLogger::Instance()->SetRemark(false);
0053   JetScapeLogger::Instance()->SetVerboseLevel(0);
0054    
0055   Show();
0056 
0057   // Main framework task
0058   auto jetscape = make_shared<JetScape>();
0059   jetscape->SetXMLMainFileName("../config/jetscape_main.xml");
0060   jetscape->SetXMLUserFileName("../config/jetscape_user.xml");
0061   jetscape->SetId("primary");
0062 
0063   // Empty initial state
0064   auto ini = make_shared<InitialState>();
0065   ini->SetId("InitialState");
0066 
0067   // mono-energetic particle gun, fixed parameters in XML file
0068   auto pGun= make_shared<PGun> ();
0069 
0070   // Simple brick, parameters in XML file
0071   auto hydro = make_shared<Brick> ();
0072 
0073   // Energy loss manager, parameters in XML file
0074   auto jlossmanager = make_shared<JetEnergyLossManager> ();
0075 
0076   // Energy loss wrapper
0077   auto jloss = make_shared<JetEnergyLoss> ();
0078   
0079   // Energy loss module, can also add multiple ones.
0080   // Parameters in XML file
0081   // auto eloss1 = make_shared<ValidationEloss> ();
0082   auto eloss1 = make_shared<ElossValidate> ();
0083   
0084   // Pure Ascii writer
0085   auto writer= make_shared<JetScapeWriterAscii> ("validate_out.dat");
0086  
0087   //Remark: For now modules have to be added in proper "workflow" order
0088   jetscape->Add(ini);
0089   jetscape->Add(pGun);
0090   jetscape->Add(hydro);
0091 
0092   // add module to the eloss wrapper, than the eloss wrapper to the manager
0093   jloss->Add(eloss1);
0094   jlossmanager->Add(jloss);  
0095   jetscape->Add(jlossmanager);
0096 
0097   // TODO: Should add hadronizer here
0098 
0099   // Add the writer
0100   jetscape->Add(writer);
0101 
0102   // Initialize all modules tasks
0103   jetscape->Init();
0104 
0105   // Run JetScape with all task/modules as specified ...
0106   jetscape->Exec();
0107 
0108   jetscape->Finish();
0109   
0110   INFO_NICE<<"Finished!";
0111   cout<<endl;
0112 
0113   t = clock() - t;
0114   time(&end);
0115   printf ("CPU time: %f seconds.\n",((float)t)/CLOCKS_PER_SEC);
0116   printf ("Real time: %f seconds.\n",difftime(end,start));
0117   
0118   return 0;
0119 }
0120 
0121 // -------------------------------------
0122 
0123 void Show()
0124 {
0125   INFO_NICE<<"--------------------------------------";
0126   INFO_NICE<<"| Validation Test JetScape Framework |";
0127   INFO_NICE<<"--------------------------------------";
0128   INFO_NICE;
0129 }