1 #ifndef FUN4ALL_FILLCHARGESMAP_300EVTS_MDC2_C
2 #define FUN4ALL_FILLCHARGESMAP_300EVTS_MDC2_C
19 R__LOAD_LIBRARY(libfun4all.so)
20 R__LOAD_LIBRARY(libfillSpaceChargeMaps.so)
21 R__LOAD_LIBRARY(libg4dst.so)
25 std::vector<
int> readBeamXings(){
29 string txt_file =
"./data/timestamps_50kHz_1M.txt";
30 ifstream InputFile (txt_file);
32 if (InputFile.is_open()){
34 while ( getline (InputFile,line) )
39 std::istringstream is( line );
46 bXs.push_back(
int(n[0]));
54 auto const it = std::lower_bound(vec.begin(), vec.end(),
value);
55 if (
it == vec.end()) {
return -1; }
59 void Fun4All_FillChargesMap_300evts_MDC2(
const int nEvents = 10,
const int eventsInFileStart = 0,
const int eventsBeamCrossing = 1508071,
const string &
fname =
"/sphenix/sim/sim01/sphnxpro/Micromegas/2/G4Hits_sHijing_0-12fm_000000_001000.root",
const string &foutputname =
"/sphenix/user/shulga/Work/IBF/DistortionMap/Files/slim_G4Hits_sHijing_0-12fm_000000_001000.root" )
74 std::vector<int> bXs_sel;
76 std::vector<int>::iterator
it = std::find(bXs.begin(), bXs.end(), eventsBeamCrossing);
79 cout<<
"Index="<<index<<endl;
80 for(
int n=0;
n<30;
n++){
82 bXs_sel.push_back(bXs[bXN]);
87 cout<<
"bX="<<bXs[bXN]<<endl;
91 string cd_name =
"fillSpaceChargeMaps"+
std::to_string(eventsInFileStart);
113 gSystem->Load(
"libFROG");
116 cout <<
"Next file:" << inputFileName << endl;
126 cout << endl <<
"Running over " <<
nEvents <<
" Events" << endl;
129 cout << endl <<
"Calling End in Fun4All_fillSpaceChargeMaps.C" << endl;
132 cout << endl <<
"All done, calling delete Fun4AllServer" << endl;
135 cout << endl <<
"gSystem->Exit(0)" << endl;