]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGGA/PHOSTasks/PHOS_PbPb/AliAnalysisTaskPi0Flow.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGGA / PHOSTasks / PHOS_PbPb / AliAnalysisTaskPi0Flow.h
index 806eadb661e58cf54f7239c511ebe95dfce7e2fe..eab0868cd333889c7db66ae4e06d94c3bac523b5 100644 (file)
@@ -1,6 +1,9 @@
 #ifndef AliAnalysisTaskPi0Flow_cxx
 #define AliAnalysisTaskPi0Flow_cxx
 
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
 // Analysis task to fill histograms with PHOS ESD or AOD clusters and cells
 // Authors : Dmitri Peressounko
 // Date    : 28.05.2011
@@ -20,6 +23,8 @@ class AliESDEvent ;
 class AliPHOSCalibData;
 class AliESDtrack ;
 class AliESDCaloCluster ;
+class AliEPFlattener;
+class AliAnalysisUtils;
 
 #include "TArrayD.h"
 
@@ -27,7 +32,9 @@ class AliESDCaloCluster ;
 
 class AliAnalysisTaskPi0Flow : public AliAnalysisTaskSE {
 public:
-    enum Period { kUndefinedPeriod, kLHC10h, kLHC11h };
+    enum Period { kUndefinedPeriod, kLHC10h, kLHC11h, kLHC13 };
+    enum EventSelection { kTotal, kInternalTriggerMaskSelection, kHasVertex, kHasAbsVertex, kHasCentrality, kCentUnderUpperBinUpperEdge, kCentOverLowerBinLowerEdge, kHasPHOSClusters, kTotalSelected };
+    enum TriggerSelection { kNoSelection, kCentralInclusive, kCentralExclusive, kSemiCentralInclusive, kSemiCentralExclusive, kMBInclusive, kMBExclusive };
 
 public:
     AliAnalysisTaskPi0Flow(const char *name = "AliAnalysisTaskPi0Flow", Period period = kUndefinedPeriod);
@@ -38,30 +45,40 @@ public:
     /* virtual void   Terminate(Option_t *); */
 
     void SetPeriod(Period period) { fPeriod = period;}
+    void SetCentralityEstimator(const char * centr) {fCentralityEstimator = centr;}
+    void EnableTOFCut(Bool_t enable = kTRUE, Double_t TOFCut = 100.e-9, Bool_t fillWide=kFALSE){fTOFCutEnabled=enable; fTOFCut=TOFCut; fFillWideTOF=fillWide;}
     
-    void SetCentralityBinning(const TArrayD& edges);
-    void SetNMixedPerCentrality(const TArrayI& nMixed);
+    void SetCentralityBinning(const TArrayD& edges, const TArrayI& nMixed);
     void SetEventMixingRPBinning(UInt_t nBins) { fNEMRPBins = nBins; }
+    void SetInternalTriggerSelection(TriggerSelection selection) { fInternalTriggerSelection = selection; }
+    void SetMaxAbsVertexZ(Float_t z) { fMaxAbsVertexZ = z; }
+    void SetManualV0EPCalc(Bool_t manCalc = true) {fManualV0EPCalc = manCalc;}
+    void SetEnablePHOSModule(int module, Bool_t enable = true);
     
     void SetPHOSBadMap(Int_t mod,TH2I * badMapHist);
+    //Where to read AODB object with EP calibration if not default
+    void SetEPcalibFileName(const TString filename) {fEPcalibFileName = filename; }   
 
 
-private:
+protected:
     AliAnalysisTaskPi0Flow(const AliAnalysisTaskPi0Flow&); // not implemented
     AliAnalysisTaskPi0Flow& operator=(const AliAnalysisTaskPi0Flow&); // not implemented
 
     // Step 0:
     AliVEvent* GetEvent();
-    AliStack* GetMCStack();
 
-    // Step 1:
+    // Step 1 (done once):
     void SetGeometry();
     void SetMisalignment();
     void SetV0Calibration(); //V0 calibration
     void SetESDTrackCuts(); // AliESDtrack cuts ( for esd data )
     void SetPHOSCalibData(); // phos re-calibration ( for esd data)
+    void SetFlatteningData(); // phos flattening
 
     // Step 2:
+    Bool_t RejectTriggerMaskSelection();
+
+    // Step 3:
     void SetVertex();
     Bool_t RejectEventVertex();
 
@@ -77,16 +94,19 @@ private:
     void FillPHOSCellQAHists();
 
     // Step 8: Event Photons (PHOS Clusters) selection
-    void SelectPhotonClusters();
-    void FillSelectedClusterHistograms();
+    virtual void SelectPhotonClusters();
+    virtual void FillSelectedClusterHistograms();
 
     // Step 9: Consider pi0 (photon/cluster) pairs.
-    void ConsiderPi0s();
+    virtual void ConsiderPi0s();
 
     // Step 10; Mixing
-    void ConsiderPi0sMix();
+    virtual void ConsiderPi0sMix();
 
-    // Step 11: Update lists
+    // Step 11: MC
+    virtual void ProcessMC();
+
+    // Step 12: Update lists
     void UpdateLists();
 
     Bool_t AreNeibors(Int_t id1,Int_t id2) ;
@@ -95,6 +115,8 @@ private:
     Double_t ApplyFlatteningV0C(Double_t phi, Double_t c) ; //Apply centrality-dependent flattening
     Int_t ConvertToInternalRunNumber(Int_t run) ;
     Double_t CoreEnergy(AliVCluster * clu, AliVCaloCells * cells);
+    void EvalCoreLambdas(AliVCluster * clu, AliVCaloCells * cells, Double_t &m02, Double_t &m20) ; 
+    Bool_t TestCoreLambda(Double_t pt,Double_t l1,Double_t l2) ;
 
 
 
@@ -102,12 +124,14 @@ private:
     void FillHistogram(const char * key,Double_t x) const ; //Fill 1D histogram witn name key
     void FillHistogram(const char * key,Double_t x, Double_t y) const ; //Fill 2D histogram witn name key
     void FillHistogram(const char * key,Double_t x, Double_t y, Double_t z) const ; //Fill 3D histogram witn name key
+    void FillHistogram(const char * key,Double_t x, Double_t y, Double_t z, Double_t w) const ; //Fill 3D histogram witn name key
 
     TVector3 GetVertexVector(const AliVVertex* vertex);
     Int_t GetCentralityBin(Float_t centralityV0M);
     Int_t GetRPBin();
 
-    void LogProgress(int step, int internalRunNumber);
+    void LogProgress(int step);
+    void LogSelection(int step, int internalRunNumber);
 
     Bool_t IsGoodChannel(const char * det, Int_t mod,Int_t ix, Int_t iz); //Use addisional bad map for PHOS
 
@@ -120,30 +144,43 @@ private:
     UInt_t GetNumberOfCentralityBins() { return fCentEdges.GetSize()-1; }
     TList* GetCaloPhotonsPHOSList(UInt_t vtxBin, UInt_t centBin, UInt_t rpBin);
     
+    AliAnalysisUtils* GetAnalysisUtils();
 
 
+protected:
+    // transient constants
+    static const Int_t    kNMod = 5;
 
-private:
     // constants:
-    static const Double_t kLogWeight= 4.5 ; // log weight for recalibration.
-    static const Double_t kAlphaCut=0.7 ;
-    static const Bool_t doESDReCalibration = kTRUE;
-    static const Int_t kNCenBins = 9; // see EvalV0ReactionPlane()
+    static const Double_t kLogWeight ; // log weight for recalibration.
+    static const Double_t kAlphaCut ;
+    static const Bool_t   doESDReCalibration;
+    static const Int_t    kNCenBins = 9; // see EvalV0ReactionPlane()
 
     // cluster cut variables:
-    static const Double_t kMinClusterEnergy = 0.3;
-    static const Int_t kMinNCells = 3;
-    static const Double_t kMinM02 = 0.2;
+    static const Double_t kMinClusterEnergy;
+    static const Double_t kMinBCDistance;  //distance to nearest bad channel
+    static const Int_t    kMinNCells;
+    static const Double_t kMinM02;
 
     // Binning, [vtx, centrality, reaction-plane]
-    static const Int_t kNVtxZBins = 1;
-    static const Double_t kCentCutoff = 90.; // Ignore Centrality over 90%
+    static const Int_t    kNVtxZBins;
+    static const Double_t kCentCutoff; // Ignore Centrality over 90%
     TArrayD fCentEdges;  // Centrality Bin Lower edges
     TArrayI fCentNMixed; // Number of mixed events for each centrality bin
     UInt_t fNEMRPBins;
     
 
+    // Behavior / cuts
     Period fPeriod;
+    TriggerSelection fInternalTriggerSelection;
+    Float_t fMaxAbsVertexZ; // in cm
+    Bool_t fManualV0EPCalc;
+    Bool_t fModuleEnabled[kNMod]; //[kNMod]
+    Bool_t fTOFCutEnabled;
+    Double_t fTOFCut;
+    Bool_t fFillWideTOF;
+
 
     TList * fOutputContainer;        //final histogram container
 
@@ -158,7 +195,6 @@ private:
     AliVEvent* fEvent; //! Current event
     AliESDEvent* fEventESD; //! Current event, if ESD.
     AliAODEvent* fEventAOD; //! Current event, if AOD.
-    AliStack * fMCStack ;
 
     // Step 1: Run Number, Misalignment Matrix, and Calibration
     Int_t fRunNumber; // run number
@@ -170,15 +206,22 @@ private:
     Float_t fWidthQ[kNCenBins][2][2];   // ...
     AliESDtrackCuts *fESDtrackCuts; // Track cut
     AliPHOSCalibData *fPHOSCalibData; // PHOS calibration object
-
-    // Step 2: Vertex
+    TString fEPcalibFileName; 
+    AliEPFlattener * fTPCFlat ; //Object for flattening of TPC
+    AliEPFlattener * fV0AFlat ; //Object for flattening of V0A
+    AliEPFlattener * fV0CFlat ; //Object for flattening of V0C
+    
+    
+    // Step 3: Vertex
     Double_t fVertex[3];
     TVector3 fVertexVector;
     Int_t fVtxBin;
 
+
     // Step 4: Centrality
-    Float_t fCentralityV0M ; //!Centrality of the currecnt event
-    Int_t fCentBin ;       //! Current centrality bin
+    TString fCentralityEstimator; //! Centrality estimator ("V0M", "ZNA")
+    Float_t fCentrality ;         //! Centrality of the current event
+    Int_t   fCentBin ;            //! Current centrality bin
 
     // Step 5: Reaction Plane
     Bool_t fHaveTPCRP ; //! Is TPC RP defined?
@@ -190,11 +233,11 @@ private:
     // Step 8: Event Photons (PHOS Clusters) selection
     TObjArray * fCaloPhotonsPHOS ;      //PHOS photons in current event
 
-    // Step 11: Update lists for mixing.
+    // Step 12: Update lists for mixing.
     TObjArray* fCaloPhotonsPHOSLists; //! array of TList, Containers for events with PHOS photons
 
 
-    ClassDef(AliAnalysisTaskPi0Flow, 1); // PHOS analysis task
+    ClassDef(AliAnalysisTaskPi0Flow, 3); // PHOS analysis task
 };
 
 #endif