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;
175 for(
int icrossing = min_crossing; icrossing <= max_crossing; ++icrossing )
178 const int ncollisions = gsl_ran_poisson(
m_rng.get(),
mu);
179 for (
int icollision = 0; icollision < ncollisions; ++icollision)
183 const auto result =
runOne( 1 );
184 if( result != 0 )
return result;
189 std::cout <<
"Fun4AllDstPileupInputManager::run - merged background event " <<
m_ievent_thisfile <<
" time: " << crossing_time << std::endl;
204 std::cout <<
Name() <<
": fileclose: No Input file open" << std::endl;
223 std::map<const std::string, int>::iterator branchiter;
236 std::cout <<
"Setting Root Tree Branch: " << branch <<
" to read" << std::endl;
244 std::cout <<
"Setting Root Tree Branch: " << branch <<
" to NOT read" << std::endl;
258 std::map<const std::string, int>::const_iterator branchiter;
261 m_IManager->selectObjectToRead(branchiter->first.c_str(), branchiter->second);
264 std::cout << branchiter->first <<
" set to " << branchiter->second << std::endl;
271 std::cout <<
PHWHERE <<
" " <<
Name() <<
": You can only call this function after a file has been opened" << std::endl;
272 std::cout <<
"Do not worry, the branches will be set as soon as you open a file" << std::endl;
281 if (what ==
"ALL" || what ==
"BRANCH")
284 std::cout <<
"--------------------------------------" << std::endl
286 std::cout <<
"List of selected branches in Fun4AllDstPileupInputManager " <<
Name() <<
":" << std::endl;
288 std::map<const std::string, int>::const_iterator iter;
291 std::cout << iter->first <<
" is switched ";
300 std::cout << std::endl;
303 if ((what ==
"ALL" || what ==
"PHOOL") &&
m_IManager)
306 std::cout <<
"--------------------------------------" << std::endl
308 std::cout <<
"PHNodeIOManager print in Fun4AllDstPileupInputManager " <<
Name() <<
":" << std::endl;
320 unsigned EventOnDst =
m_IManager->getEventNumber();
321 EventOnDst -=
static_cast<unsigned>(
i);
327 std::cout <<
PHWHERE <<
Name() <<
": could not push back events, Imanager is NULL"
328 <<
" probably the dst is not open yet (you need to call fileopen or run 1 event for lists)" << std::endl;
341 std::cout <<
Name() <<
": No Input file open" << std::endl;
349 std::cout <<
Name() <<
": No Input file from filelist opened" << std::endl;
356 std::cout <<
"Getting Event from " <<
Name() << std::endl;
367 if (nevents > 0 && ncount >= nevents)