ECCE @ EIC 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 
48 #include <chrono>
49 #include <thread>
50 
51 using namespace Jetscape;
52 
53 // Forward declaration
54 void Show();
55 
56 // -------------------------------------
57 
58 int main(int argc, char** argv)
59 {
60  clock_t t; t = clock();
61  time_t start, end; time(&start);
62 
63  cout<<endl;
64 
65  // DEBUG=true by default and REMARK=false
66  // can be also set also via XML file (at least partially)
67  JetScapeLogger::Instance()->SetInfo(true);
68  JetScapeLogger::Instance()->SetDebug(false);
69  JetScapeLogger::Instance()->SetRemark(false);
70  //SetVerboseLevel (9 adds 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(0);
73 
74  Show();
75 
76  auto jetscape = make_shared<JetScape>("./jetscape_init.xml",200);
77  jetscape->SetId("primary");
78 
79  // Initial conditions and hydro
80  auto trento = make_shared<TrentoInitial>();
81  auto pGun= make_shared<PGun> ();
82  auto hydro = make_shared<Brick> ();
83  jetscape->Add(trento);
84  jetscape->Add(pGun);
85  jetscape->Add(hydro);
86 
87  // Energy loss
88  auto jlossmanager = make_shared<JetEnergyLossManager> ();
89  auto jloss = make_shared<JetEnergyLoss> ();
90 
91  auto matter = make_shared<Matter> ();
92  // auto lbt = make_shared<LBT> ();
93  // auto martini = make_shared<Martini> ();
94  // auto adscft = make_shared<AdSCFT> ();
95 
96  // Note: if you use Matter, it MUST come first (to set virtuality)
97  jloss->Add(matter);
98  // jloss->Add(lbt); // go to 3rd party and ./get_lbtTab before adding this module
99  // jloss->Add(martini);
100  // jloss->Add(adscft);
101  jlossmanager->Add(jloss);
102  jetscape->Add(jlossmanager);
103 
104 
105  // Hadronization
106  // This helper module currently needs to be added for hadronization.
107  auto printer = make_shared<PartonPrinter> ();
108  jetscape->Add(printer);
109  auto hadroMgr = make_shared<HadronizationManager> ();
110  auto hadro = make_shared<Hadronization> ();
111  auto hadroModule = make_shared<ColoredHadronization> ();
112  hadro->Add(hadroModule);
113  // auto colorless = make_shared<ColorlessHadronization> ();
114  // hadro->Add(colorless);
115  hadroMgr->Add(hadro);
116  jetscape->Add(hadroMgr);
117 
118  // Output
119  auto writer= make_shared<JetScapeWriterAscii> ("test_out.dat");
120  // same as JetScapeWriterAscii but gzipped
121  // auto writer= make_shared<JetScapeWriterAsciiGZ> ("test_out.dat.gz");
122  // HEPMC3
123 #ifdef USE_HEPMC
124  // auto writer= make_shared<JetScapeWriterHepMC> ("test_out.hepmc");
125 #endif
126  jetscape->Add(writer);
127 
128  // Intialize all modules tasks
129  jetscape->Init();
130 
131  // Run JetScape with all task/modules as specified
132  jetscape->Exec();
133 
134  // For the future, cleanup is mostly already done in write and clear
135  jetscape->Finish();
136 
137  INFO_NICE<<"Finished!";
138  cout<<endl;
139 
140  t = clock() - t;
141  time(&end);
142  printf ("CPU time: %f seconds.\n",((float)t)/CLOCKS_PER_SEC);
143  printf ("Real time: %f seconds.\n",difftime(end,start));
144  return 0;
145 }
146 
147 // -------------------------------------
148 
149 void Show()
150 {
151  INFO_NICE<<"------------------------------------";
152  INFO_NICE<<"| Brick Test JetScape Framework ... |";
153  INFO_NICE<<"------------------------------------";
154  INFO_NICE;
155 }