void TreeEventWeightAddJuliet(string in="MergedRootWiscE1/MCEventsPhysicsWeightedMerged", int minNumber=11, int maxNumber=23, string treename="JulietTree") { gROOT->Reset(); //load shared libraries...not sure yet which of these are absolutely //critical... so load them all for now Load(); SimulationCheckerTree *evt = new SimulationCheckerTree(); TChain ch(treename.c_str()); ch.SetBranchAddress("branch",&evt); int numberAdded=0; int totalNumberFile = maxNumber - (minNumber-1); cout << "min N of file " << minNumber << "/ max N file " << maxNumber << endl; cout << "total N file " << totalNumberFile << endl; cout << "Tree Name is " << treename << endl; string input; for(int i = minNumber; i<=maxNumber; ++i){ input.clear(); input = in; input += IntToString(i); input += "reduced.root"; cout << numberAdded+1 << "th file " << input << " will be added" << endl; ch.Add(input.c_str()); ++numberAdded; cout << numberAdded << "th file " << input << " has been added" << endl; } string outfile = "./PhysicsWeightedWiscE-1.MergedReduced.root"; cout << "outfile = " << outfile << " will be created with " << numberAdded << " files" << endl; ch.Merge(outfile.c_str()); cout << "exit" << endl; } ////////////////////////////////////////////////// void Load() { gSystem->Load("libicetray"); gSystem->Load("libroot-icetray"); gSystem->Load("libdataclasses"); gSystem->Load("libphys-services"); //gSystem->Load("libjuliet-interface.so"); //gSystem->Load("libi3anis.so"); gSystem->Load("libweighting-module.so"); } void Style() { gStyle->SetOptFit(0000); gStyle->SetPalette(1); gStyle->SetLabelSize(0.05,"x"); gStyle->SetLabelSize(0.05,"y"); gStyle->SetLabelSize(0.05,"z"); gStyle->SetNdivisions(1005,"x"); gStyle->SetNdivisions(1005,"y"); gStyle->SetNdivisions(1005,"z"); gStyle->SetOptTitle(1); gStyle->SetOptStat(0); gStyle->SetTitleW(0.98); gStyle->SetTitleH(0.08); gStyle->SetTitleBorderSize(0.0); //margin Float_t rightmargin = 0.175; Float_t leftmargin = 0.175; Float_t topmargin = 0.15; Float_t bottommargin = 0.15; } ///////////////////////////////////////////////////////////// string IntToString(int num) { ostringstream myStream; //creates an ostringstream object myStream << num << flush; /* * outputs the number into the string stream and then flushes * the buffer (makes sure the output is put into the stream) */ return(myStream.str()); //returns the string form of the stringstream object } /////////////////////////////////////////////////////////////