Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrentoInitial.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrentoInitial.cc
1 // -----------------------------------------
2 // JetScape (modular/task) based framework
3 // Intial Design: LongGang Pang (2017)
4 // (UC Berkeley and LBNL)
5 // -----------------------------------------
6 // License and Doxygen-like Documentation to be added ...
7 #include "../TrentoInitial.h"
8 #include "gtest/gtest.h"
9 #include <cstdlib>
10 
11 using namespace Jetscape;
12 
13 TEST(JetscapeInitialTest, TEST_SAMPLE){
14  double cent_low = 30.0;
15  double cent_high = 40.0;
16  double stored_slow = 33.4898493386;
17  double stored_shigh = 51.671394987;
18  double grid_max = 10.0;
19  double grid_step = 0.2;
20  for (int k = 0; k < 100; k++ ) {
21  auto ini = TrentoInitial();
22  unsigned random_seed = std::rand();
23  ini.pre_defined("auau200", cent_low, cent_high,
24  grid_max, grid_step, random_seed);
25  EXPECT_EQ(ini.entropy_density_distribution_.size(), 10000);
26  double mul = ini.info_.total_entropy;
27  ASSERT_TRUE(mul >= stored_slow && mul <= stored_shigh);
28 
29  EXPECT_EQ(ini.get_x_size(), 100);
30  EXPECT_EQ(ini.get_y_size(), 100);
31  EXPECT_EQ(ini.get_z_size(), 1);
32 
33  auto idx = ini.coord_from_idx(150);
34  EXPECT_EQ(std::get<0>(idx), -10 + 50 * ini.get_x_step());
35  EXPECT_EQ(std::get<1>(idx), -10 + 1 * ini.get_y_step());
36  EXPECT_EQ(std::get<2>(idx), 0 * ini.get_z_step());
37  }
38 }
39