ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimpleValidate.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SimpleValidate.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 
17 #include <iostream>
18 #include <time.h>
19 
20 // Add includes here to test if it breaks anything
21 #include "JetScape.h"
22 #include "JetEnergyLoss.h"
23 #include "JetEnergyLossManager.h"
24 #include "JetScapeWriterStream.h"
25 #ifdef USE_HEPMC
26 #include "JetScapeWriterHepMC.h"
27 #endif
28 
29 #include "Brick.h"
30 #include "PGun.h"
31 #include "ElossValidation.h"
32 #include "PartonPrinter.h"
33 #include "HadronizationManager.h"
34 #include "Hadronization.h"
35 #include "ColoredHadronization.h"
36 
37 #include <chrono>
38 
39 using namespace Jetscape;
40 
41 // Forward declaration
42 void Show();
43 
44 // -------------------------------------
45 
46 int main(int argc, char** argv)
47 {
48  clock_t t; t = clock();
49  time_t start, end; time(&start);
50 
51  JetScapeLogger::Instance()->SetInfo(true);
52  JetScapeLogger::Instance()->SetDebug(false);
53  JetScapeLogger::Instance()->SetRemark(false);
54  JetScapeLogger::Instance()->SetVerboseLevel(0);
55 
56  Show();
57 
58  // Main framework task
59  auto jetscape = make_shared<JetScape>("../examples/simplevalidate.xml",1);
60  jetscape->SetId("primary");
61 
62  // Empty initial state
63  auto ini = make_shared<InitialState>();
64  ini->SetId("InitialState");
65 
66  // mono-energetic particle gun, fixed parameters in XML file
67  auto pGun= make_shared<PGun> ();
68 
69  // Simple brick, parameters in XML file
70  auto hydro = make_shared<Brick> ();
71 
72  // Energy loss manager, parameters in XML file
73  auto jlossmanager = make_shared<JetEnergyLossManager> ();
74 
75  // Energy loss wrapper
76  auto jloss = make_shared<JetEnergyLoss> ();
77 
78  // Energy loss module, can also add multiple ones.
79  // Parameters in XML file
80  // auto eloss1 = make_shared<ValidationEloss> ();
81  auto eloss1 = make_shared<ElossValidate> ();
82 
83  // Pure Ascii writer
84  auto writer= make_shared<JetScapeWriterAscii> ("validate_out.dat");
85 
86  //Remark: For now modules have to be added in proper "workflow" order
87  jetscape->Add(ini);
88  jetscape->Add(pGun);
89  jetscape->Add(hydro);
90 
91  // add module to the eloss wrapper, than the eloss wrapper to the manager
92  jloss->Add(eloss1);
93  jlossmanager->Add(jloss);
94  jetscape->Add(jlossmanager);
95 
96  // TODO: Should add hadronizer here
97 
98  // Add the writer
99  jetscape->Add(writer);
100 
101  // Intialize all modules tasks
102  jetscape->Init();
103 
104  // Run JetScape with all task/modules as specified ...
105  jetscape->Exec();
106 
107  jetscape->Finish();
108 
109  INFO_NICE<<"Finished!";
110  cout<<endl;
111 
112  t = clock() - t;
113  time(&end);
114  printf ("CPU time: %f seconds.\n",((float)t)/CLOCKS_PER_SEC);
115  printf ("Real time: %f seconds.\n",difftime(end,start));
116 
117  return 0;
118 }
119 
120 // -------------------------------------
121 
122 void Show()
123 {
124  INFO_NICE<<"--------------------------------------";
125  INFO_NICE<<"| Validation Test JetScape Framework |";
126  INFO_NICE<<"--------------------------------------";
127  INFO_NICE;
128 }