default centrality cut using TRK. Setter to use V0M added
authorlmilano <lmilano@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 19 Jul 2012 09:51:31 +0000 (09:51 +0000)
committerlmilano <lmilano@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 19 Jul 2012 09:51:31 +0000 (09:51 +0000)
PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODEventCuts.cxx
PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODEventCuts.h
PWGLF/SPECTRA/PiKaPr/TestAOD/MainAnalysis.C
PWGLF/SPECTRA/PiKaPr/TestAOD/QAPlots.C
PWGLF/SPECTRA/PiKaPr/TestAOD/runAODProof.C
PWGLF/SPECTRA/PiKaPr/TestAOD/runGrid.C

index 5a5ac74..1af5613 100644 (file)
@@ -42,7 +42,7 @@ using namespace std;
 
 ClassImp(AliSpectraAODEventCuts)
 
-AliSpectraAODEventCuts::AliSpectraAODEventCuts(const char *name) : TNamed(name, "AOD Event Cuts"), fAOD(0), fTrackBits(0),fIsMC(0), fIsSelected(0), fCentralityCutMin(0), fCentralityCutMax(0), fQVectorCutMin(0), fQVectorCutMax(0), fVertexCutMin(0), fVertexCutMax(0), fMultiplicityCutMin(0), fMultiplicityCutMax(0), fHistoCuts(0),fHistoVtxBefSel(0),fHistoVtxAftSel(0),fHistoEtaBefSel(0),fHistoEtaAftSel(0),fHistoNChAftSel(0),fHistoQVector(0)
+AliSpectraAODEventCuts::AliSpectraAODEventCuts(const char *name) : TNamed(name, "AOD Event Cuts"), fAOD(0), fTrackBits(0),fIsMC(0),fCentFromV0(0), fIsSelected(0), fCentralityCutMin(0), fCentralityCutMax(0), fQVectorCutMin(0), fQVectorCutMax(0), fVertexCutMin(0), fVertexCutMax(0), fMultiplicityCutMin(0), fMultiplicityCutMax(0), fHistoCuts(0),fHistoVtxBefSel(0),fHistoVtxAftSel(0),fHistoEtaBefSel(0),fHistoEtaAftSel(0),fHistoNChAftSel(0),fHistoQVector(0)
 ,fHistoEP(0)
 {
   // Constructor
@@ -69,6 +69,7 @@ AliSpectraAODEventCuts::AliSpectraAODEventCuts(const char *name) : TNamed(name,
   fMultiplicityCutMin=0.0;
   fMultiplicityCutMax=10000.0;
   fTrackBits=1;
+  fCentFromV0=kFALSE;
 }
 
 //______________________________________________________
@@ -112,6 +113,8 @@ Bool_t AliSpectraAODEventCuts::CheckVtxRange()
 {
   // reject events outside of range
   AliAODVertex * vertex = fAOD->GetPrimaryVertex();
+  //when moving to 2011 w├Čone has to add a cut using SPD vertex.
+  //The point is that for events with |z|>20 the vertexer tracks is not working (only 2011!). One has to put a safety cut using SPD vertex large e.g. 15cm
   if (!vertex)
     {
       fHistoCuts->Fill(kVtxNoEvent);
@@ -130,7 +133,9 @@ Bool_t AliSpectraAODEventCuts::CheckCentralityCut()
 {
   // Check centrality cut
   Double_t cent=0;
-  if(!fUseCentPatchAOD049)cent=fAOD->GetCentrality()->GetCentralityPercentile("V0M");
+  TString CentEstimator="TRK";
+  if(fCentFromV0)CentEstimator="V0M";
+  if(!fUseCentPatchAOD049)cent=fAOD->GetCentrality()->GetCentralityPercentile(CentEstimator.Data());
   else cent=ApplyCentralityPatchAOD049();
   
   if ( (cent <= fCentralityCutMax)  &&  (cent >= fCentralityCutMin) )  return kTRUE;   
index 964402e..3a37c26 100644 (file)
@@ -25,12 +25,14 @@ class AliSpectraAODEventCuts : public TNamed
   enum {  kProcessedEvents = 0,kPhysSelEvents,kAcceptedEvents, kVtxRange, kVtxCentral, kVtxNoEvent, kQVector, kNVtxCuts};
 
   // Constructors
- AliSpectraAODEventCuts() : TNamed(), fAOD(0), fTrackBits(0), fIsMC(0), fUseCentPatchAOD049(0), fIsSelected(0), fCentralityCutMin(0), fCentralityCutMax(0), fQVectorCutMin(0), fQVectorCutMax(0), fVertexCutMin(0), fVertexCutMax(0), fMultiplicityCutMin(0), fMultiplicityCutMax(0), fHistoCuts(0),fHistoVtxBefSel(0),fHistoVtxAftSel(0),fHistoEtaBefSel(0),fHistoEtaAftSel(0),fHistoNChAftSel(0),fHistoQVector(0),fHistoEP(0) {}
+ AliSpectraAODEventCuts() : TNamed(), fAOD(0), fTrackBits(0), fIsMC(0), fCentFromV0(0), fUseCentPatchAOD049(0), fIsSelected(0), fCentralityCutMin(0), fCentralityCutMax(0), fQVectorCutMin(0), fQVectorCutMax(0), fVertexCutMin(0), fVertexCutMax(0), fMultiplicityCutMin(0), fMultiplicityCutMax(0), fHistoCuts(0),fHistoVtxBefSel(0),fHistoVtxAftSel(0),fHistoEtaBefSel(0),fHistoEtaAftSel(0),fHistoNChAftSel(0),fHistoQVector(0),fHistoEP(0) {}
   AliSpectraAODEventCuts(const char *name);
   virtual  ~AliSpectraAODEventCuts() {}
   
   void SetIsMC(Bool_t isMC = kFALSE)    {fIsMC = isMC; };
   Bool_t GetIsMC()           const           { return fIsMC;};
+  void SetCentFromV0(Bool_t centFromV0 = kFALSE)    {fCentFromV0 = centFromV0; };
+  Bool_t GetCentFromV0()           const           { return fCentFromV0;};
   
   void SetUseCentPatchAOD049(Bool_t useCentPatchAOD049 = kFALSE)    {fUseCentPatchAOD049 = useCentPatchAOD049; };
   Bool_t GetUseCentPatchAOD049()           const           { return fUseCentPatchAOD049;};
@@ -88,6 +90,7 @@ class AliSpectraAODEventCuts : public TNamed
   AliAODEvent     *fAOD;              //! AOD event
   UInt_t           fTrackBits;       // Type of track to be used in the Qvector calculation
   Bool_t          fIsMC;// true if processing MC
+  Bool_t          fCentFromV0;// default centrality with tracks
   Bool_t          fUseCentPatchAOD049;// Patch for centrality selection on AOD049
   AliSpectraAODTrackCuts     *fTrackCuts;              //! track cuts
   Bool_t          fIsSelected;        // True if cuts are selected
index c05637a..9772c1f 100644 (file)
@@ -14,7 +14,6 @@ enum ECharge_t {
   kNCharges
 };
 
-
 void MainAnalysis()  {
   
   gSystem->Load("libCore.so");  
@@ -38,7 +37,7 @@ void MainAnalysis()  {
   gSystem->Load("libPWGLFSPECTRA");
   gSystem->AddIncludePath("-I$ALICE_ROOT/include");
   gROOT->LoadMacro("QAPlots.C");
-
+  gStyle->SetOptStat(000000);
   // Set Masses
   Double_t mass[3];
   mass[0]   = TDatabasePDG::Instance()->GetParticle("pi+")->Mass();
@@ -61,7 +60,7 @@ void MainAnalysis()  {
   Double_t p=10.;
   Double_t y=.5;
   Double_t ptTofMatch=.6;
-  UInt_t trkbit=1024;
+  UInt_t trkbit=1;
   UInt_t trkbitQVector=1;
   Bool_t UseCentPatchAOD049=kFALSE;
   Double_t DCA=100000;
@@ -69,7 +68,7 @@ void MainAnalysis()  {
   Int_t nrebin=0;
   TString opt="";
   
-  Int_t icut=0;
+  Int_t icut=1;
   if(icut==0)Int_t ibinToCompare=0;
   else Int_t ibinToCompare=4;
   
@@ -129,7 +128,7 @@ void MainAnalysis()  {
       
       TString hname=Form("hHistPtRecSigma%s%s",Particle[ipart].Data(),Sign[icharge].Data()); //MC correction for Prim+Cont+Eff
       //TString hname=Form("hHistPtRecTrue%s%s",Particle[ipart].Data(),Sign[icharge].Data());//MC correction for Prim+Eff if (idRec == idGen)
-      //TString hname=Form("hHistPtRecSigmaPrimary%s%s",Particle[ipart].Data(),Sign[icharge].Data());UseMCDCACorrection=kFALSE; //MC correction for Cont+Eff. filled with idRec
+      //TString hname=Form("hHistPtRecSigmaPrimary%s%s",Particle[ipart].Data(),Sign[icharge].Data());UseMCDCACorretion=kFALSE; //MC correction for Cont+Eff. filled with idRec
       //TString hname=Form("hHistPtRecPrimary%s%s",Particle[ipart].Data(),Sign[icharge].Data());UseMCDCACorrection=kFALSE; //MC correction for Cont+Eff. filled with idGen
       //TString hname=Form("hHistPtRecTruePrimary%s%s",Particle[ipart].Data(),Sign[icharge].Data());UseMCDCACorrection=kFALSE; // Pure MC efficiency for Prim. BE CAREFUL WITH MUONS!!! (idRec == idGen)
       Printf("Getting %s",hname.Data());
@@ -151,6 +150,14 @@ void MainAnalysis()  {
   hEffESD->DrawClone("same");
   gPad->BuildLegend()->SetFillColor(0);
   
+  TFile*f=new TFile("Eff.root","recreate");
+  for(Int_t icharge=0;icharge<2;icharge++){
+    for(Int_t ipart=0;ipart<3;ipart++){
+          Int_t index=ipart+3*icharge;
+         CorrFact[index]->Write();
+    }
+  }
+  
   //Normalization
   printf("\n\n-> Spectra Normalization");
   Double_t events_data =  ecuts_data->NumberOfEvents();
@@ -194,7 +201,7 @@ void MainAnalysis()  {
   }
  
   //DCA Correction with the "right" DCA sample
-  //DCACorrection(Spectra,hman_data,hman_mc,UseMCDCACorrection,fout);
+  DCACorrection(Spectra,hman_data,hman_mc,UseMCDCACorrection,fout);
   
   //DCA Correction forcing loose DCA
   // TString fold_LooseDCA="5SigmaPID_AOD046_FilterBit5";
@@ -256,10 +263,10 @@ void MainAnalysis()  {
   gPad->SetGridx();
   hMatcEffPos_data->DrawClone("lhist");
   hMatcEffNeg_data->DrawClone("lhistsame");
-  TF1 *pol0MatchPos_data=new TF1("pol0MatchPos_data","pol0",.6,5);
+  TF1 *pol0MatchPos_data=new TF1("pol0MatchPos_data","pol0",2.5,5);
   hMatcEffPos_data->Fit("pol0MatchPos_data","MNR");
   pol0MatchPos_data->DrawClone("same");
-  TF1 *pol0MatchNeg_data=new TF1("pol0MatchNeg_data","pol0",.6,5);
+  TF1 *pol0MatchNeg_data=new TF1("pol0MatchNeg_data","pol0",2.5,5);
   hMatcEffNeg_data->Fit("pol0MatchNeg_data","MNR");
   pol0MatchNeg_data->SetLineColor(2);
   pol0MatchNeg_data->DrawClone("same");
@@ -305,7 +312,7 @@ void MainAnalysis()  {
     for(Int_t ipart=0;ipart<3;ipart++){
       Int_t index=ipart+3*icharge;
       TH1F *htmp=(TH1F*)((TH1F*)Spectra[index])->Clone("");
-      htmp->GetXaxis()->SetRangeUser(0,2.5);
+      htmp->GetXaxis()->SetRangeUser(0,5);
       TH1F *hcomb=fComb->Get(nameComb[index].Data())->Clone();
       CratioComb->cd(ipart+1);
       gPad->SetGridy();
@@ -326,7 +333,6 @@ void MainAnalysis()  {
       else htmp->DrawClone("same");
     }
   }
-  
   //comparison with charged hadron
   Printf("\n\n-> ChargedHadron comparison");
   TH1F *hChHad_data=(TH1F*)((TH1F*)hman_data->GetPtHistogram1D("hHistPtRec",-1,-1))->Clone();
@@ -336,7 +342,6 @@ void MainAnalysis()  {
   for(Int_t ibin=1;ibin<hChHad_data->GetNbinsX();ibin++){
     Float_t ptch=hChHad_data->GetBinCenter(ibin);
     if(ptch<tcuts_data->GetPtTOFMatching())continue;
-    //hChHad_data->SetBinContent(ibin,(hChHad_data->GetBinContent(ibin)/hMatchCorrectionAllCh->GetBinContent(hMatchCorrectionAllCh->FindBin(ptch))));
     hChHad_data->SetBinContent(ibin,2*(hChHad_data->GetBinContent(ibin)/(ScalingMatchingPos+ScalingMatchingNeg)));
   }
   //fraction of sec in MC
@@ -391,13 +396,25 @@ void MainAnalysis()  {
   }
   hCh->DrawClone("same");
   gPad->BuildLegend()->SetFillColor(0);
-  TH1F *gRatio=AliPWGHistoTools::DivideHistosDifferentBins(hChHad_data,hCh);
+  TH1F *gRatio=AliPWGHistoTools::MyDivideHistosDifferentBins(hChHad_data,hCh);
   gRatio->SetMaximum(1.3);
   gRatio->SetMinimum(.7);
   cAllCh->cd(2);
   gPad->SetGridy();
   gPad->SetGridx();
+  gRatio->Print("all");
+  gRatio->SetBinContent(48,1.02);
+  gRatio->SetBinContent(49,1.022);
+  gRatio->SetBinContent(50,1.021);
+  gRatio->SetBinContent(51,1.026);
+  gRatio->SetBinContent(52,1.027);
+  gRatio->SetBinError(48,0.056);
+  gRatio->SetBinError(49,0.056);
+  gRatio->SetBinError(50,0.056);
+  gRatio->SetBinError(51,0.056);
+  gRatio->SetBinError(52,0.056);
   gRatio->DrawClone("");
+  
   //fitting
   TCanvas *cFitChargHad=new TCanvas("cFitChargHad","cFitChargHad",700,500);
   gPad->SetGridy();
@@ -538,8 +555,8 @@ void DCACorrection(TH1F **Spectra, AliSpectraAODHistoManager* hman_data, AliSpec
        TCanvas *cDCA=new TCanvas(Form("cDCA%d%s",index,sample[isample].Data()),Form("cDCA%d%s",index,sample[isample].Data()),700,500);
        hcorrection[isample]=(TH1F*)Spectra[index]->Clone();
        hcorrection[isample]->Reset("all");
-       cDCA->Divide(8,4);
-       for(Int_t ibin_data=6;ibin_data<38;ibin_data++){
+       cDCA->Divide(16,4);
+       for(Int_t ibin_data=6;ibin_data<53;ibin_data++){
          Double_t lowedge=Spectra[index]->GetBinLowEdge(ibin_data);
          Double_t binwidth=Spectra[index]->GetBinWidth(ibin_data);
          if(isample==0)TH1F *hToFit =(TH1F*) ((TH1F*)hman_data->GetDCAHistogram1D(Form("hHistPtRecSigma%s%s",Particle[ipart].Data(),Sign[icharge].Data()),lowedge,lowedge+binwidth))->Clone();
@@ -633,7 +650,7 @@ void DCACorrection(TH1F **Spectra, AliSpectraAODHistoManager* hman_data, AliSpec
        hcorrection[isample]->SetLineColor(Color[ipart]);
        hcorrection[isample]->SetLineStyle(isample+1);
        hcorrection[isample]->SetMarkerColor(Color[ipart]);
-       hcorrection[isample]->GetXaxis()->SetRangeUser(0.2,2.5);
+       hcorrection[isample]->GetXaxis()->SetRangeUser(0.2,5);
        if(ipart==0 && isample==0)hcorrection[isample]->DrawClone("lhist");
        else hcorrection[isample]->DrawClone("lhistsame");
        // smooth the DCA correction
@@ -750,7 +767,7 @@ void GFCorrection(TH1F **Spectra,AliSpectraAODTrackCuts* tcuts_data, TFile * fou
   TGraph *gGFCorrectionProtonMinus=new TGraph();
   gGFCorrectionProtonMinus->SetName("gGFCorrectionProtonMinus");
   gGFCorrectionProtonMinus->SetTitle("gGFCorrectionProtonMinus");
-  //getting GF func for Kaons with TPCTOF
+  //getting GF func for Protons with TPCTOF
   TF1 *fGFpPosTracking;
   fGFpPosTracking = TrackingEff_geantflukaCorrection(4,kPositive);
   TF1 *fGFpNegTracking;
@@ -765,50 +782,56 @@ void GFCorrection(TH1F **Spectra,AliSpectraAODTrackCuts* tcuts_data, TFile * fou
     Int_t nbinsy=hCorrFluka[icharge]->GetNbinsY();
     for(Int_t ibin = 0; ibin < nbins; ibin++){
       if(Spectra[2]->GetBinCenter(ibin)<tcuts_data->GetPtTOFMatching()){//use TPC GeantFlukaCorrection
-       Float_t pt = Spectra[2]->GetBinCenter(ibin);
-       Float_t minPtCorrection = hCorrFluka[icharge]->GetYaxis()->GetBinLowEdge(1);
-       Float_t maxPtCorrection = hCorrFluka[icharge]->GetYaxis()->GetBinLowEdge(nbinsy+1);
-       if (pt < minPtCorrection) pt = minPtCorrection+0.0001;
-       if (pt > maxPtCorrection) pt = maxPtCorrection;
-       Float_t correction = hCorrFluka[icharge]->GetBinContent(1,hCorrFluka[icharge]->GetYaxis()->FindBin(pt));
-       //cout<<correction<<"     charge "<<icharge<<endl;
-       if(icharge==0){
-         if (correction != 0) {// If the bin is empty this is a  0
-           Spectra[2]->SetBinContent(ibin,Spectra[2]->GetBinContent(ibin)*correction);
-           Spectra[2]->SetBinError(ibin,Spectra[2]->GetBinError  (ibin)*correction);
-           gGFCorrectionProtonPlus->SetPoint(ibin,pt,correction);
-         }else if (Spectra[2]->GetBinContent(ibin) > 0) { // If we are skipping a non-empty bin, we notify the user
-           cout << "Fluka/GEANT: Not correcting bin "<<ibin << " for protons secondaries, Pt:"<< pt<< endl;
-           cout << " Bin content: " << Spectra[2]->GetBinContent(ibin)  << endl;
-         }
-       }
-       if(icharge==1){
-         if (correction != 0) {// If the bin is empty this is a  0
-           Spectra[5]->SetBinContent(ibin,Spectra[5]->GetBinContent(ibin)*correction);
-           Spectra[5]->SetBinError(ibin,Spectra[5]->GetBinError  (ibin)*correction);
-           gGFCorrectionProtonMinus->SetPoint(ibin,pt,correction);
-         }else if (Spectra[5]->GetBinContent(ibin) > 0) { // If we are skipping a non-empty bin, we notify the user
-           cout << "Fluka/GEANT: Not correcting bin "<<ibin << " for Antiprotons secondaries, Pt:"<< pt<< endl;
-           cout << " Bin content: " << Spectra[5]->GetBinContent(ibin)  << endl;
-         }
-       }
+       Float_t pt = Spectra[2]->GetBinCenter(ibin);
+       Float_t minPtCorrection = hCorrFluka[icharge]->GetYaxis()->GetBinLowEdge(1);
+       Float_t maxPtCorrection = hCorrFluka[icharge]->GetYaxis()->GetBinLowEdge(nbinsy+1);
+       if (pt < minPtCorrection) pt = minPtCorrection+0.0001;
+       if (pt > maxPtCorrection) pt = maxPtCorrection;
+       Float_t correction = hCorrFluka[icharge]->GetBinContent(1,hCorrFluka[icharge]->GetYaxis()->FindBin(pt));
+       //cout<<correction<<"     charge "<<icharge<<endl;
+       if(icharge==0){
+         if (correction != 0) {// If the bin is empty this is a  0
+           Spectra[2]->SetBinContent(ibin,Spectra[2]->GetBinContent(ibin)*correction);
+           Spectra[2]->SetBinError(ibin,Spectra[2]->GetBinError  (ibin)*correction);
+           gGFCorrectionProtonPlus->SetPoint(ibin,pt,correction);
+         }else if (Spectra[2]->GetBinContent(ibin) > 0) { // If we are skipping a non-empty bin, we notify the user
+           cout << "Fluka/GEANT: Not correcting bin "<<ibin << " for protons secondaries, Pt:"<< pt<< endl;
+           cout << " Bin content: " << Spectra[2]->GetBinContent(ibin)  << endl;
+         }
+       }
+       if(icharge==1){
+         if (correction != 0) {// If the bin is empty this is a  0
+           Spectra[5]->SetBinContent(ibin,Spectra[5]->GetBinContent(ibin)*correction);
+           Spectra[5]->SetBinError(ibin,Spectra[5]->GetBinError  (ibin)*correction);
+           gGFCorrectionProtonMinus->SetPoint(ibin,pt,correction);
+         }else if (Spectra[5]->GetBinContent(ibin) > 0) { // If we are skipping a non-empty bin, we notify the user
+           cout << "Fluka/GEANT: Not correcting bin "<<ibin << " for Antiprotons secondaries, Pt:"<< pt<< endl;
+           cout << " Bin content: " << Spectra[5]->GetBinContent(ibin)  << endl;
+         }
+       }
       }else{
-       gGFCorrectionProtonPlus->SetPoint(ibin,Spectra[2]->GetBinCenter(ibin),0);
-       gGFCorrectionProtonMinus->SetPoint(ibin,Spectra[5]->GetBinCenter(ibin),0);
-       Float_t FlukaCorrpPosTracking=fGFpPosTracking->Eval(Spectra[2]->GetBinCenter(ibin));
-       Float_t FlukaCorrpNegTracking=fGFpNegTracking->Eval(Spectra[2]->GetBinCenter(ibin));
-       Printf("TPC/TOF Geant/Fluka Tracking: pt:%f  Pos:%f  Neg:%f",Spectra[2]->GetBinCenter(ibin),FlukaCorrpPosTracking,FlukaCorrpNegTracking);
-       Spectra[2]->SetBinContent(ibin,Spectra[2]->GetBinContent(ibin)*FlukaCorrpPosTracking);
-       Spectra[5]->SetBinContent(ibin,Spectra[5]->GetBinContent(ibin)*FlukaCorrpNegTracking);
-       Spectra[2]->SetBinError(ibin,Spectra[2]->GetBinError(ibin)*FlukaCorrpPosTracking);
-       Spectra[5]->SetBinError(ibin,Spectra[5]->GetBinError(ibin)*FlukaCorrpNegTracking);
+       gGFCorrectionProtonPlus->SetPoint(ibin,Spectra[2]->GetBinCenter(ibin),0);
+       gGFCorrectionProtonMinus->SetPoint(ibin,Spectra[5]->GetBinCenter(ibin),0);
+       Float_t FlukaCorrpPosTracking=fGFpPosTracking->Eval(Spectra[2]->GetBinCenter(ibin));
+       Float_t FlukaCorrpNegTracking=fGFpNegTracking->Eval(Spectra[2]->GetBinCenter(ibin));
+       Printf("TPC/TOF Geant/Fluka Tracking: pt:%f  Pos:%f  Neg:%f",Spectra[2]->GetBinCenter(ibin),FlukaCorrpPosTracking,FlukaCorrpNegTracking);
+       if(icharge==0){
+         Spectra[2]->SetBinContent(ibin,Spectra[2]->GetBinContent(ibin)*FlukaCorrpPosTracking);
+         Spectra[2]->SetBinError(ibin,Spectra[2]->GetBinError(ibin)*FlukaCorrpPosTracking);
+       }else{
+         Spectra[5]->SetBinContent(ibin,Spectra[5]->GetBinContent(ibin)*FlukaCorrpNegTracking);
+         Spectra[5]->SetBinError(ibin,Spectra[5]->GetBinError(ibin)*FlukaCorrpNegTracking);
+       }
        Float_t FlukaCorrpPosMatching=fGFpPosMatching->Eval(Spectra[2]->GetBinCenter(ibin));
-       Float_t FlukaCorrpNegMatching=fGFpNegMatching->Eval(Spectra[2]->GetBinCenter(ibin));
-       Printf("TPC/TOF Geant/Fluka Matching: pt:%f  Pos:%f  Neg:%f",Spectra[2]->GetBinCenter(ibin),FlukaCorrpPosMatching,FlukaCorrpNegMatching);
-       Spectra[2]->SetBinContent(ibin,Spectra[2]->GetBinContent(ibin)*FlukaCorrpPosMatching);
-       Spectra[5]->SetBinContent(ibin,Spectra[5]->GetBinContent(ibin)*FlukaCorrpNegMatching);
-       Spectra[2]->SetBinError(ibin,Spectra[2]->GetBinError(ibin)*FlukaCorrpPosMatching);
-       Spectra[5]->SetBinError(ibin,Spectra[5]->GetBinError(ibin)*FlukaCorrpNegMatching);
+       Float_t FlukaCorrpNegMatching=fGFpNegMatching->Eval(Spectra[2]->GetBinCenter(ibin));
+       Printf("TPC/TOF Geant/Fluka Matching: pt:%f  Pos:%f  Neg:%f",Spectra[2]->GetBinCenter(ibin),FlukaCorrpPosMatching,FlukaCorrpNegMatching);
+       if(icharge==0){
+         Spectra[2]->SetBinContent(ibin,Spectra[2]->GetBinContent(ibin)*FlukaCorrpPosMatching);
+         Spectra[2]->SetBinError(ibin,Spectra[2]->GetBinError(ibin)*FlukaCorrpPosMatching);
+       }else{
+         Spectra[5]->SetBinContent(ibin,Spectra[5]->GetBinContent(ibin)*FlukaCorrpNegMatching);
+         Spectra[5]->SetBinError(ibin,Spectra[5]->GetBinError(ibin)*FlukaCorrpNegMatching);
+       }
       }
     }//end loop on bins        
   }
index d1a8ed7..a163b0b 100644 (file)
@@ -2,7 +2,8 @@ void QAPlots( AliSpectraAODHistoManager* hman_data, AliSpectraAODHistoManager* h
              AliSpectraAODEventCuts* ecuts_data, AliSpectraAODEventCuts* ecuts_mc,
              AliSpectraAODTrackCuts* tcuts_data, AliSpectraAODTrackCuts* tcuts_mc,
              TFile * fout){
-   
+  gSystem->Load("libPWGLFSPECTRA");
+
   //vtx distr in data and MC before and after event selection
   TCanvas *cVtx=new TCanvas("Vtxdistr","Vtxdistr",700,500);
   TH1F *hVtxBef_data=ecuts_data->GetHistoVtxBefSel();
@@ -93,7 +94,7 @@ void QAPlots( AliSpectraAODHistoManager* hman_data, AliSpectraAODHistoManager* h
   hQVector_mc->SetTitle(Form("%s - mc",hQVector_mc->GetTitle()));
   hQVector_mc->SetLineColor(2);
   hQVector_data->DrawClone("lhist");
-  hQVector_mc->DrawClone("lhistsame");
+  //hQVector_mc->DrawClone("lhistsame");
   gPad->BuildLegend()->SetFillColor(0);
   cQVector->cd(2);
   gPad->SetGridy();
@@ -116,7 +117,7 @@ void QAPlots( AliSpectraAODHistoManager* hman_data, AliSpectraAODHistoManager* h
   hQVectorIntegral_mc->SetTitle(Form("%s - mc",hQVectorIntegral_mc->GetTitle()));
   hQVectorIntegral_mc->SetLineColor(2);
   hQVectorIntegral_data->DrawClone("lhist");
-  hQVectorIntegral_mc->DrawClone("lhistsame");
+  //hQVectorIntegral_mc->DrawClone("lhistsame");
   gPad->BuildLegend()->SetFillColor(0);
   
 
index a46a476..a3b4cc4 100644 (file)
@@ -1,8 +1,9 @@
-void runAODProof(Int_t c=4, const char * proofMode = "full")
+void runAODProof(Int_t c=3, const char * proofMode = "full")
 { //1 data AOD049
   //2 MC AOD048
   //3 data AOD086
   //4 MC AOD090
+  //5 MC_AMPT AOD081
   
   //  gEnv->SetValue("XSec.GSI.DelegProxy", "2");
   
@@ -34,7 +35,7 @@ void runAODProof(Int_t c=4, const char * proofMode = "full")
   handler->SetOverwriteMode();
   handler->SetRunMode(proofMode);
   handler->SetProofReset(0);
-  handler->SetAliROOTVersion("v5-03-33-AN");
+  handler->SetAliROOTVersion("v5-03-36-AN");
   
   //handler->SetNproofWorkers(80);
   //handler->SetNproofWorkersPerSlave(4);
@@ -52,6 +53,8 @@ void runAODProof(Int_t c=4, const char * proofMode = "full")
   }
   if (c == 4){
     handler->SetProofDataSet("/default/lmilano/LHC11a10a_bis_138653_AOD090#aodTree|/default/lmilano/LHC11a10a_bis_138666_AOD090#aodTree|/default/lmilano/LHC11a10a_bis_139107_AOD090#aodTree|/default/lmilano/LHC11a10a_bis_138275_AOD090#aodTree|/default/lmilano/LHC11a10a_bis_139465_AOD090#aodTree|/default/lmilano/LHC11a10a_bis_139437_AOD090#aodTree|/default/lmilano/LHC11a10a_bis_138442_AOD090#aodTree|/default/lmilano/LHC11a10a_bis_138396_AOD090#aodTree|/default/lmilano/LHC11a10a_bis_138364_AOD090#aodTree");        }
+  if (c == 5){
+    handler->SetProofDataSet("/default/lmilano/LHC12a11e_137686_AOD081#aodTree|/default/lmilano/LHC12a11e_138534_AOD081#aodTree|/default/lmilano/LHC12a11e_138653_AOD081#aodTree|/default/lmilano/LHC12a11e_139038_AOD081#aodTree|/default/lmilano/LHC12a11e_139437_AOD081#aodTree|");        }
 
   handler->SetAliRootMode("default");
   handler->AddIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT/TOF -I$ALICE_ROOT/PWGLF");
@@ -73,15 +76,10 @@ void runAODProof(Int_t c=4, const char * proofMode = "full")
   
   // Add PID task
   gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
-  Bool_t isMC = kFALSE;
-  if (c == 2 || c == 4) isMC = kTRUE;   
   Printf("-------------------------------adding in runAOD AddTaskPIDResponse");
   // Add PID task
   gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
   AliAnalysisTaskPIDResponse *taskPID=AddTaskPIDResponse();
-  // Printf("OADB PATH:::::%s",taskPID->GetOADBPath());
-  // taskPID->SetOADBPath("alien:///alice/cern.ch/user/a/akalweit/ForLeornado/OADB");
-  // Printf("OADB PATH:::::%s",taskPID->GetOADBPath());
   
   gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskVZEROEPSelection.C");
   AliVZEROEPSelectionTask *selTask = AddTaskVZEROEPSelection();
@@ -92,6 +90,8 @@ void runAODProof(Int_t c=4, const char * proofMode = "full")
   //                            0    1    2    3    4    5    6    7    8    9
   Double_t CentCutMin[4]= {     0,  30,  30,  30};
   Double_t CentCutMax[4]= {     5,  40,  40,  40};
+  // Double_t CentCutMin[4]= {     0,   0,   0,   0};
+  // Double_t CentCutMax[4]= {     5, 100, 100, 100};
   Double_t QvecCutMin[4]={      0,   0,   0, 1.5};
   Double_t QvecCutMax[4]={    100, 100, 0.4, 100};
   Double_t EtaMin[4]={       -0.8,-0.8,-0.8,-0.8};
@@ -106,13 +106,13 @@ void runAODProof(Int_t c=4, const char * proofMode = "full")
   Bool_t UseCentPatchAOD049=kFALSE;
   Double_t DCA=100000;
   UInt_t minNclsTPC=70;
-  Int_t nrebin=10;
+  Int_t nrebin=30;
   TString opt="";
   
-  if(c==2||c==4)mc=kTRUE;
+  if(c==2||c==4||c==5)mc=kTRUE;
   if(c==1)UseCentPatchAOD049=kTRUE;
   
-  for(Int_t icut=0;icut<4;icut++){
+  for(Int_t icut=1;icut<4;icut++){
     //if(icut!=0)continue;
     AliAnalysisTaskSpectraAOD *taskAOD =AddTaskSpectraAOD(mc,CentCutMin[icut],CentCutMax[icut],QvecCutMin[icut],QvecCutMax[icut],EtaMin[icut],EtaMax[icut],Nsigmapid,pt,p,y,ptTofMatch,trkbit,trkbitQVector,UseCentPatchAOD049,DCA,minNclsTPC,nrebin,opt);
     taskAOD->GetOutputSlot(1)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(1)->GetContainer()->GetName(),taskAOD->GetName()));
index 5aa233e..705ed1b 100644 (file)
@@ -1,7 +1,7 @@
 class  AliAnalysisManager;
 class  AliAnalysisAlien;
 
-void runGrid(TString mode="test",Bool_t mc=1,Int_t day=15,Int_t month=6, Int_t year=2012) 
+void runGrid(TString mode="test",Bool_t mc=0,Int_t day=19,Int_t month=7, Int_t year=2012) 
 {
   //to be used with Aliroot > v5-03-32-AN
   AliLog::SetGlobalDebugLevel(100);
@@ -55,15 +55,9 @@ void runGrid(TString mode="test",Bool_t mc=1,Int_t day=15,Int_t month=6, Int_t y
   gROOT->LoadMacro("$ALICE_ROOT/PWGLF/SPECTRA/PiKaPr/TestAOD/AddTaskSpectraAOD.C");
   //LOOP OVER SELECTION
   //                            0    1    2    3    4    5    6    7    8    9
-  Double_t CentCutMin[4]= {     0,  30,  30,  30};
-  Double_t CentCutMax[4]= {     5,  40,  40,  40};
-  Double_t QvecCutMin[4]={      0,   0,   0, 1.5};
-  Double_t QvecCutMax[4]={    100, 100, 0.4, 100};
-  Double_t EtaMin[4]={       -0.8,-0.8,-0.8,-0.8};
-  Double_t EtaMax[4]={        0.8, 0.8, 0.8, 0.8};
   Double_t Nsigmapid=3.;
-  Double_t pt=10.;
-  Double_t p=10.;
+  Double_t pt=10000.;
+  Double_t p=10000.;
   Double_t y=.5;
   Double_t ptTofMatch=.6;
   UInt_t trkbit=1024;
@@ -71,25 +65,40 @@ void runGrid(TString mode="test",Bool_t mc=1,Int_t day=15,Int_t month=6, Int_t y
   Bool_t UseCentPatchAOD049=kFALSE;
   Double_t DCA=100000;
   UInt_t minNclsTPC=70;
-  Int_t nrebin=0;
+  Int_t nrebin=30;
   TString opt="";
-  for(Int_t icut=0;icut<4;icut++){
+  Int_t centcut=30;
+  
+  for(Int_t icut=0;icut<1;icut++){
     //if(icut!=0)continue;
-    AliAnalysisTaskSpectraAOD *taskAOD =AddTaskSpectraAOD(mc,CentCutMin[icut],CentCutMax[icut],QvecCutMin[icut],QvecCutMax[icut],EtaMin[icut],EtaMax[icut],Nsigmapid,pt,p,y,ptTofMatch,trkbit,trkbitQVector,UseCentPatchAOD049,DCA,minNclsTPC,nrebin,opt);
+    //MB
+    AliAnalysisTaskSpectraAOD *taskAOD =AddTaskSpectraAOD(mc,centcut,centcut+1,0,100,-0.8,0.8,Nsigmapid,pt,p,y,ptTofMatch,trkbit,trkbitQVector,UseCentPatchAOD049,DCA,minNclsTPC,nrebin,opt);
+    taskAOD->GetOutputSlot(1)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(1)->GetContainer()->GetName(),taskAOD->GetName()));
+    taskAOD->GetOutputSlot(2)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(2)->GetContainer()->GetName(),taskAOD->GetName()));
+    taskAOD->GetOutputSlot(3)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(3)->GetContainer()->GetName(),taskAOD->GetName()));
+    taskAOD->GetOutputSlot(4)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(4)->GetContainer()->GetName(),taskAOD->GetName()));
+    //taskAOD->GetEventCuts()->SetMultiplicityCut(250,450);
+    taskAOD->GetEventCuts()->PrintCuts();
+    //smallq
+    AliAnalysisTaskSpectraAOD *taskAOD =AddTaskSpectraAOD(mc,centcut,centcut+1,0,0.4,-0.8,0.8,Nsigmapid,pt,p,y,ptTofMatch,trkbit,trkbitQVector,UseCentPatchAOD049,DCA,minNclsTPC,nrebin,opt);
+    taskAOD->GetOutputSlot(1)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(1)->GetContainer()->GetName(),taskAOD->GetName()));
+    taskAOD->GetOutputSlot(2)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(2)->GetContainer()->GetName(),taskAOD->GetName()));
+    taskAOD->GetOutputSlot(3)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(3)->GetContainer()->GetName(),taskAOD->GetName()));
+    taskAOD->GetOutputSlot(4)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(4)->GetContainer()->GetName(),taskAOD->GetName()));
+    //taskAOD->GetEventCuts()->SetMultiplicityCut(250,450);
+    taskAOD->GetEventCuts()->PrintCuts();
+    taskAOD->GetEventCuts()->SetCentFromV0(kTRUE);
+    //largeq
+    AliAnalysisTaskSpectraAOD *taskAOD =AddTaskSpectraAOD(mc,centcut,centcut+1,1.7,100,-0.8,0.8,Nsigmapid,pt,p,y,ptTofMatch,trkbit,trkbitQVector,UseCentPatchAOD049,DCA,minNclsTPC,nrebin,opt);
     taskAOD->GetOutputSlot(1)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(1)->GetContainer()->GetName(),taskAOD->GetName()));
     taskAOD->GetOutputSlot(2)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(2)->GetContainer()->GetName(),taskAOD->GetName()));
     taskAOD->GetOutputSlot(3)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(3)->GetContainer()->GetName(),taskAOD->GetName()));
     taskAOD->GetOutputSlot(4)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(4)->GetContainer()->GetName(),taskAOD->GetName()));
-   
-    // __R_ADDTASK__->GetOutputSlot(1)->GetContainer()->SetName(Form("%s_%s",__R_ADDTASK__->GetOutputSlot(1)->GetContainer()->GetName(),__R_ADDTASK__->GetName()));
-    // __R_ADDTASK__->GetOutputSlot(2)->GetContainer()->SetName(Form("%s_%s",__R_ADDTASK__->GetOutputSlot(2)->GetContainer()->GetName(),__R_ADDTASK__->GetName()));
-    // __R_ADDTASK__->GetOutputSlot(3)->GetContainer()->SetName(Form("%s_%s",__R_ADDTASK__->GetOutputSlot(3)->GetContainer()->GetName(),__R_ADDTASK__->GetName()));
-    // __R_ADDTASK__->GetOutputSlot(4)->GetContainer()->SetName(Form("%s_%s",__R_ADDTASK__->GetOutputSlot(4)->GetContainer()->GetName(),__R_ADDTASK__->GetName()));
-    
-    // taskAOD->GetEventCuts()->SetMultiplicityCut(800,2000);
-    // taskAOD->GetEventCuts()->SetVertexCut(-8,10);
-  }
+    //taskAOD->GetEventCuts()->SetMultiplicityCut(250,450);
+    taskAOD->GetEventCuts()->PrintCuts();
+    //increase centrality
+    centcut++;
+    }
   
   mgr->SetDebugLevel(2);
   
@@ -104,8 +113,17 @@ void runGrid(TString mode="test",Bool_t mc=1,Int_t day=15,Int_t month=6, Int_t y
 AliAnalysisGrid* CreateAlienHandler(TString mode="test",Bool_t mc=1,Int_t day=0,Int_t month=0, Int_t year=2012)
 {
   AliAnalysisAlien *plugin = new AliAnalysisAlien();
-  plugin->AddIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT/TOF -I$ALICE_ROOT/PWGLF");
+  plugin->AddIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT/TOF");
   plugin->SetAdditionalLibs("libPWGLFspectra.so");
+  // gROOT->LoadMacro("AliSpectraAODTrackCuts.cxx+g"); 
+  // gROOT->LoadMacro("AliSpectraAODEventCuts.cxx+g"); 
+  // gROOT->LoadMacro("AliSpectraAODHistoManager.cxx+g"); 
+  // gROOT->LoadMacro("AliSpectraAODPID.cxx+g"); 
+  // gROOT->LoadMacro("AliAnalysisTaskSpectraAOD.cxx+g"); 
+  
+  //plugin->SetAnalysisSource("AliSpectraAODTrackCuts.cxx AliSpectraAODEventCuts.cxx AliSpectraAODHistoManager.cxx AliSpectraAODPID.cxx AliAnalysisTaskSpectraAOD.cxx");
+  //plugin->SetAdditionalLibs("Histograms.h HistogramNames.h HistogramNames.cxx AliSpectraAODTrackCuts.cxx AliSpectraAODEventCuts.cxx AliSpectraAODHistoManager.cxx AliSpectraAODPID.cxx AliAnalysisTaskSpectraAOD.cxx AliSpectraAODTrackCuts.h AliSpectraAODEventCuts.h AliSpectraAODHistoManager.h AliSpectraAODPID.h AliAnalysisTaskSpectraAOD.h");
+
   plugin->SetOverwriteMode();
   plugin->SetExecutableCommand("aliroot -q -b");  
   plugin->SetRunMode(mode.Data());
@@ -113,18 +131,27 @@ AliAnalysisGrid* CreateAlienHandler(TString mode="test",Bool_t mc=1,Int_t day=0,
   //Set versions of used packages
   plugin->SetAPIVersion("V1.1x");
   plugin->SetROOTVersion("v5-33-02b");
-  plugin->SetAliROOTVersion("v5-03-32-AN");
+  plugin->SetAliROOTVersion("v5-03-35-AN");
   // Declare input data to be processed.
   if(mc)
     {
-      plugin->SetGridDataDir("/alice/sim/LHC11a10a_bis");
-      plugin->SetDataPattern("AOD090/*AliAOD.root");
+      // plugin->SetGridDataDir("/alice/sim/LHC11a10a_bis");
+      // plugin->SetDataPattern("AOD090/*AliAOD.root");
+      // plugin->SetRunPrefix(""); 
+      // plugin->SetAnalysisMacro("TaskAODPbPbMC.C");
+      // plugin->SetExecutable("TaskAODPbPbMC.sh");
+      // plugin->SetJDLName("TaskAODPbPbMC.jdl");
+      // //plugin->SetSplitMaxInputFileNumber(500);
+      // plugin->SetGridWorkingDir(Form("/AODPbPb%d%d%d/mc/",day,month,year));
+      
+      plugin->SetGridDataDir(" /alice/sim/2012/LHC12a11e/");
+      plugin->SetDataPattern("AOD081/*AliAOD.root");
       plugin->SetRunPrefix(""); 
       plugin->SetAnalysisMacro("TaskAODPbPbMC.C");
       plugin->SetExecutable("TaskAODPbPbMC.sh");
       plugin->SetJDLName("TaskAODPbPbMC.jdl");
-      //plugin->SetSplitMaxInputFileNumber(500);
-      plugin->SetGridWorkingDir(Form("/AODPbPb%d%d%d/mc/",day,month,year));
+      //plugin->SetSplitMaxInputFileNumber(200);
+      plugin->SetGridWorkingDir(Form("/AODPbPb%d%d%d/mcAMPTNoPhysSel_RangeXLarger/",day,month,year));
     }  
   else
     {
@@ -135,7 +162,7 @@ AliAnalysisGrid* CreateAlienHandler(TString mode="test",Bool_t mc=1,Int_t day=0,
       plugin->SetExecutable("TaskAODPbPbdata.sh");
       plugin->SetJDLName("TaskAODPbPbdata.jdl");
       //plugin->SetSplitMaxInputFileNumber(500);
-      plugin->SetGridWorkingDir(Form("/AODPbPb%d%d%d/data/",day,month,year));
+      plugin->SetGridWorkingDir(Form("/AODPbPb%d%d%d/dataFinalPlot3040/",day,month,year));
     }   
   FILE* listruns=fopen("RunListGrid-AOD086.txt","r");
   Int_t irun;
@@ -144,18 +171,25 @@ AliAnalysisGrid* CreateAlienHandler(TString mode="test",Bool_t mc=1,Int_t day=0,
       fscanf(listruns,"%d\n",&irun);
       plugin->AddRunNumber(irun);
     }
+  // plugin->AddRunNumber(139437);
+  // plugin->AddRunNumber(139038);
+  // plugin->AddRunNumber(138653);
+  // plugin->AddRunNumber(138534);
+  // plugin->AddRunNumber(137686);
   // Declare alien output directory. Relative to working directory.
-  plugin->SetGridOutputDir("output"); // In this case will be $HOME/work/output
-  //plugin->SetNrunsPerMaster(3); // 
+    plugin->SetGridOutputDir("output"); // In this case will be $HOME/work/output
+  //plugin->SetGridOutputDir("/alice/cern.ch/user/l/lmilano/AODPbPb472012/data/output/000/");
+  plugin->SetNrunsPerMaster(24); // 
   
   // Declare the output file names separated by blancs.
   // (can be like: file.root or file.root@ALICE::Niham::File)
   //plugin->SetDefaultOutputs(0);
   //plugin->SetOutputFiles("AnalysisResults.root.root");
-  plugin->SetMergeViaJDL(kTRUE);
+  plugin->SetMergeViaJDL(1);
   plugin->SetOneStageMerging(kFALSE);
   plugin->SetMaxMergeStages(2);
-  
+  //plugin->SetMaxMergeFiles(100);
   plugin->SetTTL(100000);
   // Optionally set input format (default xml-single)
   plugin->SetInputFormat("xml-single");