]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Suppressing lowest pt K- point in TPC, adding more versions of levy functions + cosme...
authormfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 20 Sep 2010 07:12:17 +0000 (07:12 +0000)
committermfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 20 Sep 2010 07:12:17 +0000 (07:12 +0000)
PWG2/SPECTRA/Fit/AliBWFunc.cxx
PWG2/SPECTRA/Fit/AliBWFunc.h
PWG2/SPECTRA/Fit/AliBWTools.cxx
PWG2/SPECTRA/Fit/CombineSpectra.C
PWG2/SPECTRA/Fit/FitParticle.C

index 9c187f0398b1deccd037b9354554bfb89ef6ebea..701299edf5c144428e4556c30824a97b6285b3ea 100644 (file)
@@ -177,7 +177,13 @@ TF1 * AliBWFunc::GetLevi(Double_t mass, Double_t T, Double_t n, Double_t norm, c
     return GetLevidNdpt(mass,T,n,norm,name);
     break;
   case kOneOverMtdNdmt:
-    return GetLevidNdmt(mass,T,n,norm,name);
+    return GetLevidNdmt(mass,T,n,norm,name,kOneOverMtdNdmt);
+    break;
+  case kdNdmt:
+    return GetLevidNdmt(mass,T,n,norm,name,kdNdmt);
+    break;
+  case kOneOverMtdNdmtMinusM:
+    return GetLevidNdmt(mass,T,n,norm,name,kOneOverMtdNdmtMinusM);
     break;
   default:
     AliFatal("Not implemented");
@@ -643,13 +649,18 @@ TF1 * AliBWFunc::GetLevidNdpt(Double_t mass, Double_t temp, Double_t n, Double_t
 
 }
 
-TF1 * AliBWFunc::GetLevidNdmt(Double_t mass, Double_t temp, Double_t n, Double_t norm, const char * name){
+TF1 * AliBWFunc::GetLevidNdmt(Double_t mass, Double_t temp, Double_t n, Double_t norm, const char * name, VarType_t var){
 
-  // Levi function, dNdmt
+  // Levi function, 1/mt dNdmt
   char formula[500];
-
-  //  sprintf(formula,"( [0]*([1]-1)*([1]-2)  )/( [1]*[2]*( [1]*[2]+[3]*([1]-2) )  ) * ( 1 + (x -[3])/([1]*[2])  )^(-[1])");
-  sprintf(formula,"( [0]*([1]-1)*([1]-2)  )/( [1]*[2]*( [1]*[2]+[3]*([1]-2) )  ) * ( 1 + x/([1]*[2])  )^(-[1])");
+  if (var == kOneOverMtdNdmt)
+    sprintf(formula,"( [0]*([1]-1)*([1]-2)  )/( [1]*[2]*( [1]*[2]+[3]*([1]-2) )  ) * ( 1 + (x -[3])/([1]*[2])  )^(-[1])");
+  else if (var == kdNdmt) 
+    sprintf(formula,"( x*[0]*([1]-1)*([1]-2)  )/( [1]*[2]*( [1]*[2]+[3]*([1]-2) )  ) * ( 1 + (x-[3])/([1]*[2])  )^(-[1])");
+  if (var == kOneOverMtdNdmtMinusM)
+    sprintf(formula,"( [0]*([1]-1)*([1]-2)  )/( [1]*[2]*( [1]*[2]+[3]*([1]-2) )  ) * ( 1 + (x)/([1]*[2])  )^(-[1])");
+
+  //sprintf(formula,"( [0]*([1]-1)*([1]-2)  )/( [1]*[2]*( [1]*[2]+[3]*([1]-2) )  ) * ( 1 + x/([1]*[2])  )^(-[1])");
   //  sprintf(formula,"[0] * ( 1 + x/([1]*[2])  )^(-[1])");
   fLastFunc=new TF1(name,formula,0,10);
   fLastFunc->SetParameters(norm, n, temp,mass);
@@ -664,6 +675,7 @@ TF1 * AliBWFunc::GetLevidNdmt(Double_t mass, Double_t temp, Double_t n, Double_t
 
 
 
+
 // Test Function
 Double_t AliBWFunc::IntegrandTest(const double * x, const double* p){
 
index 537182bcb36cf09f3af5dda679ef4e001bb88bac..27a2f7aadfcd75ac3cb585f1553ceeb6268939c9 100644 (file)
@@ -33,7 +33,7 @@ class AliBWFunc : public TObject {
 
 public:
   // define the variables used for the function
-  typedef enum {kdNdpt,kOneOverPtdNdpt,kOneOverMtdNdmt} VarType_t;
+  typedef enum {kdNdpt,kOneOverPtdNdpt,kOneOverMtdNdmt,kdNdmt,kOneOverMtdNdmtMinusM} VarType_t;
 
   AliBWFunc();
   ~AliBWFunc();
@@ -134,8 +134,7 @@ protected:
   // 1/mt dNdmt
   
   // Levi
-  TF1 * GetLevidNdmt(Double_t mass, Double_t T, Double_t n, Double_t norm, const char * name = "fLeviMt");
-
+  TF1 * GetLevidNdmt(Double_t mass, Double_t T, Double_t n, Double_t norm, const char * name = "fLeviMt", VarType_t var = kOneOverMtdNdmt);
 
   // gereral setters
   void SetLineWidth(Width_t width) { fLineWidth = width;}
index f7c37549c1712e035b97c9449b3edce4ba73c6d9..566864b39d55ba439af3be442bcf29adb06ac5f2 100644 (file)
@@ -39,9 +39,9 @@ TH1 * AliBWTools::GetdNdmtFromdNdpt(const TH1 * hpt, Double_t mass) {
   Float_t * xbins = new Float_t[nbins+1];
   for(Int_t ibins = 0; ibins <= nbins; ibins++){
     xbins[ibins] = TMath::Sqrt(hpt->GetBinLowEdge(ibins+1)*hpt->GetBinLowEdge(ibins+1) +
-                              mass *mass) - mass;
-//     xbins[ibins] = TMath::Sqrt(hpt->GetBinLowEdge(ibins+1)*hpt->GetBinLowEdge(ibins+1) +
-//                            mass *mass);
+                              mass *mass) - mass;
+    // xbins[ibins] = TMath::Sqrt(hpt->GetBinLowEdge(ibins+1)*hpt->GetBinLowEdge(ibins+1) +
+    //                                mass *mass);
     //    cout << ibins << " "<< xbins[ibins]  << endl;
 
   }
@@ -57,7 +57,10 @@ TH1 * AliBWTools::GetdNdmtFromdNdpt(const TH1 * hpt, Double_t mass) {
 
   hmt->SetXTitle("m_{t} - m_{0} (GeV/c^{2})");
   hmt->SetYTitle("1/m_{t} dN/dm_{t} (a.u.)");
-  
+  hmt->SetMarkerStyle(hpt->GetMarkerStyle());
+  hmt->SetMarkerColor(hpt->GetMarkerColor());
+  hmt->SetLineColor(hpt->GetLineColor());
+
   return hmt;
 
 }
index 32412d16cd6304df91ef8d5128fa6f6b24ded9fc..58da826a02453154788fd022c72422622d5bd8b6 100644 (file)
@@ -165,9 +165,9 @@ TString today = "";
 
 // Switches
 Bool_t convertToMT = 0;
-Bool_t sumCharge = kFALSE;
+Bool_t sumCharge = 1;
 Int_t whatToFit = kStatErrors; 
-Bool_t doPrint = 0;
+Bool_t doPrint = 1;
 Bool_t scaleKaons =  kFALSE;
 Bool_t drawStar =  kFALSE; // Overlay star when doing fits
 Bool_t correctSecondaries  = 1;
@@ -177,7 +177,7 @@ Int_t fitFuncID = kFitLevi;
 Bool_t showMC=kTRUE;
 Bool_t showE735=kTRUE;
 Bool_t useSecCorrFromDCA=kFALSE;
-const char * printFormats = "png"; // format in which canvases will be printed, if PrintCanvas is called (not all prints are based on printcanvas at the moment). This is a comma separated list.
+const char * printFormats = "eps"; // format in which canvases will be printed, if PrintCanvas is called (not all prints are based on printcanvas at the moment). This is a comma separated list.
 
 
 void CombineSpectra(Int_t analysisType=kDoHelp, Int_t  locfitFuncID = kFitLevi) {  //kDoSuperposition;//kDoDrawWithModels;// kDoFits; //kDoRatios;  
@@ -421,10 +421,6 @@ void FitCombined() {
        AliBWTools::GetMeanSquare(func, mean2, mean2e, 0.,100., normPar);
       }
       AliBWTools::GetMeanDataAndExtrapolation(hToFit, func, meanDF, meanDFe, 0.,100.);
-      // FIXME CANCELLAMI
-      mean = AliBWTools::GetMean      (hToFit, 0.,100., &meane);
-      AliBWTools::GetMeanDataAndExtrapolation(hToFit, func, meanDF, meanDFe, AliBWTools::GetLowestNotEmptyBinEdge(hToFit),AliBWTools::GetHighestNotEmptyBinEdge(hToFit));      
-      // --
       table.SetNextCol(mean,   meane  ,-4);
       table.SetNextCol(meanDF, meanDFe,-4);
       
@@ -450,8 +446,8 @@ void FitCombined() {
     c2r->cd();
     ALICEWorkInProgress(c2r,"","ALICE Preliminary");
     l->Draw();
-    PrintCanvas(c2,"eps,root,png");
-    PrintCanvas(c2r,"eps,root,png");
+    PrintCanvas(c2,printFormats);
+    PrintCanvas(c2r,printFormats);
     
     
   }
@@ -630,7 +626,7 @@ void LoadSpectra() {
     }
 
   // ITS + TPC (Marek)
-  //  f = TFile::Open("./Files/SpectraCorrectedITSBeforeProtons20100720.root");
+  //f = TFile::Open("./Files/SpectraCorrectedITSBeforeProtons20100720.root");
   f = TFile::Open("./Files/SpectraCorrectedITSBeforeProtons14092010new.root");
   TList * list = (TList*) gDirectory->Get("output");
   hSpectra[kITSTPC][kPion]  [kPos]= (TH1F*) list->FindObject("Pions");
@@ -663,6 +659,10 @@ void LoadSpectra() {
        hSpectra[kTPC][kKaon][icharge]->SetBinError  (ibin,0);  
       }      
     }
+    if (pt < 0.25) {
+      hSpectra[kTPC][kKaon][kNeg]->SetBinContent(ibin,0);
+      hSpectra[kTPC][kKaon][kNeg]->SetBinError  (ibin,0);      
+    }
     if (pt < 0.45) {
       for(Int_t icharge = 0; icharge < kNCharge; icharge++){
        hSpectra[kTPC][kProton][icharge]->SetBinContent(ibin,0);
@@ -712,7 +712,7 @@ void LoadSpectra() {
   // Apply correction factors
   // Secondaries for protons
 
-  //  f = new TFile ("./Files/corrFactorProtons_20100615.root");
+  //f = new TFile ("./Files/corrFactorProtons_20100615.root");
   f = new TFile ("./Files/corrFactorProtons_2010_09_15.root");
   TH1F * hCorrSecondaries = (TH1F*) gDirectory->Get("corrFactorProtons");
   if(correctSecondaries) {
index f342d2775415b73c4963b86ce5995c32bcbfd257..2f8d7daa8e2ad4c2ef64232a016fb695a0cf46a4 100644 (file)
@@ -26,7 +26,7 @@ void FitParticle(const char * file, const char * histo, const char * partName,
   //
   // You have to provide:
   // - file: file name 
-  // - histo: histogram name name (assumend to be in the mail folder of the file)
+  // - histo: histogram name name (assumend to be in the main folder of the file)
   // - partName: it is used to get the mass of the particle from
   //   TDatabasePDG. If you are not sure, just use a part of the name: a
   //   list of names matching it is printed on screen
@@ -74,6 +74,8 @@ void FitParticle(const char * file, const char * histo, const char * partName,
     
   }
   Double_t mass = TDatabasePDG::Instance()->GetParticle(partName)->Mass();
+  cout << "Fitting ["<<partName<<"], mass: " << mass << endl;
+  
   TF1* func = 0;
   Int_t normPar = -1;
   if (fitFunc == kFitLevi)   {