Hi,
I am quite new to root.
Can someone tell me how to smear my theoritical mass spectra with my experimental mass resolution ?
The experimental mass resolution is 3.5 amu. I want to incorporate this mass resolution in the mass spectrum which I obtain from my theory calculation and want to see how the width changes.
Yes, i have gone through the root tutorials and I had made a macro to do this. But It has some problems. i am sharing the marco, unfortunately I cant upload the root files.
void MassResolution()
{
TH1D*h2_Mass_resolution = new TH1D("h2_Mass_resolution","h2_Mass_resolution",101.,39.5,140.5); // Defined a histogram
TFile *file=TFile::Open("QnmFF_ROOT_Au_158.root");
TTree *tree=(TTree*)file->Get("DITY");
TH1D*h1 = new TH1D("h1","Os_187.46_MeV",101.,39.5,140.5);
h1->SetLineColor(kRed);
tree->Draw("Aff1>>h1"); // retrived histogram fom the TTree
Double_t x1,y1,z;
Double_t content=0;
Double_t sigma=3.5;
const UInt_t nX = h1->GetNbinsX();
for(UInt_t i=1;i<=nX;++i)
{
x1 = h1->GetXaxis()->GetBinCenter(i);
y1 = h1->GetBinContent(i);
z = h1->GetBinWidth(i);
TF1 *f1 = new TF1("f1","TMath::Gaus(x,[1],[2])",40,140);
f1->SetParameter(0,y1);
f1->SetParameter(1,sigma);
h2_Mass_resolution->Fill(x1, f1->GetRandom());
}
The problem as you can see from the image, I am not getting the smeared histogram.
Red is my Theoritical data, to which I want to add my mass resolution of 3.5 amu. and when I run my macro I get the blue histogram which is not correct.
Hi,
Inside my ttree I have all the theoretical masses for which I wanted to add my masss resolution of 3.5 amu. For that I declared a tree branch and variable “Aff1_Res_amu” and did
At energy = Edep_info1 = 1 (a typical value in your plots), your fwhm = resolution * energy = (p0 + p1 / sqrt(Edep_info1)) * Edep_info1 = 110.5 (i.e., fwhm >> Edep_info1, which makes no sense to me). Even if one assumes fwhm = resolution / 100. * energy (i.e., your “resolution %” to real values), you get fwhm = 1.1 (so, still fwhm > Edep_info1, which looks suspicious to me).