]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGGA/PHOSTasks/PHOS_Correlation/AddTaskPi0Correlations.C
Fix for coverity (Annalisa De Caro).
[u/mrichter/AliRoot.git] / PWGGA / PHOSTasks / PHOS_Correlation / AddTaskPi0Correlations.C
index 451ab7c59118cec73769a87b8a688c820f8e7e8c..be5a4bf1ce186910969233d81374fee09a108380 100644 (file)
@@ -1,14 +1,10 @@
 AliPHOSCorrelations* AddTaskPi0Correlations (          const char* name = "Pi0Corr",
-                                                       const char* options = "11h",
-                                                       const char* fPi0Parametrization = "Wide",
-                                                       UInt_t offlineTriggerMask = AliVEvent::kCentral,
-                                                       AliPHOSCorrelations::TriggerSelection internalTriggerSelection = AliPHOSCorrelations::kNoSelection,
-                                                       Double_t mean = 0.135,
-                                                       Double_t sigma = 0.04,
-                                                       Int_t downCentLimit = 0,
-                                                       Int_t upCentLimit = 90 )
+                                               const char* options = "11h",
+                                               Double_t sigmaWidth = 3.,
+                                               Int_t downCentLimit = 0,
+                                               Int_t upCentLimit = 90 )
 {
-       //Author: Ponomarenko Daniil
+       //Author: Ponomarenko Daniil (Daniil.Ponomarenko@cern.ch)
        /* $Id$ */
 
        AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
@@ -24,7 +20,7 @@ AliPHOSCorrelations* AddTaskPi0Correlations (         const char* name = "Pi0Corr",
                return NULL;
        }
        
-       
+               
        stringstream ss;
        ss << downCentLimit;
        string strDownCentLimit = ss.str();
@@ -32,76 +28,56 @@ AliPHOSCorrelations* AddTaskPi0Correlations (       const char* name = "Pi0Corr",
        sprintf(text,"%2i",upCentLimit);
        string strUpCentLimit = text;
        TString centralityBorder = TString ("CB") + strDownCentLimit.c_str() + TString ("t") + strUpCentLimit.c_str() + TString ("Cnt");
-       TString sName = TString (name) + TString (fPi0Parametrization) + centralityBorder ;
+       TString sigmaBorder = Form("%2iSigma", int(sigmaWidth*10.));
+       if (sigmaWidth == 0) sigmaBorder = "00Sigma";
+       TString sName = TString (name) + sigmaBorder + centralityBorder ;
 
 
-       AliPHOSCorrelations* task = new AliPHOSCorrelations(Form("%sTask", sName.Data()),internalTriggerSelection);
+       AliPHOSCorrelations* task = new AliPHOSCorrelations( Form("%sTask", sName.Data()) );
 
-       if( TString(options).Contains("10h") )
+       if( TString(options).Contains("10h") )  {
                task->SetPeriod( AliPHOSCorrelations::kLHC10h );
-       if( TString(options).Contains("11h") )
+               task->SetCentralityEstimator("V0M");
+       }
+       if( TString(options).Contains("11h") )  {
                task->SetPeriod( AliPHOSCorrelations::kLHC11h );
-       if( TString(options).Contains("13") )
+               task->SetCentralityEstimator("V0M");
+       }
+       if( TString(options).Contains("13") )   {
                task->SetPeriod( AliPHOSCorrelations::kLHC13 );
+               task->SetCentralityEstimator("V0A");
+       }
+
 
        // Binning 
-       //Any:
-       if( AliVEvent::kAny == offlineTriggerMask ) 
-       {
-               const int nbins = 8;
-               Double_t cbin[nbins+1] = {0., 10., 20., 30., 40., 50., 60., 70., 80.};
-               TArrayD tbin(nbins+1, cbin);
-               Int_t    nMixed[nbins] = {6, 40, 40, 40, 40, 80, 80, 80};
-               TArrayI tNMixed(nbins, nMixed);
-               task->SetCentralityBinning(tbin, tNMixed);
-       }
+       // TODO: Make other binning for 0-10% and 20-50%
        //Central:
-       if( AliVEvent::kCentral == offlineTriggerMask ) 
+       if( downCentLimit == 0 && upCentLimit == 10 ) 
        {
-               const int nbins = 4;
-               Double_t cbin[nbins+1] = {0., 5., 8., 9., 10.};
+               const int nbins = 5;
+               Double_t cbin[nbins+1] = {0., 2., 4., 6., 8., 10.};
                TArrayD tbin(nbins+1, cbin);
-               Int_t    nMixed[nbins] = {6, 6, 6, 6};
+               Int_t    nMixed[nbins] = {100, 100, 100, 100, 100};
                TArrayI tNMixed(nbins, nMixed);
                task->SetCentralityBinning(tbin, tNMixed);
        }
        // SemiCentral:
-       if( AliVEvent::kSemiCentral == offlineTriggerMask ) 
-       {
-               const int nbins = 8;
-               Double_t cbin[nbins+1] = {10., 11., 12., 13., 15., 20., 30., 40., 50.};
-               TArrayD tbin(nbins+1, cbin);
-               Int_t    nMixed[nbins] = {40, 40, 40, 40, 40, 40, 40, 40};
-               TArrayI tNMixed(nbins, nMixed);
-               task->SetCentralityBinning(tbin, tNMixed);
-       }
-       //INT7:
-       if( AliVEvent::kINT7 == offlineTriggerMask ) 
+       if( downCentLimit == 20 && upCentLimit == 50 ) 
        {
-               const int nbins = 8;
-               Double_t cbin[nbins+1] = {0., 10., 20., 30., 40., 50., 60., 70., 80.};
+               const int nbins = 6;
+               Double_t cbin[nbins+1] = {20., 25., 30., 35., 40., 45., 50.};
                TArrayD tbin(nbins+1, cbin);
-               Int_t    nMixed[nbins] = {6, 40, 40, 40, 40, 80, 80, 80};
-               TArrayI tNMixed(nbins, nMixed);
-               task->SetCentralityBinning(tbin, tNMixed);
-       }
-       // MB or PHOS Trigger:
-       if( AliVEvent::kMB == offlineTriggerMask || AliVEvent::kPHOSPb == offlineTriggerMask ) 
-       {
-               const int nbins = 8;
-               Double_t cbin[nbins+1] = {0., 10., 20., 30., 40., 50., 60., 70., 80.};
-               TArrayD tbin(nbins+1, cbin);
-               Int_t    nMixed[nbins] = {6, 40, 40, 40, 40, 80, 80, 80};
+               Int_t    nMixed[nbins] = {100, 100, 100, 100, 100, 100};
                TArrayI tNMixed(nbins, nMixed);
                task->SetCentralityBinning(tbin, tNMixed);
        }
 
-
-       task->SelectCollisionCandidates(offlineTriggerMask);
-       task->SetInternalTriggerSelection(internalTriggerSelection);
-       task->EnableTOFCut(true, 100.e-9);
-       task->SetMassWindow(mean-sigma, mean+sigma);
+       task->SetAnalysisAlgoritmForReal("ME");
+       task->SetAnalysisAlgoritmForMix("ME");
+       task->EnableTOFCut(false, 100.e-9);
+       task->SelectCollisionCandidates(AliVEvent::kAny);
        task->SetCentralityBorders(downCentLimit , upCentLimit) ;
+       task->SetSigmaWidth(sigmaWidth);
 
        mgr->AddTask(task);
        mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer() );
@@ -113,3 +89,4 @@ AliPHOSCorrelations* AddTaskPi0Correlations (        const char* name = "Pi0Corr",
 
        return task;
 }
+