]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/ThermalFits/InterpolateRatiosAndYields.C
Added monitoring
[u/mrichter/AliRoot.git] / PWGLF / ThermalFits / InterpolateRatiosAndYields.C
index 63d5581555d28ef023f1770fe87bac1cbd8fd83d..324ce73e15896a3a7fe510be398d0ed7ba7b23f0 100644 (file)
@@ -8,6 +8,7 @@ TClonesArray * arr =0;
 
 void InterpolateRatios(Int_t pdg1, Int_t pdg2, TString centr1="V0M0005", TString centr2="V0M0510", TString centrfinal="V0M0010") ;
 void Interpolate0010(Int_t pdg) ;
+void Interpolate2040(Int_t pdg) ;
 void Interpolate6080(Int_t pdg) ;
 
 void ExtrapolateWithConstantRatioToPions(Int_t pdg, TString centrOrigin, TString centrDest);
@@ -27,16 +28,23 @@ void InterpolateRatiosAndYields() {
   // Interpolate0010(-321);
   // Interpolate0010(2212);
   // Interpolate0010(-2212);
-  //  InterpolateRatios(2212,211);  
-  //  InterpolateRatios(321,211);  
+  // InterpolateRatios(2212,211, "V0M0005", "V0M0510", "V0M0010");  
+  // InterpolateRatios(321,211 , "V0M0005", "V0M0510", "V0M0010");  
   // Interpolate6080(211);
   // Interpolate6080(-211);
   // Interpolate6080(2212);
   // Interpolate6080(-2212);
-  Interpolate6080(321);
-  Interpolate6080(-321);
+  // Interpolate6080(321);
+  // Interpolate6080(-321);
   // InterpolateRatios(2212,211, "V0M6070", "V0M7080", "V0M6080");  
-  // InterpolateRatios(321,211, "V0M6070", "V0M7080", "V0M6080");    
+  //  InterpolateRatios(321,211, "V0M6070", "V0M7080", "V0M6080");    
+
+  Interpolate2040(211);
+  Interpolate2040(-211);
+  Interpolate2040(2212);
+  Interpolate2040(-2212);
+  Interpolate2040(321);
+  Interpolate2040(-321);
 
   // *************** Lambda and K0 *****************
   // arr=   AliParticleYield::ReadFromASCIIFile("PbPb_2760_LambdaK0.txt");
@@ -62,6 +70,8 @@ void InterpolateRatiosAndYields() {
   // arr->AbsorbObjects(AliParticleYield::ReadFromASCIIFile("pPb_5020_PiKaPrLamndaK0.txt"));
   //  ExtrapolateWithConstantRatioToPions(1000010020, "V0A0010", "V0A0005");
   // ExtrapolateWithConstantRatioToPions(-1000010020, "V0A0010", "V0A0005");
+  // ExtrapolateWithConstantRatioToPions(1000010020, "V0A6000", "V0A6080");
+  // ExtrapolateWithConstantRatioToPions(-1000010020, "V0A6000", "V0A6080");
 
 
 }
@@ -102,15 +112,32 @@ void Interpolate6080(Int_t pdg) {
   std::cout << pav->GetYield() << ", " << pav->GetStatError() << ", "<< pav->GetSystError() << std::endl;
 
 
+} 
+
+void Interpolate2040(Int_t pdg) {
+
+  TString centrPrefix = collSystem == 2 ? "V0M" : "V0A";
+
+  AliParticleYield * p0 = AliParticleYield::FindParticle(arr, pdg, collSystem, energy, centrPrefix+"2030");
+  AliParticleYield * p1 = AliParticleYield::FindParticle(arr, pdg, collSystem, energy, centrPrefix+"3040");
+  p0->Scale(0.5);
+  p1->Scale(0.5);
+  AliParticleYield * pav = AliParticleYield::Add(p0,p1);
+  std::cout << pav->GetYield() << ", " << pav->GetStatError() << ", "<< pav->GetSystError() << std::endl;
+
+
 } 
 
 void InterpolateRatios(Int_t pdg1, Int_t pdg2, TString centr1, TString centr2, TString centrfinal) {
 
+  // Get the ratios from the DB for the correct centralities
   AliParticleYield * ratio[2];
   ratio[0] = AliParticleYield::FindRatio(arr, pdg1, pdg2, 2, 2760., centr1, 1);
   ratio[1] = AliParticleYield::FindRatio(arr, pdg1, pdg2, 2, 2760., centr2, 1);
+
   AliParticleYield * average = AliParticleYield::Add(ratio[0], ratio[1]);
   average->Scale(0.5);
+
   AliParticleYield * pi[2];
   pi[0] = AliParticleYield::FindParticle(arr, pdg2, 2, 2760., centr1, 0);
   pi[0] = AliParticleYield::Add(pi[0],AliParticleYield::FindParticle(arr, -pdg2, 2, 2760., centr1, 0));
@@ -122,18 +149,20 @@ void InterpolateRatios(Int_t pdg1, Int_t pdg2, TString centr1, TString centr2, T
   ratio[0]->Scale(pi[0]->GetYield()) ;
   ratio[1]->Scale(pi[1]->GetYield()) ;
 
-  ratio[0]->Add(ratio[0], ratio[1]);
-  pi[0]->Add(pi[0],pi[1]);
+  ratio[0] = AliParticleYield::Add(ratio[0], ratio[1]);
+  pi[0]    = AliParticleYield::Add(pi[0],pi[1]);
   pi[0]->SetNormError(0);
   pi[0]->SetStatError(0);
   pi[0]->SetSystError(0);
   
   ratio[0]->Scale(1./pi[0]->GetYield());
   ratio[0]->SetCentr(centrfinal);
-
-  ratio[0]->Print();
+  cout << "*** "<< ratio[0]->GetPartName() << " " <<  centrfinal << " ***"<< std::endl;
+  std::cout << "RATIO OF AVERAGE: " ;
+  ratio[0]->Print("justvalue");
   //  average->Dump();
-  average->Print();
+  std::cout << "AVERAGE OF RATIO: " ;
+  average->Print("justvalue");
 
     
 }