Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LBT_brickTest.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file LBT_brickTest.cc
1 /*******************************************************************************
2  * Copyright (c) The JETSCAPE Collaboration, 2018
3  *
4  * Modular, task-based framework for simulating all aspects of heavy-ion collisions
5  *
6  * For the list of contributors see AUTHORS.
7  *
8  * Report issues at https://github.com/JETSCAPE/JETSCAPE/issues
9  *
10  * or via email to bugs.jetscape@gmail.com
11  *
12  * Distributed under the GNU General Public License 3.0 (GPLv3 or later).
13  * See COPYING for details.
14  ******************************************************************************/
15 // ------------------------------------------------------------
16 // JetScape Framework Brick Test Program
17 // (use either shared library (need to add paths; see setup.csh)
18 // (or create static library and link in)
19 // -------------------------------------------------------------
20 
21 #include <iostream>
22 #include <time.h>
23 
24 // JetScape Framework includes ...
25 #include "JetScape.h"
26 #include "JetEnergyLoss.h"
27 #include "JetEnergyLossManager.h"
28 #include "JetScapeWriterStream.h"
29 #ifdef USE_HEPMC
30 #include "JetScapeWriterHepMC.h"
31 #endif
32 
33 // User modules derived from jetscape framework clasess
34 #include "TrentoInitial.h"
35 #include "AdSCFT.h"
36 #include "Matter.h"
37 #include "LBT.h"
38 #include "Martini.h"
39 #include "Brick.h"
40 #include "GubserHydro.h"
41 #include "PGun.h"
42 #include "HadronizationManager.h"
43 #include "Hadronization.h"
44 #include "ColoredHadronization.h"
45 #include "ColorlessHadronization.h"
46 
47 #include <chrono>
48 #include <thread>
49 
50 using namespace std;
51 
52 using namespace Jetscape;
53 
54 // Forward declaration
55 void Show();
56 
57 // -------------------------------------
58 
59 int main(int argc, char** argv)
60 {
61  clock_t t; t = clock();
62  time_t start, end; time(&start);
63 
64  cout<<endl;
65 
66  // DEBUG=true by default and REMARK=false
67  // can be also set also via XML file (at least partially)
68  JetScapeLogger::Instance()->SetDebug(false);
69  JetScapeLogger::Instance()->SetRemark(false);
70  //SetVerboseLevel (9 a lot of additional debug output ...)
71  //If you want to suppress it: use SetVerboseLevle(0) or max SetVerboseLevle(9) or 10
72  JetScapeLogger::Instance()->SetVerboseLevel(8);
73 
74  Show();
75 
76  auto jetscape = make_shared<JetScape>();
77  jetscape->SetXMLMainFileName("../config/jetscape_main.xml");
78  jetscape->SetXMLUserFileName("../config/jetscape_user.xml");
79  jetscape->SetId("primary");
80 
81  // Initial conditions and hydro
82  auto trento = make_shared<TrentoInitial>();
83  auto pGun= make_shared<PGun> ();
84  auto hydro = make_shared<Brick> ();
85  jetscape->Add(trento);
86  jetscape->Add(pGun);
87  jetscape->Add(hydro);
88 
89  // Energy loss
90  auto jlossmanager = make_shared<JetEnergyLossManager> ();
91  auto jloss = make_shared<JetEnergyLoss> ();
92  auto lbt = make_shared<LBT> ();
93  jloss->Add(lbt);
94  jlossmanager->Add(jloss);
95  jetscape->Add(jlossmanager);
96 
97  // Hadronization
98  auto hadroMgr = make_shared<HadronizationManager> ();
99  auto hadro = make_shared<Hadronization> ();
100  auto hadroModule = make_shared<ColoredHadronization> ();
101  hadro->Add(hadroModule);
102  // auto colorless = make_shared<ColorlessHadronization> ();
103  // hadro->Add(colorless);
104  hadroMgr->Add(hadro);
105  jetscape->Add(hadroMgr);
106 
107  // Output
108  auto writer= make_shared<JetScapeWriterAscii> ("test_out.dat");
109  // same as JetScapeWriterAscii but gzipped
110  // auto writer= make_shared<JetScapeWriterAsciiGZ> ("test_out.dat.gz");
111  // HEPMC3
112 #ifdef USE_HEPMC
113  // auto writer= make_shared<JetScapeWriterHepMC> ("test_out.hepmc");
114 #endif
115  jetscape->Add(writer);
116 
117 
118  // Initialize all modules tasks
119  jetscape->Init();
120 
121  // Run JetScape with all task/modules as specified ...
122  jetscape->Exec();
123 
124  // "dummy" so far ...
125  // Most thinkgs done in write and clear ...
126  jetscape->Finish();
127 
128  INFO_NICE<<"Finished!";
129  cout<<endl;
130 
131  // wait for 5s
132  //std::this_thread::sleep_for(std::chrono::milliseconds(500000));
133 
134  t = clock() - t;
135  time(&end);
136  printf ("CPU time: %f seconds.\n",((float)t)/CLOCKS_PER_SEC);
137  printf ("Real time: %f seconds.\n",difftime(end,start));
138  //printf ("Real time: %f seconds.\n",(start-end));
139  return 0;
140 }
141 
142 // -------------------------------------
143 
144 void Show()
145 {
146  INFO_NICE<<"------------------------------------";
147  INFO_NICE<<"| Brick Test JetScape Framework ... |";
148  INFO_NICE<<"------------------------------------";
149  INFO_NICE;
150 }