void CheckNorm(double Min, double Max, double Step) { vector <double> Mass; vector <double> BranchingRatio; vector <double> XSection; for (double i=Min; i<Max; i+=Step) { Mass.push_back(i); BranchingRatio.push_back(GetBR(i)); XSection.push_back(GetXsection(i)); } TGraph* BranchGraph = new TGraph(Mass.size(),&Mass[0],&BranchingRatio[0]); TGraph* XSectionGraph = new TGraph(Mass.size(),&Mass[0],&XSection[0]); BranchGraph->SetTitle("Interpolated Branching Ratios"); XSectionGraph->SetTitle("Interpolated Cross Sections"); BranchGraph->SetMarkerStyle(20); XSectionGraph->SetMarkerStyle(20); BranchGraph->SetMarkerSize(1); XSectionGraph->SetMarkerSize(1); TCanvas* c1 = new TCanvas("c1","c1",800,650); c1->cd(); BranchGraph->Draw("AP"); c1->SaveAs("BranchingRatios.png"); c1->Clear(); XSectionGraph->Draw("AP"); c1->SaveAs("XSections.png"); delete BranchGraph; delete XSectionGraph; delete c1; }
double GetNorm(double mass1, TH1F* hist1, double mass2, TH1F* hist2, double mass) { double br = GetBR(mass); double br1 = GetBR(mass1); double br2 = GetBR(mass2); double xsec = GetXsection(mass); double xsec1 = GetXsection(mass1); double xsec2 = GetXsection(mass2); double alpha = 1.0*(mass-mass1)/(mass2-mass1); double effAcc1 = hist1->Integral()/(xsec1*br1); double effAcc2 = hist2->Integral()/(xsec2*br2); double Normalization = (xsec*br)*(effAcc1 + alpha * (effAcc2 - effAcc1)); return Normalization; }
//____________________________________________________________________ // // $Id$ // // Script to generate cross-section tables for some particles in some // mediums. The output is put in xsec.root. // // It uses the script GetXsection.C and Compile.C to compile the // aforementioned script. // // Note, that VMC _must_ be the TGeant3TGeo VMC. // void MakeXsection() { gROOT->ProcessLine(".x Compile.C(\"$(ALICE_ROOT)/FMD/scripts/GetXsection.C\""); gAlice->InitMC("$(ALICE_ROOT)/FMD/Config.C"); TFile* file = TFile::Open("xsec.root", "RECREATE"); GetXsection("FMD_Si$", "pi+"); file->Close(); }