calculate mean starting from fStartTime, if fStartTime > 0.
This commit is contained in:
parent
6ac3cdd798
commit
18564964fa
@ -99,7 +99,6 @@ PFourier::PFourier(TH1F *data, Int_t unitTag, Double_t startTime, Double_t endTi
|
|||||||
|
|
||||||
// calculate start and end bin
|
// calculate start and end bin
|
||||||
fNoOfData = (UInt_t)((fEndTime-fStartTime)/fTimeResolution);
|
fNoOfData = (UInt_t)((fEndTime-fStartTime)/fTimeResolution);
|
||||||
cout << "debug> fNoOfData=" << fNoOfData << endl;
|
|
||||||
|
|
||||||
// check if zero padding is whished
|
// check if zero padding is whished
|
||||||
if (fZeroPaddingPower > 0) {
|
if (fZeroPaddingPower > 0) {
|
||||||
@ -554,22 +553,27 @@ TH1F* PFourier::GetPhaseFourier(const Double_t scale)
|
|||||||
void PFourier::PrepareFFTwInputData(UInt_t apodizationTag)
|
void PFourier::PrepareFFTwInputData(UInt_t apodizationTag)
|
||||||
{
|
{
|
||||||
// 1st find t==0. fData start at times t<0!!
|
// 1st find t==0. fData start at times t<0!!
|
||||||
UInt_t t0bin = -1;
|
Int_t t0bin = -1;
|
||||||
for (Int_t i=1; i<fData->GetNbinsX(); i++) {
|
for (Int_t i=1; i<fData->GetNbinsX(); i++) {
|
||||||
if (fData->GetBinCenter(i) >= 0.0) {
|
if (fData->GetBinCenter(i) >= 0.0) {
|
||||||
t0bin = i;
|
t0bin = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cout << "debug> t0bin=" << t0bin << ", fNoOfData=" << fNoOfData << ", fNoOfBins=" << fNoOfBins << endl;
|
|
||||||
|
// find the bin of the start time
|
||||||
|
Int_t ival = static_cast<Int_t>(fStartTime/fTimeResolution) + t0bin;
|
||||||
|
UInt_t start = 1;
|
||||||
|
if (ival > 0) { // start time > 0
|
||||||
|
start = static_cast<UInt_t>(ival);
|
||||||
|
}
|
||||||
|
|
||||||
Double_t mean = 0.0;
|
Double_t mean = 0.0;
|
||||||
if (fDCCorrected) {
|
if (fDCCorrected) {
|
||||||
for (UInt_t i=t0bin; i<fNoOfData; i++) {
|
for (UInt_t i=start; i<fNoOfData; i++) {
|
||||||
mean += fData->GetBinContent(i);
|
mean += fData->GetBinContent(i);
|
||||||
}
|
}
|
||||||
mean /= (Double_t)(fNoOfData-t0bin);
|
mean /= (Double_t)(fNoOfData-start);
|
||||||
cout << "debug> mean=" << mean << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2nd fill fIn
|
// 2nd fill fIn
|
||||||
|
Loading…
x
Reference in New Issue
Block a user