}
// Mean Statistic
if (fNumberFit > 0) {
- AliInfo(Form("There are %d with at least one entries. %d fits have been proceeded (sucessfully or not...). There is a mean statistic of: %d over these fitted histograms and %d successfulled fits",fNumberEnt, fNumberFit, (Int_t) fStatisticMean/fNumberFit, fNumberFitSuccess));
+ AliInfo(Form("There are %d with at least one entries. %d fits have been proceeded (sucessfully or not...). There is a mean statistic of: %f over these fitted histograms and %d successfulled fits",fNumberEnt, fNumberFit, (Double_t) (fStatisticMean/fNumberFit), fNumberFitSuccess));
fStatisticMean = fStatisticMean / fNumberFit;
}
else {
}
// Mean Statistics
if (fNumberFit > 0) {
- AliInfo(Form("There are %d with at least one entries. %d fits have been proceeded (sucessfully or not...). There is a mean statistic of: %d over these fitted histograms and %d successfulled fits",fNumberEnt, fNumberFit, (Int_t) fStatisticMean/fNumberFit, fNumberFitSuccess));
+ AliInfo(Form("There are %d with at least one entries. %d fits have been proceeded (sucessfully or not...). There is a mean statistic of: %f over these fitted histograms and %d successfulled fits",fNumberEnt, fNumberFit, (Double_t) (fStatisticMean/fNumberFit), fNumberFitSuccess));
fStatisticMean = fStatisticMean / fNumberFit;
}
else {
// Mean Statistic
if (fNumberFit > 0) {
- AliInfo(Form("There are %d with at least one entries. %d fits have been proceeded (sucessfully or not...). There is a mean statistic of: %d over these fitted histograms and %d successfulled fits",fNumberEnt, fNumberFit, (Int_t) fStatisticMean/fNumberFit,fNumberFitSuccess));
+ AliInfo(Form("There are %d with at least one entries. %d fits have been proceeded (sucessfully or not...). There is a mean statistic of: %f over these fitted histograms and %d successfulled fits",fNumberEnt, fNumberFit, (Double_t) (fStatisticMean/fNumberFit),fNumberFitSuccess));
fStatisticMean = fStatisticMean / fNumberFit;
}
else {
} // Boucle object
// Mean Statistic
if (fNumberFit > 0) {
- AliInfo(Form("There are %d with at least one entries. %d fits have been proceeded (sucessfully or not...). There is a mean statistic of: %d over these fitted histograms and %d successfulled fits",fNumberEnt, fNumberFit, (Int_t) fStatisticMean/fNumberFit,fNumberFitSuccess));
+ AliInfo(Form("There are %d with at least one entries. %d fits have been proceeded (sucessfully or not...). There is a mean statistic of: %f over these fitted histograms and %d successfulled fits",fNumberEnt, fNumberFit, (Double_t) (fStatisticMean/fNumberFit),fNumberFitSuccess));
fStatisticMean = fStatisticMean / fNumberFit;
}
else {
if (fNumberFit > 0) {
AliInfo(Form("There are %d with at least one entries.",fNumberEnt));
AliInfo(Form("%d fits have been proceeded (sucessfully or not...).",fNumberFit));
- AliInfo(Form("There is a mean statistic of: %d over these fitted histograms and %d successfulled fits"
- ,(Int_t) fStatisticMean/fNumberFit,fNumberFitSuccess));
+ AliInfo(Form("There is a mean statistic of: %f over these fitted histograms and %d successfulled fits"
+ ,(Double_t) (fStatisticMean/fNumberFit),fNumberFitSuccess));
fStatisticMean = fStatisticMean / fNumberFit;
}
else {
if (fNumberFit > 0) {
AliInfo(Form("There are %d with at least one entries.",fNumberEnt));
AliInfo(Form("%d fits have been proceeded (sucessfully or not...).",fNumberFit));
- AliInfo(Form("There is a mean statistic of: %d over these fitted histograms and %d successfulled fits"
- ,(Int_t) fStatisticMean/fNumberFit,fNumberFitSuccess));
+ AliInfo(Form("There is a mean statistic of: %f over these fitted histograms and %d successfulled fits"
+ ,(Double_t) (fStatisticMean/fNumberFit),fNumberFitSuccess));
fStatisticMean = fStatisticMean / fNumberFit;
}
else {
} // Boucle object
// Mean Statistics
if (fNumberFit > 0) {
- AliInfo(Form("There are %d with at least one entries. %d fits have been proceeded (sucessfully or not...). There is a mean statistic of: %d over these fitted histograms and %d successfulled fits",fNumberEnt, fNumberFit, (Int_t) fStatisticMean/fNumberFit,fNumberFitSuccess));
+ AliInfo(Form("There are %d with at least one entries. %d fits have been proceeded (sucessfully or not...). There is a mean statistic of: %f over these fitted histograms and %d successfulled fits",fNumberEnt, fNumberFit, (Double_t) (fStatisticMean/fNumberFit),fNumberFitSuccess));
}
else {
AliInfo(Form("There are %d with at least one entries. There is no fit!",fNumberEnt));
} // Boucle object
// Mean Statistics
if (fNumberFit > 0) {
- AliInfo(Form("There are %d with at least one entries. %d fits have been proceeded (sucessfully or not...). There is a mean statistic of: %d over these fitted histograms and %d successfulled fits",fNumberEnt, fNumberFit, (Int_t) fStatisticMean/fNumberFit,fNumberFitSuccess));
+ AliInfo(Form("There are %d with at least one entries. %d fits have been proceeded (sucessfully or not...). There is a mean statistic of: %f over these fitted histograms and %d successfulled fits",fNumberEnt, fNumberFit, (Double_t) (fStatisticMean/fNumberFit),fNumberFitSuccess));
}
else {
AliInfo(Form("There are %d with at least one entries. There is no fit!",fNumberEnt));
// Take the result
TVectorD param(2);
TVectorD error(3);
- fEntriesCurrent = 0;
+ Double_t entriesCurrent = 0;
fCountDet = idet;
Bool_t here = calivdli->GetParam(idet,¶m);
Bool_t heree = calivdli->GetError(idet,&error);
//printf("here %d and heree %d\n",here, heree);
if(heree) {
- fEntriesCurrent = (Int_t) error[2];
+ entriesCurrent = error[2];
fNumberEnt++;
}
//printf("Number of entries %d\n",fEntriesCurrent);
// Nothing found or not enough statistic
- if((!heree) || (!here) || (fEntriesCurrent <= fMinEntries)) {
+ if((!heree) || (!here) || (entriesCurrent <= fMinEntries)) {
NotEnoughStatisticLinearFitter();
continue;
}
//error.Print();
//Statistics
fNumberFit++;
- fStatisticMean += fEntriesCurrent;
+ fStatisticMean += entriesCurrent;
// Check the fit
- if((-(param[1])) <= 0.0) {
+ if((-(param[1])) <= 0.000001) {
NotEnoughStatisticLinearFitter();
continue;
}
}
// Mean Statistics
if (fNumberFit > 0) {
- AliInfo(Form("There are %d with at least one entries. %d fits have been proceeded (sucessfully or not...). There is a mean statistic of: %d over these fitted histograms and %d successfulled fits",fNumberEnt, fNumberFit, (Int_t) fStatisticMean/fNumberFit,fNumberFitSuccess));
+ AliInfo(Form("There are %d with at least one entries. %d fits have been proceeded (sucessfully or not...). There is a mean statistic of: %f over these fitted histograms and %d successfulled fits",fNumberEnt, fNumberFit, (Double_t) (fStatisticMean/fNumberFit),fNumberFitSuccess));
}
else {
AliInfo(Form("There are %d with at least one entries. There is no fit!",fNumberEnt));
// Take the result
TVectorD param(3);
TVectorD error(3);
- fEntriesCurrent = 0;
+ Double_t entriesCurrent = 0;
fCountDet = idet;
Bool_t here = calivdli->GetParam(idet,¶m);
Bool_t heree = calivdli->GetError(idet,&error);
//printf("here %d and heree %d\n",here, heree);
if(heree) {
- fEntriesCurrent = (Int_t) error[2];
+ entriesCurrent = error[2];
fNumberEnt++;
}
//printf("Number of entries %d\n",fEntriesCurrent);
// Nothing found or not enough statistic
- if((!heree) || (!here) || (fEntriesCurrent <= fMinEntries)) {
+ if((!heree) || (!here) || (entriesCurrent <= fMinEntries)) {
NotEnoughStatisticExbAlt();
continue;
}
//error.Print();
//Statistics
fNumberFit++;
- fStatisticMean += fEntriesCurrent;
+ fStatisticMean += entriesCurrent;
// Statistics
fNumberFitSuccess ++;
}
// Mean Statistics
if (fNumberFit > 0) {
- AliInfo(Form("There are %d with at least one entries. %d fits have been proceeded (sucessfully or not...). There is a mean statistic of: %d over these fitted histograms and %d successfulled fits",fNumberEnt, fNumberFit, (Int_t) fStatisticMean/fNumberFit,fNumberFitSuccess));
+ AliInfo(Form("There are %d with at least one entries. %d fits have been proceeded (sucessfully or not...). There is a mean statistic of: %f over these fitted histograms and %d successfulled fits",fNumberEnt, fNumberFit, (Double_t) (fStatisticMean/fNumberFit),fNumberFitSuccess));
}
else {
AliInfo(Form("There are %d with at least one entries. There is no fit!",fNumberEnt));
// Fit
- Int_t entries = 0;
+ Double_t entries = 0;
TAxis *xaxis = linearfitterhisto->GetXaxis();
TAxis *yaxis = linearfitterhisto->GetYaxis();
TLinearFitter linearfitter = TLinearFitter(2,"pol1");
for(Int_t k = 0; k < (Int_t)linearfitterhisto->GetBinContent(ibinx+1,ibiny+1); k++){
if(!securitybreaking){
linearfitter.AddPoint(&x,y);
- entries++;
+ entries = entries+1.;
}
else {
- if(entries< 1198){
+ if(entries< 1198.0){
linearfitter.AddPoint(&x,y);
- entries++;
+ entries = entries + 1.;
}
}
}
// Put the fCurrentCoef
fCurrentCoef[0] = -par[1];
// here the database must be the one of the reconstruction for the lorentz angle....
- if(fCurrentCoef[0] > 0.0) fCurrentCoef2[0] = (par[0]+meanvdriftused*meanexbused)/fCurrentCoef[0];
+ if(fCurrentCoef[0] > 0.00001) fCurrentCoef2[0] = (par[0]+meanvdriftused*meanexbused)/fCurrentCoef[0];
else fCurrentCoef2[0] = 100.0;
}
// Initialisation
////////////////////////
Double_t meanAll = 0.0;
- Double_t rmsAll = 0.0;
- Int_t countAll = 0;
- ////////////
+ Double_t rmsAll = 0.0;
+ Int_t countAll = 0;
+ ////////////
// compute
////////////
for (Int_t k = 0; k < loop; k++) {
Bool_t put = kTRUE;
+ ///////////////////////////////
// Beginning of the signal
+ //////////////////////////////
TH1D *pentea = new TH1D("pentea","pentea",projPH->GetNbinsX(),0,(Float_t) limit);
for (Int_t k = 1; k < projPH->GetNbinsX(); k++) {
pentea->SetBinContent(k,(Double_t) (projPH->GetBinContent(k+1) - projPH->GetBinContent(k)));
fPhd[0] = placemaximum;
}
+ /////////////////////////////
// Amplification region
+ /////////////////////////////
binmax = 0;
ju = 0;
for (Int_t kbin = 1; kbin < projPH->GetNbinsX(); kbin ++) {
}
fPhd[1] = placemaximum;
}
-
+
+ //////////////////
// Drift region
+ //////////////////
+ Bool_t putd = kTRUE;
TH1D *pente = new TH1D("pente","pente", projPH->GetNbinsX(),0,(Float_t) limit);
for (Int_t k = TMath::Min(binmax+4, projPH->GetNbinsX()); k < projPH->GetNbinsX(); k++) {
pente->SetBinContent(k,(Double_t) (projPH->GetBinContent(k+1) - projPH->GetBinContent(k)));
//should not happen
if (binmin <= 1) {
binmin = 2;
- put = 1;
+ putd = 1;
//AliInfo("Put the binmax from 1 to 2 to enable the fit");
}
//check
if((projPH->GetBinContent(binmin)-projPH->GetBinError(binmin)) < (projPH->GetBinContent(binmin+1))) {
//AliInfo("Too many fluctuations at the end!");
- put = kFALSE;
+ putd = kFALSE;
}
if((projPH->GetBinContent(binmin)+projPH->GetBinError(binmin)) > (projPH->GetBinContent(binmin-1))) {
//AliInfo("Too many fluctuations at the end!");
- put = kFALSE;
+ putd = kFALSE;
}
if(TMath::Abs(pente->GetBinContent(binmin+1)) <= 0.0000000000001){
//AliInfo("No entries for the next bin!");
if((pente->GetBinContent(binmin+2) <= pente->GetBinContent(binmin+1)) &&
(pente->GetBinContent(binmin-2) <= pente->GetBinContent(binmin-1))) {
//AliInfo("polynome 4 false 1");
- put = kFALSE;
+ putd = kFALSE;
}
if(((binmin+3) <= (nbins-1)) &&
(pente->GetBinContent(binmin+3) <= pente->GetBinContent(binmin+2)) &&
((binmin-3) >= TMath::Min(binmax+4, projPH->GetNbinsX())) &&
(pente->GetBinContent(binmin-3) <= pente->GetBinContent(binmin-2))) {
//AliInfo("polynome 4 false 2");
- put = kFALSE;
+ putd = kFALSE;
}
// poly 3
if((pente->GetBinContent(binmin+2) <= pente->GetBinContent(binmin+1)) &&
//richtung +
if((pente->GetBinContent(binmin+2) <= pente->GetBinContent(binmin+1))) {
//AliInfo("polynome 2+ false");
- put = kFALSE;
+ putd = kFALSE;
}
}
//pol2 case 2
//richtung -
if((pente->GetBinContent(binmin-2) <= pente->GetBinContent(binmin-1))) {
//AliInfo("polynome 2- false ");
- put = kFALSE;
+ putd = kFALSE;
}
}
if((binmin == (nbins-1)) && ((binmin-2) < TMath::Min(binmax+4, projPH->GetNbinsX()))) {
- put = kFALSE;
+ putd = kFALSE;
//AliInfo("At the limit for the drift and not usable!");
}
//pass
if((binmin == (nbins-2)) && ((binmin-1) < TMath::Min(binmax+4, projPH->GetNbinsX()))){
- put = kFALSE;
+ putd = kFALSE;
//AliInfo("For the drift...problem!");
}
//pass but should not happen
if((binmin <= (nbins-3)) && (binmin < TMath::Min(binmax+6, projPH->GetNbinsX()))){
- put = kFALSE;
+ putd = kFALSE;
//AliInfo("For the drift...problem!");
}
- if(put) {
+ if(putd) {
polynome = new TF1("pol","[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x",min,max);
polynome->SetParameters(c0,c1,c2,c3,c4);
//AliInfo(Form("GetMinimum of the function %f",polynome->GetMinimumX()));
if ((fPhd[2] > fPhd[0]) &&
(fPhd[2] > fPhd[1]) &&
(fPhd[1] > fPhd[0]) &&
- (put)) {
+ (put) &&
+ (putd)) {
fCurrentCoef[0] = (kDrWidth) / (fPhd[2]-fPhd[1]);
if(fCurrentCoef[0] > 2.5) fCurrentCoef[0] = -TMath::Abs(fCurrentCoef[1]);
else fNumberFitSuccess++;
if (fCurrentCoef2[0] < -3.0) {
fCurrentCoef2[0] = fCurrentCoef2[1] + 100.0;
}
+ else fNumberFitSuccess++;
}
else {
fCurrentCoef2[0] = fCurrentCoef2[1] + 100.0;
TCanvas *cpentei = new TCanvas("cpentei","cpentei",50,50,600,800);
cpentei->cd();
projPH->Draw();
+ if(polynomea) polynomea->Draw("same");
line->SetLineColor(2);
line->DrawLine(fPhd[0],0,fPhd[0],projPH->GetMaximum());
line->DrawLine(fPhd[1],0,fPhd[1],projPH->GetMaximum());
AliInfo(Form("fPhd[0] (beginning of the signal): %f" ,(Float_t) fPhd[0]));
AliInfo(Form("fPhd[1] (end of the amplification region): %f" ,(Float_t) fPhd[1]));
AliInfo(Form("fPhd[2] (end of the drift region): %f" ,(Float_t) fPhd[2]));
- AliInfo(Form("fVriftCoef[3] (with only the drift region(default)): %f",(Float_t) fCurrentCoef[0]));
+ AliInfo(Form("Vdrift (with only the drift region(default)): %f",(Float_t) fCurrentCoef[0]));
+ AliInfo(Form("Timeoffset (with only the drift region(default)): %f",(Float_t) fCurrentCoef2[0]));
TCanvas *cpentei2 = new TCanvas("cpentei2","cpentei2",50,50,600,800);
cpentei2->cd();
pentea->Draw();