26 #include <Math/MinimizerOptions.h> 52 fTf1->SetParameters(10.,5.);
53 fTf1->SetParNames(
"amp",
"t0");
54 ROOT::Math::MinimizerOptions::SetDefaultStrategy(0);
74 UInt_t altrocfg1, UInt_t altrocfg2 )
76 Float_t pedEstimate = 0;
81 Float_t ampEstimate = 0;
82 short timeEstimate = 0;
87 Bool_t fitDone = kFALSE;
90 maxADC, timeEstimate, pedEstimate, first, last, (
int)
fAmpCut );
93 if (ampEstimate >= fAmpCut )
96 Int_t timebinOffset = bunchlist.at(bunchIndex).GetStartBin() - (bunchlist.at(bunchIndex).GetLength()-1);
101 FitRaw(first, last, amp, time, chi2, fitDone);
102 time += timebinOffset;
103 timeEstimate += timebinOffset;
109 Float_t ampAsymm = (amp - ampEstimate)/(amp + ampEstimate);
110 Float_t timeDiff = time - timeEstimate;
112 if ( (TMath::Abs(ampAsymm) > 0.1) || (TMath::Abs(timeDiff) > 2) )
124 amp += (0.5 - gRandom->Rndm());
141 Float_t & amp, Float_t & time, Float_t &
chi2, Bool_t & fitDone)
const 151 Int_t nsamples = lastTimeBin - firstTimeBin + 1;
153 if ( nsamples < 3 )
return;
156 for (
int i=0; i<nsamples; i++)
158 Int_t timebin = firstTimeBin + i;
163 fTf1->SetRange(lastTimeBin, firstTimeBin);
164 fTf1->SetParameter(1, time);
165 fTf1->SetParameter(0, amp);
166 fTf1->SetParLimits(0, 0.5*amp, 2*amp );
167 fTf1->SetParLimits(1, time - 4, time + 4);
172 amp =
fTf1->GetParameter(0);
173 time =
fTf1->GetParameter(1);
174 chi2 =
fTf1->GetChisquare();
178 catch (
const std::exception & e)
180 AliError( Form(
"TH1 Fit exception %s", e.what()) );
194 Double_t signal = 0.;
195 Double_t xx = ( x[0] - par[1] +
TAU ) /
TAU;
198 signal = par[0] * TMath::Power(xx ,
ORDER) * TMath::Exp(
ORDER * (1 - xx )) ;
Raw data fitting: standard TMinuit fit.
Float_t fAmpCut
Max ADC - pedestal must be higher than this befor attemting to extract the amplitude.
virtual ~AliCaloRawAnalyzerKStandardFast()
Destructor.
void FitRaw(Int_t firstTimeBin, Int_t lastTimeBin, Float_t &, Float_t &time, Float_t &chi2, Bool_t &fitDone) const
Fits the raw signal time distribution.
AliCaloRawAnalyzerKStandardFast()
Constructor.
const double TIMEBINWITH
each sample is 100 ns
Container class to hold results from fitting.
const double TAU
Approximate shaping time.
TGraph * fSignal
histogram for signal that will be fit
Raw data fitters base class.
Algo::fitAlgorithm fAlgo
Which algorithm to use.
Double_t GetReversed(const int i) const
int PreFitEvaluateSamples(const std::vector< AliCaloBunchInfo > &bunchvector, UInt_t altrocfg1, UInt_t altrocfg2, Int_t &index, Float_t &maxf, short &maxamp, short &maxampindex, Float_t &ped, int &first, int &last, int acut)
Method to do the selection of what should possibly be fitted.
TF1 * fTf1
Analytical formula of the Semi Gaussian to be fitted.
const int ORDER
Order of shaping stages of the signal conditioning unit.
static Double_t RawResponseFunction(Double_t *x, Double_t *par)
Approximate response function of the EMCal electronics. Simplified version, adapted from AliEMCALRawR...
Double_t fL1Phase
Phase of the ADC sampling clock relative to the LHC clock.
const int TIMEBINS
number of sampling bins of the raw RO signal (we typically use 15-50; max is 1k+) ...
virtual AliCaloFitResults Evaluate(const std::vector< AliCaloBunchInfo > &bunchvector, UInt_t altrocfg1, UInt_t altrocfg2)
Evaluation Amplitude and TOF.
#define AliError(message)
const int OVERFLOWCUT
sample overflow