Update HFE v2 analyses
authorrbailhac <Raphaelle.Bailhache@cern.ch>
Tue, 2 Dec 2014 17:27:29 +0000 (18:27 +0100)
committerrbailhac <Raphaelle.Bailhache@cern.ch>
Tue, 2 Dec 2014 17:27:29 +0000 (18:27 +0100)
PWGHF/hfe/AliAnalysisTaskFlowITSTPCTOFQCSP.cxx
PWGHF/hfe/AliAnalysisTaskFlowITSTPCTOFQCSP.h
PWGHF/hfe/AliAnalysisTaskFlowTPCEMCalQCSP.cxx
PWGHF/hfe/AliAnalysisTaskFlowTPCEMCalQCSP.h
PWGHF/hfe/macros/AddTaskFlowITSTPCTOFQCSP.C
PWGHF/hfe/macros/AddTaskFlowTPCEMCalQCSP.C
PWGHF/hfe/macros/AddTaskHFEnpePbPb.C

index b58f1c4..cc339f3 100755 (executable)
@@ -208,6 +208,9 @@ AliAnalysisTaskFlowITSTPCTOFQCSP::AliAnalysisTaskFlowITSTPCTOFQCSP(const char *n
 ,fAssoTPCCluster(0)
 ,fAssoITSRefit(0)
 ,fPhiCut(0)
+,fHistEPDistrWeight(0)
+,EPweights(0)
+,EPVzAftW(0)
 {
     //Named constructor
     
@@ -327,6 +330,9 @@ AliAnalysisTaskFlowITSTPCTOFQCSP::AliAnalysisTaskFlowITSTPCTOFQCSP()
 ,fAssoTPCCluster(0)
 ,fAssoITSRefit(0)
 ,fPhiCut(0)
+,fHistEPDistrWeight(0)
+,EPweights(0)
+,EPVzAftW(0)
 {
     //Default constructor
     fPID = new AliHFEpid("hfePid");
@@ -539,16 +545,32 @@ void AliAnalysisTaskFlowITSTPCTOFQCSP::UserExec(Option_t*)
     EPTPCp->Fill(evPlAngTPCp);
     EPVz->Fill(evPlAngV0);
     
+    
+    
+    Double_t weightEP =1;
+    if(EPweights){
+        weightEP = GiveMeWeight(evPlAngV0);
+        EPVzAftW->Fill(evPlAngV0,weightEP);
+        
+    }
+
+    
+    
     fSubEventDPhiv2->Fill(0.5, TMath::Cos(2.*(evPlAngV0A-evPlAngTPC))); // vzeroa - tpc
     fSubEventDPhiv2->Fill(1.5, TMath::Cos(2.*(evPlAngV0A-evPlAngV0C))); // vzeroa - vzeroc
     fSubEventDPhiv2->Fill(2.5, TMath::Cos(2.*(evPlAngV0C-evPlAngTPC))); // tpc - vzeroc
     
     
-    fSubEventDPhiv2new->Fill(0.5, TMath::Cos(2.*(evPlAngV0-evPlAngTPCp))); // vzero - tpcp
-    fSubEventDPhiv2new->Fill(1.5, TMath::Cos(2.*(evPlAngV0-evPlAngTPCn))); // vzero - tpcn
-    fSubEventDPhiv2new->Fill(2.5, TMath::Cos(2.*(evPlAngTPCp-evPlAngTPCn))); // tpcp - tpcn
-    
-    
+    if(EPweights){
+        fSubEventDPhiv2new->Fill(0.5, TMath::Cos(2.*(evPlAngV0-evPlAngTPCp)),weightEP); // vzero - tpcp
+        fSubEventDPhiv2new->Fill(1.5, TMath::Cos(2.*(evPlAngV0-evPlAngTPCn)),weightEP); // vzero - tpcn
+        fSubEventDPhiv2new->Fill(2.5, TMath::Cos(2.*(evPlAngTPCp-evPlAngTPCn))); // tpcp - tpcn
+    }
+    if(!EPweights){
+        fSubEventDPhiv2new->Fill(0.5, TMath::Cos(2.*(evPlAngV0-evPlAngTPCp))); // vzero - tpcp
+        fSubEventDPhiv2new->Fill(1.5, TMath::Cos(2.*(evPlAngV0-evPlAngTPCn))); // vzero - tpcn
+        fSubEventDPhiv2new->Fill(2.5, TMath::Cos(2.*(evPlAngTPCp-evPlAngTPCn))); // tpcp - tpcn
+    }
     //====================================================================================================================
     
     AliAODTrack *track = NULL;
@@ -713,7 +735,10 @@ void AliAnalysisTaskFlowITSTPCTOFQCSP::UserExec(Option_t*)
         Double_t v2PhiV0tot[2] = {
             v2PhiVz,
             pt};
-        fV2Phivzerotot->Fill(v2PhiV0tot);
+    
+        if(EPweights) fV2Phivzerotot->Fill(v2PhiV0tot,weightEP);
+        if(!EPweights) fV2Phivzerotot->Fill(v2PhiV0tot);
+        
         
         //==========================================================================================================
         //=========================================================================================================
@@ -759,7 +784,7 @@ void AliAnalysisTaskFlowITSTPCTOFQCSP::UserExec(Option_t*)
         //=========================================================================================================
         //----------------------Selection and Flow of Photonic Electrons-----------------------------
         Bool_t fFlagPhotonicElec = kFALSE;
-        SelectPhotonicElectron(iTracks,track,fTPCnSigma,evPlAngV0,fFlagPhotonicElec);
+        SelectPhotonicElectron(iTracks,track,fTPCnSigma,evPlAngV0,fFlagPhotonicElec,weightEP);
         if(fFlagPhotonicElec){fPhotoElecPt->Fill(pt);}
               // Semi inclusive electron
         if(!fFlagPhotonicElec){fSemiInclElecPt->Fill(pt);}
@@ -773,7 +798,7 @@ void AliAnalysisTaskFlowITSTPCTOFQCSP::UserExec(Option_t*)
     //----------hfe end---------
 }
 //_________________________________________
-void AliAnalysisTaskFlowITSTPCTOFQCSP::SelectPhotonicElectron(Int_t itrack,const AliAODTrack *track,Float_t fTPCnSigma,Double_t evPlAngV0, Bool_t &fFlagPhotonicElec)
+void AliAnalysisTaskFlowITSTPCTOFQCSP::SelectPhotonicElectron(Int_t itrack,const AliAODTrack *track,Float_t fTPCnSigma,Double_t evPlAngV0, Bool_t &fFlagPhotonicElec, Double_t weightEPflat)
 {
     
     //Identify non-heavy flavour electrons using Invariant mass method
@@ -875,18 +900,20 @@ void AliAnalysisTaskFlowITSTPCTOFQCSP::SelectPhotonicElectron(Int_t itrack,const
        if(fFlagULS){
                Double_t ulsSparse[3] = {
                track->Pt(),
-                fTPCnSigma,
+        fTPCnSigma,
                DeltaPhi_eEP
                }; 
-               fSparsephipsiULS->Fill(ulsSparse);  
+               if(EPweights) fSparsephipsiULS->Fill(ulsSparse,weightEPflat);
+        if(!EPweights) fSparsephipsiULS->Fill(ulsSparse);
                }
        if(fFlagLS){
                Double_t lsSparse[3] = {
                track->Pt(),
-                fTPCnSigma,
+        fTPCnSigma,
                DeltaPhi_eEP
                }; 
-               fSparsephipsiLS->Fill(lsSparse);  
+               if(EPweights) fSparsephipsiLS->Fill(lsSparse,weightEPflat);
+        if(!EPweights)fSparsephipsiLS->Fill(lsSparse);
                }
        }
         
@@ -1107,17 +1134,17 @@ void AliAnalysisTaskFlowITSTPCTOFQCSP::UserCreateOutputObjects()
     
     
     //----------------------------------------------------------------------------
-    EPVzA = new TH1D("EPVzA", "EPVzA", 80, -2, 2);
+    EPVzA = new TH1D("EPVzA", "EPVzA", 60, -TMath::Pi()/2, TMath::Pi()/2);
     fOutputList->Add(EPVzA);
-    EPVzC = new TH1D("EPVzC", "EPVzC", 80, -2, 2);
+    EPVzC = new TH1D("EPVzC", "EPVzC", 60, -TMath::Pi()/2, TMath::Pi()/2);
     fOutputList->Add(EPVzC);
-    EPTPC = new TH1D("EPTPC", "EPTPC", 80, -2, 2);
+    EPTPC = new TH1D("EPTPC", "EPTPC", 60, -TMath::Pi()/2, TMath::Pi()/2);
     fOutputList->Add(EPTPC);
-    EPVz = new TH1D("EPVz", "EPVz", 80, -2, 2);
+    EPVz = new TH1D("EPVz", "EPVz", 60, -TMath::Pi()/2, TMath::Pi()/2);
     fOutputList->Add(EPVz);
-    EPTPCp = new TH1D("EPTPCp", "EPTPCp", 80, -2, 2);
+    EPTPCp = new TH1D("EPTPCp", "EPTPCp", 60, -TMath::Pi()/2, TMath::Pi()/2);
     fOutputList->Add(EPTPCp);
-    EPTPCn = new TH1D("EPTPCn", "EPTPCn", 80, -2, 2);
+    EPTPCn = new TH1D("EPTPCn", "EPTPCn", 60, -TMath::Pi()/2, TMath::Pi()/2);
     fOutputList->Add(EPTPCn);
     
     
@@ -1126,15 +1153,17 @@ void AliAnalysisTaskFlowITSTPCTOFQCSP::UserCreateOutputObjects()
     fSubEventDPhiv2->GetXaxis()->SetBinLabel(1, "<cos(2(#Psi_{a} - #Psi_{b}))>");
     fSubEventDPhiv2->GetXaxis()->SetBinLabel(2, "<cos(2(#Psi_{a} - #Psi_{c}>))");
     fSubEventDPhiv2->GetXaxis()->SetBinLabel(3, "<cos(2(#Psi_{b} - #Psi_{c}>))");
+    fSubEventDPhiv2->Sumw2();
     fOutputList->Add(fSubEventDPhiv2);
     
     fSubEventDPhiv2new = new TProfile("fSubEventDPhiv2new", "fSubEventDPhiv2new", 3, 0, 3);
     fSubEventDPhiv2new->GetXaxis()->SetBinLabel(1, "<cos(2(#Psi_{a} - #Psi_{b}))>");
     fSubEventDPhiv2new->GetXaxis()->SetBinLabel(2, "<cos(2(#Psi_{a} - #Psi_{c}>))");
     fSubEventDPhiv2new->GetXaxis()->SetBinLabel(3, "<cos(2(#Psi_{b} - #Psi_{c}>))");
+    fSubEventDPhiv2new->Sumw2();
     fOutputList->Add(fSubEventDPhiv2new);
     
-    //================================Event Plane with VZERO=====================
+    //================================Event Plane with VZERO A and C=====================
     const Int_t nPtBins = 12;
     Double_t binsPt[nPtBins+1] = {0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 2.5, 3, 3.5, 4, 5};
     // v2A, v2C, pt
@@ -1148,7 +1177,10 @@ void AliAnalysisTaskFlowITSTPCTOFQCSP::UserCreateOutputObjects()
     fV2Phi->GetAxis(0)->SetTitle("v_{2} (V0A)");
     fV2Phi->GetAxis(1)->SetTitle("v_{2} (V0C)");
     fV2Phi->GetAxis(2)->SetTitle("p_{T} (GeV/c)");
+    fV2Phi->Sumw2();
     fOutputList->Add(fV2Phi);
+    
+    
     //================================Event Plane with VZERO=====================
     Int_t    binsV[2] = {  50,  100};
     Double_t xminV[2] = { -1.,   0};
@@ -1159,6 +1191,7 @@ void AliAnalysisTaskFlowITSTPCTOFQCSP::UserCreateOutputObjects()
     // set axes titles
     fV2Phivzerotot->GetAxis(0)->SetTitle("v_{2} (V0)");
     fV2Phivzerotot->GetAxis(1)->SetTitle("p_{T} (GeV/c)");
+    fV2Phivzerotot->Sumw2();
     fOutputList->Add(fV2Phivzerotot);
 
     
@@ -1196,12 +1229,14 @@ void AliAnalysisTaskFlowITSTPCTOFQCSP::UserCreateOutputObjects()
     fSparsephipsiULS->GetAxis(0)->SetTitle("pt (Gev/c)");
     fSparsephipsiULS->GetAxis(1)->SetTitle("tpcnsigma");
     fSparsephipsiULS->GetAxis(2)->SetTitle("DeltaPhiULS");
+    fSparsephipsiULS->Sumw2();
     fOutputList->Add(fSparsephipsiULS);
  
     fSparsephipsiLS = new THnSparseF("fSparsephipsiLS", "pt:tpcnsigma:DeltaPhiLS", 3, binsphipsi, xminphipsi, xmaxphipsi);
     fSparsephipsiLS->GetAxis(0)->SetTitle("pt (Gev/c)");
     fSparsephipsiLS->GetAxis(1)->SetTitle("tpcnsigma");
     fSparsephipsiLS->GetAxis(2)->SetTitle("DeltaPhiLS");
+    fSparsephipsiLS->Sumw2();
     fOutputList->Add(fSparsephipsiLS);
     
     
@@ -1219,6 +1254,13 @@ void AliAnalysisTaskFlowITSTPCTOFQCSP::UserCreateOutputObjects()
     fOutputList->Add(fSparseMassLS);
 
     
+    EPVzAftW = new TH1D("EPVzAftW", "EPVzAftW",60, -TMath::Pi()/2, TMath::Pi()/2);
+    fOutputList->Add(EPVzAftW);
+
+    
+    fOutputList->Add(fHistEPDistrWeight);
+    
+    
     PostData(1,fOutputList);
     // create and post flowevent
     fFlowEvent = new AliFlowEvent(10000);
@@ -1481,6 +1523,34 @@ Bool_t AliAnalysisTaskFlowITSTPCTOFQCSP::IsEventSelectedForCentrFlattening(Float
     
 }
 //---------------------------------------------------------------------------
+//_____________________________________________________________________________
+void AliAnalysisTaskFlowITSTPCTOFQCSP::SetHistoForEPFlattWeights(TH1D *h){
+    
+    if(fHistEPDistrWeight)delete fHistEPDistrWeight;
+    fHistEPDistrWeight=(TH1D*)h->Clone("fHistEPDistrWeight");
+    Double_t Inte = fHistEPDistrWeight->Integral()/fHistEPDistrWeight->GetNbinsX();
+    
+    
+    
+    for(Int_t j=1;j<=h->GetNbinsX();j++){// Now set the "probabilities"
+        Double_t w = Inte/fHistEPDistrWeight->GetBinContent(j);
+        fHistEPDistrWeight->SetBinError(j,0./*h->GetBinError(j)*ref/bincont*/);
+        
+        fHistEPDistrWeight->SetBinContent(j,w);
+    }
+    return;
+    
+}
+//-------------------------------------------------
+Double_t AliAnalysisTaskFlowITSTPCTOFQCSP::GiveMeWeight(Double_t EP){
+    
+    Int_t Bin = fHistEPDistrWeight->FindBin(EP);
+    Double_t ww = fHistEPDistrWeight->GetBinContent(Bin);
+    return ww;
+    
+}
+//-------------------------------------------------
+
 
 
 //_____________________________________________________________________________
index b39149e..f0ea1aa 100755 (executable)
@@ -48,7 +48,7 @@ public:
     void                                 SetEnableDebugMode() {fDebug = kTRUE; };
     void                                 SetCentralityParameters(Double_t CentralityMin, Double_t CentralityMax, const char* CentralityMethod); //select centrality
     void                                 CheckCentrality(AliAODEvent *event,Bool_t &centralitypass); //to use only events with the correct centrality....
-    void                                 SelectPhotonicElectron(Int_t itrack,const AliAODTrack *track,Float_t fTPCnSigma,Double_t evPlAngV0, Bool_t &fFlagPhotonicElec);
+    void                                 SelectPhotonicElectron(Int_t itrack,const AliAODTrack *track,Float_t fTPCnSigma,Double_t evPlAngV0, Bool_t &fFlagPhotonicElec, Double_t weightEPflat);
     void                                 SelectPhotonicElectronMethod(Bool_t dca){fDCA = dca;}
     void                                 SetInvariantMassCut(Double_t invmass) {fInvmassCut = invmass;};
     void                                 SetPtMinAssoCut(Double_t ptminimumasso) {fptminAsso = ptminimumasso;};
@@ -76,6 +76,10 @@ public:
     void                                 SetAssoTPCCluster(Int_t tpc_clust) {fAssoTPCCluster = tpc_clust;};
     void                                 SetPhiCut(Bool_t phicut){fPhiCut = phicut;};
 
+    void                                 SetHistoForEPFlattWeights(TH1D *h);
+    Double_t                             GiveMeWeight(Double_t EP);
+    void                                 SetEPWeight(Bool_t epw){EPweights = epw;};
+
     
     AliHFEpid *GetPID() const { return fPID; };
     
@@ -186,6 +190,11 @@ private:
     Bool_t                fAssoITSRefit;//asso its refit
     Bool_t                fPhiCut;//Phi cut to simulate emcal acc
 
+    TH1D                 *fHistEPDistrWeight;// isto for Centr Flat
+    Bool_t               EPweights;//for mult correlationcut
+    TH1D                 *EPVzAftW;//!v0cep
+    
+
     
     AliAnalysisTaskFlowITSTPCTOFQCSP(const AliAnalysisTaskFlowITSTPCTOFQCSP&); // not implemented
     AliAnalysisTaskFlowITSTPCTOFQCSP& operator=(const AliAnalysisTaskFlowITSTPCTOFQCSP&); // not implemented
index fa1460b..ed5920e 100644 (file)
@@ -201,6 +201,9 @@ AliAnalysisTaskFlowTPCEMCalQCSP::AliAnalysisTaskFlowTPCEMCalQCSP(const char *nam
 ,fSparsephipsiLS(0)
 ,fSparseMassULS(0)
 ,fSparseMassLS(0)
+,fHistEPDistrWeight(0)
+,EPweights(0)
+,EPVzAftW(0)
 {
     //Named constructor
     
@@ -313,6 +316,9 @@ AliAnalysisTaskFlowTPCEMCalQCSP::AliAnalysisTaskFlowTPCEMCalQCSP()
 ,fSparsephipsiLS(0)
 ,fSparseMassULS(0)
 ,fSparseMassLS(0)
+,fHistEPDistrWeight(0)
+,EPweights(0)
+,EPVzAftW(0)
 {
     //Default constructor
     fPID = new AliHFEpid("hfePid");
@@ -526,21 +532,31 @@ void AliAnalysisTaskFlowTPCEMCalQCSP::UserExec(Option_t*)
     EPVz->Fill(evPlAngV0);
     
     
-    
+    Double_t weightEP =1;
+    if(EPweights){
+        weightEP = GiveMeWeight(evPlAngV0);
+        EPVzAftW->Fill(evPlAngV0,weightEP);
+        
+    }
+
     
     fSubEventDPhiv2->Fill(0.5, TMath::Cos(2.*(evPlAngV0A-evPlAngTPC))); // vzeroa - tpc
     fSubEventDPhiv2->Fill(1.5, TMath::Cos(2.*(evPlAngV0A-evPlAngV0C))); // vzeroa - vzeroc
     fSubEventDPhiv2->Fill(2.5, TMath::Cos(2.*(evPlAngV0C-evPlAngTPC))); // tpc - vzeroc
     
     
-    fSubEventDPhiv2new->Fill(0.5, TMath::Cos(2.*(evPlAngV0-evPlAngTPCp))); // vzero - tpcp
-    fSubEventDPhiv2new->Fill(1.5, TMath::Cos(2.*(evPlAngV0-evPlAngTPCn))); // vzero - tpcn
-    fSubEventDPhiv2new->Fill(2.5, TMath::Cos(2.*(evPlAngTPCp-evPlAngTPCn))); // tpcp - tpcn
-    
-    
-    
-    
+    if(EPweights){
+        fSubEventDPhiv2new->Fill(0.5, TMath::Cos(2.*(evPlAngV0-evPlAngTPCp)),weightEP); // vzero - tpcp
+        fSubEventDPhiv2new->Fill(1.5, TMath::Cos(2.*(evPlAngV0-evPlAngTPCn)),weightEP); // vzero - tpcn
+        fSubEventDPhiv2new->Fill(2.5, TMath::Cos(2.*(evPlAngTPCp-evPlAngTPCn))); // tpcp - tpcn
+    }
+    if(!EPweights){
+        fSubEventDPhiv2new->Fill(0.5, TMath::Cos(2.*(evPlAngV0-evPlAngTPCp))); // vzero - tpcp
+        fSubEventDPhiv2new->Fill(1.5, TMath::Cos(2.*(evPlAngV0-evPlAngTPCn))); // vzero - tpcn
+        fSubEventDPhiv2new->Fill(2.5, TMath::Cos(2.*(evPlAngTPCp-evPlAngTPCn))); // tpcp - tpcn
+    }
     //====================================================================================================================
+
     
     
     AliAODTrack *track = NULL;
@@ -683,7 +699,12 @@ void AliAnalysisTaskFlowTPCEMCalQCSP::UserExec(Option_t*)
         Double_t v2PhiV0tot[2] = {
             v2PhiVz,
             pt};
-        fV2Phivzerotot->Fill(v2PhiV0tot);
+        
+        if(EPweights) fV2Phivzerotot->Fill(v2PhiV0tot,weightEP);
+        if(!EPweights) fV2Phivzerotot->Fill(v2PhiV0tot);
+        
+
+        
         //=========================================================================================================
         fTPCnsigmaAft->Fill(p,fTPCnSigma);
         fInclusiveElecPt->Fill(pt);
@@ -755,7 +776,7 @@ void AliAnalysisTaskFlowTPCEMCalQCSP::UserExec(Option_t*)
         if(!fDCA){
             //----------------------Selection of Photonic Electrons KFParticle-----------------------------
             Bool_t fFlagPhotonicElec = kFALSE;
-            SelectPhotonicElectron(iTracks,track,fEovP, evPlAngV0, fFlagPhotonicElec);
+            SelectPhotonicElectron(iTracks,track,fEovP, evPlAngV0, fFlagPhotonicElec,weightEP);
             if(fFlagPhotonicElec){fPhotoElecPt->Fill(pt);}
             // Semi inclusive electron
             if(!fFlagPhotonicElec){fSemiInclElecPt->Fill(pt);}
@@ -774,7 +795,7 @@ void AliAnalysisTaskFlowTPCEMCalQCSP::UserExec(Option_t*)
     //----------hfe end---------
 }
 //_________________________________________
-void AliAnalysisTaskFlowTPCEMCalQCSP::SelectPhotonicElectron(Int_t itrack,const AliAODTrack *track,Double_t fEovP,Double_t evPlAngV0, Bool_t &fFlagPhotonicElec)
+void AliAnalysisTaskFlowTPCEMCalQCSP::SelectPhotonicElectron(Int_t itrack,const AliAODTrack *track,Double_t fEovP,Double_t evPlAngV0, Bool_t &fFlagPhotonicElec, Double_t weightEPflat)
 {
     //Identify non-heavy flavour electrons using Invariant mass method KF
     
@@ -880,19 +901,21 @@ void AliAnalysisTaskFlowTPCEMCalQCSP::SelectPhotonicElectron(Int_t itrack,const
        if(fFlagULS){
                Double_t ulsSparse[3] = {
                track->Pt(),
-                fEovP,
+        fEovP,
                DeltaPhi_eEP
                }; 
-               fSparsephipsiULS->Fill(ulsSparse);  
+        if(EPweights) fSparsephipsiULS->Fill(ulsSparse,weightEPflat);
+        if(!EPweights) fSparsephipsiULS->Fill(ulsSparse);
                }
        if(fFlagLS){
                Double_t lsSparse[3] = {
                track->Pt(),
-                fEovP,
+        fEovP,
                DeltaPhi_eEP
                }; 
-               fSparsephipsiLS->Fill(lsSparse);  
-               }
+        if(EPweights) fSparsephipsiLS->Fill(lsSparse,weightEPflat);
+        if(!EPweights)fSparsephipsiLS->Fill(lsSparse);
+        }
        }
         
         
@@ -1069,19 +1092,19 @@ void AliAnalysisTaskFlowTPCEMCalQCSP::UserCreateOutputObjects()
     
     
     //----------------------------------------------------------------------------
-    EPVzA = new TH1D("EPVzA", "EPVzA", 80, -2, 2);
+    EPVzA = new TH1D("EPVzA", "EPVzA", 60, -TMath::Pi()/2, TMath::Pi()/2);
     fOutputList->Add(EPVzA);
-    EPVzC = new TH1D("EPVzC", "EPVzC", 80, -2, 2);
+    EPVzC = new TH1D("EPVzC", "EPVzC", 60, -TMath::Pi()/2, TMath::Pi()/2);
     fOutputList->Add(EPVzC);
-    EPTPC = new TH1D("EPTPC", "EPTPC", 80, -2, 2);
+    EPTPC = new TH1D("EPTPC", "EPTPC", 60, -TMath::Pi()/2, TMath::Pi()/2);
     fOutputList->Add(EPTPC);
     
     
-    EPVz = new TH1D("EPVz", "EPVz", 80, -2, 2);
+    EPVz = new TH1D("EPVz", "EPVz", 60, -TMath::Pi()/2, TMath::Pi()/2);
     fOutputList->Add(EPVz);
-    EPTPCp = new TH1D("EPTPCp", "EPTPCp", 80, -2, 2);
+    EPTPCp = new TH1D("EPTPCp", "EPTPCp", 60, -TMath::Pi()/2, TMath::Pi()/2);
     fOutputList->Add(EPTPCp);
-    EPTPCn = new TH1D("EPTPCn", "EPTPCn", 80, -2, 2);
+    EPTPCn = new TH1D("EPTPCn", "EPTPCn", 60, -TMath::Pi()/2, TMath::Pi()/2);
     fOutputList->Add(EPTPCn);
     
     //----------------------------------------------------------------------------
@@ -1089,6 +1112,7 @@ void AliAnalysisTaskFlowTPCEMCalQCSP::UserCreateOutputObjects()
     fSubEventDPhiv2->GetXaxis()->SetBinLabel(1, "<cos(2(#Psi_{a} - #Psi_{b}))>");
     fSubEventDPhiv2->GetXaxis()->SetBinLabel(2, "<cos(2(#Psi_{a} - #Psi_{c}>))");
     fSubEventDPhiv2->GetXaxis()->SetBinLabel(3, "<cos(2(#Psi_{b} - #Psi_{c}>))");
+    fSubEventDPhiv2->Sumw2();
     fOutputList->Add(fSubEventDPhiv2);
     
     
@@ -1097,7 +1121,10 @@ void AliAnalysisTaskFlowTPCEMCalQCSP::UserCreateOutputObjects()
     fSubEventDPhiv2new->GetXaxis()->SetBinLabel(1, "<cos(2(#Psi_{a} - #Psi_{b}))>");
     fSubEventDPhiv2new->GetXaxis()->SetBinLabel(2, "<cos(2(#Psi_{a} - #Psi_{c}>))");
     fSubEventDPhiv2new->GetXaxis()->SetBinLabel(3, "<cos(2(#Psi_{b} - #Psi_{c}>))");
+    fSubEventDPhiv2new->Sumw2();
     fOutputList->Add(fSubEventDPhiv2new);
+    
+    
     //================================Event Plane with VZERO A & C=====================
     const Int_t nPtBins = 12;
     Double_t binsPt[nPtBins+1] = {0, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 10, 13};
@@ -1112,10 +1139,9 @@ void AliAnalysisTaskFlowTPCEMCalQCSP::UserCreateOutputObjects()
     fV2Phi->GetAxis(0)->SetTitle("v_{2} (V0A)");
     fV2Phi->GetAxis(1)->SetTitle("v_{2} (V0C)");
     fV2Phi->GetAxis(2)->SetTitle("p_{T} (GeV/c)");
+    fV2Phi->Sumw2();
     fOutputList->Add(fV2Phi);
     
-    
-    
     //================================Event Plane with VZERO=====================
     // const Int_t nPtBins = 10;
     // Double_t binsPt[nPtBins+1] = {0, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
@@ -1129,6 +1155,8 @@ void AliAnalysisTaskFlowTPCEMCalQCSP::UserCreateOutputObjects()
     // set axes titles
     fV2Phivzerotot->GetAxis(0)->SetTitle("v_{2} (V0)");
     fV2Phivzerotot->GetAxis(1)->SetTitle("p_{T} (GeV/c)");
+    fV2Phivzerotot->Sumw2();
+
     fOutputList->Add(fV2Phivzerotot);
     
     
@@ -1172,12 +1200,14 @@ void AliAnalysisTaskFlowTPCEMCalQCSP::UserCreateOutputObjects()
     fSparsephipsiULS->GetAxis(0)->SetTitle("pt (Gev/c)");
     fSparsephipsiULS->GetAxis(1)->SetTitle("eop");
     fSparsephipsiULS->GetAxis(2)->SetTitle("DeltaPhiULS");
+    fSparsephipsiULS->Sumw2();
     fOutputList->Add(fSparsephipsiULS);
  
     fSparsephipsiLS = new THnSparseF("fSparsephipsiLS", "pt:eop:DeltaPhiLS", 3, binsphipsi, xminphipsi, xmaxphipsi);
     fSparsephipsiLS->GetAxis(0)->SetTitle("pt (Gev/c)");
     fSparsephipsiLS->GetAxis(1)->SetTitle("eop");
     fSparsephipsiLS->GetAxis(2)->SetTitle("DeltaPhiLS");
+    fSparsephipsiLS->Sumw2();
     fOutputList->Add(fSparsephipsiLS);
     
     Int_t    binsmass[2] = { 100, 200};
@@ -1193,7 +1223,11 @@ void AliAnalysisTaskFlowTPCEMCalQCSP::UserCreateOutputObjects()
     fSparseMassLS->GetAxis(1)->SetTitle("mass");
     fOutputList->Add(fSparseMassLS);
     
+    EPVzAftW = new TH1D("EPVzAftW", "EPVzAftW",60, -TMath::Pi()/2, TMath::Pi()/2);
+    fOutputList->Add(EPVzAftW);
     
+    fOutputList->Add(fHistEPDistrWeight);
+
     
     PostData(1,fOutputList);
     // create and post flowevent
@@ -1452,4 +1486,38 @@ Bool_t AliAnalysisTaskFlowTPCEMCalQCSP::IsEventSelectedForCentrFlattening(Float_
     
 }
 //---------------------------------------------------------------------------
+//_____________________________________________________________________________
+void AliAnalysisTaskFlowTPCEMCalQCSP::SetHistoForEPFlattWeights(TH1D *h){
+    
+    if(fHistEPDistrWeight)delete fHistEPDistrWeight;
+    fHistEPDistrWeight=(TH1D*)h->Clone("fHistEPDistrWeight");
+    Double_t Inte = fHistEPDistrWeight->Integral()/fHistEPDistrWeight->GetNbinsX();
+    
+    
+    
+    for(Int_t j=1;j<=h->GetNbinsX();j++){// Now set the "probabilities"
+        Double_t w = Inte/fHistEPDistrWeight->GetBinContent(j);
+        fHistEPDistrWeight->SetBinError(j,0./*h->GetBinError(j)*ref/bincont*/);
+        
+        fHistEPDistrWeight->SetBinContent(j,w);
+    }
+    return;
+    
+}
+//-------------------------------------------------
+Double_t AliAnalysisTaskFlowTPCEMCalQCSP::GiveMeWeight(Double_t EP){
+    
+    Int_t Bin = fHistEPDistrWeight->FindBin(EP);
+    Double_t ww = fHistEPDistrWeight->GetBinContent(Bin);
+    return ww;
+    
+}
+//-------------------------------------------------
+
+
+
+//_____________________________________________________________________________
+
+
+
 
index af8f538..5a1d9f9 100644 (file)
@@ -51,7 +51,7 @@ public:
     void                                 SetEnableDebugMode() {fDebug = kTRUE; };
     void                                 SetCentralityParameters(Double_t CentralityMin, Double_t CentralityMax, const char* CentralityMethod); //select centrality
     void                                 CheckCentrality(AliAODEvent *event,Bool_t &centralitypass); //to use only events with the correct centrality....
-    void                                 SelectPhotonicElectron(Int_t itrack,const AliAODTrack *track, Double_t eopinc, Double_t evPlAnglV0, Bool_t &fFlagPhotonicElec);
+    void                                 SelectPhotonicElectron(Int_t itrack,const AliAODTrack *track, Double_t eopinc, Double_t evPlAnglV0, Bool_t &fFlagPhotonicElec, Double_t weightEPflat);
     void                                 SetInvariantMassCut(Double_t invmass) {fInvmassCut = invmass;};
     void                                 SetpTCuttrack(Double_t ptcut) {fpTCut = ptcut;};
     void                                 SetTrigger(Int_t trig) {fTrigger = trig;};
@@ -76,7 +76,10 @@ public:
     void                                 SetHistoForCentralityFlattening(TH1F *h,Double_t minCentr,Double_t maxCentr,Double_t centrRef=0.,Int_t switchTRand=0);
     Bool_t                               IsEventSelectedForCentrFlattening(Float_t centvalue);
     
-    
+    void                                 SetHistoForEPFlattWeights(TH1D *h);
+    Double_t                             GiveMeWeight(Double_t EP);
+    void                                 SetEPWeight(Bool_t epw){EPweights = epw;};
+
     
     
     
@@ -178,6 +181,11 @@ private:
     THnSparseF           *fSparseMassULS;//!ssss
     THnSparseF           *fSparseMassLS;//!ssssss
     
+    TH1D                 *fHistEPDistrWeight;// isto for Centr Flat
+    Bool_t               EPweights;//for mult correlationcut
+    TH1D                 *EPVzAftW;//!v0cep
+
+    
     
     AliAnalysisTaskFlowTPCEMCalQCSP(const AliAnalysisTaskFlowTPCEMCalQCSP&); // not implemented
     AliAnalysisTaskFlowTPCEMCalQCSP& operator=(const AliAnalysisTaskFlowTPCEMCalQCSP&); // not implemented
index 5e95af7..30523ad 100755 (executable)
@@ -37,6 +37,7 @@ AliAnalysisTaskFlowITSTPCTOFQCSP* AddTaskFlowITSTPCTOFQCSP(
                                                      Int_t TPCClusterforAsso = 80,
                                                      Bool_t AssoITSref = kTRUE,
                                                      Double_t ptminassocut = 0.0,
+                                                     Bool_t Weight = kFALSE,
                                                      Bool_t PhiCut = kFALSE,
                                                      Bool_t PhotonicElectronDCA = kFALSE,
                                                     // Bool_t QaPidSparse = kFALSE,
@@ -50,8 +51,7 @@ AliAnalysisTaskFlowITSTPCTOFQCSP* AddTaskFlowITSTPCTOFQCSP(
                                                      Int_t RPFilterBit = 1,
                                                      Bool_t op_ang = kFALSE,
                                                      Int_t Vz = 10,
-                                                     Double_t op_angle_cut = 3.,
-                                                     TString histoflatname = "alien:///alice/cern.ch/user/a/adubla/CentrDistrBins005.root"
+                                                     Double_t op_angle_cut = 3.
                                                      )
 
 {
@@ -82,13 +82,26 @@ AliAnalysisTaskFlowITSTPCTOFQCSP* AddTaskFlowITSTPCTOFQCSP(
         return 0x0;
     }
     taskHFE->SetTrigger(Trigger);
+    taskHFE->SetEPWeight(Weight);
+
     
+    TString histoflatname = "alien:///alice/cern.ch/user/a/adubla/CentrDistrBins005.root"
     if(Trigger==0 || Trigger==4){
         TFile *fFlat=TFile::Open(histoflatname.Data());
         TCanvas *c=fFlat->Get("cintegral");
         TH1F *hfl=(TH1F*)c->FindObject("hint");
         taskHFE->SetHistoForCentralityFlattening(hfl,centrMin,centrMax,0.,0);
     }
+    
+    TString histoflatnameEP = "alien:///alice/cern.ch/user/a/adubla/EPVZero010_Smart.root"
+    if(Weight){
+        TFile *fFlatEP=TFile::Open(histoflatnameEP,"READ");
+        TCanvas *cEP=fFlatEP->Get("c1_n7");
+        TH1D *hEPfl=(TH1D*)cEP->FindObject("EPVz");
+        taskHFE->SetHistoForEPFlattWeights(hEPfl);
+    }
+    
+    
     // Set centrality percentiles and method V0M, FMD, TRK, TKL, CL0, CL1, V0MvsFMD, TKLvsV0M, ZEMvsZDC
     taskHFE->SetCentralityParameters(centrMin, centrMax, Cent);
     taskHFE->SetInvariantMassCut(InvmassCut);
index 7465e54..3093445 100644 (file)
@@ -31,6 +31,7 @@ AliAnalysisTaskFlowTPCEMCalQCSP*  AddTaskFlowTPCEMCalQCSP(
                                                           Double_t Dispersion,
                                                           Int_t minTPCCluster,
                                                           AliHFEextraCuts::ITSPixel_t pixel,
+                                                          Bool_t Weight = kFALSE,
                                                           Bool_t NUA = kTRUE,
                                                           Bool_t PhotonicElectronDCA = kFALSE,
                                                           Int_t TPCClusterforAsso = 80,
@@ -48,8 +49,7 @@ AliAnalysisTaskFlowTPCEMCalQCSP*  AddTaskFlowTPCEMCalQCSP(
                                                           Bool_t debug = kFALSE,
                                                           Int_t RPFilterBit = 1,
                                                           Bool_t op_ang = kFALSE,
-                                                          Double_t op_angle_cut=3.,
-                                                          TString histoflatname = "alien:///alice/cern.ch/user/a/adubla/CentrDistrBins005.root"
+                                                          Double_t op_angle_cut=3.
                                                           )
 
 {
@@ -80,7 +80,10 @@ AliAnalysisTaskFlowTPCEMCalQCSP*  AddTaskFlowTPCEMCalQCSP(
         return 0x0;
     }
     taskHFE->SetTrigger(Trigger);
+    taskHFE->SetEPWeight(Weight);
+
     
+    TString histoflatname = "alien:///alice/cern.ch/user/a/adubla/CentrDistrBins005.root"
     if(Trigger==0 || Trigger==4){
         TFile *fFlat=TFile::Open(histoflatname.Data());
         TCanvas *c=fFlat->Get("cintegral");
@@ -88,6 +91,17 @@ AliAnalysisTaskFlowTPCEMCalQCSP*  AddTaskFlowTPCEMCalQCSP(
         taskHFE->SetHistoForCentralityFlattening(hfl,centrMin,centrMax,0.,0);
     }
     
+    
+    TString histoflatnameEP = "alien:///alice/cern.ch/user/a/adubla/EPVZero010_Smart.root"
+    if(Weight){
+        TFile *fFlatEP=TFile::Open(histoflatnameEP,"READ");
+        TCanvas *cEP=fFlatEP->Get("c1_n7");
+        TH1D *hEPfl=(TH1D*)cEP->FindObject("EPVz");
+        taskHFE->SetHistoForEPFlattWeights(hEPfl);
+    }
+    
+
+    
     // Set centrality percentiles and method V0M, FMD, TRK, TKL, CL0, CL1, V0MvsFMD, TKLvsV0M, ZEMvsZDC
     taskHFE->SetCentralityParameters(centrMin, centrMax, Cent);
     taskHFE->SetInvariantMassCut(InvmassCut);
index 7e3f181..6aa0fc3 100755 (executable)
@@ -223,8 +223,8 @@ AliAnalysisTask *RegisterTaskNPEPbPb(Bool_t useMC, Bool_t isAOD, Bool_t beauty,
   
   printf("Add macro appendix %s\n", appendix.Data());
   
-  if(useMC&&!gROOT->GetListOfGlobalFunctions()->FindObject("ConfigWeightFactors")) gROOT->LoadMacro("$TRAIN_ROOT/util/hfe/configs/ConfigWeightFactors.C");
-  if(!gROOT->GetListOfGlobalFunctions()->FindObject("ConfigHFEnpePbPb"))gROOT->LoadMacro("$TRAIN_ROOT/util/hfe/configs/ConfigHFEnpePbPb.C");
+  if(useMC&&!gROOT->GetListOfGlobalFunctions()->FindObject("ConfigWeightFactors")) gROOT->LoadMacro("$ALICE_ROOT/PWGHF/hfe/macros/configs/PbPb/ConfigWeightFactors.C");
+  if(!gROOT->GetListOfGlobalFunctions()->FindObject("ConfigHFEnpePbPb"))gROOT->LoadMacro("$ALICE_ROOT/PWGHF/hfe/macros/configs/PbPb/ConfigHFEnpePbPb.C");
   
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();