// makeDecayHists.C // // Simple root macro to generate positron decay histograms from musrSim data // #include "NewSpec.h" // // void makeDecayHists(const char* musrSimFileName) // { // gROOT->ProcessLine(".L NewSpec.C"); // TFile *fout = new TFile(musrSimFileName, "UPDATE"); // if (fout == 0) { // cout << endl << "**ERROR** Couldn't open file" << musrSimFileName; // cout << endl << endl; // return; // } // fout->cd(); // // // TFile::Open(musrSimFileName, "update"); // NewSpec spec; // spec.TBLRCoinIO(1,0.5,0); //all muon decays // // // hT->Write();hB->Write();hL->Write();hR->Write();hAsyLR->Write();hAsyTB->Write(); // // hEdeposited->Write();hTof->Write();hDetz->Write();hBeamSpot->Write(); // // fout->Close(); // return; // } { // gROOT->ProcessLine(".L NewSpec.C"); TH1F *hT, *hB, *hL, *hR, *hAsyLR, *hAsyTB, *hEdeposited, *hTof, *hDetz, *hBeamSpot; TFile::Open("data/musr_13047.root", "update"); NewSpec spec; spec.TBLRCoinIO(1,0.5,1); //0: all muon decays, 1: muons decaying outside sample plate hT = (TH1F*)gDirectory->FindObjectAny("hT"); hB = (TH1F*)gDirectory->FindObjectAny("hB"); hL = (TH1F*)gDirectory->FindObjectAny("hL"); hR = (TH1F*)gDirectory->FindObjectAny("hR"); hAsyLR = (TH1F*)gDirectory->FindObjectAny("hAsyLR"); hAsyTB = (TH1F*)gDirectory->FindObjectAny("hAsyTB"); hEdeposited = (TH1F*)gDirectory->FindObjectAny("hEdeposited"); hTof = (TH1F*)gDirectory->FindObjectAny("hTof"); hDetz = (TH1F*)gDirectory->FindObjectAny("hDetz"); hBeamSpot = (TH1F*)gDirectory->FindObjectAny("hBeamSpot"); hT->Write();hB->Write();hL->Write();hR->Write();hAsyLR->Write();hAsyTB->Write(); hEdeposited->Write();hTof->Write();hDetz->Write();hBeamSpot->Write(); }