#include #include #include #include "TString.h" #include "TFile.h" #include "TTree.h" #include "TMath.h" #include "string.h" #include void Time(long i,long nentries); using namespace std; void twoDMap() { char rootfile[300];//rootfile name for output int num_evt;//define event number double max_chan;//maximum channel number in one file double evt_chan=20000;//channel in one event sprintf(rootfile,"/Users/shishaoxi/research/data/spectra/rootfiles/o2_12.root");//path of input file if(access(rootfile,0)) { cout<Get("t"); // TChain *tree = new TChain("t"); // tree->Add(rootfile); Long64_t nentries = tree->GetEntriesFast(); tree->SetBranchAddress("num_of_peak", &num_of_peak, &b_num_of_peak); tree->SetBranchAddress("peak_position", peak_position, &b_peak_position); tree->SetBranchAddress("peak_high", peak_high, &b_peak_high); Double_t x; Double_t y; TFile *fout = new TFile("../rootfiles/histo1.root","RECREATE");//path of output file TTree *T777 = new TTree("T777","T777"); T777->Branch("x",&x,"x/D"); T777->Branch("y",&y,"y/D"); for(Long64_t i=0; iGetEntry(i); // if(i==10) break; int num_of_peak_tem = num_of_peak; double peak_position_x[23]={0}; // cout<<"num_of_peak "<Fill(); // std::cout << "x= " <