#include #include #include #include #include "TFile.h" #include "TTree.h" using namespace std; int main(int argc, char **argv) { int option(0); const char* fileOut; while ((option = getopt(argc, argv,"o:")) != -1) { switch (option) { case 'o' : { fileOut = optarg; break; } } } TFile* f = new TFile(fileOut,"recreate"); TTree* t = new TTree("MC","MC"); double hits1; t->Branch("hits1", &hits1); for (int i(0); i < 100; i++) { hits1 = double(i); t->Fill(); } t->Write(); return 0; }