]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskRhoVnModulation.h
integration of local rho into framework. From Rosi/Redmer
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / UserTasks / AliAnalysisTaskRhoVnModulation.h
index 5800e76296875160395b066badbc58fd27d27470..97364d69e793ea3a3fc617415e43a6d0158fdbeb 100644 (file)
@@ -18,6 +18,7 @@ class TF1;
 class THF1;
 class THF2;
 class TProfile;
+class AliLocalRhoParameter;
 
 class AliAnalysisTaskRhoVnModulation : public AliAnalysisTaskEmcalJet
 {
@@ -27,13 +28,13 @@ class AliAnalysisTaskRhoVnModulation : public AliAnalysisTaskEmcalJet
         enum qcRecovery         { kFixedRho, kNegativeVn, kTryFit };    // how to deal with negative cn value for qcn value
         enum runModeType        { kLocal, kGrid };                      // run mode type
         enum dataType           { kESD, kAOD, kESDMC, kAODMC };         // data type
-        enum detectorType       { kTPC, kVZEROA, kVZEROC};    // detector that was used
+        enum detectorType       { kTPC, kVZEROA, kVZEROC, kVZEROComb};  // detector that was used
         // constructors, destructor
                                 AliAnalysisTaskRhoVnModulation();
                                 AliAnalysisTaskRhoVnModulation(const char *name, runModeType type);
         virtual                 ~AliAnalysisTaskRhoVnModulation();
-       
         // setting up the task and technical aspects
+        void                    ExecOnce();
         Bool_t                  InitializeAnalysis();
         virtual void            UserCreateOutputObjects();
         virtual Bool_t          Run();
@@ -57,21 +58,12 @@ class AliAnalysisTaskRhoVnModulation : public AliAnalysisTaskEmcalJet
             return -999; }
         // note that the cdf of the chisquare distribution is the normalized lower incomplete gamma function
         /* inline */    Double_t ChiSquareCDF(Int_t ndf, Double_t x) const { return TMath::Gamma(ndf/2., x/2.); }
-        /* inline */    Double_t RhoVal() const { return (fRho) ? fRho->GetVal(): -999.;}                 
-        /* inline */    Double_t RhoVal(Double_t phi, Double_t r, Double_t n) const {
-            if(!fFitModulation) return RhoVal(); // coverity
-            switch (fFitModulationType) {
-                case kNoFit : return RhoVal();
-                default : {
-                    Double_t denom(2*r*fFitModulation->GetParameter(0));
-                    return  (denom <= 0.) ? RhoVal() : n*(fFitModulation->Integral(phi-r, phi+r)/denom); 
-                }
-            }
-        }
         // setters - analysis setup
         void                    SetDebugMode(Int_t d)                           {fDebug = d;}
+        void                    SetAttachToEvent(Bool_t b)                      {fAttachToEvent = b;}
+        void                    SetFillHistograms(Bool_t b)                     {fFillHistograms = b;}
         void                    SetFillQAHistograms(Bool_t qa)                  {fFillQAHistograms = qa;}
-        void                    SetReduceBinsXYByFactor(Int_t x, Int_t y)       {fReduceBinsXByFactor = x;
+        void                    SetReduceBinsXYByFactor(Float_t x, Float_t y)   {fReduceBinsXByFactor = x;
                                                                                  fReduceBinsYByFactor = y;}
         void                    SetNoEventWeightsForQC(Bool_t e)                {fNoEventWeightsForQC = e;}
         void                    SetCentralityClasses(TArrayI* c)                {fCentralityClasses = c;}
@@ -84,9 +76,9 @@ class AliAnalysisTaskRhoVnModulation : public AliAnalysisTaskEmcalJet
         void                    SetNameJetClones(const char* name)              {fNameJetClones = name; }
         void                    SetNamePicoTrackClones(const char* name)        {fNamePicoTrackClones = name; }
         void                    SetNameRho(const char* name)                    {fNameRho = name; }
+        void                    SetUseScaledRho(Bool_t s)                       {fUseScaledRho = s; }
         void                    SetRandomSeed(TRandom3* r)                      {if (fRandom) delete fRandom; fRandom = r; }
-        void                    SetModulationFit(TF1* fit)                      {if (fFitModulation) delete fFitModulation;
-                                                                                 fFitModulation = fit; }
+        void                    SetModulationFit(TF1* fit);
         void                    SetModulationFitMinMaxP(Float_t m, Float_t n)   {fMinPvalue = m; fMaxPvalue = n; }
         void                    SetModulationFitType(fitModulationType type)    {fFitModulationType = type; }
         void                    SetQCnRecoveryType(qcRecovery type)             {fQCRecovery = type; }
@@ -97,22 +89,26 @@ class AliAnalysisTaskRhoVnModulation : public AliAnalysisTaskEmcalJet
         void                    SetAbsVertexZ(Float_t v)                        {fAbsVertexZ = v; }
         void                    SetMinDistanceRctoLJ(Float_t m)                 {fMinDisanceRCtoLJ = m; }
         void                    SetRandomConeRadius(Float_t r)                  {fRandomConeRadius = r; }
+        void                    SetMaxNoRandomCones(Int_t m)                    {fMaxCones = m; }
         void                    SetMinLeadingHadronPt(Double_t m)               {fMinLeadingHadronPt = m; }
+        void                    SetSetPtSub(Bool_t s)                           {fSubtractJetPt = s;}
         void                    SetForceAbsVnHarmonics(Bool_t f)                {fAbsVnHarmonics = f; }
         void                    SetExcludeLeadingJetsFromFit(Float_t n)         {fExcludeLeadingJetsFromFit = n; }
         void                    SetRebinSwapHistoOnTheFly(Bool_t r)             {fRebinSwapHistoOnTheFly = r; }
         void                    SetSaveThisPercentageOfFits(Float_t p)          {fPercentageOfFits = p; }
         void                    SetUseV0EventPlaneFromHeader(Bool_t h)          {fUseV0EventPlaneFromHeader = h;}
-        void                    SetSetPtSub(Bool_t s)                           {fSetPtSub = s; }
         void                    SetExplicitOutlierCutForYear(Int_t y)           {fExplicitOutlierCut = y;}
         // getters - these are used as well by AliAnalyisTaskJetFlow, so be careful when changing them
         TString                 GetJetsName() const                             {return fJetsName; }
         TString                 GetTracksName() const                           {return fTracksName; }
+        TString                 GetLocalRhoName() const                         {return fLocalRhoName; }
         TArrayI*                GetCentralityClasses() const                    {return fCentralityClasses;}
         TArrayD*                GetPtBinsHybrids() const                        {return fPtBinsHybrids; }
         TArrayD*                GetPtBinsJets() const                           {return fPtBinsJets; }
         TProfile*               GetResolutionParameters(Int_t h, Int_t c) const {return (h==2) ? fProfV2Resolution[c] : fProfV3Resolution[c];}
         TList*                  GetOutputList() const                           {return fOutputList;}
+        AliLocalRhoParameter*   GetLocalRhoParameter() const                    {return fLocalRho;}
+        Double_t                GetJetRadius() const                            {return fJetRadius;}
         void                    ExecMe()                                        {ExecOnce();}
         AliAnalysisTaskRhoVnModulation* ReturnMe()                              {return this;}
         // local cuts
@@ -123,7 +119,9 @@ class AliAnalysisTaskRhoVnModulation : public AliAnalysisTaskEmcalJet
         // numerical evaluations
         void                    CalculateEventPlaneVZERO(Double_t vzero[2][2]) const;
         void                    CalculateEventPlaneTPC(Double_t* tpc);
-        void                    CalculateEventPlaneResolution(Double_t vzero[2][2], Double_t* tpc) const;
+        void                    CalculateEventPlaneCombinedVZERO(Double_t* comb) const;
+        void                    CalculateEventPlaneResolution(Double_t vzero[2][2], Double_t* vzeroComb, Double_t* tpc);
+        Double_t                CalculateEventPlaneChi(Double_t resEP) const;
         void                    CalculateRandomCone(Float_t &pt, Float_t &eta, Float_t &phi, AliEmcalJet* jet = 0x0, Bool_t randomize = 0) const;
         Double_t                CalculateQC2(Int_t harm);
         Double_t                CalculateQC4(Int_t harm);
@@ -150,15 +148,14 @@ class AliAnalysisTaskRhoVnModulation : public AliAnalysisTaskEmcalJet
         Bool_t                  PassesCuts(Int_t year);
         Bool_t                  PassesCuts(const AliVCluster* track) const;
         // filling histograms
-        void                    FillHistogramsAfterSubtraction(Double_t vzero[2][2], Double_t* tpc) const;
+        void                    FillHistogramsAfterSubtraction(Double_t psi2, Double_t psi3, Double_t vzero[2][2], Double_t* vzeroComb, Double_t* tpc) const;
         void                    FillTrackHistograms() const;
         void                    FillClusterHistograms() const;
         void                    FillCorrectedClusterHistograms() const;
-        void                    FillEventPlaneHistograms(Double_t vzero[2][2], Double_t* tpc) const;
+        void                    FillEventPlaneHistograms(Double_t vzero[2][2], Double_t* vzeroComb, Double_t* tpc) const;
         void                    FillRhoHistograms() const;
-        void                    FillDeltaPtHistograms(Double_t vzero[2][2], Double_t* tpc) const; 
-        void                    FillJetHistograms(Double_t vzero[2][2], Double_t* psi) const;
-        void                    FillDeltaPhiHistograms(Double_t vzero[2][2], Double_t* tpc) const;
+        void                    FillDeltaPtHistograms(Double_t psi2, Double_t psi3) const; 
+        void                    FillJetHistograms(Double_t psi2, Double_t psi3) const;
         void                    FillQAHistograms(AliVTrack* vtrack) const;
         void                    FillQAHistograms(AliVEvent* vevent);
         void                    FillAnalysisSummaryHistogram() const;
@@ -172,10 +169,12 @@ class AliAnalysisTaskRhoVnModulation : public AliAnalysisTaskEmcalJet
     private:
         // analysis flags and settings
         Int_t                   fDebug;                 // debug level (0 none, 1 fcn calls, 2 verbose)
-        Bool_t                  fInitialized;           //! is the analysis initialized?
+        Bool_t                  fLocalInit;             //! is the analysis initialized?
+        Bool_t                  fAttachToEvent;         // attach local rho to the event
+        Bool_t                  fFillHistograms;        // fill histograms
         Bool_t                  fFillQAHistograms;      // fill qa histograms
-        Int_t                   fReduceBinsXByFactor;   // reduce the bins on x-axis of histo's by this integer
-        Int_t                   fReduceBinsYByFactor;   // reduce the bins on y-axis of histo's by this integer
+        Float_t                 fReduceBinsXByFactor;   // reduce the bins on x-axis of histo's by this much
+        Float_t                 fReduceBinsYByFactor;   // reduce the bins on y-axis of histo's by this much
         Bool_t                  fNoEventWeightsForQC;   // don't store event weights for qc analysis
         TArrayI*                fCentralityClasses;     //-> centrality classes (maximum 10)
         TArrayD*                fPtBinsHybrids;         //-> pt bins for hybrid track vn anaysis
@@ -185,6 +184,7 @@ class AliAnalysisTaskRhoVnModulation : public AliAnalysisTaskEmcalJet
         TH1F*                   fUserSuppliedR2;        // correct the extracted v2 with this r
         TH1F*                   fUserSuppliedR3;        // correct the extracted v3 with this r
         // members
+        Bool_t                  fUseScaledRho;          // use scaled rho
         Int_t                   fNAcceptedTracks;       //! number of accepted tracks
         Int_t                   fNAcceptedTracksQCn;    //! accepted tracks for QCn
         fitModulationType       fFitModulationType;     // fit modulation type
@@ -222,14 +222,15 @@ class AliAnalysisTaskRhoVnModulation : public AliAnalysisTaskEmcalJet
         // general settings
         Float_t                 fMinDisanceRCtoLJ;      // min distance between rc and leading jet
         Float_t                 fRandomConeRadius;      // radius of random cone
+        Int_t                   fMaxCones;              // max number of random cones
         Bool_t                  fAbsVnHarmonics;        // force postive local rho
         Float_t                 fExcludeLeadingJetsFromFit;    // exclude n leading jets from fit
         Bool_t                  fRebinSwapHistoOnTheFly;       // rebin swap histo on the fly
         Float_t                 fPercentageOfFits;      // save this percentage of fits
-        Bool_t                  fUseV0EventPlaneFromHeader;    // use the vzero event plane from the header
-        Bool_t                  fSetPtSub;              // store the subtracted pt in the jet
+        Bool_t                  fUseV0EventPlaneFromHeader;             // use the vzero event plane from the header
         Int_t                   fExplicitOutlierCut;    // cut on correlation of tpc and global multiplicity
         Double_t                fMinLeadingHadronPt;    // minimum pt for leading hadron
+        Bool_t                  fSubtractJetPt;         // save subtracted jet pt by calling SetPtSub
         // transient object pointers
         TList*                  fOutputList;            //! output list
         TList*                  fOutputListGood;        //! output list for local analysis
@@ -261,6 +262,7 @@ class AliAnalysisTaskRhoVnModulation : public AliAnalysisTaskEmcalJet
         TProfile*               fHistPsiSpread;          //! event plane spread histogram
         TH1F*                   fHistPsiVZEROA;          //! psi 2 from vzero a
         TH1F*                   fHistPsiVZEROC;          //! psi 2 from vzero c
+        TH1F*                   fHistPsiVZERO;           //! psi 2 from combined vzero
         TH1F*                   fHistPsiTPC;             //! psi 2 from tpc
         // background
         TH1F*                   fHistRhoPackage[10];     //! rho as estimated by emcal jet package
@@ -273,21 +275,13 @@ class AliAnalysisTaskRhoVnModulation : public AliAnalysisTaskEmcalJet
         TH2F*                   fHistRCPhiEta[10];              //! random cone eta and phi
         TH2F*                   fHistRhoVsRCPt[10];             //! rho * A vs rcpt
         TH1F*                   fHistRCPt[10];                  //! rcpt
-        TH2F*                   fHistDeltaPtDeltaPhi2TPC[10];   //! dpt vs dphi tpc
-        TH2F*                   fHistDeltaPtDeltaPhi2V0A[10];   //! dpt vs dphi vzeroa
-        TH2F*                   fHistDeltaPtDeltaPhi2V0C[10];   //! dpt vs dphi vzeroc
-        TH2F*                   fHistDeltaPtDeltaPhi3TPC[10];   //! dpt vs dphi tpc
-        TH2F*                   fHistDeltaPtDeltaPhi3V0A[10];   //! dpt vs dphi vzeroa
-        TH2F*                   fHistDeltaPtDeltaPhi3V0C[10];   //! dpt vs dphi vzeroc
+        TH2F*                   fHistDeltaPtDeltaPhi2[10];      //! dpt vs dphi (psi2 - phi)
+        TH2F*                   fHistDeltaPtDeltaPhi3[10];      //! dpt vs dphi (psi3 - phi)
         TH2F*                   fHistRCPhiEtaExLJ[10];          //! random cone eta and phi, excl leading jet
         TH2F*                   fHistRhoVsRCPtExLJ[10];         //! rho * A vs rcpt, excl leading jet
         TH1F*                   fHistRCPtExLJ[10];              //! rcpt, excl leading jet
-        TH2F*                   fHistDeltaPtDeltaPhi2ExLJTPC[10];  //! dpt vs dphi, excl leading jet
-        TH2F*                   fHistDeltaPtDeltaPhi2ExLJV0A[10];  //! dpt vs dphi, excl leading jet
-        TH2F*                   fHistDeltaPtDeltaPhi2ExLJV0C[10];  //! dpt vs dphi, excl leading jet
-        TH2F*                   fHistDeltaPtDeltaPhi3ExLJTPC[10];  //! dpt vs dphi, excl leading jet
-        TH2F*                   fHistDeltaPtDeltaPhi3ExLJV0A[10];  //! dpt vs dphi, excl leading jet
-        TH2F*                   fHistDeltaPtDeltaPhi3ExLJV0C[10];  //! dpt vs dphi, excl leading jet
+        TH2F*                   fHistDeltaPtDeltaPhi2ExLJ[10];  //! dpt vs dphi, excl leading jet
+        TH2F*                   fHistDeltaPtDeltaPhi3ExLJ[10];  //! dpt vs dphi, excl leading jet
         /* TH2F*                   fHistRCPhiEtaRand[10];          //! random cone eta and phi, randomized */
         /* TH2F*                   fHistRhoVsRCPtRand[10];         //! rho * A vs rcpt, randomized */
         /* TH1F*                   fHistRCPtRand[10];              //! rcpt, randomized */ 
@@ -301,21 +295,13 @@ class AliAnalysisTaskRhoVnModulation : public AliAnalysisTaskEmcalJet
         TH2F*                   fHistJetPtConstituents[10];     //! jet pt versus number of constituents
         TH2F*                   fHistJetEtaRho[10];             //! jet eta versus jet rho
         // in plane, out of plane jet spectra
-        TH2F*                   fHistJetPsiTPCPt[10];            //! psi tpc versus pt
-        TH2F*                   fHistJetPsiVZEROAPt[10];         //! psi vzeroa versus pt
-        TH2F*                   fHistJetPsiVZEROCPt[10];         //! psi vzeroc versus pt
-        // phi minus psi 
-        TH1F*                   fHistDeltaPhi2VZEROA[10];       //! phi minus psi_A
-        TH1F*                   fHistDeltaPhi2VZEROC[10];       //! phi minus psi_C
-        TH1F*                   fHistDeltaPhi2TPC[10];          //! phi minus psi_TPC
-        TH1F*                   fHistDeltaPhi3VZEROA[10];       //! phi minus psi_A
-        TH1F*                   fHistDeltaPhi3VZEROC[10];       //! phi minus psi_C
-        TH1F*                   fHistDeltaPhi3TPC[10];          //! phi minus psi_TPC
+        TH2F*                   fHistJetPsi2Pt[10];             //! psi tpc versus pt
+        TH2F*                   fHistJetPsi3Pt[10];             //! psi vzeroc versus pt
 
         AliAnalysisTaskRhoVnModulation(const AliAnalysisTaskRhoVnModulation&);                  // not implemented
         AliAnalysisTaskRhoVnModulation& operator=(const AliAnalysisTaskRhoVnModulation&);       // not implemented
 
-        ClassDef(AliAnalysisTaskRhoVnModulation, 14);
+        ClassDef(AliAnalysisTaskRhoVnModulation, 15);
 };
 
 #endif