Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
brickTest.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file 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 "PartonPrinter.h"
43 #include "HadronizationManager.h"
44 #include "Hadronization.h"
45 #include "ColoredHadronization.h"
46 #include "ColorlessHadronization.h"
47 #include "CausalLiquefier.h"
48 
49 #include <chrono>
50 #include <thread>
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)
71  //SetVerboseLevel (9 adds a lot of additional debug output)
72  //If you want to suppress it: use SetVerboseLevle(0) or max SetVerboseLevle(9) or 10
74 
75  Show();
76 
77  auto jetscape = make_shared<JetScape>();
78  jetscape->SetXMLMainFileName("../config/jetscape_main.xml");
79  jetscape->SetXMLUserFileName("../config/jetscape_user.xml");
80  jetscape->SetId("primary");
81 
82  // Initial conditions and hydro
83  auto trento = make_shared<TrentoInitial>();
84  auto pGun= make_shared<PGun> ();
85  auto hydro = make_shared<Brick> ();
86  auto myliquefier = make_shared<CausalLiquefier> ();
87  jetscape->Add(trento);
88  jetscape->Add(pGun);
89  jetscape->Add(hydro);
90 
91  // Energy loss
92  auto jlossmanager = make_shared<JetEnergyLossManager> ();
93  auto jloss = make_shared<JetEnergyLoss> ();
94  jloss->add_a_liqueifier(myliquefier);
95 
96 
97  auto matter = make_shared<Matter> ();
98  //auto lbt = make_shared<LBT> ();
99  // auto martini = make_shared<Martini> ();
100  // auto adscft = make_shared<AdSCFT> ();
101 
102  // Note: if you use Matter, it MUST come first (to set virtuality)
103  jloss->Add(matter);
104  // jloss->Add(lbt); // go to 3rd party and ./get_lbtTab before adding this module
105  // jloss->Add(martini);
106  // jloss->Add(adscft);
107  jlossmanager->Add(jloss);
108  jetscape->Add(jlossmanager);
109 
110 
111  // Hadronization
112  // This helper module currently needs to be added for hadronization.
113  // auto printer = make_shared<PartonPrinter> ();
114  // jetscape->Add(printer);
115  auto hadroMgr = make_shared<HadronizationManager> ();
116  auto hadro = make_shared<Hadronization> ();
117  auto hadroModule = make_shared<ColoredHadronization> ();
118  hadro->Add(hadroModule);
119  // auto colorless = make_shared<ColorlessHadronization> ();
120  // hadro->Add(colorless);
121  hadroMgr->Add(hadro);
122  jetscape->Add(hadroMgr);
123 
124  // Output
125  auto writer= make_shared<JetScapeWriterAscii> ("test_out.dat");
126  // same as JetScapeWriterAscii but gzipped
127  // auto writer= make_shared<JetScapeWriterAsciiGZ> ("test_out.dat.gz");
128  // HEPMC3
129 #ifdef USE_HEPMC
130  // auto writer= make_shared<JetScapeWriterHepMC> ("test_out.hepmc");
131 #endif
132  jetscape->Add(writer);
133 
134  // Initialize all modules tasks
135  jetscape->Init();
136 
137  // Run JetScape with all task/modules as specified
138  jetscape->Exec();
139 
140  // For the future, cleanup is mostly already done in write and clear
141  jetscape->Finish();
142 
143  INFO_NICE<<"Finished!";
144  cout<<endl;
145 
146  t = clock() - t;
147  time(&end);
148  printf ("CPU time: %f seconds.\n",((float)t)/CLOCKS_PER_SEC);
149  printf ("Real time: %f seconds.\n",difftime(end,start));
150  return 0;
151 }
152 
153 // -------------------------------------
154 
155 void Show()
156 {
157  INFO_NICE<<"------------------------------------";
158  INFO_NICE<<"| Brick Test JetScape Framework ... |";
159  INFO_NICE<<"------------------------------------";
160  INFO_NICE;
161 }