]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Primary charged tracks added
authorlmilano <lmilano@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Apr 2012 16:39:39 +0000 (16:39 +0000)
committerlmilano <lmilano@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Apr 2012 16:39:39 +0000 (16:39 +0000)
PWGLF/SPECTRA/PiKaPr/TestAOD/AliAnalysisTaskSpectraAOD.cxx
PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODHistoManager.cxx
PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODHistoManager.h
PWGLF/SPECTRA/PiKaPr/TestAOD/MainAnalysis.C
PWGLF/SPECTRA/PiKaPr/TestAOD/runAODProof.C

index 45be284f5c103de8e94d681efad0ea77df0fb06b..cff85b53c0016f28f4e62fe06b0bbdcf6a563875 100644 (file)
@@ -165,9 +165,9 @@ void AliAnalysisTaskSpectraAOD::UserExec(Option_t *)
        for (Int_t iMC = 0; iMC < nMC; iMC++)\r
          {\r
            AliAODMCParticle *partMC = (AliAODMCParticle*) arrayMC->At(iMC);\r
-           fHistMan->GetPtHistogram(kHistPtGen)->Fill(partMC->Pt(),partMC->IsPhysicalPrimary());\r
-           \r
            if(TMath::Abs(partMC->Eta()) > fTrackCuts->GetEta()) continue;\r
+           \r
+           fHistMan->GetPtHistogram(kHistPtGen)->Fill(partMC->Pt(),partMC->IsPhysicalPrimary());\r
            // check for true PID + and fill P_t histos \r
            //if (partMC->IsPhysicalPrimary() && CheckYCut(partMC) ) {// only primary vertices and y cut satisfied\r
            if (CheckYCut(partMC) ){// only primary vertices and y cut satisfied\r
@@ -199,7 +199,7 @@ void AliAnalysisTaskSpectraAOD::UserExec(Option_t *)
          Bool_t isDCA = track_clone->PropagateToDCA(fAOD->GetPrimaryVertex(),fAOD->GetMagneticField(),9999.,d,covd);\r
          delete track_clone;\r
          if(!isDCA)d[0]=-999;\r
-\r
+         \r
          fHistMan->GetPtHistogram(kHistPtRec)->Fill(track->Pt(),d[0]);  // PT histo\r
          //Response\r
          fHistMan->GetPIDHistogram(kHistPIDTPC)->Fill(track->GetTPCmomentum(), track->GetTPCsignal()*track->Charge()); // PID histo\r
@@ -267,20 +267,37 @@ void AliAnalysisTaskSpectraAOD::UserExec(Option_t *)
            if (!partMC) { \r
              AliError("Cannot get MC particle");\r
              continue; }\r
-           if (CheckYCut(partMC)) {\r
+           if (partMC->IsPhysicalPrimary())fHistMan->GetPtHistogram(kHistPtRecPrimary)->Fill(track->Pt(),d[0]);  // PT histo\r
+           if (CheckYCut(partMC)){\r
              // primaries, true pid\r
-             if ( partMC->PdgCode() == 2212) { fHistMan->GetPtHistogram(kHistPtRecTrueProtonPlus)->Fill(track->Pt(),d[0]); \r
+             //25th Apr - nsigma cut added in addition to the PDG code\r
+             if ( partMC->PdgCode() == 2212 && nsigmaTPCTOFkProton < fNSigmaPID) { fHistMan->GetPtHistogram(kHistPtRecTrueProtonPlus)->Fill(track->Pt(),d[0]); \r
                if (partMC->IsPhysicalPrimary()) {fHistMan->GetPtHistogram(kHistPtRecTruePrimaryProtonPlus)->Fill(track->Pt(),d[0]); }}\r
-             if ( partMC->PdgCode() == -2212) { fHistMan->GetPtHistogram(kHistPtRecTrueProtonMinus)->Fill(track->Pt(),d[0]); \r
+             if ( partMC->PdgCode() == -2212 && nsigmaTPCTOFkProton < fNSigmaPID) { fHistMan->GetPtHistogram(kHistPtRecTrueProtonMinus)->Fill(track->Pt(),d[0]); \r
                if (partMC->IsPhysicalPrimary()) {fHistMan->GetPtHistogram(kHistPtRecTruePrimaryProtonMinus)->Fill(track->Pt(),d[0]); }}\r
-             if ( partMC->PdgCode() == 321) { fHistMan->GetPtHistogram(kHistPtRecTrueKaonPlus)->Fill(track->Pt(),d[0]); \r
+             if ( partMC->PdgCode() == 321 && nsigmaTPCTOFkKaon < fNSigmaPID) { fHistMan->GetPtHistogram(kHistPtRecTrueKaonPlus)->Fill(track->Pt(),d[0]); \r
                if (partMC->IsPhysicalPrimary()) {fHistMan->GetPtHistogram(kHistPtRecTruePrimaryKaonPlus)->Fill(track->Pt(),d[0]); }}\r
-             if ( partMC->PdgCode() == -321) { fHistMan->GetPtHistogram(kHistPtRecTrueKaonMinus)->Fill(track->Pt(),d[0]); \r
+             if ( partMC->PdgCode() == -321 && nsigmaTPCTOFkKaon < fNSigmaPID) { fHistMan->GetPtHistogram(kHistPtRecTrueKaonMinus)->Fill(track->Pt(),d[0]); \r
                if (partMC->IsPhysicalPrimary()) {fHistMan->GetPtHistogram(kHistPtRecTruePrimaryKaonMinus)->Fill(track->Pt(),d[0]); }}\r
-             if ( partMC->PdgCode() == 211) { fHistMan->GetPtHistogram(kHistPtRecTruePionPlus)->Fill(track->Pt(),d[0]); \r
+             if ( partMC->PdgCode() == 211 && nsigmaTPCTOFkPion < fNSigmaPID) { fHistMan->GetPtHistogram(kHistPtRecTruePionPlus)->Fill(track->Pt(),d[0]); \r
                if (partMC->IsPhysicalPrimary()) {fHistMan->GetPtHistogram(kHistPtRecTruePrimaryPionPlus)->Fill(track->Pt(),d[0]); }}\r
-             if ( partMC->PdgCode() == -211) { fHistMan->GetPtHistogram(kHistPtRecTruePionMinus)->Fill(track->Pt(),d[0]);  \r
+             if ( partMC->PdgCode() == -211 && nsigmaTPCTOFkPion < fNSigmaPID) { fHistMan->GetPtHistogram(kHistPtRecTruePionMinus)->Fill(track->Pt(),d[0]);  \r
                if (partMC->IsPhysicalPrimary()) {fHistMan->GetPtHistogram(kHistPtRecTruePrimaryPionMinus)->Fill(track->Pt(),d[0]); }}\r
+             //25th Apr - Muons are added to Pions\r
+             if ( partMC->PdgCode() == 13 && nsigmaTPCTOFkPion < fNSigmaPID) { \r
+               fHistMan->GetPtHistogram(kHistPtRecTruePionPlus)->Fill(track->Pt(),d[0]); \r
+               fHistMan->GetPtHistogram(kHistPtRecTruePrimaryPionPlus)->Fill(track->Pt(),d[0]);///////////////////FIXME \r
+               fHistMan->GetPtHistogram(kHistPtRecTrueMuonPlus)->Fill(track->Pt(),d[0]); \r
+               if (partMC->IsPhysicalPrimary()) {\r
+                 fHistMan->GetPtHistogram(kHistPtRecTruePrimaryMuonPlus)->Fill(track->Pt(),d[0]); \r
+               }}\r
+             if ( partMC->PdgCode() == -13 && nsigmaTPCTOFkPion < fNSigmaPID) { \r
+               fHistMan->GetPtHistogram(kHistPtRecTruePionMinus)->Fill(track->Pt(),d[0]); \r
+               fHistMan->GetPtHistogram(kHistPtRecTruePrimaryPionMinus)->Fill(track->Pt(),d[0]);//////////////FIXME \r
+               fHistMan->GetPtHistogram(kHistPtRecTrueMuonMinus)->Fill(track->Pt(),d[0]); \r
+               if (partMC->IsPhysicalPrimary()) {\r
+                 fHistMan->GetPtHistogram(kHistPtRecTruePrimaryMuonMinus)->Fill(track->Pt(),d[0]); \r
+               }}\r
              \r
              // primaries, sigma pid \r
              if (partMC->IsPhysicalPrimary()) { \r
index 547c4763c75c28e6da5025ba60b09ffd4c093d16..40b328c2f43c1260e6f322fd9067ce4dbfc74c3c 100644 (file)
@@ -168,10 +168,13 @@ TH1F* AliSpectraAODHistoManager::GetPtHistogram1D(const char * name,Double_t min
   //   //if minDCA=-1 && maxDCA=-1 the projection is done using the full DCA range
   TH2F *hist=(TH2F*)fOutputList->FindObject(name);
   TH1F *outhist=0x0;
-  if(minDCA==-1 && maxDCA==-1)outhist=(TH1F*)hist->ProjectionX("_px",0,-1,"e");
-  else {
+  Printf("--- Projecting %s on Xaxis[%f,%f]:",name,minDCA,maxDCA);
+  if(minDCA==-1 && maxDCA==-1){
+    outhist=(TH1F*)hist->ProjectionX("_px",0,-1,"e");
+    Printf("Full Range");
+  }else {
     Int_t firstbin=hist->GetYaxis()->FindBin(minDCA);
-    Int_t lastbin=hist->GetYaxis()->FindBin(maxDCA-0.00000001);
+    Int_t lastbin=hist->GetYaxis()->FindBin(maxDCA);
     Printf("firstbin: %d lastbin: %d",firstbin,lastbin);
     outhist=(TH1F*)hist->ProjectionX("_px",firstbin,lastbin,"e");
   }
@@ -187,13 +190,18 @@ TH1F* AliSpectraAODHistoManager::GetDCAHistogram1D(const char * name,Double_t mi
   //   //if minPt=-1 && maxPt=-1 the projection is done using the full DCA range
   TH2F *hist=(TH2F*)fOutputList->FindObject(name);
   TH1F *outhist=0x0;
-  if(minPt==-1 && maxPt==-1)outhist=(TH1F*)hist->ProjectionY("_py",0,-1,"e");
-  else {
+  Printf("--- Projecting %s on Yaxis[%f,%f]:",name,minPt,maxPt);
+  if(minPt==-1 && maxPt==-1){
+    outhist=(TH1F*)hist->ProjectionY("_py",0,-1,"e");
+    Printf("Full Range");
+  }else {
     Int_t firstbin=hist->GetXaxis()->FindBin(minPt);
-    Int_t lastbin=hist->GetXaxis()->FindBin(maxPt-0.0000001);
+    Int_t lastbin=hist->GetXaxis()->FindBin(maxPt);
+    Printf("firstbin: %d lastbin: %d",firstbin,lastbin);
     outhist=(TH1F*)hist->ProjectionY("_py",firstbin,lastbin,"e");
     Printf("GetDCAHistogram1D(%s) BinRange:%d  %d  Pt Range: %f %f",hist->GetName(),firstbin,lastbin,hist->GetXaxis()->GetBinLowEdge(firstbin),hist->GetXaxis()->GetBinLowEdge(firstbin)+hist->GetXaxis()->GetBinWidth(lastbin));
   }
+  Printf("Entries outhist: %.0f   Entries hist: %.0f",outhist->GetEntries(),hist->GetEntries());
   return outhist;
 }
 
index 24e62c62698b9eff7f0a73b6cfa95b60f1a5620b..cd75def4968d2cc5edf273e5e828e3a38f4e8b6e 100644 (file)
@@ -34,10 +34,11 @@ namespace AliSpectraNameSpace
       kHistPtGenTruePrimaryProtonMinus,         // Pt histo for protons -, generated tracks, true ID, primary Event
       kHistPtGenTruePrimaryKaonMinus,           // Pt histo for kaons -, generated tracks, true ID, primary Event
       kHistPtGenTruePrimaryPionMinus,           // Pt histo for pions -, generated tracks, true ID, primary Event
-      kNPtGenHist = kHistPtGenTruePrimaryPionMinus,                    // Number of ptGen-likehistos histos
+      kHistPtGen,                               // Pt histo for all particles, generated tracks
+      kNPtGenHist = kHistPtGen,                    // Number of ptGen-likehistos histos
       
       // 6 Pt Reconstructed Sigma
-      kHistPtRecSigmaProtonPlus,            // Pt histo for protons +, reconstructed tracks, sigma ID
+      kHistPtRecSigmaProtonPlus,                // Pt histo for protons +, reconstructed tracks, sigma ID
       kHistPtRecSigmaKaonPlus,                  // Pt histo for kaons +, reconsructed tracks, sigma ID
       kHistPtRecSigmaPionPlus,                  // Pt histo for pions +, reconstructed tracks, sigma ID
       kHistPtRecSigmaProtonMinus,               // Pt histo for protons -, reconstructed tracks, sigma ID
@@ -51,6 +52,8 @@ namespace AliSpectraNameSpace
       kHistPtRecTrueProtonMinus,                // Pt histo for protons -, reconstructed tracks, true ID
       kHistPtRecTrueKaonMinus,                  // Pt histo for kaons -, reconstructed tracks, true ID
       kHistPtRecTruePionMinus,                  // Pt histo for pions -, reconstructed tracks, true ID
+      kHistPtRecTrueMuonPlus,                   // Pt histo for muons +, reconstructed tracks, true ID,
+      kHistPtRecTrueMuonMinus,                  // Pt histo for muons +, reconstructed tracks, true ID,
             
       // 6 Pt Reconstructed Sigma Primary
       kHistPtRecSigmaPrimaryProtonPlus,         // Pt histo for protons +, reconstructed tracks, sigma ID, primary Event
@@ -83,11 +86,13 @@ namespace AliSpectraNameSpace
       kHistPtRecTruePrimaryProtonMinus,         // Pt histo for protons -, reconstructed tracks, true ID, primary event
       kHistPtRecTruePrimaryKaonMinus,           // Pt histo for kaons -, reconstructed tracks, true ID, primary event
       kHistPtRecTruePrimaryPionMinus,           // Pt histo for pions -, reconstructed tracks, true ID, primary event
+      kHistPtRecTruePrimaryMuonPlus,            // Pt histo for muons +, reconstructed tracks, true ID, primary event
+      kHistPtRecTruePrimaryMuonMinus,            // Pt histo for muons +, reconstructed tracks, true ID, primary event
       
       // Rest
       kHistPtRec,                               // Pt histo for all particles, reconstructed tracks
-      kHistPtGen,                               // Pt histo for all particles, generated tracks
-      kNPtRecHist = kHistPtGen,                    // Number of ptRec-likehistos histos
+      kHistPtRecPrimary,                               // Pt histo for all particles, reconstructed tracks
+      kNPtRecHist = kHistPtRecPrimary,                    // Number of ptRec-likehistos histos
       
       kHistPIDTPC,                              // Particle Identification histo
       kHistPIDTOF,                              
@@ -129,7 +134,8 @@ namespace AliSpectraNameSpace
       "histPtGenTruePrimaryProtonMinus",          // Pt histo for protons -, generated tracks, sigma ID, primary Event
       "histPtGenTruePrimaryKaonMinus",            // Pt histo for kaons -, generated tracks, sigma ID, primary Event
       "histPtGenTruePrimaryPionMinus",            // Pt histo for pions -, generated tracks, sigma ID, primary Event
-      
+      "histPtGen",                              // Pt histo for all particles, generated tracks
+     
       // 6 Pt Reconstructed Sigma
       "histPtRecSigmaProtonPlus",               // Pt histo for protons +, reconstructed tracks, sigma ID
       "histPtRecSigmaKaonPlus",                 // Pt histo for kaons +, reconsructed tracks, sigma ID
@@ -145,7 +151,9 @@ namespace AliSpectraNameSpace
       "histPtRecTrueProtonMinus",               // Pt histo for protons -, reconstructed tracks, true ID
       "histPtRecTrueKaonMinus",                 // Pt histo for kaons -, reconstructed tracks, true ID
       "histPtRecTruePionMinus",                 // Pt histo for pions -, reconstructed tracks, true ID
-
+      "histPtRecTrueMuonPlus",                  // Pt histo for muons +, reconstructed tracks, true ID
+      "histPtRecTrueMuonMinus",                 // Pt histo for muons -, reconstructed tracks, true ID
+      
       // 6 Pt Reconstructed Sigma Primary
       "histPtRecSigmaPrimaryProtonPlus",        // Pt histo for protons +, reconstructed tracks, sigma ID, primary Event
       "histPtRecSigmaPrimaryKaonPlus",          // Pt histo for kaons +, reconsructed tracks, sigma ID, primary Event
@@ -177,11 +185,13 @@ namespace AliSpectraNameSpace
       "histPtRecTruePrimaryProtonMinus",        // Pt histo for protons -, reconstructed tracks, true ID, primary event
       "histPtRecTruePrimaryKaonMinus",          // Pt histo for kaons -, reconstructed tracks, true ID, primary event
       "histPtRecTruePrimaryPionMinus",          // Pt histo for pions -, reconstructed tracks, true ID, primary event
+      "histPtRecTruePrimaryMuonPlus",           // Pt histo for muons +, reconstructed tracks, true ID, primary event
+      "histPtRecTruePrimaryMuonMinus",          // Pt histo for muons -, reconstructed tracks, true ID, primary event
       
       // Rest
       "histPtRec",                              // Pt histo for all particles, reconstructed tracks
-      "histPtGen",                              // Pt histo for all particles, generated tracks
-     
+      "histPtRecPrimary",                              // Pt histo for all particles, reconstructed tracks
+      
       "histPIDTPC",                             // Particle Identification histo
       "histPIDTOF",                             
      
index a05e22f5480c9df52c355885589caa808df231c5..b67e9b23d5930a6e8a68b37d6db2eee36f56f95e 100644 (file)
@@ -20,8 +20,8 @@ Double_t proju[3]={10,40,90};
 
 
 void MainAnalysis() {
-  TString fold="5SigmaPIDFilterBit6";
-  //TString fold="5SigmaPID";
+  //TString fold="5SigmaPIDFilterBit6";
+  TString fold="5SigmaPID";
   Int_t ibinToCompare=-1;
   
   //TString sname="Cent0to100_QVec0.0to100.0";
@@ -38,17 +38,25 @@ void MainAnalysis() {
   TString dataFile = Form("outputAOD%s/Pt.AOD.1._data_ptcut_%s.root",fold.Data(),sname.Data());
   TString mcFile =Form("outputAOD%s/Pt.AOD.1._MC_%s.root",fold.Data(),sname.Data());
   
-  gSystem->Load("libTree.so");
+  gSystem->Load("libCore.so");  
   gSystem->Load("libGeom.so");
-  gSystem->Load("libVMC.so");
   gSystem->Load("libPhysics.so");
-  gSystem->Load("libSTEERBase.so");
-  gSystem->Load("libESD.so");
-  gSystem->Load("libAOD.so");
-  gSystem->Load("libANALYSIS.so");
-  gSystem->Load("libANALYSISalice.so");
+  gSystem->Load("libVMC");
+  gSystem->Load("libTree");
+  gSystem->Load("libProof");
+  gSystem->Load("libMatrix");
+  gSystem->Load("libSTEERBase");
+  gSystem->Load("libESD");
+  gSystem->Load("libAOD");
   gSystem->Load("libANALYSIS");
+  gSystem->Load("libOADB");
   gSystem->Load("libANALYSISalice");
+  gSystem->Load("libTENDER");
+  gSystem->Load("libCORRFW");
+  //gSystem->Load("libPWG0base");
+  gSystem->Load("libMinuit");
+  gSystem->Load("libPWGTools");
+  gSystem->Load("libPWGLFSPECTRA");
   gSystem->AddIncludePath("-I$ALICE_ROOT/include");
   gStyle->SetPalette(1);
   
@@ -196,9 +204,10 @@ void MainAnalysis() {
   for(Int_t icharge=0;icharge<2;icharge++){
     for(Int_t ipart=0;ipart<3;ipart++){
       Int_t index=ipart+3*icharge;
-      TString hname=Form("histPtRecSigma%s%s",Particle[ipart].Data(),Sign[icharge].Data());
+      //TString hname=Form("histPtRecSigma%s%s",Particle[ipart].Data(),Sign[icharge].Data());
       //TString hname=Form("histPtRecTrue%s%s",Particle[ipart].Data(),Sign[icharge].Data());
       //TString hname=Form("histPtRecSigmaPrimary%s%s",Particle[ipart].Data(),Sign[icharge].Data());
+      TString hname=Form("histPtRecTruePrimary%s%s",Particle[ipart].Data(),Sign[icharge].Data());
       Printf("Getting %s",hname.Data());
       CorrFact[index]=(TH1F*)((TH1F*) hman_mc->GetPtHistogram1D(hname.Data(),-1,-1))->Clone();
       CorrFact[index]->SetName(Form("CorrFact_%s%s",Particle[ipart].Data(),Sign[icharge].Data()));
@@ -213,6 +222,9 @@ void MainAnalysis() {
       else CorrFact[index]->DrawClone("same");
     }
   } 
+  TFile *fESD=new TFile("EffAlex/pionEffPbPb.root");
+  TH1F *hEffESD=(TH1F*)fESD->Get("effMapPionTpcOnlyNeg0");
+  hEffESD->DrawClone("same");
   gPad->BuildLegend();
 
   //Normalization
@@ -221,7 +233,6 @@ void MainAnalysis() {
   Double_t events_data =  ecuts_data->NumberOfEvents();
   Printf(": accepted events: %.0f",events_data);
   
-  
   //divide RAW for Correction Factor
   Printf("\n\n-> Using MC correction factor to correct RAW spectra");
   TH1F *Spectra[6];
@@ -237,11 +248,16 @@ void MainAnalysis() {
       Spectra[index]->SetMarkerColor(Color[ipart]);
       Spectra[index]->SetLineColor(Color[ipart]);
       Printf("... and divide it by %s",hname.Data());
-      Spectra[index]->Divide(CorrFact[index]);
+      Spectra[index]->Divide(CorrFact[index]);//////////////////////////////////////////////////////////////////////////////////////////FIXME
+      // if(index!=3)Spectra[index]->Divide(CorrFact[index]);
+      // else{
+      //       Spectra[index]=AliPWGHistoTools::MyDivideHistosDifferentBins(Spectra[index],hEffESD);
+      // }
       Spectra[index]->Scale(1./events_data,"width");//NORMALIZATION
     }
   } 
   
+    
   //Geant/Fluka Correction
   Printf("\nGF correction for Kaons");
   TString fnameGeanFlukaK="GFCorrection/correctionForCrossSection.321.root";
@@ -364,7 +380,6 @@ void MainAnalysis() {
     
   
   //if Bin 0-5% with no cut ratio with combined analysis
-  
   if(ibinToCompare!=-1){
     TCanvas *CratioComb=new TCanvas("CratioComb","CratioComb",700,500);
     CratioComb->Divide(3,2);
@@ -393,6 +408,98 @@ void MainAnalysis() {
       }
     }
   }    
+
+  //comparison with charged hadron
+  Printf("\n\n-> ChargedHadron comparison");
+  TCanvas *cAllCh=new TCanvas("cAllCh","cAllCh",700,500);
+  cAllCh->Divide(1,4);
+  TH1F *hChHad_data=(TH1F*)((TH1F*)hman_data->GetPtHistogram1D("histPtRec",-1,-1))->Clone();
+  hChHad_data->Scale(1./events_data,"width");//NORMALIZATION
+  //fraction of sec in MC
+  TH1F *hSecAllMC=(TH1F*)((TH1F*)hman_mc->GetPtHistogram1D("histPtGen",0,0))->Clone();
+  TH1F *hAllMC=(TH1F*)((TH1F*)hman_mc->GetPtHistogram1D("histPtGen",0,1))->Clone();
+  hSecAllMC->Divide(hAllMC);
+  cAllCh->cd(1);
+  hSecAllMC->DrawClone();
+  cAllCh->cd(2);
+  hChHad_data->DrawClone();
+  for(Int_t ibin=1;ibin<=hChHad_data->GetNbinsX();ibin++){
+    Double_t en=hChHad_data->GetBinContent(ibin);
+    Double_t sec=hSecAllMC->GetBinContent(ibin);
+    hChHad_data->SetBinContent(ibin,en-(en*sec*0.2));
+    //Printf("%f %f %d",en,sec,ibin);
+    //Printf("%f",hChHad_data->GetBinContent(ibin));
+  }
+  hChHad_data->DrawClone("lhistsame");
+  //efficiency for primaries
+  TH1F *hEff_mc=(TH1F*)((TH1F*)hman_mc->GetPtHistogram1D("histPtRec",-1,-1))->Clone();
+  hEff_mc->Divide((TH1F*)((TH1F*)hman_mc->GetPtHistogram1D("histPtGen",0.5,1.5))->Clone());
+  cAllCh->cd(3);
+  hEff_mc->DrawClone();
+  hChHad_data->Divide(hEff_mc);
+  cAllCh->cd(4);
+  hChHad_data->Draw();
+  
+  //Comparison of efficiency with TPCTOF ESD analysis
+  Printf("\n\n-> Calculating Efficiency to be compared with ESD analysis");
+  TH1F *EffTRUEPions;
+  TH1F *EffSIGMAPions;
+  TCanvas *cEffESD=new TCanvas("cEffESD","cEffESD",700,500);
+  cEffESD->Divide(1,2);
+  Int_t icharge=1;
+  Int_t ipart=0;
+  //using MC truth
+  //TString hname=Form("histPtRecTrue%s%s",Particle[ipart].Data(),Sign[icharge].Data());
+  TString hname=Form("histPtRecTruePrimary%s%s",Particle[ipart].Data(),Sign[icharge].Data());
+  Printf("Getting %s",hname.Data());
+  EffTRUEPions=(TH1F*)((TH1F*) hman_mc->GetPtHistogram1D(hname.Data(),-1,-1))->Clone();
+  EffTRUEPions->SetName(Form("Eff TRUE_%s%s",Particle[ipart].Data(),Sign[icharge].Data()));
+  EffTRUEPions->SetTitle(Form("Eff TRUE %s%s",Particle[ipart].Data(),Sign[icharge].Data()));
+  EffTRUEPions->SetMarkerStyle(Marker[icharge]);
+  EffTRUEPions->SetMarkerColor(Color[ipart]);
+  EffTRUEPions->SetLineColor(Color[ipart]);
+  hname=Form("histPtGenTruePrimary%s%s",Particle[ipart].Data(),Sign[icharge].Data());
+  Printf("... and divide it by %s",hname.Data());
+  EffTRUEPions->Divide(EffTRUEPions,(TH1F*)((TH1F*)hman_mc->GetPtHistogram1D(hname.Data(),1,1))->Clone(),1,1,"B");//binomial error
+  //using NSigma
+  //hname=Form("histPtRecSigma%s%s",Particle[ipart].Data(),Sign[icharge].Data());
+  hname=Form("histPtRecSigmaPrimary%s%s",Particle[ipart].Data(),Sign[icharge].Data());
+  Printf("Getting %s",hname.Data());
+  EffSIGMAPions=(TH1F*)((TH1F*) hman_mc->GetPtHistogram1D(hname.Data(),-1,-1))->Clone();
+  EffSIGMAPions->SetName(Form("Eff SIGMA_%s%s",Particle[ipart].Data(),Sign[icharge].Data()));
+  EffSIGMAPions->SetTitle(Form("Eff SIGMA %s%s",Particle[ipart].Data(),Sign[icharge].Data()));
+  EffSIGMAPions->SetMarkerStyle(Marker[icharge]);
+  EffSIGMAPions->SetMarkerColor(Color[ipart+1]);
+  EffSIGMAPions->SetLineColor(Color[ipart+1]);
+  hname=Form("histPtGenTruePrimary%s%s",Particle[ipart].Data(),Sign[icharge].Data());
+  Printf("... and divide it by %s",hname.Data());
+  EffSIGMAPions->Divide(EffSIGMAPions,(TH1F*)((TH1F*)hman_mc->GetPtHistogram1D(hname.Data(),1,1))->Clone(),1,1,"B");//binomial error
+  cEffESD->cd(1);
+  //if(icharge==0)EffTRUEPions->DrawClone();
+  //else EffTRUEPions->DrawClone("same");
+  EffTRUEPions->DrawClone("lhist");
+  EffSIGMAPions->DrawClone("lhistsame");
+  hEffESD->Draw("lhistsame");
+  gPad->BuildLegend();
+  cEffESD->cd(2);
+  TH1F *hRatioTRUE=AliPWGHistoTools::MyDivideHistosDifferentBins(EffTRUEPions,hEffESD);
+  hRatioTRUE->Draw("lhist");
+  TH1F *hRatioSIGMA=AliPWGHistoTools::MyDivideHistosDifferentBins(EffSIGMAPions,hEffESD);
+  hRatioSIGMA->Draw("lhistsame");
+
+
+  //Muon over Pion Ratio
+  TCanvas *cMu=new TCanvas("cMu","cMu");
+  TH1F *hMuOverPi[2];
+  for(Int_t icharge=0;icharge<2;icharge++){
+    TString hname=Form("histPtRecTruePrimaryMuon%s",Sign[icharge].Data());
+    hMuOverPi[icharge]=(TH1F*)((TH1F*) hman_mc->GetPtHistogram1D(hname.Data(),-1,-1))->Clone();
+    hname=Form("histPtRecTruePrimaryPion%s",Sign[icharge].Data());
+    hMuOverPi[icharge]->Divide((TH1F*)((TH1F*) hman_mc->GetPtHistogram1D(hname.Data(),-1,-1))->Clone());
+    if(icharge==0)hMuOverPi[icharge]->DrawClone();
+    else hMuOverPi[icharge]->DrawClone("same");
+  }
+  
 }
 
 
@@ -514,7 +621,7 @@ void DCACorrection(TH1F **Spectra, AliSpectraAODHistoManager* hman_data, AliSpec
       
       }
       Spectra[index]->Multiply(hcorrection[0]);//multiply for data
-      Spectra[index]->Divide(hcorrection[1]); //divide by Monte Carlo
+      //Spectra[index]->Divide(hcorrection[1]); //divide by Monte Carlo
     }
   }
   ccorrection->cd(1);
index 8e9169822f9a583ede61bfe88a69e6b221fb5380..1cf7f4b843756135408d819c62176905e62f1b27 100644 (file)
@@ -1,4 +1,4 @@
-void runAODProof(Int_t c=1, const char * proofMode = "full")
+void runAODProof(Int_t c=2, const char * proofMode = "full")
 {
 
    gEnv->SetValue("XSec.GSI.DelegProxy", "2");