24 #include <gsl/gsl_randist.h>
36 m_rng.reset( gsl_rng_alloc(gsl_rng_mt19937) );
51 std::cout <<
"Closing currently open file "
53 <<
" and opening " << filenam << std::endl;
77 auto runheader = findNode::getClass<RunHeader>(
m_runNode,
"RunHeader");
132 std::cout <<
PHWHERE <<
": " <<
Name() <<
" Could not open file " <<
FileName() << std::endl;
142 if( nevents == 0 )
return runOne( nevents );
143 else if( nevents > 1 )
145 const auto result =
runOne( nevents-1 );
146 if( result != 0 )
return result;
174 for(
int icrossing = min_crossing; icrossing <= max_crossing; ++icrossing )
177 const int ncollisions = gsl_ran_poisson(
m_rng.get(), mu);
178 for (
int icollision = 0; icollision < ncollisions; ++icollision)
182 const auto result =
runOne( 1 );
183 if( result != 0 )
return result;
188 std::cout <<
"Fun4AllDstPileupInputManager::run - merged background event " <<
m_ievent_thisfile <<
" time: " << crossing_time << std::endl;
203 std::cout <<
Name() <<
": fileclose: No Input file open" << std::endl;
222 std::map<const std::string, int>::iterator branchiter;
235 std::cout <<
"Setting Root Tree Branch: " << branch <<
" to read" << std::endl;
243 std::cout <<
"Setting Root Tree Branch: " << branch <<
" to NOT read" << std::endl;
257 std::map<const std::string, int>::const_iterator branchiter;
260 m_IManager->selectObjectToRead(branchiter->first.c_str(), branchiter->second);
263 std::cout << branchiter->first <<
" set to " << branchiter->second << std::endl;
270 std::cout <<
PHWHERE <<
" " <<
Name() <<
": You can only call this function after a file has been opened" << std::endl;
271 std::cout <<
"Do not worry, the branches will be set as soon as you open a file" << std::endl;
280 if (what ==
"ALL" || what ==
"BRANCH")
283 std::cout <<
"--------------------------------------" << std::endl
285 std::cout <<
"List of selected branches in Fun4AllDstPileupInputManager " <<
Name() <<
":" << std::endl;
287 std::map<const std::string, int>::const_iterator iter;
290 std::cout << iter->first <<
" is switched ";
299 std::cout << std::endl;
302 if ((what ==
"ALL" || what ==
"PHOOL") &&
m_IManager)
305 std::cout <<
"--------------------------------------" << std::endl
307 std::cout <<
"PHNodeIOManager print in Fun4AllDstPileupInputManager " <<
Name() <<
":" << std::endl;
319 unsigned EventOnDst =
m_IManager->getEventNumber();
320 EventOnDst -=
static_cast<unsigned>(i);
326 std::cout <<
PHWHERE <<
Name() <<
": could not push back events, Imanager is NULL"
327 <<
" probably the dst is not open yet (you need to call fileopen or run 1 event for lists)" << std::endl;
340 std::cout <<
Name() <<
": No Input file open" << std::endl;
348 std::cout <<
Name() <<
": No Input file from filelist opened" << std::endl;
355 std::cout <<
"Getting Event from " <<
Name() << std::endl;
366 if (nevents > 0 && ncount >= nevents)