Commit 4d838ad9 authored by Shahid Khan's avatar Shahid Khan
Browse files

Merge branch 'cmake' into 'master'

CMake

See merge request !1
parents a65ba9bc cd6498a5
project(SignalExtraction CXX)
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 11)
project(Fitting)
if(NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RELEASE)
endif()
add_executable(Fitting AliHFInvMassFitter.cxx)
if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
endif()
# in DEBUG mode make verbose Makefile
if (CMAKE_BUILD_TYPE MATCHES DEBUG)
set(CMAKE_VERBOSE_MAKEFILE ON)
endif ()
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -ggdb -g -DDEBUG -D__DEBUG -Wall -Wextra")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -ftree-vectorize -ffast-math -DNODEBUG")
message(STATUS "Using CXX flags for ${CMAKE_BUILD_TYPE}: ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}")
find_package(ROOT REQUIRED)
message(STATUS "Using ROOT: ${ROOT_VERSION} <${ROOT_CONFIG}>")
include_directories(${ROOT_INCLUDE_DIR} ${ROOT_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} src)
include(${ROOT_USE_FILE})
add_subdirectory(src)
add_subdirectory(macro)
\ No newline at end of file
#if !defined(__CINT__) || defined(__MAKECINT__)
#include <TMath.h>
#include <TFile.h>
#include <TCanvas.h>
#include <TH1F.h>
#include <TH2F.h>
#include <TStyle.h>
#include <TDatabasePDG.h>
#include <TTree.h>
#include "AliHFInvMassFitter.h"
#include "AliHFMassFitter.h"
#endif
enum {kGaus=0, kDoubleGaus};
Double_t minMassForFit=1.08;
Double_t maxMassForFit=2.0;
//const Int_t nPtBins=5;
//Double_t ptlims[nPtBins+1]={1.,2.,3.,5.,8.,12.};
//Int_t rebin[nPtBins]={2,2,1,1,2};
const Int_t nPtBins=15;
Double_t ptlims[nPtBins+1]={0.,3.};
Int_t rebin[nPtBins]={.2};
Int_t typeb=2;
Int_t types=kGaus;
void FitXicZerotoXiPiInvMass(TString fname, TString fNameOut=""){
TFile *f = TFile::Open(fname.Data());
if (!f) {
printf("ERROR: file %s does not exist",fname.Data());
return;
}
TCanvas *cInvMass[nPtBins];
for(int i=0; i<nPtBins; i++){
cInvMass[i]=new TCanvas(Form("c%d",i), Form("c%d",i));
cInvMass[i]->Divide(5,2);
}
float mass;
float pT;
float mva;
TBranch *mass;
TBranch *pT;
TBranch *b_mva;
TTree *t = (TTree*)f->Get("t1");
t->SetBranchAddress("mass", &mass, &mass);
t->SetBranchAddress("pT", &pT, &pT);
t->SetBranchAddress("MVA2", &mva, &b_mva);
TH2F *hMassVsPt[20];
for(int j =0; j<10; j++){
hMassVsPt[j] = new TH2F(Form("hMassVsPt%d",j),Form("hMassVsPt%d",j),80,2.468-0.2,2.468+0.2, 20, 0, 20);
for (Int_t i=0; i<t->GetEntries(); i++){
t->GetEntry(i);
if (mva>j/10.) hMassVsPt[j]->Fill(mass,pT);
}
}
TH1F** hMass=new TH1F*[nPtBins];
for(Int_t i=0;i<nPtBins;i++) {
hMass[i]=0x0;
}
AliHFInvMassFitter.h** fitter=new AliHFInvMassFitter.h*[10];
cout<< "1"<<endl;
Double_t sig,errsig,s,errs,b,errb;
Double_t mxicPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
for(int j =0; j<10; j++){
for (Int_t i=0; i<nPtBins; i++){
Printf("bin %d ", i);
Int_t ptminbin = hMassVsPt[j]->GetYaxis()->FindBin(ptlims[i]+0.0001);
Int_t ptmaxbin = hMassVsPt[j]->GetYaxis()->FindBin(ptlims[i+1]-0.0001);
Printf("====== pt limits %f %f , bins %d %d", ptlims[i],ptlims[i+1], ptminbin, ptmaxbin );
hMass[i]=(TH1F*)hMassVsPt[j]->ProjectionX(Form("projection_%d",i), ptminbin, ptmaxbin) ;
cInvMass[i]->cd(j+1);
hMass[i]->SetTitle(Form(" %0.0f < p_{T} < %0.0f GeV/c, MVA cut %f", ptlims[i],ptlims[i+1],j/10.));
hMass[i]->Rebin(rebin[i]);
hMass[i]->Sumw2();
//hMass[i]->Draw();
Int_t nMassBins=hMass[i]->GetNbinsX();
Double_t hmin=TMath::Max(minMassForFit,hMass[i]->GetBinLowEdge(2));
Double_t hmax=TMath::Min(maxMassForFit,hMass[i]->GetBinLowEdge(nMassBins-2)+hMass[i]->GetBinWidth(nMassBins-2));
cout<<"LIMITS FOR FITS = " << hmin << " " << hmax << endl;
fitter[i]=new AliHFMassFitter(hMass[i],hmin, hmax,1,typeb,types);
//
// fitter[i]->SetInitialGaussianMean(2.467);
fitter[i]->SetInitialGaussianMean(2.470);
// fitter[i]->SetFixGaussianSigma(0.010);
fitter[i]->SetInitialGaussianSigma(0.010);
Printf("mean = %f\n", fitter[i][j]->GetMean());
//Printf("mean = %f, sigma = %f \n", fitter[i]->GetMean(), fitter[i]->GetSigma());
//fitter[i]->SetInitialGaussianSigma(0.012);
Bool_t ok=fitter[i]->MassFitter(kFALSE);
if(ok){
fitter[i]->DrawHere(cInvMass[i]->cd(j+1),3,1);
}
else if(!ok) {
cout << ".........I am sorry" <<endl;
fitter[i]->GetHistoClone()->Draw();
}
// Double_t mass=fitter[i]->GetMean();
//Double_t massErr= fitter[i]->GetMeanUncertainty();
// Double_t sigma=fitter[i]->GetSigma();
// Double_t sigmaErr=fitter[i]->GetSigmaUncertainty();
//fitter[i]->DrawHere(gPad);
//fitter[i]->Signal(3,s,errs);
//fitter[i]->Background(3,b,errb);
//fitter[i]->Significance(3,sig,errsig);
}//loop on pt
}
if(fNameOut!=""){
//cInvMass->SaveAs(Form("%s.png",fNameOut.Data()));
}
}
include_directories(${CMAKE_SOURCE_DIR}/src)
add_executable(fit FitXicZerotoXiPiInvMass.C)
target_link_libraries(fit SignalExtraction ${ROOT_LIBRARIES} EG Minuit)
#if !defined(__CINT__) || defined(__MAKECINT__)
#include <TCanvas.h>
#include <TDatabasePDG.h>
#include <TFile.h>
#include <TH1F.h>
#include <TH2F.h>
#include <TMath.h>
#include <TStyle.h>
#include <TTree.h>
#include "AliHFInvMassFitter.h"
#include "AliHFMassFitter.h"
#endif
enum { kGaus = 0,
kDoubleGaus };
Double_t minMassForFit = 1.08;
Double_t maxMassForFit = 2.0;
//const Int_t nPtBins=5;
//Double_t ptlims[nPtBins+1]={1.,2.,3.,5.,8.,12.};
//Int_t rebin[nPtBins]={2,2,1,1,2};
const Int_t nPtBins = 15;
Double_t ptlims[nPtBins + 1] = {0., 3.};
Int_t rebin[nPtBins] = {2};
Int_t typeb = 2;
Int_t types = kGaus;
using std::cout;
using std::endl;
void FitXicZerotoXiPiInvMass(TString fname, TString fNameOut = "") {
TFile* f = TFile::Open(fname.Data());
if (!f) {
printf("ERROR: file %s does not exist", fname.Data());
return;
}
TCanvas* cInvMass[nPtBins];
for (int i = 0; i < nPtBins; i++) {
cInvMass[i] = new TCanvas(Form("c%d", i), Form("c%d", i));
cInvMass[i]->Divide(5, 2);
}
float mass;
float pT;
float mva;
TBranch* mass_branch;
TBranch* pT_branch;
TBranch* b_mva;
TTree* t = (TTree*) f->Get("t1");
t->SetBranchAddress("mass_branch", &mass, &mass_branch);
t->SetBranchAddress("pT_branch", &pT, &pT_branch);
t->SetBranchAddress("MVA2", &mva, &b_mva);
TH2F* hMassVsPt[20];
for (int j = 0; j < 10; j++) {
hMassVsPt[j] = new TH2F(Form("hMassVsPt%d", j), Form("hMassVsPt%d", j), 80, 2.468 - 0.2, 2.468 + 0.2, 20, 0, 20);
for (Int_t i = 0; i < t->GetEntries(); i++) {
t->GetEntry(i);
if (mva > j / 10.) hMassVsPt[j]->Fill(mass, pT);
}
}
TH1F** hMass = new TH1F*[nPtBins];
for (Int_t i = 0; i < nPtBins; i++) {
hMass[i] = 0x0;
}
AliHFMassFitter** fitter = new AliHFMassFitter*[10];
cout << "1" << endl;
Double_t sig, errsig, s, errs, b, errb;
Double_t mxicPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
for (int j = 0; j < 10; j++) {
for (Int_t i = 0; i < nPtBins; i++) {
Printf("bin %d ", i);
Int_t ptminbin = hMassVsPt[j]->GetYaxis()->FindBin(ptlims[i] + 0.0001);
Int_t ptmaxbin = hMassVsPt[j]->GetYaxis()->FindBin(ptlims[i + 1] - 0.0001);
Printf("====== pt limits %f %f , bins %d %d", ptlims[i], ptlims[i + 1], ptminbin, ptmaxbin);
hMass[i] = (TH1F*) hMassVsPt[j]->ProjectionX(Form("projection_%d", i), ptminbin, ptmaxbin);
cInvMass[i]->cd(j + 1);
hMass[i]->SetTitle(Form(" %0.0f < p_{T} < %0.0f GeV/c, MVA cut %f", ptlims[i], ptlims[i + 1], j / 10.));
hMass[i]->Rebin(rebin[i]);
hMass[i]->Sumw2();
//hMass[i]->Draw();
Int_t nMassBins = hMass[i]->GetNbinsX();
Double_t hmin = TMath::Max(minMassForFit, hMass[i]->GetBinLowEdge(2));
Double_t hmax = TMath::Min(maxMassForFit, hMass[i]->GetBinLowEdge(nMassBins - 2) + hMass[i]->GetBinWidth(nMassBins - 2));
cout << "LIMITS FOR FITS = " << hmin << " " << hmax << endl;
fitter[i] = new AliHFMassFitter(hMass[i], hmin, hmax, 1, typeb, types);
//
// fitter[i]->SetInitialGaussianMean(2.467);
fitter[i]->SetInitialGaussianMean(2.470);
// fitter[i]->SetFixGaussianSigma(0.010);
fitter[i]->SetInitialGaussianSigma(0.010);
Printf("mean = %f\n", fitter[i][j].GetMean());
//Printf("mean = %f, sigma = %f \n", fitter[i]->GetMean(), fitter[i]->GetSigma());
//fitter[i]->SetInitialGaussianSigma(0.012);
Bool_t ok = fitter[i]->MassFitter(kFALSE);
if (ok) {
fitter[i]->DrawHere(cInvMass[i]->cd(j + 1), 3, 1);
} else if (!ok) {
cout << ".........I am sorry" << endl;
fitter[i]->GetHistoClone()->Draw();
}
// Double_t mass_branch=fitter[i]->GetMean();
//Double_t massErr= fitter[i]->GetMeanUncertainty();
// Double_t sigma=fitter[i]->GetSigma();
// Double_t sigmaErr=fitter[i]->GetSigmaUncertainty();
//fitter[i]->DrawHere(gPad);
//fitter[i]->Signal(3,s,errs);
//fitter[i]->Background(3,b,errb);
//fitter[i]->Significance(3,sig,errsig);
}//loop on pt
}
if (fNameOut != "") {
//cInvMass->SaveAs(Form("%s.png",fNameOut.Data()));
}
}
int main() {
TString name = "";
FitXicZerotoXiPiInvMass(name);
return 0;
}
\ No newline at end of file
......@@ -22,6 +22,7 @@
#include <TStyle.h>
#include <TPaveText.h>
#include "AliHFInvMassFitter.h"
#include "AliVertexingHFUtils.h"
/// \cond CLASSIMP
ClassImp(AliHFInvMassFitter);
......@@ -973,26 +974,8 @@ void AliHFInvMassFitter::Significance(Double_t min, Double_t max, Double_t &sign
errsignificance=0;
return;
}
void ComputeSignificance(Double_t signal, Double_t errsignal, Double_t background, Double_t errbackground, Double_t &significance,Double_t &errsignificance){
/// calculate significance from S, B and errors
Double_t errSigSq=errsignal*errsignal;
Double_t errBkgSq=errbackground*errbackground;
Double_t sigPlusBkg=signal+background;
if(sigPlusBkg>0. && signal>0.){
significance = signal/TMath::Sqrt(signal+background);
errsignificance = significance*TMath::Sqrt((errSigSq+errBkgSq)/(4.*sigPlusBkg*sigPlusBkg)+(background/sigPlusBkg)*errSigSq/signal/signal);
}else{
significance=0.;
errsignificance=0.;
}
return;
}
ComputeSignificance(fRawYield,fRawYieldErr,background,errbackground,significance,errsignificance);
AliVertexingHFUtils::ComputeSignificance(fRawYield,fRawYieldErr,background,errbackground,significance,errsignificance);
return;
}
......
......@@ -16,10 +16,12 @@
#include <TNamed.h>
#include <TH1.h>
#include <TF1.h>
#include "AliLog.h"
class TF1;
class TH1F;
class TVirtualPad;
class AliHFInvMassFitter : public TNamed {
public:
......
This diff is collapsed.
#ifndef ALIHFMASSFITTER_H
#define ALIHFMASSFITTER_H
/* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
/////////////////////////////////////////////////////////////
///
/// \class AliHFMassFitter
/// \brief AliHFMassFitter for the fit of invariant mass distribution
/// of charmed mesons
///
/// \author Author: C.Bianchin, chiara.bianchin@pd.infn.it
/////////////////////////////////////////////////////////////
#include <TNamed.h>
#include <TString.h>
class TF1;
class TNtuple;
class TFile;
class TList;
class TH1F;
class TVirtualPad;
class TPaveText;
class AliHFMassFitter : public TNamed {
public:
enum ETypeOfBkg{ kExpo=0, kLin=1, kPol2=2, kNoBk=3, kPow=4, kPowEx=5 };
enum ETypeOfSgn{ kGaus=0, k2Gaus=1 };
AliHFMassFitter();
AliHFMassFitter(const TH1F* histoToFit, Double_t minvalue, Double_t maxvalue, Int_t rebin=1, Int_t fittypeb=kExpo, Int_t fittypes=kGaus);
virtual ~AliHFMassFitter();
AliHFMassFitter(const AliHFMassFitter &mfit);
AliHFMassFitter& operator=(const AliHFMassFitter &mfit);
/// setters
void SetHisto(const TH1F *histoToFit);
void SetRangeFit(Double_t minvalue, Double_t maxvalue){fminMass=minvalue; fmaxMass=maxvalue; CheckRangeFit();}
void SetMinRangeFit(Double_t minvalue){fminMass=minvalue;printf("CheckRangeFit after SetMaxRangeFit is also set\n");}
void SetMaxRangeFit(Double_t maxvalue){fmaxMass=maxvalue;printf("CheckRangeFit after SetMinRangeFit is also set\n");}
void SetBinN(Int_t newbinN){fNbin=newbinN;}
void SetType(Int_t fittypeb, Int_t fittypes);
void SetReflectionSigmaFactor(Int_t constant) {ffactor=constant;}
void SetInitialGaussianMean(Double_t mean) {fMass=mean;} /// change the default value of the mean
void SetInitialGaussianSigma(Double_t sigma) {fSigmaSgn=sigma;} /// change the default value of the sigma
void SetSideBands(Bool_t onlysidebands=kTRUE) {fSideBands=onlysidebands;} /// consider only side bands
void SetFixParam(Bool_t *fixpar){fFixPar=fixpar;}
virtual void SetDefaultFixParam();
virtual Bool_t SetFixThisParam(Int_t thispar,Bool_t fixpar);
virtual void SetFixGaussianMean(Double_t mean=1.865,Bool_t fixpar=kTRUE){SetInitialGaussianMean(mean); SetFixThisParam(fNFinalPars-2,fixpar);}
virtual void SetFixGaussianSigma(Double_t sigma=0.012, Bool_t fixpar=kTRUE){SetInitialGaussianSigma(sigma); SetFixThisParam(fNFinalPars-1,fixpar);}
//getters
TH1F* GetHistoClone() const; /// return the histogram
void GetRangeFit(Double_t &minvalue, Double_t &maxvalue) const {minvalue=fminMass; maxvalue=fmaxMass;}
Double_t GetMinRangeFit()const {return fminMass;}
Double_t GetMaxRangeFit()const {return fmaxMass;}
Int_t GetBinN() const {return fNbin;}
void GetFitPars(Float_t* pars) const;
Int_t GetNFinalPars() const {return fNFinalPars;}
void GetTypeOfFit(Bool_t &background, Int_t &typeb) const {background = fWithBkg; typeb = ftypeOfFit4Bkg;}
Int_t GetReflectionSigmaFactor() const {return ffactor;}
Double_t GetMean() const {return fMass;}
Double_t GetMeanUncertainty() const {return fMassErr;}
Double_t GetSigma()const {return fSigmaSgn;}
Double_t GetSigmaUncertainty()const { return fSigmaSgnErr;}
Double_t GetRawYield()const {return fRawYield;}
Double_t GetRawYieldError()const {return fRawYieldErr;}
Double_t GetChiSquare() const;
Double_t GetBkgChiSquare();
Double_t GetReducedChiSquare() const;
Double_t GetBkgReducedChiSquare();
Double_t GetFitProbability() const;
void GetSideBandsBounds(Int_t& lb, Int_t& hb) const;
Bool_t* GetFixParam()const {return fFixPar;}
Bool_t GetFixThisParam(Int_t thispar)const;
virtual TH1F* GetAllRangeResidualsAndPulls(Double_t minrange=0,Double_t maxrange=-1,TH1 *hPulls=0x0,TH1 *hResidualTrend=0x0,TH1 *hPullsTrend=0x0);
virtual TH1F* GetOverBackgroundResidualsAndPulls(Double_t minrange=0,Double_t maxrange=-1,TH1 *hPulls=0x0,TH1 *hResidualTrend=0x0,TH1 *hPullsTrend=0x0);
TH1F* GetResidualsAndPulls(TH1 *h,TF1 *f,Double_t minrange=0,Double_t maxrange=-1,TH1 *hPulls=0x0,TH1 *hResidualTrend=0x0,TH1 *hPullsTrend=0x0);
virtual TPaveText* GetYieldBox(Double_t nsigma=3.);
virtual TPaveText* GetFitParametersBox(Double_t nsigma=3.,Int_t mode=0);
TVirtualPad* GetPad(Double_t nsigma=3,Int_t writeFitInfo=1)const;
void PrintParTitles() const;
void InitNtuParam(TString ntuname="ntupar"); /// initialize TNtuple to store the parameters
void FillNtuParam(); //Fill the TNtuple with the current parameters
TNtuple* GetNtuParam() const {return fntuParam;} /// return the TNtuple
TNtuple* NtuParamOneShot(TString ntuname="ntupar"); /// the three functions above all together
void WriteHisto(TString path="./") const; /// write the histogram
void WriteNtuple(TString path="./") const; /// write the TNtuple
virtual void WriteCanvas(TString userIDstring="",TString path="./",Double_t nsigma=3,Int_t writeFitInfo=1,Bool_t draw=kFALSE) const; /// write the canvas in a root file
void DrawHere(TVirtualPad* pd,Double_t nsigma=3,Int_t writeFitInfo=1) const;
void DrawFit(Double_t nsigma=3) const;
void Reset();
virtual void IntS(Float_t *valuewitherror) const; /// integral of signal given my the fit with error
virtual Double_t IntTot() const {return fhistoInvMass->Integral("width");} /// return total integral of the histogram
virtual void Signal(Double_t nOfSigma,Double_t &signal,Double_t &errsignal) const; /// signal in nsigma with error
virtual void Signal(Double_t min,Double_t max,Double_t &signal,Double_t &errsignal) const; /// signal in (min, max) with error
virtual void Background(Double_t nOfSigma,Double_t &background,Double_t &errbackground) const; /// backgournd in nsigma with error
virtual void Background(Double_t min,Double_t max,Double_t &background,Double_t &errbackground) const; /// backgournd in (min, max) with error
void Significance(Double_t nOfSigma,Double_t &significance,Double_t &errsignificance) const; /// significance in nsigma with error
void Significance(Double_t min,Double_t max,Double_t &significance,Double_t &errsignificance) const; /// significance in (min, max) with error
virtual Double_t FitFunction4MassDistr (Double_t* x, Double_t* par);
virtual Double_t FitFunction4Sgn (Double_t* x, Double_t* par);
virtual Double_t FitFunction4Bkg (Double_t* x, Double_t* par);
virtual Bool_t MassFitter(Bool_t draw=kTRUE);
virtual Bool_t RefitWithBkgOnly(Bool_t draw=kTRUE);
void RebinMass(Int_t bingroup=1);
TF1* GetBackgroundFullRangeFunc(){
return fhistoInvMass->GetFunction("funcbkgFullRange");
}
TF1* GetBackgroundRecalcFunc(){
return fhistoInvMass->GetFunction("funcbkgRecalc");
}
TF1* GetMassFunc(){
return fhistoInvMass->GetFunction("funcmass");
}
void SetUseLikelihoodFit(){fFitOption="L,E";}
void SetUseLikelihoodWithWeightsFit(){fFitOption="WL,E";}
void SetUseChi2Fit(){fFitOption="E";}
void SetFitOption(TString opt){fFitOption=opt.Data();};
protected:
virtual void PlotFit(TVirtualPad* pd,Double_t nsigma=3,Int_t writeFitInfo=1)const;
virtual void ComputeParSize();
virtual void ComputeNFinalPars();
Bool_t SideBandsBounds();
virtual Bool_t CheckRangeFit();
virtual void AddFunctionsToHisto();
TH1F* fhistoInvMass; /// histogram to fit
Double_t fminMass; /// lower mass limit
Double_t fmaxMass; /// upper mass limit
Int_t fminBinMass; /// bin corresponding to fminMass
Int_t fmaxBinMass; /// bin corresponding to fmaxMass
Int_t fNbin; /// number of bins
Int_t fParsSize; /// size of fFitPars array
Int_t fNFinalPars; /// number of parameters of the final function
Float_t* fFitPars; //[fParsSize] array of fit parameters
Bool_t fWithBkg; /// signal+background (kTRUE) or signal only (kFALSE)
Int_t ftypeOfFit4Bkg; /// 0 = exponential; 1 = linear; 2 = pol2
Int_t ftypeOfFit4Sgn; /// 0 = gaus; 1 = gaus+gaus broadened
Int_t ffactor; /// number to multiply to the sigma of the signal to obtain the reflected gaussian
TNtuple* fntuParam; /// contains fit parameters
Double_t fMass; /// signal gaussian mean value
Double_t fMassErr; /// err signal gaussian mean value
Double_t fSigmaSgn; /// signal gaussian sigma
Double_t fSigmaSgnErr; /// err signal gaussian sigma
Double_t fRawYield; /// signal gaussian integral
Double_t fRawYieldErr; /// err on signal gaussian integral
Bool_t fSideBands; /// kTRUE = only side bands considered
Bool_t* fFixPar; //[fNFinalPars] for each par if kTRUE it is fixed in fit
Int_t fSideBandl; /// left side band limit (bin number)
Int_t fSideBandr; /// right side band limit (bin number)
Int_t fcounter; /// internal counter
Int_t fNpfits; /// Number of points used in the fit
TString fFitOption; /// L, LW or Chi2
TList* fContourGraph; /// TList of TGraph containing contour plots
/// \cond CLASSIMP
ClassDef(AliHFMassFitter,9); /// class for invariant mass fit
/// \endcond
};
#endif
This diff is collapsed.
This diff is collapsed.
#ifndef SIGNALEXTRACTION_SRC_ALIVERTEXINGHFUTILS_H_
#define SIGNALEXTRACTION_SRC_ALIVERTEXINGHFUTILS_H_
namespace AliVertexingHFUtils{
//______________________________________________________________________
inline void ComputeSignificance(Double_t signal,
Double_t errsignal,
Double_t background,
Double_t errbackground,
Double_t& significance,
Double_t& errsignificance) {
/// calculate significance from S, B and errors
Double_t errSigSq=errsignal*errsignal;
Double_t errBkgSq=errbackground*errbackground;
Double_t sigPlusBkg=signal+background;
if(sigPlusBkg>0. && signal>0.){
significance = signal/TMath::Sqrt(signal+background);
errsignificance = significance*TMath::Sqrt((errSigSq+errBkgSq)/(4.*sigPlusBkg*sigPlusBkg)+(background/sigPlusBkg)*errSigSq/signal/signal);
}else{
significance=0.;
errsignificance=0.;
}
return;
}
}
#endif //SIGNALEXTRACTION_SRC_ALIVERTEXINGHFUTILS_H_
set(SOURCES AliHFInvMassFitter.cxx AliHFMassFitter.cxx AliLog.cxx)
string(REPLACE ".cxx" ".h" HEADERS "${SOURCES}")
list(APPEND HEADERS "AliVertexingHFUtils.h")
add_library(SignalExtraction SHARED ${SOURCES} G__SignalExtraction.cxx)
ROOT_GENERATE_DICTIONARY(G__SignalExtraction ${HEADERS} LINKDEF SignalExtractionLinkDef.h)
target_link_libraries(SignalExtraction ${ROOT_LIBRARIES})
#ifdef __CINT__
#pragma link off all globals;