Good Day,
I am trying to renormalize a histogram to another. Meaning I have the “parent” histogram, then I apply a cut to this “parent” histogram to make a “daughter” histogram. Now what I want to do is see if this cut is an acceptable cut buy normalizing the “daughter” to the “parent” using the number of entries of the “parent”.
I am trying to do this all in TPostScript.
Here is a sort of code I am working with, as well as a figure to give some idea.
Thanks
MK
[code]#include
#include
#include
#include
#include
void NormMasses(){
TChain *chain = new TChain(“NTuple_omega”);
//chain->Add("/Volumes/MAC PC/Work/Omega/Analysis/Root Files/Ntuple_Omega_eta_31.root");
chain->Add("/media/disk-1/NTuples/NTupOmega/Omega_1.root");
Int_t nEvent = chain->GetEntries();
std::cout <<"Number of events " <<nEvent <<std::endl;
TPostScript *ps = new TPostScript(“Mass_Plots.ps”,112);
ps->Range(26,26);
gStyle->SetPalette(1);
TCanvas *c1 = new TCanvas(“c1”,“Blank”, 800, 650);
// picture 8
ps->NewPage();
TCanvas *c2 = new TCanvas(“c2”,“mm_P”, 800, 650);
c2->Divide(1,1);
c2->SetFillColor(0);
c2->SetBorderMode(0);
c2->cd(1);
c2->cd(1)->SetFrameFillColor(0);
c2->cd(1)->SetFrameBorderMode(0);
chain->Draw(“mm_P >> mmP(1000,0.0,2.5)”);
mmP->SetLineColor(2);
chain->Draw("mm_P ",“abs((pow(abs(dP_TOF-0.125),2)/1.5 + pow(abs(dPim_TOF-0.02),2))) < 0.08 && abs((pow(abs(dP_TOF-0.125),2)/1.5 + pow(abs(dPip_TOF-0.02),2))) < 0.08 && abs((pow(abs(dPip_TOF-0.02),2)/1.5 + pow(abs(dPim_TOF-0.02),2)/1.5)) < 0.04”,“same”);
mmP.DrawNormalized();
c2->Update();
ps->Close();
}[/code]
Mass_Plots.pdf (21.9 KB)