#include #include #include #include #include "PHITStoRooTracker.hh" using namespace std; void usage(); void TestFormat(string); void Deposit(string); void ICEDUSTFormat(string); static int bunch = 1000; static int event = 1000; int main(int argc, char** argv) { if (argc<1) cerr << "Error: there is no input file or options!" << endl; vector input; for (int i=1; i> bunch; } else if (input[i]=="-e" || input[i]=="--event") { istringstream evt(input[i+1]); evt >> event; } } for (int i=0; i [input file]" << endl; cout << "\n RooTracker is a simple program to convert PHITS dump file into a root file," << endl; cout << "then it will be read out by GEANT4 to simulate physics.\n"; cout << "\nOptions:\n"; cout << "\n -h, --help help" << endl; cout << " -b, --bunch number of bunch" << endl; cout << " -e, --event number of event" << endl; cout << " -t, --testoutput a simple format used to check the data" << endl; cout << " -d, --deposit convert energy depostion data to root file" << endl; cout << " -i, --icedust convert dump file to icedust format\n" << endl; } void TestFormat(string file) { cout << "\n file: " << file << " --> convert to my format" << endl; cout << "reading... " << endl; SimPHITSToRooTracker* rt = new SimPHITSToRooTracker(file); rt->WriteToTestFormat(bunch, event); } void Deposit(string file) { cout << "\n file: " << file << " --> convert to root file" << endl; cout << "reading..." << endl; SimPHITSToRooTracker* rt = new SimPHITSToRooTracker(file); rt->ReadEnergyDeposition(bunch, event); } void ICEDUSTFormat(string file) { cout << "\n file: " << file << " --> convert to icedust format" << endl; cout << "reading..." << endl; SimPHITSToRooTracker* rt = new SimPHITSToRooTracker(file); rt->WriteToICEDUSTFormat(bunch, event); }