00001 { 00002 const unsigned int npeaks = 6; 00003 const Double_t peak_search[npeaks] = { 1453., 1325., 967., 933., 606., 508.}; 00004 const TFile* all = new TFile("out/v37/out.root", "READ"); 00005 TH1* h = (TH1*)all->Get("GeSpectrum/hEnergy"); 00006 h->SetStats(0); 00007 h->SetTitle("Peaks Watched For Drift"); 00008 h->GetXaxis()->SetTitle("Energy (keV"); 00009 h->GetYaxis()->SetTitle("Counts (All Al50b Data)"); 00010 h->SetLineColor(kBlack); 00011 00012 TCanvas* c = new TCanvas(); 00013 TLegend* leg = new TLegend(0.7, 0.7, 0.9, 0.9); 00014 h->Draw(); 00015 h->GetXaxis()->SetRangeUser(400., 1600.); 00016 h->GetYaxis()->SetRangeUser(0., 20000.); 00017 for (unsigned int i = 0; i < npeaks; ++i) { 00018 char lab[256]; 00019 const Double_t hgt = 4000.; 00020 const Double_t x1 = peak_search[i]; 00021 const Double_t x2 = peak_search[i]; 00022 const Double_t y2 = h->GetBinContent(h->FindBin(peak_search[i])); 00023 const Double_t y1 = y2 + hgt; 00024 TArrow* arr = new TArrow(x1, y1, x2, y2, 0.02); 00025 arr->SetLineColor(i+1); 00026 sprintf(lab, "%u keV", (unsigned int)peak_search[i]); 00027 leg->AddEntry(arr, lab, "l"); 00028 arr->Draw(); 00029 } 00030 leg->Draw("SAME"); 00031 00032 }