//*-- author : Paul Eugenio 17-Dec-98 //////////////////////////////////////////////////////////////////////// // // HDFast: The Hall D Fast MC Package // ================================= // This package is build upon the MCFast framework. // // This program creates : // - a ROOT file which contains a tree of MCFast objects // // // // //////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #include #include "TMCFastHepEvt.h" //#include "TMCFastTOF.h" #include "TMCFastOfflineTrack.h" using namespace std; // undefined reference errors occur because errno is not defined // on RHEL3 GCC3.2. Define it here to avoid this. #undef errno extern "C" int errno; int errno=0; void PrintUsage(char *processName); #ifndef HDFAST_LITE TROOT HDFast("HDFast","The Hall D Fast MC Package"); #endif extern "C" void mcfast_main(int argc, char **argv); Int_t counter=0,Nevents=0,Debug=0,SaveBrokenEvents =0,SaveOldFormat =0; int main(int argc, char **argv) { char defaultFile[25]="hdfast.rdt"; char *outputfile,*argptr; // gSystem->Load("libTMCFast.so"); outputfile = defaultFile; if (argc == 1){ PrintUsage(argv[0]); exit (0); } for (Int_t i=1; i 1)) { argptr++; switch (*argptr) { case 'v': SaveOldFormat=1; break; case 'u': SaveBrokenEvents =1; break; case 'd': argptr+=2; Debug = atoi(argptr); cerr<< "Using debug level: "<< Debug<SetCompressionLevel(comp); #endif /* * Now call the mcfast framework */ mcfast_main(argc, argv); /* * Close the Root I/O */ cout<<"\n\nEvents Written: "<Write(); rdtfile->Close(); #endif return 1; } void PrintUsage(char *processName){ cerr<< processName << " usage: [switches]" << endl; cerr<< "\t-f The mcfast command file.\n"; cerr<< "\t-u Save Broken Events (*.evt file do not use w/ -v ).\n"; cerr<< "\t-l The log file.\n"; cerr<< "\t-hb A hbook file used for testing.\n"; cerr<< "\t-d Debug level --use level=1 for basic debug\n"; #ifdef HDFAST_LITE cerr<< "\t-o The output file.\n"; cerr<< "\t-v Save in old Event Format (*.evt file).\n"; #endif cerr<< "\t-h Print this help message\n\n"; }