14 R__LOAD_LIBRARY(libfun4all.so)
15 R__LOAD_LIBRARY(libreadDigitalCurrents.so)
16 R__LOAD_LIBRARY(libg4dst.so)
20 std::vector<
int> readBeamXings(){
24 string txt_file =
"./data/timestamps_50kHz_1M.txt";
25 ifstream InputFile (txt_file);
27 if (InputFile.is_open()){
29 while ( getline (InputFile,line) )
34 std::istringstream is( line );
41 bXs.push_back(
int(n[0]));
50 auto const it = std::lower_bound(vec.begin(), vec.end(),
value);
51 if (
it == vec.end()) {
return -1; }
56 void Fun4All_FillDCMap(
const int nEvents = 1000,
const int eventsInFileStart = 0,
const int eventsBeamCrossing = 1508071,
const string &
fname =
"/sphenix/user/shulga/Work/IBF/macros/detectors/sPHENIX/Files/DST_G4Hits_sHijing_0-12fm_005000_006000.root",
const string &foutputname =
"./Files/hists_G4Hits_sHijing_0-12fm_000000_001000.root" )
64 std::vector<int> bXs_sel;
66 std::vector<int>::iterator
it = std::find(bXs.begin(), bXs.end(), eventsBeamCrossing);
69 cout<<
"Index="<<index<<endl;
70 for(
int n=0;
n<30;
n++){
72 bXs_sel.push_back(bXs[bXN]);
73 cout<<
"bX="<<bXs[bXN]<<endl;
77 string cd_name =
"readDigitalCurrents"+
std::to_string(eventsInFileStart);
89 gSystem->Load(
"libFROG");
92 cout <<
"Next file:" << inputFileName << endl;
102 cout << endl <<
"Running over " <<
nEvents <<
" Events" << endl;
105 cout << endl <<
"Calling End in Fun4All_readDigitalCurrents.C" << endl;
108 cout << endl <<
"All done, calling delete Fun4AllServer" << endl;
111 cout << endl <<
"gSystem->Exit(0)" << endl;