#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; TString fres_name = "../Output/masses.dat"; void FillProb(){ TString work_dir = "../Output/"; const int n_histo_prob = 6; const int n_histo_nhits = 2; string title[n_histo_prob]= {"Prob_reco.dat","Prob_ghost.dat","Prob_reco_3.dat","Prob_ghost_3.dat", "Prob_reco_4.dat", "Prob_ghost_4.dat"}; TH1F* hProb[n_histo_prob]; float xmax=1.01, xmin=0.0; int Nbins=250; TString mProbHistoName[n_histo_prob] = {"Prob_reco","Prob_ghost","Prob_reco_3","Prob_ghost_3", "Prob_reco_4", "Prob_ghost_4"}; TH1F* hHits[n_histo_nhits]; float xmax_h=10.1, xmin_h=-0.1; int Nbins_h=51; TString mNHitsHistoName[n_histo_nhits] = {"NHits_reco","NHits_ghost"}; for(int i=0; iFill(nhits); } else sscanf(line.data(),"%f",&prob); hProb[i]->Fill(prob); } fin.close(); } TFile fRoot("Prob.root","RECREATE"); for(int i=0; iWrite(); hProb[i]->Write(); } else hProb[i]->Write(); } } void FillMassHistoFromAscii(){ fstream fpres; fpres.open (fres_name.Data(), fstream::in); TH1F* hMass[30]; float xmax[30], xmin[30]; map pdgToHisto; const int nParticles = 11; int mPartPDG[nParticles] = {310,3122,3312,-3312,3334, 3224,3114, 3000, 421,411,-411}; TString mPartName[nParticles] = {"ks","lambda","ksi-","ksi+","omega-", "sigma*+","sigma*-", "Hdb", "D0","D+","D-"}; for(int i=0; i> num >> mass >> pdg; hMass[pdgToHisto[pdg]]->Fill(mass); if (fpres.eof()) cout << " Data from file " << fres_name << " read succesfully " << endl; } // read results fpres.close(); TFile fRoot("Masses.root","RECREATE"); for(int i=0; iWrite(); } void FillHistoFromAscii(){ FillMassHistoFromAscii(); FillProb(); }