2 /**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * Authors: Øystein Djuvsland <oysteind@ift.uib.no> *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 #include "AliHLTPHOSPhysicsAnalyzerPeakFitter.h"
24 ClassImp(AliHLTPHOSPhysicsAnalyzerPeakFitter);
26 AliHLTPHOSPhysicsAnalyzerPeakFitter::AliHLTPHOSPhysicsAnalyzerPeakFitter() : fGainLow(80), fGainHigh(5),
32 AliHLTPHOSPhysicsAnalyzerPeakFitter::~AliHLTPHOSPhysicsAnalyzerPeakFitter()
37 AliHLTPHOSPhysicsAnalyzerPeakFitter::AliHLTPHOSPhysicsAnalyzerPeakFitter(const AliHLTPHOSPhysicsAnalyzerPeakFitter&): fGainLow(80), fGainHigh(5),
45 AliHLTPHOSPhysicsAnalyzerPeakFitter::FitGaussian()
49 Int_t maxBin = fRootHistPtr->GetMaximumBin();
50 Float_t binWidth = fRootHistPtr->GetBinWidth(maxBin);
51 Float_t maxBinValue = (Float_t)(maxBin * binWidth);
52 Float_t lowRange = maxBinValue - 0.03;
53 Float_t highRange = maxBinValue + 0.03;
55 TF1* gaussian = new TF1("gaussian", "gaus", 0.1, 0.2);
57 fRootHistPtr->Fit(gaussian->GetName(), "", "",lowRange, highRange);
64 AliHLTPHOSPhysicsAnalyzerPeakFitter::FitLorentzian()
67 Int_t maxBin = fRootHistPtr->GetMaximumBin();
68 Float_t binWidth = fRootHistPtr->GetBinWidth(maxBin);
69 Float_t maxBinValue = (Float_t)(maxBin * binWidth);
70 Double_t lowRange = maxBinValue - 0.03;
71 Double_t highRange = maxBinValue + 0.03;
73 char* name = "lorentzian";
75 TF1* lorentzian = new TF1(name, "([0]*1/TMath::Pi())*[1]/((x[0]-[2])*(x[0]-[2])+[1]*[1])", lowRange, highRange);
77 Double_t params[3] = {fRootHistPtr->GetBinContent(maxBin)/20, 0.01, 0.135};
78 lorentzian->SetParameters(params);
80 fRootHistPtr->Fit(lorentzian->GetName(), "", "", lowRange, highRange);
82 lorentzian->GetParameters(params);
84 TFile *outfile = new TFile("/afsuser/odjuvsland","recreate");
85 fRootHistPtr->Write();