#include <TAxis.h>
#include <TMath.h>
#include <TDirectory.h>
-#include <TROOT.h>
#include <TTreeStream.h>
#include <TLinearFitter.h>
#include <TVectorD.h>
-#include <TArrayF.h>
+#include <TROOT.h>
+#include <TString.h>
#include "AliLog.h"
#include "AliMathBase.h"
//
// Set the calibration mode
- const char *name = ch->GetTitle();
+ //const char *name = ch->GetTitle();
+ TString name = ch->GetTitle();
if(!SetModeCalibration(name,0)) return kFALSE;
// Number of Ybins (detectors or groups of pads)
//
// Set the calibraMode
- const char *name = calvect->GetNameCH();
+ //const char *name = calvect->GetNameCH();
+ TString name = calvect->GetNameCH();
if(!SetModeCalibration(name,0)) return kFALSE;
// Number of Xbins (detectors or groups of pads)
//
// Set the calibration mode
- const char *name = ph->GetTitle();
+ //const char *name = ph->GetTitle();
+ TString name = ph->GetTitle();
if(!SetModeCalibration(name,1)) return kFALSE;
//printf("Mode calibration set\n");
//
// Set the calibration mode
- const char *name = calvect->GetNamePH();
+ //const char *name = calvect->GetNamePH();
+ TString name = calvect->GetNamePH();
if(!SetModeCalibration(name,1)) return kFALSE;
// Number of Xbins (detectors or groups of pads)
//
// Set the calibration mode
- const char *name = prf->GetTitle();
+ //const char *name = prf->GetTitle();
+ TString name = prf->GetTitle();
if(!SetModeCalibration(name,2)) return kFALSE;
// Number of Ybins (detectors or groups of pads)
//
// Set the calibration mode
- const char *name = prf->GetTitle();
+ //const char *name = prf->GetTitle();
+ TString name = prf->GetTitle();
if(!SetModeCalibration(name,2)) return kFALSE;
// Number of Ybins (detectors or groups of pads)
//
// Set the calibra mode
- const char *name = calvect->GetNamePRF();
+ //const char *name = calvect->GetNamePRF();
+ TString name = calvect->GetNamePRF();
if(!SetModeCalibration(name,2)) return kFALSE;
//printf("test0 %s\n",name);
//
// Set the calibra mode
- const char *name = calvect->GetNamePRF();
+ //const char *name = calvect->GetNamePRF();
+ TString name = calvect->GetNamePRF();
if(!SetModeCalibration(name,2)) return kFALSE;
//printf("test0 %s\n",name);
Int_t nbg = GetNumberOfGroupsPRF((const char *)name);
fCurrentCoef2[0] = (param[0]+fCurrentCoef[1]*fCurrentCoef2[1])/fCurrentCoef[0];
fCurrentCoefE = error[1];
fCurrentCoefE2 = error[0];
- if((fCurrentCoef2[0] != 0.0) && (param[0] != 0.0)){
+ if((TMath::Abs(fCurrentCoef2[0]) > 0.0000001) && (TMath::Abs(param[0]) > 0.0000001)){
fCurrentCoefE2 = (fCurrentCoefE2/param[0]+fCurrentCoefE/fCurrentCoef[0])*fCurrentCoef2[0];
}
}
//____________Functions for seeing if the pad is really okey___________________
//_____________________________________________________________________________
-Int_t AliTRDCalibraFit::GetNumberOfGroupsPRF(const char* nametitle)
+Int_t AliTRDCalibraFit::GetNumberOfGroupsPRF(TString nametitle)
{
//
// Get numberofgroupsprf
const Char_t *pattern6 = "Ngp6";
// Nrphi mode
- if (strstr(nametitle,pattern0)) {
+ if (strstr(nametitle.Data(),pattern0)) {
return 0;
}
- if (strstr(nametitle,pattern1)) {
+ if (strstr(nametitle.Data(),pattern1)) {
return 1;
}
- if (strstr(nametitle,pattern2)) {
+ if (strstr(nametitle.Data(),pattern2)) {
return 2;
}
- if (strstr(nametitle,pattern3)) {
+ if (strstr(nametitle.Data(),pattern3)) {
return 3;
}
- if (strstr(nametitle,pattern4)) {
+ if (strstr(nametitle.Data(),pattern4)) {
return 4;
}
- if (strstr(nametitle,pattern5)) {
+ if (strstr(nametitle.Data(),pattern5)) {
return 5;
}
- if (strstr(nametitle,pattern6)){
+ if (strstr(nametitle.Data(),pattern6)){
return 6;
}
else return -1;
}
//_____________________________________________________________________________
-Bool_t AliTRDCalibraFit::SetModeCalibration(const char *name, Int_t i)
+Bool_t AliTRDCalibraFit::SetModeCalibration(TString name, Int_t i)
{
//
// Set fNz[i] and fNrphi[i] of the AliTRDCalibraFit::Instance()
}
//_____________________________________________________________________________
-Bool_t AliTRDCalibraFit::SetNrphiFromTObject(const char *name, Int_t i)
+Bool_t AliTRDCalibraFit::SetNrphiFromTObject(TString name, Int_t i)
{
//
// Set fNrphi[i] of the AliTRDCalibraFit::Instance()
const Char_t *patternz100 = "Nz100";
// Nrphi mode
- if ((strstr(name,patternrphi100)) && (strstr(name,patternz100))) {
+ if ((strstr(name.Data(),patternrphi100)) && (strstr(name.Data(),patternz100))) {
fCalibraMode->SetAllTogether(i);
fNbDet = 540;
if (fDebugLevel > 1) {
}
return kTRUE;
}
- if ((strstr(name,patternrphi10)) && (strstr(name,patternz10))) {
+ if ((strstr(name.Data(),patternrphi10)) && (strstr(name.Data(),patternz10))) {
fCalibraMode->SetPerSuperModule(i);
fNbDet = 30;
if (fDebugLevel > 1) {
return kTRUE;
}
- if (strstr(name,patternrphi0)) {
+ if (strstr(name.Data(),patternrphi0)) {
fCalibraMode->SetNrphi(i ,0);
if (fDebugLevel > 1) {
AliInfo(Form("fNbDet %d and 0",fNbDet));
}
return kTRUE;
}
- if (strstr(name,patternrphi1)) {
+ if (strstr(name.Data(),patternrphi1)) {
fCalibraMode->SetNrphi(i, 1);
if (fDebugLevel > 1) {
AliInfo(Form("fNbDet %d and 1",fNbDet));
}
return kTRUE;
}
- if (strstr(name,patternrphi2)) {
+ if (strstr(name.Data(),patternrphi2)) {
fCalibraMode->SetNrphi(i, 2);
if (fDebugLevel > 1) {
AliInfo(Form("fNbDet %d and 2",fNbDet));
}
return kTRUE;
}
- if (strstr(name,patternrphi3)) {
+ if (strstr(name.Data(),patternrphi3)) {
fCalibraMode->SetNrphi(i, 3);
if (fDebugLevel > 1) {
AliInfo(Form("fNbDet %d and 3",fNbDet));
}
return kTRUE;
}
- if (strstr(name,patternrphi4)) {
+ if (strstr(name.Data(),patternrphi4)) {
fCalibraMode->SetNrphi(i, 4);
if (fDebugLevel > 1) {
AliInfo(Form("fNbDet %d and 4",fNbDet));
}
return kTRUE;
}
- if (strstr(name,patternrphi5)) {
+ if (strstr(name.Data(),patternrphi5)) {
fCalibraMode->SetNrphi(i, 5);
if (fDebugLevel > 1) {
AliInfo(Form("fNbDet %d and 5",fNbDet));
}
return kTRUE;
}
- if (strstr(name,patternrphi6)) {
+ if (strstr(name.Data(),patternrphi6)) {
fCalibraMode->SetNrphi(i, 6);
if (fDebugLevel > 1) {
AliInfo(Form("fNbDet %d and 6",fNbDet));
}
//_____________________________________________________________________________
-Bool_t AliTRDCalibraFit::SetNzFromTObject(const char *name, Int_t i)
+Bool_t AliTRDCalibraFit::SetNzFromTObject(TString name, Int_t i)
{
//
// Set fNz[i] of the AliTRDCalibraFit::Instance()
const Char_t *patternz10 = "Nz10";
const Char_t *patternz100 = "Nz100";
- if ((strstr(name,patternrphi100)) && (strstr(name,patternz100))) {
+ if ((strstr(name.Data(),patternrphi100)) && (strstr(name.Data(),patternz100))) {
fCalibraMode->SetAllTogether(i);
fNbDet = 540;
if (fDebugLevel > 1) {
}
return kTRUE;
}
- if ((strstr(name,patternrphi10)) && (strstr(name,patternz10))) {
+ if ((strstr(name.Data(),patternrphi10)) && (strstr(name.Data(),patternz10))) {
fCalibraMode->SetPerSuperModule(i);
fNbDet = 30;
if (fDebugLevel > 1) {
}
return kTRUE;
}
- if (strstr(name,patternz0)) {
+ if (strstr(name.Data(),patternz0)) {
fCalibraMode->SetNz(i, 0);
if (fDebugLevel > 1) {
AliInfo(Form("fNbDet %d and 0",fNbDet));
}
return kTRUE;
}
- if (strstr(name,patternz1)) {
+ if (strstr(name.Data(),patternz1)) {
fCalibraMode->SetNz(i ,1);
if (fDebugLevel > 1) {
AliInfo(Form("fNbDet %d and 1",fNbDet));
}
return kTRUE;
}
- if (strstr(name,patternz2)) {
+ if (strstr(name.Data(),patternz2)) {
fCalibraMode->SetNz(i ,2);
if (fDebugLevel > 1) {
AliInfo(Form("fNbDet %d and 2",fNbDet));
}
return kTRUE;
}
- if (strstr(name,patternz3)) {
+ if (strstr(name.Data(),patternz3)) {
fCalibraMode->SetNz(i ,3);
if (fDebugLevel > 1) {
AliInfo(Form("fNbDet %d and 3",fNbDet));
}
return kTRUE;
}
- if (strstr(name,patternz4)) {
+ if (strstr(name.Data(),patternz4)) {
fCalibraMode->SetNz(i ,4);
if (fDebugLevel > 1) {
AliInfo(Form("fNbDet %d and 4",fNbDet));
detector = ((AliTRDFitInfo *) vectorFit->At(k))->GetDetector();
AliTRDCalROC *calROC = object->GetCalROC(detector);
Float_t mean = detobject->GetValue(detector);
- if(mean == 0) continue;
+ if(TMath::Abs(mean) <= 0.0000000001) continue;
Int_t rowMax = calROC->GetNrows();
Int_t colMax = calROC->GetNcols();
for (Int_t row = 0; row < rowMax; row++) {
Float_t l3P2am = pentea->GetFunction("pol2")->GetParameter(2);
Float_t l3P1amE = pentea->GetFunction("pol2")->GetParError(1);
Float_t l3P2amE = pentea->GetFunction("pol2")->GetParError(2);
- if (l3P2am != 0) {
+ if (TMath::Abs(l3P2am) > 0.00000001) {
fPhd[0] = -(l3P1am / (2 * l3P2am));
}
if(!fTakeTheMaxPH){
- if((l3P1am != 0.0) && (l3P2am != 0.0)){
+ if((TMath::Abs(l3P1am) > 0.0000000001) && (TMath::Abs(l3P2am) > 0.00000000001)){
fCurrentCoefE2 = (l3P1amE/l3P1am + l3P2amE/l3P2am)*fPhd[0];
}
}
Float_t l3P2amf = projPH->GetFunction("pol2")->GetParameter(2);
Float_t l3P1amfE = projPH->GetFunction("pol2")->GetParError(1);
Float_t l3P2amfE = projPH->GetFunction("pol2")->GetParError(2);
- if (l3P2amf != 0) {
+ if (TMath::Abs(l3P2amf) > 0.00000000001) {
fPhd[1] = -(l3P1amf / (2 * l3P2amf));
}
- if((l3P1amf != 0.0) && (l3P2amf != 0.0)){
+ if((TMath::Abs(l3P1amf) > 0.0000000001) && (TMath::Abs(l3P2amf) > 0.000000001)){
fCurrentCoefE = (l3P1amfE/l3P1amf + l3P2amfE/l3P2amf)*fPhd[1];
}
if(fTakeTheMaxPH){
Float_t l3P2dr = pente->GetFunction("pol2")->GetParameter(2);
Float_t l3P1drE = pente->GetFunction("pol2")->GetParError(1);
Float_t l3P2drE = pente->GetFunction("pol2")->GetParError(2);
- if (l3P2dr != 0) {
+ if (TMath::Abs(l3P2dr) > 0.00000001) {
fPhd[2] = -(l3P1dr / (2 * l3P2dr));
}
- if((l3P1dr != 0.0) && (l3P2dr != 0.0)){
+ if((TMath::Abs(l3P1dr) > 0.0000000001) && (TMath::Abs(l3P2dr) > 0.00000000001)){
fCurrentCoefE += (l3P1drE/l3P1dr + l3P2drE/l3P2dr)*fPhd[2];
}
Float_t fPhdt0 = 0.0;
AliInfo("Too many fluctuations at the end!");
put = kFALSE;
}
- if(pente->GetBinContent(binmin+1)==0){
+ if(TMath::Abs(pente->GetBinContent(binmin+1)) <= 0.0000000000001){
AliInfo("No entries for the next bin!");
pente->SetBinContent(binmin,0);
if(pente->GetEntries() > 0) binmin = (Int_t) pente->GetMinimumBin();
Double_t ret = FitGausMI(arraye, arraym, arrayme, nBins, xMin, xMax,¶m);
- if(ret == -4){
+ if(TMath::Abs(ret+4) <= 0.000000001){
fCurrentCoef[0] = -fCurrentCoef[1];
return kFALSE;
}
if((valueI - arrayme[ibin]) > 0.0) errorn = TMath::Log((valueI - arrayme[ibin])/valueI);
error = TMath::Max(TMath::Abs(errorm),TMath::Abs(errorn));
}
- if(error == 0.0) continue;
+ if(TMath::Abs(error) < 0.000000001) continue;
val = TMath::Log(Float_t(valueI));
fitter.AddPoint(&xcenter,val,error);
npoints++;
if (!param) param = new TVectorD(3);
- if(par[2] == 0.0) return -4.0;
+ if(TMath::Abs(par[2]) <= 0.000000001) return -4.0;
Double_t x = TMath::Sqrt(TMath::Abs(-2*par[2]));
Double_t deltax = (fitter.GetParError(2))/x;
Double_t errorparam2 = TMath::Abs(deltax)/(x*x);
Double_t ermin0 = 0.0;
//Double_t prfe0 = 0.0;
Double_t prf0 = 0.0;
- if((pars0[2] > 0.0) && (pars0[1] != 0.0)) {
+ if((pars0[2] > 0.000000000001) && (TMath::Abs(pars0[1]) >= 0.000000000001)) {
min0 = -pars0[1]/(2*pars0[2]);
ermin0 = TMath::Abs(min0*(errorsx0/pars0[2]+linearfitter.GetParError(1)*pointError0/pars0[1]));
prf0 = pars0[0]+pars0[1]*min0+pars0[2]*min0*min0;
return gauss;
}
+