-#ifndef AliAnalysisTaskPi0Flow_cxx\r
-#define AliAnalysisTaskPi0Flow_cxx\r
-\r
-// example of an analysis task creating a p_t spectrum\r
-// Authors: Panos Cristakoglou, Jan Fiete Grosse-Oetringhaus, Christian Klein-Boesing\r
-\r
-class TObjArray;\r
-class TH1F;\r
-class TH2I;\r
-class TH2F;\r
-class TH3F;\r
-class TF1 ;\r
-class AliStack ;\r
-class AliESDtrackCuts;\r
-class AliPHOSGeometry;\r
-class AliESDEvent ;\r
-class AliPHOSCalibData;\r
-class AliESDtrack ;\r
-class AliESDCaloCluster ;\r
-\r
-#include "AliAnalysisTaskSE.h"\r
-\r
-class AliAnalysisTaskPi0Flow : public AliAnalysisTaskSE {\r
-public:\r
- AliAnalysisTaskPi0Flow(const char *name = "AliAnalysisTaskPi0Flow");\r
- virtual ~AliAnalysisTaskPi0Flow() {}\r
- \r
- virtual void UserCreateOutputObjects();\r
- virtual void UserExec(Option_t *option);\r
- virtual void Terminate(Option_t *);\r
- void SetPHOSBadMap(Int_t mod,TH2I * h)\r
- {\r
- if(fPHOSBadMap[mod]) delete fPHOSBadMap[mod] ;\r
- fPHOSBadMap[mod]=new TH2I(*h) ;\r
- printf("Set %s \n",fPHOSBadMap[mod]->GetName());\r
- }\r
- \r
-private:\r
- AliAnalysisTaskPi0Flow(const AliAnalysisTaskPi0Flow&); // not implemented\r
- AliAnalysisTaskPi0Flow& operator=(const AliAnalysisTaskPi0Flow&); // not implemented\r
- Bool_t IsGoodChannel(const char * det, Int_t mod,Int_t ix, Int_t iz); //Use addisional bad map for PHOS\r
-\r
- void FillHistogram(const char * key,Double_t x) const ; //Fill 1D histogram witn name key\r
- void FillHistogram(const char * key,Double_t x, Double_t y) const ; //Fill 2D histogram witn name key\r
- void FillHistogram(const char * key,Double_t x, Double_t y, Double_t z) const ; //Fill 3D histogram witn name key\r
-\r
- Bool_t TestLambda(Double_t pt,Double_t l1,Double_t l2) ; //Evaluate Dispersion cuts for photons\r
- Bool_t TestLambda2(Double_t pt,Double_t l1,Double_t l2) ; //Evaluate Dispersion cuts for photons\r
- Double_t TestCPV(Double_t dx, Double_t dz, Double_t pt, Int_t charge);\r
- Int_t ConvertRunNumber(Int_t run) ; \r
-\r
- void OpenInfoCalbration(Int_t run); //V0 calibration\r
- void EvalV0ReactionPlane(AliESDEvent * event) ;\r
- Double_t ApplyFlattening(Double_t phi, Double_t c) ; //Apply centrality-dependent flattening\r
- Double_t ApplyFlatteningV0A(Double_t phi, Double_t c) ; //Apply centrality-dependent flattening\r
- Double_t ApplyFlatteningV0C(Double_t phi, Double_t c) ; //Apply centrality-dependent flattening\r
-\r
- Double_t CoreEnergy(AliESDCaloCluster * clu); \r
- void Reclusterize(AliESDCaloCluster * clu) ;\r
- Bool_t AreNeibors(Int_t id1,Int_t id2) ;\r
-private:\r
- AliESDtrackCuts *fESDtrackCuts; // Track cut\r
- AliStack * fStack ;\r
- TList * fOutputContainer; //final histogram container\r
- TList * fPHOSEvents[1][10][11] ; //Containers for events with PHOS photons\r
- TClonesArray * fPHOSEvent ; //PHOS photons in current event\r
- AliPHOSCalibData *fPHOSCalibData; // PHOS calibration object\r
- TF1 *fNonLinCorr; // Non-linearity correction\r
- \r
- //Reaction plain for v2\r
- Float_t fRP ; //!Reaction plane calculated with full TPC \r
- Float_t fRPV0A ; //!Reaction plain calculated with A-side TPC: eta>0.15 \r
- Float_t fRPV0C ; //!Reaction plain calculated with C-side TPC: eta<-0.15\r
- Bool_t fHaveTPCRP ; //! Is TPC RP defined?\r
- \r
- //V0 calibration\r
-\r
- static const Int_t nCentrBinV0 = 9; // # cenrality bins\r
-\r
- TProfile *fMultV0; // object containing VZERO calibration information\r
-\r
- Float_t fV0Cpol,fV0Apol; // loaded by OADB\r
-\r
- Float_t fMeanQ[nCentrBinV0][2][2]; // and recentering\r
-\r
- Float_t fWidthQ[nCentrBinV0][2][2]; // ...\r
-\r
-\r
-// TF1 * fRecent[5][12] ;//Recentering corrections\r
-\r
- Int_t fRunNumber ; //Current run number\r
- Float_t fCentrality ; //!Centrality of the currecnt event\r
-\r
- Int_t fCenBin ; //! Current centrality bin\r
-\r
- TH2I *fPHOSBadMap[6] ; //Container for PHOS bad channels map\r
-\r
- AliPHOSGeometry *fPHOSGeo; //! PHOS geometry\r
- Int_t fEventCounter; // number of analyzed events\r
-\r
- ClassDef(AliAnalysisTaskPi0Flow, 1); // PHOS analysis task\r
-};\r
-\r
-#endif\r
+#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
+// Modified: 03.08.2012 Henrik Qvigstad
+/* $Id$ */
+
+class TObjArray;
+class TH1F;
+class TH2I;
+class TH2F;
+class TH3F;
+class TF1 ;
+class AliStack ;
+class AliESDtrackCuts;
+class AliPHOSGeometry;
+class AliESDEvent ;
+class AliPHOSCalibData;
+class AliESDtrack ;
+class AliESDCaloCluster ;
+class AliEPFlattener;
+class AliAnalysisUtils;
+
+#include "TArrayD.h"
+
+#include "AliAnalysisTaskSE.h"
+
+class AliAnalysisTaskPi0Flow : public AliAnalysisTaskSE {
+public:
+ 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);
+ virtual ~AliAnalysisTaskPi0Flow();
+
+ virtual void UserCreateOutputObjects();
+ virtual void UserExec(Option_t *option);
+ /* 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, 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; }
+
+
+protected:
+ AliAnalysisTaskPi0Flow(const AliAnalysisTaskPi0Flow&); // not implemented
+ AliAnalysisTaskPi0Flow& operator=(const AliAnalysisTaskPi0Flow&); // not implemented
+
+ // Step 0:
+ AliVEvent* GetEvent();
+
+ // 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();
+
+ // Step 4:
+ void SetCentrality();
+ Bool_t RejectCentrality();
+
+ // Step 5:
+ void EvalReactionPlane();
+ void EvalV0ReactionPlane();
+
+ // Step 7: QA PHOS cells
+ void FillPHOSCellQAHists();
+
+ // Step 8: Event Photons (PHOS Clusters) selection
+ virtual void SelectPhotonClusters();
+ virtual void FillSelectedClusterHistograms();
+
+ // Step 9: Consider pi0 (photon/cluster) pairs.
+ virtual void ConsiderPi0s();
+
+ // Step 10; Mixing
+ virtual void ConsiderPi0sMix();
+
+ // Step 11: MC
+ virtual void ProcessMC();
+
+ // Step 12: Update lists
+ void UpdateLists();
+
+ Bool_t AreNeibors(Int_t id1,Int_t id2) ;
+ Double_t ApplyFlattening(Double_t phi, Double_t c) ; //Apply centrality-dependent flattening
+ Double_t ApplyFlatteningV0A(Double_t phi, Double_t c) ; //Apply centrality-dependent flattening
+ 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) ;
+
+
+
+
+ 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);
+ 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
+
+
+ void Reclusterize(AliVCluster * clu) ;
+ Double_t TestCPV(Double_t dx, Double_t dz, Double_t pt, Int_t charge);
+ Bool_t TestLambda(Double_t pt,Double_t l1,Double_t l2) ; //Evaluate Dispersion cuts for photons
+ Bool_t TestLambda2(Double_t pt,Double_t l1,Double_t l2) ; //Evaluate Dispersion cuts for photons
+
+ 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;
+
+ // constants:
+ 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;
+ 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;
+ 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
+
+ TF1 *fNonLinCorr; // Non-linearity correction
+//TF1 * fRecent[5][12] ;//Recentering corrections
+ TH2I *fPHOSBadMap[6] ; //Container for PHOS bad channels map
+
+ // Run variables
+
+ // Step 0: Event Objects
+ // fEvent, fMCStack
+ AliVEvent* fEvent; //! Current event
+ AliESDEvent* fEventESD; //! Current event, if ESD.
+ AliAODEvent* fEventAOD; //! Current event, if AOD.
+
+ // Step 1: Run Number, Misalignment Matrix, and Calibration
+ Int_t fRunNumber; // run number
+ Int_t fInternalRunNumber ; //Current internal run number
+ AliPHOSGeometry *fPHOSGeo; //! PHOS geometry
+ TProfile *fMultV0; // object containing VZERO calibration information
+ Float_t fV0Cpol,fV0Apol; // loaded by OADB
+ Float_t fMeanQ[kNCenBins][2][2]; // and recentering
+ Float_t fWidthQ[kNCenBins][2][2]; // ...
+ AliESDtrackCuts *fESDtrackCuts; // Track cut
+ AliPHOSCalibData *fPHOSCalibData; // PHOS calibration object
+ 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
+ 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?
+ Float_t fRP ; //!Reaction plane calculated with full TPC
+ Float_t fRPV0A ; //!Reaction plain calculated with A-side TPC: eta>0.15
+ Float_t fRPV0C ; //!Reaction plain calculated with C-side TPC: eta<-0.15
+ Int_t fEMRPBin; //! Event Mixing Reaction Plane Bin
+
+ // Step 8: Event Photons (PHOS Clusters) selection
+ TObjArray * fCaloPhotonsPHOS ; //PHOS photons in current event
+
+ // Step 12: Update lists for mixing.
+ TObjArray* fCaloPhotonsPHOSLists; //! array of TList, Containers for events with PHOS photons
+
+
+ ClassDef(AliAnalysisTaskPi0Flow, 3); // PHOS analysis task
+};
+
+#endif