Adopting for real data + improvments in the macro to visualize the QA and the results
authorpchrist <pchrist@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 7 Dec 2009 12:26:27 +0000 (12:26 +0000)
committerpchrist <pchrist@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 7 Dec 2009 12:26:27 +0000 (12:26 +0000)
PWG2/SPECTRA/AliAnalysisTaskProtons.cxx
PWG2/SPECTRA/AliProtonAnalysis.cxx
PWG2/SPECTRA/AliProtonAnalysisBase.cxx
PWG2/SPECTRA/AliProtonAnalysisBase.h
PWG2/SPECTRA/macros/AddTaskProtons.C
PWG2/SPECTRA/macros/configProtonAnalysis.C
PWG2/SPECTRA/macros/configProtonAnalysisBaseObject.C
PWG2/SPECTRA/macros/drawProtonResults.C
PWG2/SPECTRA/macros/runProtonAnalysis.C

index b8027b2ab57f1c9c4d8cfa54b0b8e0f8afe0bea5..865e21176de902659a02e7ec0e303b90544efcce 100644 (file)
@@ -122,14 +122,24 @@ void AliAnalysisTaskProtons::Exec(Option_t *) {
       return;
     }
 
       return;
     }
 
-    if(dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->IsEventTriggered(fESD,dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->GetTriggerMode())) {
+    if(dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->GetMCAnalysisMode()) {
+      if(dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->IsEventTriggered(fESD,dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->GetTriggerMode())) {
+       const AliESDVertex *vertex = dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->GetVertex(fESD,dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->GetAnalysisMode(),dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->GetVxMax(),dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->GetVyMax(),dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->GetVzMax());
+       if(vertex) {
+         AliDebug(1,Form("Proton ESD analysis task: There are %d tracks in this event",fESD->GetNumberOfTracks()));
+         //Printf("Proton ESD analysis task: There are %d tracks in this event", fESD->GetNumberOfTracks());
+         fProtonAnalysis->Analyze(fESD,vertex);
+       }//reconstructed vertex
+      }//triggered event
+    }//MC analysis
+    else {
       const AliESDVertex *vertex = dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->GetVertex(fESD,dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->GetAnalysisMode(),dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->GetVxMax(),dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->GetVyMax(),dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->GetVzMax());
       if(vertex) {
        AliDebug(1,Form("Proton ESD analysis task: There are %d tracks in this event",fESD->GetNumberOfTracks()));
        //Printf("Proton ESD analysis task: There are %d tracks in this event", fESD->GetNumberOfTracks());
        fProtonAnalysis->Analyze(fESD,vertex);
       }//reconstructed vertex
       const AliESDVertex *vertex = dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->GetVertex(fESD,dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->GetAnalysisMode(),dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->GetVxMax(),dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->GetVyMax(),dynamic_cast<AliProtonAnalysisBase*>(fProtonAnalysis->GetProtonAnalysisBaseObject())->GetVzMax());
       if(vertex) {
        AliDebug(1,Form("Proton ESD analysis task: There are %d tracks in this event",fESD->GetNumberOfTracks()));
        //Printf("Proton ESD analysis task: There are %d tracks in this event", fESD->GetNumberOfTracks());
        fProtonAnalysis->Analyze(fESD,vertex);
       }//reconstructed vertex
-    }//triggered event
+    }//real data analysis
   }//ESD analysis              
   
   else if(gAnalysisLevel == "AOD") {
   }//ESD analysis              
   
   else if(gAnalysisLevel == "AOD") {
index b0626762538125a523adb42ec9c0dc54161c5bc3..7d6c2314d04d45b1895a9e5b6abbd0c9ec13d8ab 100644 (file)
@@ -696,7 +696,12 @@ void AliProtonAnalysis::Analyze(AliESDEvent* esd,
       gPt = tpcTrack->Pt();
       gP = tpcTrack->P();
       
       gPt = tpcTrack->Pt();
       gP = tpcTrack->P();
       
+      if(fProtonAnalysisBase->IsAccepted(esd,vertex,track)) 
+       ((TH2F *)(fQA2DList->At(0)))->Fill(gP,track->GetTPCsignal());
+
       if(fProtonAnalysisBase->IsProton(track)) {
       if(fProtonAnalysisBase->IsProton(track)) {
+       if(fProtonAnalysisBase->IsAccepted(esd,vertex,track)) 
+         ((TH2F *)(fQA2DList->At(1)))->Fill(gP,track->GetTPCsignal());
        FillQA(esd,vertex,track);
        if(tpcTrack->Charge() > 0) {
          nIdentifiedProtons += 1;
        FillQA(esd,vertex,track);
        if(tpcTrack->Charge() > 0) {
          nIdentifiedProtons += 1;
@@ -786,7 +791,11 @@ void AliProtonAnalysis::Analyze(AliESDEvent* esd,
       gPt = track->Pt();
       gP = track->P();
       
       gPt = track->Pt();
       gP = track->P();
       
+      if(fProtonAnalysisBase->IsAccepted(esd,vertex,track)) 
+       ((TH2F *)(fQA2DList->At(0)))->Fill(gP,track->GetTPCsignal());
       if(fProtonAnalysisBase->IsProton(track)) {
       if(fProtonAnalysisBase->IsProton(track)) {
+       if(fProtonAnalysisBase->IsAccepted(esd,vertex,track)) 
+         ((TH2F *)(fQA2DList->At(1)))->Fill(gP,track->GetTPCsignal());
        FillQA(esd,vertex,track);
        if(track->Charge() > 0) {
          nIdentifiedProtons += 1;
        FillQA(esd,vertex,track);
        if(track->Charge() > 0) {
          nIdentifiedProtons += 1;
@@ -1252,6 +1261,11 @@ void AliProtonAnalysis::InitQA() {
   fQA2DList = new TList();
   fQA2DList->SetName("fQA2DList");
   fGlobalQAList->Add(fQA2DList);
   fQA2DList = new TList();
   fQA2DList->SetName("fQA2DList");
   fGlobalQAList->Add(fQA2DList);
+  //dEdx plots
+  TH2F *gHistdEdxP = new TH2F("gHistdEdxP","dE/dx (TPC); P [GeV/c]; dE/dx [a.u]",100,0.01,10.1,100,0,600);
+  fQA2DList->Add(gHistdEdxP);
+  TH2F *gHistProtonsdEdxP = new TH2F("gHistProtonsdEdxP","Accepted protons dE/dx (TPC); P [GeV/c]; dE/dx [a.u]",100,0.01,10.1,100,0,600);
+  fQA2DList->Add(gHistProtonsdEdxP);
   
   //========================================================//
   fQAProtonsAcceptedList = new TList();
   
   //========================================================//
   fQAProtonsAcceptedList = new TList();
index ab71d248a81c9c38918274a2d3218969f497002a..9f8efdf4d86c394cd83d74c5d19d63eb7fa850ac 100644 (file)
@@ -39,7 +39,7 @@ ClassImp(AliProtonAnalysisBase)
 
 //____________________________________________________________________//
 AliProtonAnalysisBase::AliProtonAnalysisBase() : 
 
 //____________________________________________________________________//
 AliProtonAnalysisBase::AliProtonAnalysisBase() : 
-  TObject(),  fProtonAnalysisLevel("ESD"),
+  TObject(),  fProtonAnalysisLevel("ESD"), fAnalysisMC(kFALSE),
   fTriggerMode(kMB2), fProtonAnalysisMode(kTPC), fProtonPIDMode(kBayesian),
   fAnalysisEtaMode(kFALSE),
   fVxMax(100.), fVyMax(100.), fVzMax(100.),
   fTriggerMode(kMB2), fProtonAnalysisMode(kTPC), fProtonPIDMode(kBayesian),
   fAnalysisEtaMode(kFALSE),
   fVxMax(100.), fVyMax(100.), fVzMax(100.),
index f0429bf44f47188ef363f1089b1a8d9605f05616..c9f5b7698bfcec3d08f95da72a5237cf1bd90e67 100644 (file)
@@ -36,7 +36,8 @@ class AliProtonAnalysisBase : public TObject {
   void SetAnalysisLevel(const char* type) {fProtonAnalysisLevel = type;}
   void SetAnalysisMode(AnalysisMode analysismode) {fProtonAnalysisMode = analysismode;}
   void SetEtaMode() {fAnalysisEtaMode = kTRUE;}
   void SetAnalysisLevel(const char* type) {fProtonAnalysisLevel = type;}
   void SetAnalysisMode(AnalysisMode analysismode) {fProtonAnalysisMode = analysismode;}
   void SetEtaMode() {fAnalysisEtaMode = kTRUE;}
-  void SetTriggerMode(TriggerMode triggermode) {fTriggerMode = triggermode;}
+  void SetTriggerMode(TriggerMode triggermode) {
+    fAnalysisMC = kTRUE; fTriggerMode = triggermode;}
   void SetPIDMode(PIDMode pidmode) {fProtonPIDMode = pidmode;}
 
   const char *GetAnalysisLevel() {return fProtonAnalysisLevel.Data();}
   void SetPIDMode(PIDMode pidmode) {fProtonPIDMode = pidmode;}
 
   const char *GetAnalysisLevel() {return fProtonAnalysisLevel.Data();}
@@ -44,6 +45,7 @@ class AliProtonAnalysisBase : public TObject {
   Bool_t GetEtaMode() const {return fAnalysisEtaMode;}
   TriggerMode GetTriggerMode() const {return fTriggerMode;}
   PIDMode GetPIDMode() const {return fProtonPIDMode;}
   Bool_t GetEtaMode() const {return fAnalysisEtaMode;}
   TriggerMode GetTriggerMode() const {return fTriggerMode;}
   PIDMode GetPIDMode() const {return fProtonPIDMode;}
+  Bool_t GetMCAnalysisMode() {return fAnalysisMC;}
 
   const  AliESDVertex *GetVertex(AliESDEvent *esd,
                                 AnalysisMode mode,
 
   const  AliESDVertex *GetVertex(AliESDEvent *esd,
                                 AnalysisMode mode,
@@ -253,6 +255,7 @@ class AliProtonAnalysisBase : public TObject {
   AliProtonAnalysisBase& operator=(const AliProtonAnalysisBase&); // Not implemented
 
   TString fProtonAnalysisLevel;//"ESD", "AOD" or "MC"
   AliProtonAnalysisBase& operator=(const AliProtonAnalysisBase&); // Not implemented
 
   TString fProtonAnalysisLevel;//"ESD", "AOD" or "MC"
+  Bool_t fAnalysisMC; //kTRUE if MC analysis
   TriggerMode fTriggerMode; //Trigger mode
   AnalysisMode fProtonAnalysisMode; //Analysis mode: TPC-Hybrid-Global
   PIDMode fProtonPIDMode; //PID mode: Bayesian-dE/dx ratio-Nsigma areas
   TriggerMode fTriggerMode; //Trigger mode
   AnalysisMode fProtonAnalysisMode; //Analysis mode: TPC-Hybrid-Global
   PIDMode fProtonPIDMode; //PID mode: Bayesian-dE/dx ratio-Nsigma areas
index d1b8ca6e8d9e7ee91ba1a97370c8ae23cf2803b3..547e70ddce1962694e822c94926eae1004c45ffd 100644 (file)
@@ -1,4 +1,5 @@
-AliAnalysisTaskProtons *AddTaskProtons(const char *analysisType="Hybrid",
+AliAnalysisTaskProtons *AddTaskProtons(Bool_t kAnalyzeMC = kFALSE,
+                                      const char *analysisType="Hybrid",
                                       const char *pidMode="Bayesian")
 {
   // Creates a proton analysis task and adds it to the analysis manager.
                                       const char *pidMode="Bayesian")
 {
   // Creates a proton analysis task and adds it to the analysis manager.
@@ -20,9 +21,11 @@ AliAnalysisTaskProtons *AddTaskProtons(const char *analysisType="Hybrid",
   TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
   gROOT->LoadMacro("$ALICE_ROOT/PWG2/SPECTRA/macros/configProtonAnalysis.C");
   AliProtonAnalysis *pa = 0;
   TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
   gROOT->LoadMacro("$ALICE_ROOT/PWG2/SPECTRA/macros/configProtonAnalysis.C");
   AliProtonAnalysis *pa = 0;
-  if (type=="ESD") pa = GetProtonAnalysisObject("ESD", analysisType, pidMode);
-  else if (type=="AOD") pa = GetProtonAnalysisObject("AOD", analysisType, pidMode);
-  else pa = GetProtonAnalysisObject("MC", analysisType, pidMode);
+  if (type=="ESD") pa = GetProtonAnalysisObject("ESD", kAnalyzeMC, 
+                                               analysisType, pidMode);
+  else if (type=="AOD") pa = GetProtonAnalysisObject("AOD", kAnalyzeMC, 
+                                                    analysisType, pidMode);
+  else pa = GetProtonAnalysisObject("MC", analysisType, kAnalyzeMC, pidMode);
 
   // Create the task, add it to manager and configure it.
   //===========================================================================
 
   // Create the task, add it to manager and configure it.
   //===========================================================================
index c6bfa80fed3e8e756e351a87adb419dd5cd6f2d7..4df6ac85384141e800b0cf78e9f0b02a89a0a2e0 100644 (file)
@@ -1,12 +1,13 @@
 //__________________________________________________//
 //__________________________________________________//
-AliProtonAnalysis *GetProtonAnalysisObject(const char* analysisLevel = "ESD", 
+AliProtonAnalysis *GetProtonAnalysisObject(const char* analysisLevel = "ESD",
+                                          Bool_t kAnalyzeMC = kTRUE,
                                           const char* esdAnalysisType = "Hybrid", 
                                           const char* pidMode = "Bayesian") {
                                           
                                           
   gROOT->LoadMacro("$ALICE_ROOT/PWG2/SPECTRA/macros/configProtonAnalysisBaseObject.C");  
   //Function to setup the AliProtonAnalysis object and return it
                                           const char* esdAnalysisType = "Hybrid", 
                                           const char* pidMode = "Bayesian") {
                                           
                                           
   gROOT->LoadMacro("$ALICE_ROOT/PWG2/SPECTRA/macros/configProtonAnalysisBaseObject.C");  
   //Function to setup the AliProtonAnalysis object and return it
-  AliProtonAnalysisBase *baseAnalysis = GetProtonAnalysisBaseObject(analysisLevel,esdAnalysisType,pidMode);
+  AliProtonAnalysisBase *baseAnalysis = GetProtonAnalysisBaseObject(analysisLevel,kAnalyzeMC,esdAnalysisType,pidMode);
 
   AliProtonAnalysis *analysis = new AliProtonAnalysis();
   analysis->SetBaseAnalysis(baseAnalysis);
 
   AliProtonAnalysis *analysis = new AliProtonAnalysis();
   analysis->SetBaseAnalysis(baseAnalysis);
index 3d3273a974a3ed289dd12e303e53a58e96e13d32..91931245677f27e4241ccee062e96a608745c25c 100644 (file)
@@ -1,4 +1,5 @@
 AliProtonAnalysisBase *GetProtonAnalysisBaseObject(const char* analysisLevel = "ESD",\r
 AliProtonAnalysisBase *GetProtonAnalysisBaseObject(const char* analysisLevel = "ESD",\r
+                                                  Bool_t kAnalyzeMC = kTRUE,\r
                                                   const char* esdAnalysisType = "Hybrid",\r
                                                   const char* pidMode = "Bayesian") {\r
   \r
                                                   const char* esdAnalysisType = "Hybrid",\r
                                                   const char* pidMode = "Bayesian") {\r
   \r
@@ -6,8 +7,9 @@ AliProtonAnalysisBase *GetProtonAnalysisBaseObject(const char* analysisLevel = "
   AliProtonAnalysisBase *baseAnalysis = new AliProtonAnalysisBase();\r
   //baseAnalysis->SetDebugMode();\r
   baseAnalysis->SetAnalysisLevel(analysisLevel);\r
   AliProtonAnalysisBase *baseAnalysis = new AliProtonAnalysisBase();\r
   //baseAnalysis->SetDebugMode();\r
   baseAnalysis->SetAnalysisLevel(analysisLevel);\r
-  if(analysisLevel == "ESD") {  \r
-    baseAnalysis->SetTriggerMode(AliProtonAnalysisBase::kMB2);\r
+  if(analysisLevel == "ESD") {\r
+    if(kAnalyzeMC)\r
+      baseAnalysis->SetTriggerMode(AliProtonAnalysisBase::kMB2);\r
     baseAnalysis->SetMinTPCClusters(110);\r
     baseAnalysis->SetMaxChi2PerTPCCluster(2.2);\r
     baseAnalysis->SetMaxCov11(0.5);\r
     baseAnalysis->SetMinTPCClusters(110);\r
     baseAnalysis->SetMaxChi2PerTPCCluster(2.2);\r
     baseAnalysis->SetMaxCov11(0.5);\r
@@ -62,7 +64,7 @@ AliProtonAnalysisBase *GetProtonAnalysisBaseObject(const char* analysisLevel = "
     default:\r
       break;\r
     }\r
     default:\r
       break;\r
     }\r
-    baseAnalysis->SetAcceptedVertexDiamond(5.,5.,15.);\r
+    baseAnalysis->SetAcceptedVertexDiamond(5.,5.,25.);\r
     baseAnalysis->SetEtaMode();\r
     switch(pidMode) {\r
     case "Bayesian":\r
     baseAnalysis->SetEtaMode();\r
     switch(pidMode) {\r
     case "Bayesian":\r
index aa8ccdf0a2f301859969ac0877b27cbeccc20b9b..25520bea065d73ac324d0b8af6e4efe9e53c2533 100644 (file)
@@ -1,9 +1,26 @@
 void drawProtonResults(const char* esdFileName) {
   //Macro to visualize the proton ratio results
   //It also visualizes the QA plots
 void drawProtonResults(const char* esdFileName) {
   //Macro to visualize the proton ratio results
   //It also visualizes the QA plots
+  gStyle->SetPalette(1,0);
+  drawResults(esdFileName);
   drawQAPlots(esdFileName);
 }
 
   drawQAPlots(esdFileName);
 }
 
+//___________________________________________________//
+void drawResults(const char* esdFileName) {
+  //Draws the main results from the ratio analysis
+  TFile *f = TFile::Open(esdFileName);
+  TList *analysisList = dynamic_cast<TList *>(f->Get("outputList"));
+  analysisList->ls();
+  TH2D *gHistYPtProtons = dynamic_cast<TH2D *>(analysisList->At(0));
+  TH2D *gHistYPtAntiProtons = dynamic_cast<TH2D *>(analysisList->At(1));
+
+  TCanvas *c2D = new TCanvas("c2D","eta-pT (anti)protons",0,0,700,400);
+  c2D->SetFillColor(10); c2D->SetHighLightColor(10); c2D->Divide(2,1);
+  c2D->cd(1); gHistYPtProtons->Draw("col");
+  c2D->cd(2); gHistYPtAntiProtons->Draw("col");
+}
+
 //___________________________________________________//
 void drawQAPlots(const char* esdFileName) {
   //Draws the QA plots from the output of the analysis
 //___________________________________________________//
 void drawQAPlots(const char* esdFileName) {
   //Draws the QA plots from the output of the analysis
@@ -21,6 +38,14 @@ void drawQAPlots(const char* esdFileName) {
 
   //================QA plots================//
   TList *fQA2DList = dynamic_cast<TList *>(gListGlobalQA->At(0));
 
   //================QA plots================//
   TList *fQA2DList = dynamic_cast<TList *>(gListGlobalQA->At(0));
+  TH2F *gHistdEdxP = dynamic_cast<TH2F *>(fQA2DList->At(0));
+  gHistdEdxP->SetStats(kFALSE);
+  TH2F *gHistProtonsdEdxP = dynamic_cast<TH2F *>(fQA2DList->At(1));
+  gHistProtonsdEdxP->SetStats(kFALSE);
+  TCanvas *cdEdx = new TCanvas("cdEdx","dE/dx (TPC)",0,0,700,400);
+  cdEdx->SetFillColor(10); cdEdx->SetHighLightColor(10); cdEdx->Divide(2,1);
+  cdEdx->cd(1)->SetLogx(); gHistdEdxP->Draw("col");
+  cdEdx->cd(2)->SetLogx(); gHistProtonsdEdxP->Draw("col");
 
   //Accepted protons
   TList *fQAProtonsAcceptedList = dynamic_cast<TList *>(gListGlobalQA->At(1));
 
   //Accepted protons
   TList *fQAProtonsAcceptedList = dynamic_cast<TList *>(gListGlobalQA->At(1));
@@ -143,7 +168,7 @@ void drawQAPlots(const char* esdFileName) {
   TH1F *gAntiProtonsNumberOfTPCdEdxPointsReject = dynamic_cast<TH1F *>(fQAAntiProtonsRejectedList->At(26));
 
   //__________________________________________________//
   TH1F *gAntiProtonsNumberOfTPCdEdxPointsReject = dynamic_cast<TH1F *>(fQAAntiProtonsRejectedList->At(26));
 
   //__________________________________________________//
-  TCanvas *c1 = new TCanvas("c1","",0,0,600,400);
+  TCanvas *c1 = new TCanvas("c1","ITS clusters",0,0,600,400);
   c1->SetFillColor(10); c1->SetHighLightColor(10);
   c1->Divide(2,1);
   c1->cd(1); gProtonsITSClustersPass->Draw(); 
   c1->SetFillColor(10); c1->SetHighLightColor(10);
   c1->Divide(2,1);
   c1->cd(1); gProtonsITSClustersPass->Draw(); 
@@ -151,7 +176,7 @@ void drawQAPlots(const char* esdFileName) {
   c1->cd(2); gAntiProtonsITSClustersPass->Draw(); 
   gAntiProtonsITSClustersReject->Draw("same");
 
   c1->cd(2); gAntiProtonsITSClustersPass->Draw(); 
   gAntiProtonsITSClustersReject->Draw("same");
 
-  TCanvas *c2 = new TCanvas("c2","",0,100,600,400);
+  TCanvas *c2 = new TCanvas("c2","chi^2 per ITS cluster",0,100,600,400);
   c2->SetFillColor(10); c2->SetHighLightColor(10);
   c2->Divide(2,1);
   c2->cd(1); gProtonsChi2PerClusterITSPass->Draw(); 
   c2->SetFillColor(10); c2->SetHighLightColor(10);
   c2->Divide(2,1);
   c2->cd(1); gProtonsChi2PerClusterITSPass->Draw(); 
@@ -159,7 +184,7 @@ void drawQAPlots(const char* esdFileName) {
   c2->cd(2); gAntiProtonsChi2PerClusterITSPass->Draw(); 
   gAntiProtonsChi2PerClusterITSReject->Draw("same");
 
   c2->cd(2); gAntiProtonsChi2PerClusterITSPass->Draw(); 
   gAntiProtonsChi2PerClusterITSReject->Draw("same");
 
-  TCanvas *c3 = new TCanvas("c3","",0,200,600,400);
+  TCanvas *c3 = new TCanvas("c3","TPC clusters",0,200,600,400);
   c3->SetFillColor(10); c3->SetHighLightColor(10);
   c3->Divide(2,1);
   c3->cd(1); gProtonsTPCClustersPass->Draw();
   c3->SetFillColor(10); c3->SetHighLightColor(10);
   c3->Divide(2,1);
   c3->cd(1); gProtonsTPCClustersPass->Draw();
@@ -167,7 +192,7 @@ void drawQAPlots(const char* esdFileName) {
   c3->cd(2); gAntiProtonsTPCClustersPass->Draw();
   gAntiProtonsTPCClustersReject->Draw("same");
 
   c3->cd(2); gAntiProtonsTPCClustersPass->Draw();
   gAntiProtonsTPCClustersReject->Draw("same");
 
-  TCanvas *c4 = new TCanvas("c4","",0,300,600,400);
+  TCanvas *c4 = new TCanvas("c4","chi^2 per TPC cluster",0,300,600,400);
   c4->SetFillColor(10); c4->SetHighLightColor(10);
   c4->Divide(2,1);
   c4->cd(1); gProtonsChi2PerClusterTPCPass->Draw(); 
   c4->SetFillColor(10); c4->SetHighLightColor(10);
   c4->Divide(2,1);
   c4->cd(1); gProtonsChi2PerClusterTPCPass->Draw(); 
@@ -175,95 +200,95 @@ void drawQAPlots(const char* esdFileName) {
   c4->cd(2); gAntiProtonsChi2PerClusterTPCPass->Draw(); 
   gAntiProtonsChi2PerClusterTPCReject->Draw("same");
 
   c4->cd(2); gAntiProtonsChi2PerClusterTPCPass->Draw(); 
   gAntiProtonsChi2PerClusterTPCReject->Draw("same");
 
-  TCanvas *c5 = new TCanvas("c5","",0,400,600,400);
+  TCanvas *c5 = new TCanvas("c5","Cov11",0,400,600,400);
   c5->SetFillColor(10); c5->SetHighLightColor(10);
   c5->Divide(2,1);
   c5->SetFillColor(10); c5->SetHighLightColor(10);
   c5->Divide(2,1);
-  c5->cd(1); gProtonsExtCov11Pass->Draw(); 
+  c5->cd(1)->SetLogy(); gProtonsExtCov11Pass->Draw(); 
   gProtonsExtCov11Reject->Draw("same");
   gProtonsExtCov11Reject->Draw("same");
-  c5->cd(2); gAntiProtonsExtCov11Pass->Draw(); 
+  c5->cd(2)->SetLogy(); gAntiProtonsExtCov11Pass->Draw(); 
   gAntiProtonsExtCov11Reject->Draw("same");
 
   gAntiProtonsExtCov11Reject->Draw("same");
 
-  TCanvas *c6 = new TCanvas("c6","",0,500,600,400);
+  TCanvas *c6 = new TCanvas("c6","Cov22",0,500,600,400);
   c6->SetFillColor(10); c6->SetHighLightColor(10);
   c6->Divide(2,1);
   c6->SetFillColor(10); c6->SetHighLightColor(10);
   c6->Divide(2,1);
-  c6->cd(1); gProtonsExtCov22Pass->Draw(); 
+  c6->cd(1)->SetLogy(); gProtonsExtCov22Pass->Draw(); 
   gProtonsExtCov22Reject->Draw("same");
   gProtonsExtCov22Reject->Draw("same");
-  c6->cd(2); gAntiProtonsExtCov22Pass->Draw(); 
+  c6->cd(2)->SetLogy(); gAntiProtonsExtCov22Pass->Draw(); 
   gAntiProtonsExtCov22Reject->Draw("same");
 
   gAntiProtonsExtCov22Reject->Draw("same");
 
-  TCanvas *c7 = new TCanvas("c7","",600,0,600,400);
+  TCanvas *c7 = new TCanvas("c7","Cov33",600,0,600,400);
   c7->SetFillColor(10); c7->SetHighLightColor(10);
   c7->Divide(2,1);
   c7->SetFillColor(10); c7->SetHighLightColor(10);
   c7->Divide(2,1);
-  c7->cd(1); gProtonsExtCov33Pass->Draw(); 
+  c7->cd(1)->SetLogy(); gProtonsExtCov33Pass->Draw(); 
   gProtonsExtCov33Reject->Draw("same");
   gProtonsExtCov33Reject->Draw("same");
-  c7->cd(2); gAntiProtonsExtCov33Pass->Draw(); 
+  c7->cd(2)->SetLogy(); gAntiProtonsExtCov33Pass->Draw(); 
   gAntiProtonsExtCov33Reject->Draw("same");
 
   gAntiProtonsExtCov33Reject->Draw("same");
 
-  TCanvas *c8 = new TCanvas("c8","",600,100,600,400);
+  TCanvas *c8 = new TCanvas("c8","Cov44",600,100,600,400);
   c8->SetFillColor(10); c8->SetHighLightColor(10);
   c8->Divide(2,1);
   c8->SetFillColor(10); c8->SetHighLightColor(10);
   c8->Divide(2,1);
-  c8->cd(1); gProtonsExtCov44Pass->Draw(); 
+  c8->cd(1)->SetLogy(); gProtonsExtCov44Pass->Draw(); 
   gProtonsExtCov44Reject->Draw("same");
   gProtonsExtCov44Reject->Draw("same");
-  c8->cd(2); gAntiProtonsExtCov44Pass->Draw(); 
+  c8->cd(2)->SetLogy(); gAntiProtonsExtCov44Pass->Draw(); 
   gAntiProtonsExtCov44Reject->Draw("same");
 
   gAntiProtonsExtCov44Reject->Draw("same");
 
-  TCanvas *c9 = new TCanvas("c9","",600,200,600,400);
+  TCanvas *c9 = new TCanvas("c9","Cov55",600,200,600,400);
   c9->SetFillColor(10); c9->SetHighLightColor(10);
   c9->Divide(2,1);
   c9->SetFillColor(10); c9->SetHighLightColor(10);
   c9->Divide(2,1);
-  c9->cd(1); gProtonsExtCov55Pass->Draw(); 
+  c9->cd(1)->SetLogy(); gProtonsExtCov55Pass->Draw(); 
   gProtonsExtCov55Reject->Draw("same");
   gProtonsExtCov55Reject->Draw("same");
-  c9->cd(2); gAntiProtonsExtCov55Pass->Draw(); 
+  c9->cd(2)->SetLogy(); gAntiProtonsExtCov55Pass->Draw(); 
   gAntiProtonsExtCov55Reject->Draw("same");
 
   gAntiProtonsExtCov55Reject->Draw("same");
 
-  TCanvas *c10 = new TCanvas("c10","",600,300,600,400);
+  TCanvas *c10 = new TCanvas("c10","N-sigma to Vertex",600,300,600,400);
   c10->SetFillColor(10); c10->SetHighLightColor(10);
   c10->Divide(2,1);
   c10->SetFillColor(10); c10->SetHighLightColor(10);
   c10->Divide(2,1);
-  c10->cd(1); gProtonsSigmaToVertexPass->Draw(); 
+  c10->cd(1)->SetLogy(); gProtonsSigmaToVertexPass->Draw(); 
   gProtonsSigmaToVertexReject->Draw("same");
   gProtonsSigmaToVertexReject->Draw("same");
-  c10->cd(2); gAntiProtonsSigmaToVertexPass->Draw(); 
+  c10->cd(2)->SetLogy(); gAntiProtonsSigmaToVertexPass->Draw(); 
   gAntiProtonsSigmaToVertexReject->Draw("same");
 
   gAntiProtonsSigmaToVertexReject->Draw("same");
 
-  TCanvas *c11 = new TCanvas("c11","",600,400,600,400);
+  TCanvas *c11 = new TCanvas("c11","N-sigma to Vertex (TPC)",600,400,600,400);
   c11->SetFillColor(10); c11->SetHighLightColor(10);
   c11->Divide(2,1);
   c11->SetFillColor(10); c11->SetHighLightColor(10);
   c11->Divide(2,1);
-  c11->cd(1); gProtonsSigmaToVertexTPCPass->Draw(); 
+  c11->cd(1)->SetLogy(); gProtonsSigmaToVertexTPCPass->Draw(); 
   gProtonsSigmaToVertexTPCReject->Draw("same");
   gProtonsSigmaToVertexTPCReject->Draw("same");
-  c11->cd(2); gAntiProtonsSigmaToVertexTPCPass->Draw(); 
+  c11->cd(2)->SetLogy(); gAntiProtonsSigmaToVertexTPCPass->Draw(); 
   gAntiProtonsSigmaToVertexTPCReject->Draw("same");
 
   gAntiProtonsSigmaToVertexTPCReject->Draw("same");
 
-  TCanvas *c12 = new TCanvas("c12","",600,500,600,400);
+  TCanvas *c12 = new TCanvas("c12","dca(xy)",600,500,600,400);
   c12->SetFillColor(10); c12->SetHighLightColor(10);
   c12->Divide(2,1);
   c12->SetFillColor(10); c12->SetHighLightColor(10);
   c12->Divide(2,1);
-  c12->cd(1); gProtonsDCAXYPass->Draw(); 
+  c12->cd(1)->SetLogy(); gProtonsDCAXYPass->Draw(); 
   gProtonsDCAXYReject->Draw("same");
   gProtonsDCAXYReject->Draw("same");
-  c12->cd(2); gAntiProtonsDCAXYPass->Draw(); 
+  c12->cd(2)->SetLogy(); gAntiProtonsDCAXYPass->Draw(); 
   gAntiProtonsDCAXYReject->Draw("same");
 
   gAntiProtonsDCAXYReject->Draw("same");
 
-  TCanvas *c13 = new TCanvas("c13","",1200,0,600,400);
+  TCanvas *c13 = new TCanvas("c13","dca(xy - TPC)",1200,0,600,400);
   c13->SetFillColor(10); c13->SetHighLightColor(10);
   c13->Divide(2,1);
   c13->SetFillColor(10); c13->SetHighLightColor(10);
   c13->Divide(2,1);
-  c13->cd(1); gProtonsDCAXYTPCPass->Draw(); 
+  c13->cd(1)->SetLogy(); gProtonsDCAXYTPCPass->Draw(); 
   gProtonsDCAXYTPCReject->Draw("same");
   gProtonsDCAXYTPCReject->Draw("same");
-  c13->cd(2); gAntiProtonsDCAXYTPCPass->Draw(); 
+  c13->cd(2)->SetLogy(); gAntiProtonsDCAXYTPCPass->Draw(); 
   gAntiProtonsDCAXYTPCReject->Draw("same");
 
   gAntiProtonsDCAXYTPCReject->Draw("same");
 
-  TCanvas *c14 = new TCanvas("c14","",1200,100,600,400);
+  TCanvas *c14 = new TCanvas("c14","dca(z)",1200,100,600,400);
   c14->SetFillColor(10); c14->SetHighLightColor(10);
   c14->Divide(2,1);
   c14->SetFillColor(10); c14->SetHighLightColor(10);
   c14->Divide(2,1);
-  c14->cd(1); gProtonsDCAZPass->Draw(); 
+  c14->cd(1)->SetLogy(); gProtonsDCAZPass->Draw(); 
   gProtonsDCAZReject->Draw("same");
   gProtonsDCAZReject->Draw("same");
-  c14->cd(2); gAntiProtonsDCAZPass->Draw(); 
+  c14->cd(2)->SetLogy(); gAntiProtonsDCAZPass->Draw(); 
   gAntiProtonsDCAZReject->Draw("same");
 
   gAntiProtonsDCAZReject->Draw("same");
 
-  TCanvas *c15 = new TCanvas("c15","",1200,200,600,400);
+  TCanvas *c15 = new TCanvas("c15","dca(z - TPC)",1200,200,600,400);
   c15->SetFillColor(10); c15->SetHighLightColor(10);
   c15->Divide(2,1);
   c15->SetFillColor(10); c15->SetHighLightColor(10);
   c15->Divide(2,1);
-  c15->cd(1); gProtonsDCAZTPCPass->Draw(); 
+  c15->cd(1)->SetLogy(); gProtonsDCAZTPCPass->Draw(); 
   gProtonsDCAZTPCReject->Draw("same");
   gProtonsDCAZTPCReject->Draw("same");
-  c15->cd(2); gAntiProtonsDCAZTPCPass->Draw(); 
+  c15->cd(2)->SetLogy(); gAntiProtonsDCAZTPCPass->Draw(); 
   gAntiProtonsDCAZTPCReject->Draw("same");
 
   gAntiProtonsDCAZTPCReject->Draw("same");
 
-  TCanvas *c16 = new TCanvas("c16","",1200,300,600,400);
+  TCanvas *c16 = new TCanvas("c16","TPC clusters (dE/dx)",1200,300,600,400);
   c16->SetFillColor(10); c16->SetHighLightColor(10);
   c16->Divide(2,1);
   c16->cd(1); gProtonsNumberOfTPCdEdxPointsPass->Draw(); 
   c16->SetFillColor(10); c16->SetHighLightColor(10);
   c16->Divide(2,1);
   c16->cd(1); gProtonsNumberOfTPCdEdxPointsPass->Draw(); 
@@ -283,11 +308,11 @@ void drawQAPlots(const char* esdFileName) {
   TH1F *gHistVzAccepted = dynamic_cast<TH1F *>(gListVertexQA->At(5));
   gHistVzAccepted->SetFillColor(10);
 
   TH1F *gHistVzAccepted = dynamic_cast<TH1F *>(gListVertexQA->At(5));
   gHistVzAccepted->SetFillColor(10);
 
-  TCanvas *cVertex = new TCanvas("cVertex","Veretx QA",0,0,900,400);
+  TCanvas *cVertex = new TCanvas("cVertex","Vertex QA",0,0,900,400);
   cVertex->SetFillColor(10); cVertex->SetHighLightColor(10);
   cVertex->Divide(3,1);
   cVertex->SetFillColor(10); cVertex->SetHighLightColor(10);
   cVertex->Divide(3,1);
-  cVertex->cd(1); gHistVx->Draw(); gHistVxAccepted->Draw("same");
-  cVertex->cd(2); gHistVy->Draw(); gHistVyAccepted->Draw("same");
-  cVertex->cd(3); gHistVz->Draw(); gHistVzAccepted->Draw("same");
+  cVertex->cd(1)->SetLogy(); gHistVx->Draw(); gHistVxAccepted->Draw("same");
+  cVertex->cd(2)->SetLogy(); gHistVy->Draw(); gHistVyAccepted->Draw("same");
+  cVertex->cd(3)->SetLogy(); gHistVz->Draw(); gHistVzAccepted->Draw("same");
 }
   
 }
   
index c96f96a8fb524409aa325d8f384bb893daa76700..8f74c3099bd98eb7b24300ed977cfb0789eafc16 100644 (file)
@@ -1,4 +1,5 @@
-void runProtonAnalysis(const char* esdAnalysisType = "Hybrid",
+void runProtonAnalysis(Bool_t kAnalyzeMC = kTRUE,
+                      const char* esdAnalysisType = "Hybrid",
                       const char* pidMode = "Bayesian") {
   //Macro to run the proton analysis tested for local, proof & GRID.
   //Local: Takes four arguments, the analysis mode, the type of the ESD 
                       const char* pidMode = "Bayesian") {
   //Macro to run the proton analysis tested for local, proof & GRID.
   //Local: Takes four arguments, the analysis mode, the type of the ESD 
@@ -22,14 +23,15 @@ void runProtonAnalysis(const char* esdAnalysisType = "Hybrid",
   TStopwatch timer;
   timer.Start();
   
   TStopwatch timer;
   timer.Start();
   
-  /*runLocal("ESD",
+  runLocal("ESD", 
+          kAnalyzeMC,
           esdAnalysisType,
           pidMode,
           esdAnalysisType,
           pidMode,
-          "/home/pchrist/ALICE/Baryons/Analysis/Protons/Local/data");*/
-  //runInteractive("ESD",esdAnalysisType,pidMode,"tag.xml");
-  //runBatch("ESD",esdAnalysisType,pidMode,"wn.xml");  
-  runProof("ESD",esdAnalysisType,pidMode,
-          500000,0,"/COMMON/COMMON/LHC09d1_0.9TeV_0.5T#esdTree");
+          "/home/pchrist/ALICE/Baryons/Data/104070");
+  //runInteractive("ESD",kAnalyzeMC, esdAnalysisType,pidMode,"tag.xml");
+  //runBatch("ESD",kAnalyzeMC, esdAnalysisType,pidMode,"wn.xml");  
+  //runProof("ESD",kAnalyzeMC, esdAnalysisType,pidMode,
+  //500000,0,"/COMMON/COMMON/LHC09d1_0.9TeV_0.5T#esdTree");
 
   timer.Stop();
   timer.Print();
 
   timer.Stop();
   timer.Print();
@@ -37,6 +39,7 @@ void runProtonAnalysis(const char* esdAnalysisType = "Hybrid",
 
 //_________________________________________________//
 void runLocal(const char* mode = "ESD",
 
 //_________________________________________________//
 void runLocal(const char* mode = "ESD",
+             Bool_t kAnalyzeMC = kTRUE,
              const char* analysisType = 0x0,
              const char* pidMode = 0x0,
              const char* path = "/home/pchrist/ALICE/Alien/Tutorial/November2007/Tags") {
              const char* analysisType = 0x0,
              const char* pidMode = 0x0,
              const char* path = "/home/pchrist/ALICE/Alien/Tutorial/November2007/Tags") {
@@ -82,7 +85,7 @@ void runLocal(const char* mode = "ESD",
 
   //____________________________________________//
   gROOT->LoadMacro("configProtonAnalysis.C");
 
   //____________________________________________//
   gROOT->LoadMacro("configProtonAnalysis.C");
-  AliProtonAnalysis *analysis = GetProtonAnalysisObject(mode,
+  AliProtonAnalysis *analysis = GetProtonAnalysisObject(mode,kAnalyzeMC,
                                                        analysisType,
                                                        pidMode);
   //____________________________________________//
                                                        analysisType,
                                                        pidMode);
   //____________________________________________//
@@ -123,6 +126,7 @@ void runLocal(const char* mode = "ESD",
 
 //_________________________________________________//
 void runInteractive(const char* mode = "ESD",
 
 //_________________________________________________//
 void runInteractive(const char* mode = "ESD",
+                   Bool_t kAnalyzeMC = kTRUE,
                    const char* analysisType = 0x0,
                    const char* pidMode = 0x0,
                    const char* collectionName = "tag.xml") {
                    const char* analysisType = 0x0,
                    const char* pidMode = 0x0,
                    const char* collectionName = "tag.xml") {
@@ -176,7 +180,7 @@ void runInteractive(const char* mode = "ESD",
   
   //____________________________________________//
   gROOT->LoadMacro("configProtonAnalysis.C");
   
   //____________________________________________//
   gROOT->LoadMacro("configProtonAnalysis.C");
-  AliProtonAnalysis *analysis = GetProtonAnalysisObject(mode,
+  AliProtonAnalysis *analysis = GetProtonAnalysisObject(mode,kAnalyzeMC,
                                                        analysisType,
                                                        pidMode);
   //____________________________________________//
                                                        analysisType,
                                                        pidMode);
   //____________________________________________//
@@ -217,6 +221,7 @@ void runInteractive(const char* mode = "ESD",
 
 //_________________________________________________//
 void runBatch(const char* mode = "ESD",
 
 //_________________________________________________//
 void runBatch(const char* mode = "ESD",
+             Bool_t kAnalyzeMC = kTRUE,
              const char* analysisType = 0x0,
              const char* pidMode = 0x0,
              const char *collectionfile = "wn.xml") {
              const char* analysisType = 0x0,
              const char* pidMode = 0x0,
              const char *collectionfile = "wn.xml") {
@@ -260,7 +265,7 @@ void runBatch(const char* mode = "ESD",
 
   //____________________________________________//
   gROOT->LoadMacro("configProtonAnalysis.C");
 
   //____________________________________________//
   gROOT->LoadMacro("configProtonAnalysis.C");
-  AliProtonAnalysis *analysis = GetProtonAnalysisObject(mode,
+  AliProtonAnalysis *analysis = GetProtonAnalysisObject(mode,kAnalyzeMC,
                                                        analysisType,
                                                        pidMode);
   //____________________________________________//
                                                        analysisType,
                                                        pidMode);
   //____________________________________________//
@@ -301,6 +306,7 @@ void runBatch(const char* mode = "ESD",
 
 //_________________________________________________//
 void runProof(const char* mode = "ESD",
 
 //_________________________________________________//
 void runProof(const char* mode = "ESD",
+             Bool_t kAnalyzeMC = kTRUE,
              const char* analysisType = 0x0,
              const char* pidMode = 0x0,
              Int_t stats = 0, Int_t startingPoint = 0,
              const char* analysisType = 0x0,
              const char* pidMode = 0x0,
              Int_t stats = 0, Int_t startingPoint = 0,
@@ -335,7 +341,7 @@ void runProof(const char* mode = "ESD",
   
   //____________________________________________//
   gROOT->LoadMacro("configProtonAnalysis.C");
   
   //____________________________________________//
   gROOT->LoadMacro("configProtonAnalysis.C");
-  AliProtonAnalysis *analysis = GetProtonAnalysisObject(mode,
+  AliProtonAnalysis *analysis = GetProtonAnalysisObject(mode,kAnalyzeMC,
                                                        analysisType,
                                                        pidMode);
   //____________________________________________//
                                                        analysisType,
                                                        pidMode);
   //____________________________________________//