author rbertens Thu, 13 Nov 2014 14:17:26 +0000 (15:17 +0100) committer rbertens Thu, 13 Nov 2014 14:17:40 +0000 (15:17 +0100)

index cda21b5..d745288 100644 (file)
@@ -4278,299 +4278,6 @@ void AliJetFlowTools::GetSignificance(
cout << " AVERAGE_STAT " << statE/ctr << endl;
}
//_____________________________________________________________________________
-void AliJetFlowTools::MinimizeChi22d()
-{
-    // Choose method upon creation between:
-    // kScan, kFumili
-    ROOT::Minuit2::Minuit2Minimizer min ( ROOT::Minuit2::kMigrad );
-    min.SetMaxFunctionCalls(1000000);
-    min.SetMaxIterations(100000);
-    min.SetTolerance(0.001);
-    ROOT::Math::Functor f(&PhenixChi22d,2);
-    double step[] = {0.0000001, 0.0000001};
-    double variable[] = {-1., -1.};
-
-    min.SetFunction(f);
-    // Set the free variables to be minimized!
-    min.SetVariable(0,"epsilon_c",variable[0], step[0]);
-    min.SetVariable(1,"epsilon_b",variable[1], step[1]);
-
-
-    min.Minimize();
-    const double *xs = min.X();
-    cout << endl << endl <<  "Minimum: f(" << xs[0] << ", " << xs[1] <<"):"  << PhenixChi22d(xs) << endl;
-    cout << "p-value: p(" << PhenixChi22d(xs) << ", 6) " << TMath::Prob(PhenixChi22d(xs), 4) << endl;
-    cout << "  so the probability of finding data at least as imcompatible with 0 as the actually" << endl;
-    cout << "  observed data is " << TMath::Prob(PhenixChi22d(xs), 4) << endl << endl << endl ;
-}
-//_____________________________________________________________________________
-Double_t AliJetFlowTools::PhenixChi22d(const Double_t *xx )
-{
-    // define arrays with results and errors
-
-    // these points are for 0-5  centrality, 30 - 100 gev (in which data is reported)
-
-  /*
-   Double_t v2[] = {
-        0.0094,
-        0.0559,
-        0.0746,
-        0.1077,
-        0.1208,
-        0.0883
-    };
-   Double_t stat[] = {
-        0.0287,
-        0.0311,
-        0.0443,
-        0.0600,
-        0.0802,
-        0.1223
-   };
-   Double_t shape[] = {
-        0.0607,
-        0.0623,
-        0.0397,
-        0.0312,
-        0.0452,
-        0.0716
-   };
-   Double_t corr[] = {
-        0.0402,
-        0.0460,
-        0.0412,
-        0.0411,
-        0.0403,
-        0.0402
- };
-*/
-    // these points are for 30 - 50 centrality, 20-90 gev (in which data is reported)
-    Double_t v2[] = {
-        0.0816,
-        0.0955,
-        0.0808,
-        0.0690,
-        0.0767,
-        0.1005
-    };
-    Double_t stat[] = {
-        0.0113,
-        0.0172,
-        0.0221,
-        0.0317,
-        0.0469,
-        0.0694
-    };
-    Double_t shape[] = {
-        0.1024,
-        0.0552,
-        0.0275,
-        0.0231,
-        0.0234,
-        0.0665
-    };
-    Double_t corr[] = {
-        0.0165,
-        0.0164,
-        0.0165,
-        0.0166,
-        0.0166,
-        0.0165
-    };
-
-    // return the function value at certain epsilon
-    const Double_t epsc = xx[0];
-    const Double_t epsb = xx[1];
-    Double_t chi2(0);
-    Int_t counts = (Int_t)(sizeof(v2)/sizeof(v2[0]));
-
-    // implemtation of eq 3 of arXiv:0801.1665v2
-    // this will be minimized w.r.t. 'x', which is epsilon_B in the paper
-    for(Int_t i(1); i < counts-1; i++) {
-        // quadratic sum of statistical and uncorrelated systematic error
-        Double_t e = stat[i];
-
-        // sum of v2 plus epsilon times correlated error minus hypothesis (0)
-        // also the numerator of equation 3 of phenix paper
-        Double_t numerator = TMath::Power(v2[i]+epsc*corr[i]+epsb*shape[i], 2);
-
-        // denominator of equation 3 of phenix paper
-        Double_t denominator = e*e;//TMath::Power((e*(v2[i]+epsc*corr[i]+epsb*shape[i]))/v2[i], 2);
-
-        // add to the sum
-        chi2 += numerator/denominator;
-    }
-    // add the square of epsilon to the total chi2 as penalty
-    chi2 += epsc*epsc + epsb*epsb;
-
-    return chi2;
-}
-//_____________________________________________________________________________
-Double_t AliJetFlowTools::ConstructFunction2d(Double_t *x, Double_t *par)
-{
-       return AliJetFlowTools::PhenixChi22d(x);
-}
-//_____________________________________________________________________________
-TF2* AliJetFlowTools::ReturnFunction2d()
-{
-      TF2 *f1 = new TF2("2dhist",AliJetFlowTools::ConstructFunction2d, -10, 10, -10, 10, 0);
-      printf(" > locating minima < \n");
-      Double_t chi2(f1->GetMinimum());
-      f1->GetXaxis()->SetTitle("#epsilon{b}");
-      f1->GetXaxis()->SetTitle("#epsilon_{c}");
-      f1->GetZaxis()->SetTitle("#chi^{2}");
-
-      printf(" > minimal chi2 %.8f \n", chi2);
-      cout << "  so the probability of finding data at least as imcompatible with 0 as the actually" << endl;
-      cout << "  observed data is " << TMath::Prob(chi2, 6) << endl;
-
-      return f1;
-}
-//_____________________________________________________________________________
-void AliJetFlowTools::MinimizeChi2()
-{
-    // Choose method upon creation between:
-    // kScan, kFumili
-    ROOT::Minuit2::Minuit2Minimizer min ( ROOT::Minuit2::kMigrad );
-    min.SetMaxFunctionCalls(1000000);
-    min.SetMaxIterations(100000);
-    min.SetTolerance(0.001);
-    ROOT::Math::Functor f(&PhenixChi2,1);
-    double step[] = {0.0000001};
-    double variable[] = {-1.};
-
-    min.SetFunction(f);
-    // Set the free variables to be minimized!
-    min.SetVariable(0,"epsilon_c",variable[0], step[0]);
-
-
-    min.Minimize();
-    const double *xs = min.X();
-    cout << endl << endl << "Minimum: f(" << xs[0] << "):"  << PhenixChi2(xs) << endl;
-    cout << "p-value: p(" << PhenixChi2(xs) << ", 6) " << TMath::Prob(PhenixChi2(xs), 6) << endl;
-    cout << "  so the probability of finding data at least as imcompatible with 0 as the actually" << endl;
-    cout << "  observed data is " << TMath::Prob(PhenixChi2(xs), 6) << endl << endl << endl;
-}
-//_____________________________________________________________________________
-Double_t AliJetFlowTools::PhenixChi2(const Double_t *xx )
-{
-    // define arrays with results and errors
-  /*
-   Double_t v2[] = {
-        0.0094,
-        0.0559,
-        0.0746,
-        0.1077,
-        0.1208,
-        0.0883
-    };
-   Double_t stat[] = {
-        0.0287,
-        0.0311,
-        0.0443,
-        0.0600,
-        0.0802,
-        0.1223
-   };
-   Double_t shape[] = {
-        0.0607,
-        0.0623,
-        0.0397,
-        0.0312,
-        0.0452,
-        0.0716
-   };
-   Double_t corr[] = {
-        0.0402,
-        0.0460,
-        0.0412,
-        0.0411,
-        0.0403,
-        0.0402
- };
-*/
-    // these points are for 30 - 50 centrality, 20-90 gev (in which data is reported)
-    Double_t v2[] = {
-        0.0816,
-        0.0955,
-        0.0808,
-        0.0690,
-        0.0767,
-        0.1005
-    };
-    Double_t stat[] = {
-        0.0113,
-        0.0172,
-        0.0221,
-        0.0317,
-        0.0469,
-        0.0694
-    };
-    Double_t shape[] = {
-        0.1024,
-        0.0552,
-        0.0275,
-        0.0231,
-        0.0234,
-        0.0665
-    };
-    Double_t corr[] = {
-        0.0165,
-        0.0164,
-        0.0165,
-        0.0166,
-        0.0166,
-        0.0165
-    };
-    // return the function value at certain epsilon
-    const Double_t epsc = xx[0];
-    Double_t chi2(0);
-    Int_t counts = (Int_t)(sizeof(v2)/sizeof(v2[0]));
-
-    // implemtation of eq 3 of arXiv:0801.1665v2
-    // this will be minimized w.r.t. 'x', which is epsilon_B in the paper
-    for(Int_t i(0); i < counts; i++) {
-        // quadratic sum of statistical and uncorrelated systematic error
-        Double_t e = TMath::Sqrt(stat[i]*stat[i]+shape[i]*shape[i]);
-
-        // sum of v2 plus epsilon times correlated error minus hypothesis (0)
-        // also the numerator of equation 3 of phenix paper
-        Double_t numerator = TMath::Power(v2[i]+epsc*corr[i], 2);
-
-        // denominator of equation 3 of phenix paper
-        Double_t denominator = e*e;//TMath::Power((e*(v2[i]+epsc*corr[i]))/v2[i], 2);
-
-        // add to the sum
-        chi2 += numerator/denominator;
-    }
-    // add the square of epsilon to the total chi2 as penalty
-    chi2 += epsc*epsc;
-
-    return chi2;
-}
-//_____________________________________________________________________________
-Double_t AliJetFlowTools::ConstructFunction(Double_t *x, Double_t *par)
-{
-       return AliJetFlowTools::PhenixChi2(x);
-}
-//_____________________________________________________________________________
-TF1* AliJetFlowTools::ReturnFunction()
-{
-      TF1 *f1 = new TF1("1dmyfunc",AliJetFlowTools::ConstructFunction, -10, 10, 0);
-      printf(" > locating minima < \n");
-      Double_t chi2(f1->GetMinimum());
-      f1->GetXaxis()->SetTitle("#epsilon_{c}");
-      f1->GetYaxis()->SetTitle("#chi^{2}");
-      return f1;
-}
-//_____________________________________________________________________________
void AliJetFlowTools::MinimizeChi2nd()
{
// Choose method upon creation between:
@@ -4593,53 +4300,16 @@ void AliJetFlowTools::MinimizeChi2nd()

min.Minimize();
const double *xs = min.X();
+    Int_t DOF(6);
cout << endl << endl <<  "Minimum: Chi2nd(" << xs[0] << ", " << xs[1] <<"):"  << PhenixChi2nd(xs) << endl;
-    cout << "p-value: p(" << PhenixChi2nd(xs) << ", 6) " << TMath::Prob(PhenixChi2nd(xs), 6) << endl;
+    cout << "p-value: p(" << PhenixChi2nd(xs) << ", " << DOF << ") " << TMath::Prob(PhenixChi2nd(xs), DOF) << endl;
cout << "  so the probability of finding data at least as imcompatible with 0 as the actually" << endl;
-    cout << "  observed data is " << TMath::Prob(PhenixChi2nd(xs), 6) << endl << endl << endl ;
+    cout << "  observed data is " << TMath::Prob(PhenixChi2nd(xs), DOF) << endl << endl << endl ;
}
//_____________________________________________________________________________
Double_t AliJetFlowTools::PhenixChi2nd(const Double_t *xx )
{
// define arrays with results and errors here, see example at PhenixChi2()
-    // very ugly, but two set of data, for 0-5  and 30-50 pct centrality
-    // this function has to be static, so this is the easiest way to implement it in the class ...
-  /*
-   Double_t v2[] = {
-        0.0094,
-        0.0559,
-        0.0746,
-        0.1077,
-        0.1208,
-        0.0883
-    };
-   Double_t stat[] = {
-        0.0287,
-        0.0311,
-        0.0443,
-        0.0600,
-        0.0802,
-        0.1223
-   };
-   Double_t shape[] = {
-        0.0607,
-        0.0623,
-        0.0397,
-        0.0312,
-        0.0452,
-        0.0716
-   };
-   Double_t corr[] = {
-        0.0402,
-        0.0460,
-        0.0412,
-        0.0411,
-        0.0403,
-        0.0402
- };
-*/
-    // these points are for 30 - 50 centrality, 20-90 gev (in which data is reported)
Double_t v2[] = {
0.0816,
0.0955,
@@ -4648,39 +4318,36 @@ Double_t AliJetFlowTools::PhenixChi2nd(const Double_t *xx )
0.0767,
0.1005
};
-    Double_t stat[] = {
-        0.0113,
-        0.0172,
-        0.0221,
-        0.0317,
-        0.0469,
-        0.0694
-    };
-    Double_t shape[] = {
-        0.1024,
-        0.0552,
-        0.0275,
-        0.0231,
-        0.0234,
-        0.0665
-    };
-    Double_t corr[] = {
-        0.0165,
-        0.0164,
-        0.0165,
-        0.0166,
-        0.0166,
-        0.0165
-    };
+    Double_t stat[] = {
+     0.0065,
+     0.0099,
+     0.0127,
+     0.0183,
+     0.0271,
+     0.0401};
+    Double_t shape[] = {
+     0.0065,
+     0.0099,
+     0.0127,
+     0.0183,
+     0.0271,
+     0.0401};
+    Double_t corr[] = {
+     0.01,
+     0.01,
+     0.01,
+     0.01,
+     0.01,
+     0.01};
+
// return the function value at certain epsilon
const Double_t epsc = xx[0];
const Double_t epsb = xx[1];
Double_t chi2(0);
Int_t counts = (Int_t)(sizeof(v2)/sizeof(v2[0]));

-    // implemtation of eq 3 of arXiv:0801.1665v2
-    // this will be minimized w.r.t. 'x', which is epsilon_B in the paper
+    // altered implemtation of eq 3 of arXiv:0801.1665v2
+    // see analysis note and QM2014 poster for validation
for(Int_t i(0); i < counts; i++) {
// quadratic sum of statistical and uncorrelated systematic error
Double_t e = stat[i];
index 3df25fd..5c6725c 100644 (file)
@@ -254,18 +254,10 @@ class AliJetFlowTools {
Int_t low,                      // pt lower level
Int_t up                        // pt upper level
);
-        static void     MinimizeChi22d();
-        static Double_t PhenixChi22d(const Double_t *xx );
-        static Double_t ConstructFunction2d(Double_t *x, Double_t *par);
-        static TF2*     ReturnFunction2d();
static void     MinimizeChi2nd();
static Double_t PhenixChi2nd(const Double_t *xx );
static Double_t ConstructFunctionnd(Double_t *x, Double_t *par);
-        static void     MinimizeChi2();
static TF2*     ReturnFunctionnd();
-        static Double_t PhenixChi2(const Double_t *xx );
-        static Double_t ConstructFunction(Double_t *x, Double_t *par);
-        static TF1*     ReturnFunction();
static void     WriteObject(TObject* object, TString suffix = "", Bool_t kill = kTRUE);
static TH2D*    ConstructDPtResponseFromTH1D(TH1D* dpt, Bool_t AvoidRoundingError);
static TH2D*    GetUnityResponse(TArrayD* binsTrue, TArrayD* binsRec, TString suffix = "");