@@ -65,6 +65,7 @@ FSSW::FSSW(std::shared_ptr<RandomUtil::Random> ran_gen,
6565 FO_length = FOsurf_ptr.size ();
6666
6767 paraRdr = paraRdr_in;
68+ echoLevel_ = paraRdr->getVal (" JSechoLevel" , 1 );
6869
6970 hydro_mode = paraRdr->getVal (" hydro_mode" );
7071
@@ -83,12 +84,19 @@ FSSW::FSSW(std::shared_ptr<RandomUtil::Random> ran_gen,
8384 } else {
8485 bUSE_GZIP_FORMAT = true ;
8586 }
87+
8688 if (paraRdr->getVal (" use_binary_format" ) == 0 ) {
8789 bUSE_BINARY_FORMAT = false ;
8890 } else {
8991 bUSE_BINARY_FORMAT = true ;
9092 }
9193
94+ if (paraRdr->getVal (" RegVisYield" , 0 ) == 1 ) {
95+ flagRegVisYield_ = true ;
96+ } else {
97+ flagRegVisYield_ = false ;
98+ }
99+
92100 if (paraRdr->getVal (" include_deltaf_shear" ) == 0 ) {
93101 bINCLUDE_SHEAR_DELTAF = false ;
94102 } else {
@@ -808,6 +816,9 @@ void FSSW::calculate_dN_dxtdy_for_one_particle_species(
808816 }
809817
810818 total_N = N_eq + deltaN_bulk + deltaN_qmu;
819+ if (flagRegVisYield_) {
820+ total_N = std::min (2 .*N_eq, total_N);
821+ }
811822
812823 dN_dxtdy_for_one_particle_species[l] = std::max (0 ., total_N);
813824 }
@@ -983,7 +994,10 @@ void FSSW::sample_using_dN_dxtdy_4all_particles_conventional() {
983994*/
984995 Stopwatch sw_total;
985996 sw_total.tic ();
986- messager_.info (" Function sample_using_dN_dxtdy_4all_particles started..." );
997+ if (echoLevel_ > 0 ) {
998+ messager_.info (
999+ " Function sample_using_dN_dxtdy_4all_particles started..." );
1000+ }
9871001
9881002 std::vector<double > visCoefficients;
9891003
@@ -1018,11 +1032,14 @@ void FSSW::sample_using_dN_dxtdy_4all_particles_conventional() {
10181032 // reusable variables
10191033 // dN_dxtdy for 1 particle
10201034 // vector<double> dN_dxtdy_single_particle(FO_length, 0);
1021- messager_ << " Sampling using dN/dy with "
1022- << " sample_using_dN_dxtdy_4all_particles function." ;
1023- messager_.flush (" info" );
1024- messager_<< " number of repeated sampling = " << number_of_repeated_sampling;
1025- messager_.flush (" info" );
1035+ if (echoLevel_ > 0 ) {
1036+ messager_ << " Sampling using dN/dy with "
1037+ << " sample_using_dN_dxtdy_4all_particles function." ;
1038+ messager_.flush (" info" );
1039+ messager_ << " number of repeated sampling = "
1040+ << number_of_repeated_sampling;
1041+ messager_.flush (" info" );
1042+ }
10261043 for (int n = 0 ; n < number_of_chosen_particles; n++) {
10271044 int real_particle_idx = chosen_particles_sampling_table[n];
10281045 const particle_info *particle = &particles[real_particle_idx];
@@ -1031,14 +1048,18 @@ void FSSW::sample_using_dN_dxtdy_4all_particles_conventional() {
10311048 const int baryon = particle->baryon ;
10321049 const int strange = particle->strange ;
10331050 const int charge = particle->charge ;
1034- messager_ << " Index: " << n << " , Name: " << particle->name
1051+ if (echoLevel_ > 0 ) {
1052+ messager_ << " Index: " << n << " , Name: " << particle->name
10351053 << " , Monte-carlo index: " << particle->monval ;
1036- messager_.flush (" info" );
1054+ messager_.flush (" info" );
1055+ }
10371056 if (local_charge_conservation == 1 ) {
10381057 if (particle->charge < 0 ) {
1039- cout << " local charge conservation is turn on~ "
1040- << " Skip the negative charge particles."
1041- << endl;
1058+ if (echoLevel_ > 0 ) {
1059+ messager_ << " local charge conservation is turn on~ "
1060+ << " Skip the negative charge particles." ;
1061+ messager_.flush (" info" );
1062+ }
10421063 continue ;
10431064 }
10441065 }
@@ -1062,9 +1083,11 @@ void FSSW::sample_using_dN_dxtdy_4all_particles_conventional() {
10621083 // for (3+1)-d case, dN_dy is total N (summing over all etas)
10631084 dN = dN_dy;
10641085 }
1065- messager_ << " -- Sampling using dN_dy=" << dN_dy << " , "
1066- << " dN=" << dN << " ..." ;
1067- messager_.flush (" info" );
1086+ if (echoLevel_ > 0 ) {
1087+ messager_ << " -- Sampling using dN_dy=" << dN_dy << " , "
1088+ << " dN=" << dN << " ..." ;
1089+ messager_.flush (" info" );
1090+ }
10681091
10691092 Stopwatch sw;
10701093 sw.tic ();
@@ -1177,9 +1200,11 @@ void FSSW::sample_using_dN_dxtdy_4all_particles_conventional() {
11771200 } // n; particle loop
11781201
11791202 sw_total.toc ();
1180- cout << endl
1181- << " sample_using_dN_dxtdy_4all_particles finished in "
1182- << sw_total.takeTime () << " seconds." << endl;
1203+ if (echoLevel_ > 0 ) {
1204+ cout << endl
1205+ << " sample_using_dN_dxtdy_4all_particles finished in "
1206+ << sw_total.takeTime () << " seconds." << endl;
1207+ }
11831208}
11841209
11851210
@@ -1719,7 +1744,9 @@ double FSSW::get_deltaf_qmu_coeff(double T, double muB) {
17191744
17201745
17211746void FSSW::initialize_special_function_arrays () {
1722- messager_.info (" Initializing special function arrays ... " );
1747+ if (echoLevel_ > 0 ) {
1748+ messager_.info (" Initializing special function arrays ... " );
1749+ }
17231750 sf_expint_truncate_order = 10 ;
17241751 sf_x_min = 0.5 ;
17251752 sf_x_max = 400 ;
@@ -1857,7 +1884,9 @@ void FSSW::check_samples_in_memory() {
18571884
18581885void FSSW::perform_resonance_feed_down (
18591886 vector< vector<iSS_Hadron>* >* input_particle_list) {
1860- cout << " perform resonance decays... " << endl;
1887+ if (echoLevel_ > 0 ) {
1888+ cout << " perform resonance decays... " << endl;
1889+ }
18611890 // loop over events
18621891 unsigned int nev = input_particle_list->size ();
18631892 for (unsigned int ievent = 0 ; ievent < nev; ievent++) {
@@ -2162,26 +2191,17 @@ void FSSW::computeAvgTotalEnergyMomentum() {
21622191 std::vector<double > Pmu_err (4 , 0 );
21632192 std::vector<double > nQ_avg (3 , 0 );
21642193 std::vector<double > nQ_err (3 , 0 );
2165- for (auto const &Pmu_i : PmuList) {
2166- for (int j = 0 ; j < 4 ; j++) {
2167- Pmu_avg[j] += Pmu_i[j];
2168- Pmu_err[j] += Pmu_i[j]*Pmu_i[j];
2169- }
2170- nev++;
2171- }
2172- for (auto const &nQ_i : ChargesList) {
2173- for (int j = 0 ; j < 3 ; j++) {
2174- nQ_avg[j] += nQ_i[j];
2175- nQ_err[j] += nQ_i[j]*nQ_i[j];
2176- }
2194+ if (echoLevel_ > 0 ) {
2195+ messager_.info (" Averaged total energy and momentum:" );
21772196 }
2178- messager_.info (" Averaged total energy and momentum:" );
21792197 for (int i = 0 ; i < 4 ; i++) {
21802198 Pmu_avg[i] = Pmu_avg[i]/nev;
21812199 Pmu_err[i] = sqrt ((Pmu_err[i]/nev - Pmu_avg[i]*Pmu_avg[i])/nev);
2182- messager_ << " <P[" << i << " ]> = " << Pmu_avg[i] << " +/- "
2183- << Pmu_err[i] << " GeV." ;
2184- messager_.flush (" info" );
2200+ if (echoLevel_ > 0 ) {
2201+ messager_ << " <P[" << i << " ]> = " << Pmu_avg[i] << " +/- "
2202+ << Pmu_err[i] << " GeV." ;
2203+ messager_.flush (" info" );
2204+ }
21852205 }
21862206 messager_.info (" Averaged total conserved charges:" );
21872207 for (int i = 0 ; i < 3 ; i++) {
0 commit comments