from Ante Bilandzic: MPC updates
authormkrzewic <mikolaj.krzewicki@cern.ch>
Wed, 9 Jul 2014 16:05:27 +0000 (18:05 +0200)
committermkrzewic <mikolaj.krzewicki@cern.ch>
Wed, 9 Jul 2014 16:06:01 +0000 (18:06 +0200)
PWG/FLOW/Base/AliFlowAnalysisWithMultiparticleCorrelations.cxx
PWG/FLOW/Base/AliFlowAnalysisWithMultiparticleCorrelations.h
PWG/FLOW/Tasks/AliAnalysisTaskMultiparticleCorrelations.cxx
PWG/FLOW/Tasks/AliAnalysisTaskMultiparticleCorrelations.h

index 21961c1..620d9cd 100644 (file)
@@ -4869,7 +4869,7 @@ void AliFlowAnalysisWithMultiparticleCorrelations::DumpThePoints(AliFlowEventSim
 
 //=======================================================================================================================
 
-TH1D *AliFlowAnalysisWithMultiparticleCorrelations::GetHistogramWithWeights(const char *filePath, const char *listName, const char *type, const char *variable)
+TH1D *AliFlowAnalysisWithMultiparticleCorrelations::GetHistogramWithWeights(const char *filePath, const char *listName, const char *type, const char *variable, const char *production)
 {
  // Access from external ROOT file the desired histogram with weights. 
 
@@ -4884,11 +4884,12 @@ TH1D *AliFlowAnalysisWithMultiparticleCorrelations::GetHistogramWithWeights(cons
  TH1D *hist = NULL; 
 
  // b) Method name: 
- TString sMethodName = "Double_t AliFlowAnalysisWithMultiparticleCorrelations::GetHistogramWithWeights(const char *filePath, const char *listName, const char *type, const char *variable)"; 
+ TString sMethodName = "Double_t AliFlowAnalysisWithMultiparticleCorrelations::GetHistogramWithWeights(const char *filePath, const char *listName, const char *type, const char *variable, const char *production)"; 
 
  // c) Basic protection for arguments:
  if(!(TString(type).EqualTo("RP") || TString(type).EqualTo("POI"))){Fatal(sMethodName.Data(),"!(TString(type).EqualTo...");}
  if(!(TString(variable).EqualTo("phi") || TString(variable).EqualTo("pt") || TString(variable).EqualTo("eta"))){Fatal(sMethodName.Data(),"!(TString(variable).EqualTo...");}
+ if(!(TString(production).EqualTo("data") || TString(production).BeginsWith("LHC"))){Fatal(sMethodName.Data(),"!(TString(production).EqualTo...");}
 
  // d) Check if the external ROOT file exists at specified path:
  if(gSystem->AccessPathName(filePath,kFileExists))
@@ -4920,7 +4921,7 @@ TH1D *AliFlowAnalysisWithMultiparticleCorrelations::GetHistogramWithWeights(cons
   return NULL;
  }
  // Finally, access the desired histogram:
- hist = dynamic_cast<TH1D*>(list->FindObject(Form("%s,%s",type,variable)));
+ hist = dynamic_cast<TH1D*>(list->FindObject(Form("%s,%s,%s",type,variable,production)));
  if(!hist)
  {
   //printf("\n => if(!hist)\n\n");   
@@ -4933,7 +4934,7 @@ TH1D *AliFlowAnalysisWithMultiparticleCorrelations::GetHistogramWithWeights(cons
 
  return hist;
 
-} // TH1D *AliFlowAnalysisWithMultiparticleCorrelations::GetHistogramWithWeights(const char *filePath, const char *listName, const char *type, const char *variable)
+} // TH1D *AliFlowAnalysisWithMultiparticleCorrelations::GetHistogramWithWeights(const char *filePath, const char *listName, const char *type, const char *variable, const char *production)
 
 
 
index d977a62..3baf8d5 100644 (file)
@@ -289,7 +289,7 @@ class AliFlowAnalysisWithMultiparticleCorrelations{
   static void DumpPointsForDurham(TH1D *h);
   static void DumpPointsForDurham(TH1F *h);
   virtual void DumpThePoints(AliFlowEventSimple *anEvent);
-  TH1D* GetHistogramWithWeights(const char *filePath, const char *listName, const char *type, const char *variable);
+  TH1D* GetHistogramWithWeights(const char *filePath, const char *listName, const char *type, const char *variable, const char *production);
 
  private:
   AliFlowAnalysisWithMultiparticleCorrelations(const AliFlowAnalysisWithMultiparticleCorrelations& afawQc);
index 6161b97..ae26e83 100644 (file)
@@ -52,6 +52,7 @@ AliAnalysisTaskMultiparticleCorrelations::AliAnalysisTaskMultiparticleCorrelatio
  fFillMultCorrelationsHist(kFALSE),
  fCalculateQvector(kFALSE),
  fCalculateDiffQvectors(kFALSE),
+ fProduction(""),
  fCalculateCorrelations(kFALSE),
  fCalculateIsotropic(kFALSE),
  fCalculateSame(kFALSE),
@@ -170,6 +171,7 @@ AliAnalysisTaskMultiparticleCorrelations::AliAnalysisTaskMultiparticleCorrelatio
  fFillMultCorrelationsHist(kFALSE),
  fCalculateQvector(kFALSE),
  fCalculateDiffQvectors(kFALSE),
+ fProduction(""),
  fCalculateCorrelations(kFALSE),
  fCalculateIsotropic(kFALSE),
  fCalculateSame(kFALSE),
@@ -322,7 +324,8 @@ void AliAnalysisTaskMultiparticleCorrelations::UserCreateOutputObjects()
    {
     if(!fWeightsHist[rp][ppe])
     {
-     fWeightsHist[rp][ppe] = GetHistogramWithWeights(TString(Form("%s/%s",gSystem->pwd(),"weights.root")).Data(),TString(this->fName).Data(),type[rp].Data(),variable[ppe].Data());
+     if(fProduction.EqualTo("")){Fatal(sMethodName.Data(),"fProduction is empty, for one reason or another...");}
+     fWeightsHist[rp][ppe] = GetHistogramWithWeights(TString(Form("%s/%s",gSystem->pwd(),"weights.root")).Data(),TString(this->fName).Data(),type[rp].Data(),variable[ppe].Data(),fProduction.Data());
     }
     if(!fWeightsHist[rp][ppe])
     {
index 3f218f5..8537033 100644 (file)
@@ -73,10 +73,11 @@ class AliAnalysisTaskMultiparticleCorrelations : public AliAnalysisTaskSE{
 
   // Weights:              
   void SetWeightsHist(TH1D* const hist, const char *type, const char *variable); // .cxx
-  TH1D* GetHistogramWithWeights(const char *filePath, const char *listName, const char *type, const char *variable)
+  TH1D* GetHistogramWithWeights(const char *filePath, const char *listName, const char *type, const char *variable, const char *production)
   {
+   fProduction = TString(production);
    AliFlowAnalysisWithMultiparticleCorrelations *mpc = new AliFlowAnalysisWithMultiparticleCorrelations();
-   return mpc->GetHistogramWithWeights(filePath,listName,type,variable);
+   return mpc->GetHistogramWithWeights(filePath,listName,type,variable,production);
   };
 
   // Correlations:
@@ -187,6 +188,7 @@ class AliAnalysisTaskMultiparticleCorrelations : public AliAnalysisTaskSE{
   // Weights:
   Bool_t fUseWeights[2][3]; // use weights [RP,POI][phi,pt,eta]
   TH1D *fWeightsHist[2][3]; // histograms holding weights [RP,POI][phi,pt,eta]
+  TString fProduction;      // TBI most likely an overkill
 
   // Correlations:
   Bool_t fCalculateCorrelations;      // calculate and store correlations, or perhaps not, if the weather is bad...