Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:19:14

0001 // -----------------------------------------
0002 // JetScape (modular/task) based framework
0003 // Intial Design: LongGang Pang (2017)
0004 //                (UC Berkeley and LBNL)
0005 // -----------------------------------------
0006 // License and Doxygen-like Documentation to be added ...
0007 #include "../TrentoInitial.h"
0008 #include "gtest/gtest.h"
0009 #include <cstdlib>
0010 
0011 using namespace Jetscape;
0012 
0013 TEST(JetscapeInitialTest, TEST_SAMPLE){
0014     double cent_low = 30.0;
0015     double cent_high = 40.0;
0016     double stored_slow = 33.4898493386; 
0017     double stored_shigh = 51.671394987;
0018     double grid_max = 10.0;
0019     double grid_step = 0.2;
0020     for (int k = 0; k < 100; k++ ) {
0021         auto ini = TrentoInitial();
0022         unsigned random_seed = std::rand();
0023         ini.pre_defined("auau200", cent_low, cent_high,
0024                                grid_max, grid_step, random_seed);
0025         EXPECT_EQ(ini.entropy_density_distribution_.size(), 10000);
0026         double mul = ini.info_.total_entropy;
0027         ASSERT_TRUE(mul >= stored_slow && mul <= stored_shigh);
0028 
0029         EXPECT_EQ(ini.get_x_size(), 100);
0030         EXPECT_EQ(ini.get_y_size(), 100);
0031         EXPECT_EQ(ini.get_z_size(), 1);
0032 
0033         auto idx = ini.coord_from_idx(150);
0034         EXPECT_EQ(std::get<0>(idx), -10 + 50 * ini.get_x_step());
0035         EXPECT_EQ(std::get<1>(idx), -10 + 1 * ini.get_y_step());
0036         EXPECT_EQ(std::get<2>(idx), 0 * ini.get_z_step());
0037     }
0038 }
0039