Run initialization fixed
authorprsnko <Dmitri.Peressounko@cern.ch>
Sat, 29 Nov 2014 13:20:35 +0000 (16:20 +0300)
committerprsnko <Dmitri.Peressounko@cern.ch>
Sun, 30 Nov 2014 12:58:47 +0000 (15:58 +0300)
PWGGA/PHOSTasks/PHOS_Correlation/AddTaskPi0Correlations.C
PWGGA/PHOSTasks/PHOS_Correlation/AliPHOSCorrelations.cxx
PWGGA/PHOSTasks/PHOS_Correlation/AliPHOSCorrelations.h

index cfb706e..f6824cd 100644 (file)
@@ -2,7 +2,8 @@ AliPHOSCorrelations* AddTaskPi0Correlations (           const char* name = "Pi0Corr",
                                                const char* options = "11h",
                                                Double_t sigmaWidth = 3.,
                                                Int_t downCentLimit = 0,
-                                               Int_t upCentLimit = 90 )
+                                               Int_t upCentLimit = 90,
+                                               const char* suffix = "" )
 {
        //Author: Ponomarenko Daniil (Daniil.Ponomarenko@cern.ch)
        /* $Id$ */
@@ -24,20 +25,20 @@ AliPHOSCorrelations* AddTaskPi0Correlations (       const char* name = "Pi0Corr",
        TString className = name;
        TString sigmaName = Form( "%2iSigma", int(sigmaWidth*10.) ) ;
        if( sigmaWidth==0 ) sigmaName = "00Sigma";
-       TString sName = Form("%s%sCB%it%iCnt", className.Data(), sigmaName.Data(), downCentLimit, upCentLimit);
-       //TString sName = "LOL";
+       TString sName = Form("%s%s%sCB%it%iCnt", className.Data(), suffix, sigmaName.Data(), downCentLimit, upCentLimit);
 
-       AliPHOSCorrelations* task = new AliPHOSCorrelations( Form("%sTask", sName.Data()) );
+       TString combinedName;
+       combinedName.Form("%sTask", sName.Data());
+
+       AliPHOSCorrelations* task = new AliPHOSCorrelations( combinedName );
 
        if( TString(options).Contains("10h") )  
        {
-               task->SetPeriod( AliPHOSCorrelations::kLHC10h );
                task->SetCentralityEstimator("V0M");
        }
        
        if( TString(options).Contains("11h") )  
        {
-               task->SetPeriod( AliPHOSCorrelations::kLHC11h );
                task->SetCentralityEstimator("V0M");
                if( downCentLimit == 0 && upCentLimit == 10 ) 
                {
@@ -58,7 +59,6 @@ AliPHOSCorrelations* AddTaskPi0Correlations (         const char* name = "Pi0Corr",
        
        if( TString(options).Contains("13") )   
        {
-               task->SetPeriod( AliPHOSCorrelations::kLHC13 );
                task->SetCentralityEstimator("V0A");
                if( downCentLimit == 0 && upCentLimit == 10 ) 
                {
@@ -100,6 +100,9 @@ AliPHOSCorrelations* AddTaskPi0Correlations (       const char* name = "Pi0Corr",
                task->SetCentralityBinning(tbin, tNMixed);
        }
 
+
+       // Period setup
+       task->SetPeriodName( TString(options) );
        // Events
        task->SelectCollisionCandidates(AliVEvent::kAny);
        task->SetCentralityBorders((Double_t)downCentLimit , (Double_t)upCentLimit) ;
@@ -116,12 +119,11 @@ AliPHOSCorrelations* AddTaskPi0Correlations (     const char* name = "Pi0Corr",
     task->SwitchOffTrackHitSPDSelection();
     task->SetTrackFilterMask(786);
 
-
        mgr->AddTask(task);
        mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer() );
 
-       TString cname(Form("%sCoutput1", sName.Data()));
-       TString pname(Form("%s:%s", AliAnalysisManager::GetCommonFileName(), sName.Data()));
+       TString cname(Form("%sCoutput1", combinedName.Data()));
+       TString pname(Form("%s:%s", AliAnalysisManager::GetCommonFileName(), combinedName.Data()));
        AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(cname.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, pname.Data());
        mgr->ConnectOutput(task, 1, coutput1);
 
index f070c49..2e8cd4f 100644 (file)
@@ -77,7 +77,7 @@ AliPHOSCorrelations::AliPHOSCorrelations()
     fTracksTPCLists(0x0),
     fRunNumber(-999),
     fInternalRunNumber(0),
-    fPeriod(kUndefinedPeriod),
+    fPeriod("0x0"),
     fPHOSEvent(false),
     fMBEvent(false),
     fNVtxZBins(10),
@@ -116,66 +116,7 @@ AliPHOSCorrelations::AliPHOSCorrelations()
     fSelectFractionTPCSharedClusters(kTRUE),
     fCutTPCSharedClustersFraction(0.4)
 {
-    //Deafult constructor, no memory allocations here
-}
-
-//_______________________________________________________________________________
-AliPHOSCorrelations::AliPHOSCorrelations(const char *name)
-:AliAnalysisTaskSE(name),
-    fPHOSGeo(0x0),
-    fOutputContainer(0x0),
-    fEvent(0x0),
-    fEventESD(0x0),
-    fEventAOD(0x0),
-    fEventHandler(0),
-    fCaloPhotonsPHOS(0x0),
-    fTracksTPC(0x0),
-    fCaloPhotonsPHOSLists(0x0),
-    fTracksTPCLists(0x0),
-    fRunNumber(-999),
-    fInternalRunNumber(0),
-    fPeriod(kUndefinedPeriod),
-    fPHOSEvent(false),
-    fMBEvent(false),
-    fNVtxZBins(10),
-    fVtxEdges(10),
-    fCentEdges(10),
-    fCentNMixed(),
-    fNEMRPBins(6),
-    fAssocBins(),
-    fVertexVector(),
-    fVtxBin(0),
-    fCentralityEstimator("V0M"),
-    fCentrality(0.),
-    fCentBin(0),
-    fHaveTPCRP(0),
-    fRP(0.),
-    fEMRPBin(0),
-    fMaxAbsVertexZ(10.),
-    fCentralityLowLimit(0.),
-    fCentralityHightLimit(90),
-    fMinClusterEnergy(0.3),
-    fMinBCDistance(0),
-    fMinNCells(3),
-    fMinM02(0.2),
-    fTOFCutEnabled(1),
-    fTOFCut(100.e-9),
-    fUseMassWindowParametrisation(true),
-    fMassInvMeanMin(0.13),
-    fMassInvMeanMax(0.145),
-    fNSigmaWidth(0.),
-    fUseEfficiency(true),
-    fESDtrackCuts(0x0),
-    fSelectHybridTracks(0),
-    fTrackStatus(0),      
-    fTrackFilterMask(786),
-    fSelectSPDHitTracks(0),
-    fSelectFractionTPCSharedClusters(kTRUE),
-    fCutTPCSharedClustersFraction(0.4)
-{
-    // Constructor
-    // Output slots #0 write into a TH1 container
-    DefineOutput(1,THashList::Class());
+     // Constructor
 
     fMassMean[0]  = 1.00796e-05 ;
     fMassMean[1]  = 0.136096    ;
@@ -199,13 +140,13 @@ AliPHOSCorrelations::AliPHOSCorrelations(const char *name)
     fVertex[1] = 0; 
     fVertex[2] = 0;
 
-    SetGeometry();
+    //SetGeometry();
 
     ZeroingVariables();
 }
 
 //_______________________________________________________________________________
-AliPHOSCorrelations::AliPHOSCorrelations(const char *name, Period period)
+AliPHOSCorrelations::AliPHOSCorrelations(const char *name)
 :AliAnalysisTaskSE(name),
     fPHOSGeo(0x0),
     fOutputContainer(0x0),
@@ -219,7 +160,7 @@ AliPHOSCorrelations::AliPHOSCorrelations(const char *name, Period period)
     fTracksTPCLists(0x0),
     fRunNumber(-999),
     fInternalRunNumber(0),
-    fPeriod(period),
+    fPeriod("0x0"),
     fPHOSEvent(false),
     fMBEvent(false),
     fNVtxZBins(10),
@@ -268,24 +209,23 @@ AliPHOSCorrelations::AliPHOSCorrelations(const char *name, Period period)
     fMassSigma[1] = 0.0041709 ;
     fMassSigma[2] = 0.00468736 ;
 
-    const Int_t nPtAssoc=10 ;
-    Double_t ptAssocBins[nPtAssoc]={0.,0.5,1.0,1.5,2.0,3.,5.,7.,10.,16} ;
+    const Int_t nPtAssoc = 10 ;
+    Double_t ptAssocBins[nPtAssoc] = {0.,0.5,1.0,1.5,2.0,3.,5.,7.,10.,16} ;
     fAssocBins.Set(nPtAssoc,ptAssocBins) ;
 
     const int nbins = 9;
     Double_t edges[nbins+1] = {0., 5., 10., 20., 30., 40., 50., 60., 70., 80.};
-    TArrayD centEdges(nbins+1, edges);
+    TArrayD centEdges( nbins+1, edges );
     Int_t nMixed[nbins] = {4,4,6,10,20,30,50,100,100};
-    //Int_t nMixed[nbins] = {100,100,100,100,100,100,100,100,100};
     TArrayI centNMixed(nbins, nMixed);
     SetCentralityBinning(centEdges, centNMixed);
     SetVertexBinning();
 
     fVertex[0] = 0; 
     fVertex[1] = 0; 
-    fVertex[2] = 0; 
+    fVertex[2] = 0;
 
-    SetGeometry();
+    //SetGeometry();
 
     ZeroingVariables();
 }
@@ -533,7 +473,7 @@ void AliPHOSCorrelations::SetHistPtAssoc(const Int_t& ptMult, const Double_t& pt
     Float_t EtaMax =  1.        ;
 
     TString spid[4]={"all","cpv","disp","both"} ;
-    
+
     for (int i = 0; i<fAssocBins.GetSize()-1; i++)
     {
         for(Int_t ipid=0; ipid<4; ipid++)
@@ -615,10 +555,16 @@ void AliPHOSCorrelations::UserExec(Option_t *)
     {
         fRunNumber = fEvent->GetRunNumber();
         fInternalRunNumber = ConvertToInternalRunNumber(fRunNumber);
+        SetGeometry();
         SetESDTrackCuts();
     }
     LogProgress(2);
 
+    if(GetPeriod().Contains("0x0"))
+    {
+        AliWarning("Undefined period!");
+    }
+
     // Step 2: Preparation variables for new event
     ZeroingVariables();
 
@@ -697,7 +643,7 @@ void AliPHOSCorrelations::UserExec(Option_t *)
         LogProgress(8);
     }
 
-    if(fPeriod == kLHC13 && fMBEvent) 
+    if(GetPeriod().Contains("13") && fMBEvent)
     {
         ConsiderPi0s_MBSelection();
         LogProgress(9);
@@ -735,7 +681,7 @@ void AliPHOSCorrelations::SetESDTrackCuts()
 Int_t AliPHOSCorrelations::ConvertToInternalRunNumber(const Int_t& run) const
 {
     // Manual setup using data from logbook.
-    if(fPeriod== kLHC11h)
+    if(GetPeriod().Contains("11h"))
     {
         switch(run)
         {
@@ -923,7 +869,7 @@ Int_t AliPHOSCorrelations::ConvertToInternalRunNumber(const Int_t& run) const
         }
     }
     
-    if(fPeriod== kLHC10h)
+    if(GetPeriod().Contains("10h"))
     {
         switch(run)
         {
@@ -1068,7 +1014,7 @@ Int_t AliPHOSCorrelations::ConvertToInternalRunNumber(const Int_t& run) const
         }
     }
     
-    if( kLHC13 == fPeriod ) 
+    if(GetPeriod().Contains("13"))
     {
         switch(run)
         {
@@ -1246,7 +1192,7 @@ Int_t AliPHOSCorrelations::ConvertToInternalRunNumber(const Int_t& run) const
         }
     }
     
-    if((fPeriod == kUndefinedPeriod) && (fDebug >= 1) ) 
+    if(GetPeriod().Contains("0x0") && fDebug >= 1)
     {
         AliWarning("Period not defined");
     }
@@ -1349,14 +1295,14 @@ Bool_t AliPHOSCorrelations::RejectTriggerMaskSelection()
     fMBEvent    = false ;
 
     // Choosing triggers for different periods.
-    if(fPeriod == kLHC13) 
+    if(GetPeriod().Contains("13")) 
     {
         // Working: MB + TriggerPHOS events in real events; MB only in mixed events.
         isTriggerEvent  =  isPHI7 || isINT7 ;
         isMIXEvent      =  isINT7 ;
     }
 
-    if(fPeriod == kLHC11h) 
+    if(GetPeriod().Contains("11h"))
     {
         // Working: The same trigger in real and mixed events.
         isTriggerEvent = isCentral || isSemiCentral ;
@@ -2332,7 +2278,7 @@ Double_t AliPHOSCorrelations::GetEfficiency(const Double_t& pt) const
     // TODO: fix functions value below 1 GeV/c.
     if(x < 1.) x = 1.;
 
-    if(fPeriod == kLHC11h)
+    if(GetPeriod().Contains("11h"))
     {
         if (fCentrality <= 5)                       pFitPoint = &par0[0];
         if (fCentrality > 5 && fCentrality <= 10)   pFitPoint = &par1[0];
@@ -2353,7 +2299,7 @@ Double_t AliPHOSCorrelations::GetEfficiency(const Double_t& pt) const
             e = TMath::Exp(-((((1.+(pFit[1]*x))+(pFit[2]*(x*x)))+(pFit[5]*(x*(x*x))))/(((pFit[3]*x)+(pFit[4]*(x*x)))+(pFit[6]*(x*(x*x)))))) ;
     }
     else
-    if( fPeriod == kLHC13 ) 
+    if(GetPeriod().Contains("13")) 
     {
         pFitPoint = &par8[0];
         Double_t pFit[9];
@@ -2483,3 +2429,4 @@ void AliPHOSCorrelations::FillEventBiningProperties() const
     }
 }
 
+
index 00b2df3..c339a21 100644 (file)
@@ -34,7 +34,6 @@ class AliVTrack;
 class AliPHOSCorrelations : public AliAnalysisTaskSE 
 {
 public:
-  enum Period               { kUndefinedPeriod, kLHC10h, kLHC11h, kLHC13 } ;
   enum EventSelection       { kTotal, kEvent, kEventHandler, 
                               kTriggerMaskSelection, kHasVertex, kHasCentrality, 
                               kHasPHOSClusters, kHasTPCTracks, kPHOSEvent, 
@@ -45,13 +44,14 @@ public:
 public:
   AliPHOSCorrelations() ;
   AliPHOSCorrelations(const char *name) ;
-  AliPHOSCorrelations(const char *name, Period period ) ;
   virtual ~AliPHOSCorrelations() ;
 
   virtual void   UserCreateOutputObjects() ;
   virtual void   UserExec(Option_t *option) ;
 
-  void SetPeriod(const Period period)                                             { fPeriod = period                     ; }
+  void SetPeriodName(const TString str)                                           { fPeriod = str                    ; }
+  TString GetPeriod()                                                   const { return fPeriod                   ; }
+
   void SetCentralityEstimator(const char * centr)                                 { fCentralityEstimator = centr         ; }
   void SetEventMixingRPBinning(const UInt_t nBins)                                { fNEMRPBins = nBins                   ; }
   void SetMaxAbsVertexZ(const Float_t z)                                          { fMaxAbsVertexZ = z                   ; }
@@ -214,7 +214,7 @@ private:
 
   Int_t     fRunNumber;                                 //! Run number
   Int_t     fInternalRunNumber ;                        //! Current internal run number 
-  Period    fPeriod;                                    //! kUndefinedPeriod, kLHC10h, kLHC11h, kLHC13
+  TString   fPeriod;
 
   Bool_t    fPHOSEvent;                                 //! PHOS event trigger.
   Bool_t    fMBEvent;                                   //! MB event trigger.