- overload the constructor with arguments for cuts on eta, pt, DCAr and DCAz
authorkkanaki <kkanaki@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 17 Apr 2011 17:33:34 +0000 (17:33 +0000)
committerkkanaki <kkanaki@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 17 Apr 2011 17:33:34 +0000 (17:33 +0000)
  (default values deliberately are loose)
- saved these values in the output of the task for use in the drawing macro

HLT/QA/tasks/AliAnalysisTaskHLT.cxx
HLT/QA/tasks/AliAnalysisTaskHLT.h
HLT/QA/tasks/macros/compare-HLT-offline-local.C
HLT/QA/tasks/macros/drawGlobalESDHistograms.C

index 1b7f24b..0da0514 100644 (file)
@@ -98,8 +98,13 @@ AliAnalysisTaskSE()
   
   ,fBeamType()
   ,fTextBox(0)
+  ,fCuts(0)
   ,fSwitch(kTRUE)
   ,fCentrality()
+  ,fEta(0)
+  ,fPt(0)
+  ,fDCAr(0)
+  ,fDCAz(0)
 {
   // Constructor
   // Define input and output slots here
@@ -108,7 +113,7 @@ AliAnalysisTaskSE()
   // Output slot #0 writes into a TH1 container
 }
  
-AliAnalysisTaskHLT::AliAnalysisTaskHLT(const char *name)
+AliAnalysisTaskHLT::AliAnalysisTaskHLT(const char *name, float eta, float pt, float DCAr, float DCAz)
   :
   AliAnalysisTaskSE(name) 
   ,fUseHLTTrigger(kFALSE)   
@@ -153,8 +158,13 @@ AliAnalysisTaskHLT::AliAnalysisTaskHLT(const char *name)
   
   ,fBeamType()
   ,fTextBox(0)
+  ,fCuts(0)
   ,fSwitch(kTRUE)
   ,fCentrality()
+  ,fEta(eta)
+  ,fPt(pt)
+  ,fDCAr(DCAr)
+  ,fDCAz(DCAz)
 { 
   // Constructor
   // Define input and output slots here
@@ -274,6 +284,11 @@ void AliAnalysisTaskHLT::UserCreateOutputObjects(){
   //--------------------------------------------------//
   
   fTextBox = new TText(); 
+  fCuts = new TText(); 
+  fCuts->SetName("cuts");
+  TString s = Form("|#eta|<%2g, p_{T}>%2g GeV/c, |DCAr|<%2g cm, |DCAz|<%2g cm", TMath::Abs(fEta), TMath::Abs(fPt), TMath::Abs(fDCAr), TMath::Abs(fDCAz));
+  fCuts->SetTitle(s);  
+  
   //fOutputList->Add(fHistTrigger);
   fOutputList->Add(fChargeOff);          fOutputList->Add(fChargeHLT);       fOutputList->Add(fChargeHLTcut);  
   fOutputList->Add(fMomentumOff);        fOutputList->Add(fMomentumHLT);     fOutputList->Add(fMomentumHLTcut); 
@@ -295,6 +310,7 @@ void AliAnalysisTaskHLT::UserCreateOutputObjects(){
   fOutputList->Add(fNcontOff);           fOutputList->Add(fNcontHLT);  
   
   fOutputList->Add(fTextBox);
+  fOutputList->Add(fCuts);
   if(fBeamType.Contains("Pb")) fOutputList->Add(fV0cent);
  
   //SetupESDtrackCuts();
@@ -402,7 +418,7 @@ void AliAnalysisTaskHLT::UserExec(Option_t *){
     fPhiHLT->Fill(esdtrackHLT->Phi()*TMath::RadToDeg());
     fMomentumHLT->Fill(TMath::Abs(esdtrackHLT->Pt()));  
     
-    if(TMath::Abs(esdtrackHLT->Eta())<0.9 && TMath::Abs(esdtrackHLT->Pt())>0.3 && TMath::Abs(dca[0])<7 && TMath::Abs(dca[1])<7){
+    if(TMath::Abs(esdtrackHLT->Eta())<TMath::Abs(fEta) && TMath::Abs(esdtrackHLT->Pt())>TMath::Abs(fPt) && TMath::Abs(dca[0])<TMath::Abs(fDCAr) && TMath::Abs(dca[1])<TMath::Abs(fDCAz)){
        fChargeHLTcut->Fill(esdtrackHLT->Charge());
        fNclusterHLTcut->Fill(esdtrackHLT->GetTPCNcls());
        fNITSclusterHLTcut->Fill(esdtrackHLT->GetNcls(0));
index 840e800..5fca51e 100644 (file)
@@ -25,7 +25,7 @@ class AliAnalysisTaskHLT : public AliAnalysisTaskSE {
  
   public: 
     AliAnalysisTaskHLT();
-    AliAnalysisTaskHLT(const char *name);
+    AliAnalysisTaskHLT(const char *name, float eta=2, float pt=0, float DCAr=20, float DCAz=20);
     virtual ~AliAnalysisTaskHLT() {}
 
     virtual void  UserCreateOutputObjects();
@@ -103,9 +103,14 @@ private:
         
     TString fBeamType;         //! beam type: p-p, Pb-Pb, No beam
     TText *fTextBox;           //! TText box containing run number info and date
+    TText *fCuts;              //! TText box containing the cuts
     Bool_t fSwitch;            //! boolean used to execute parts of the code in the UserExec only once, although
                                // the function is called once per event
-    AliCentrality *fCentrality;  //! Centrality holder
+    AliCentrality *fCentrality;//! Centrality holder
+    Float_t fEta;              //! cut value
+    Float_t fPt;               //! cut value
+    Float_t fDCAr;             //! cut value
+    Float_t fDCAz;             //! cut value
    
     ClassDef(AliAnalysisTaskHLT, 0);
 };
index 72db168..1c24028 100644 (file)
@@ -218,6 +218,7 @@ void compare_HLT_offline_local( TString file
   
   if(bGLOBAL){
     AliAnalysisTaskHLT *taskGLOBAL = new AliAnalysisTaskHLT("offhlt_comparison_GLOBAL");
+    //AliAnalysisTaskHLT *taskGLOBAL = new AliAnalysisTaskHLT("offhlt_comparison_GLOBAL",0.9,0.3,7,7);
     taskGLOBAL->SetUseHLTTriggerDecision(fUseHLTTrigger);
     taskGLOBAL->SetBeamType(beamType);
     mgr->AddTask(taskGLOBAL);
index 904708c..55162e2 100644 (file)
@@ -22,6 +22,7 @@
 #include "TCanvas.h"
 #include "TText.h"
 #include "TPaveStats.h"
+#include "TPaveText.h"
 #include "TH1D.h"
 #include "TH2D.h"
 #include "TLegend.h"
@@ -59,11 +60,14 @@ void drawGlobalESDHistograms(const char* filename="HLT-OFFLINE-GLOBAL-comparison
     return; 
  }
  
- TText *hText = (TText*)list->FindObject("text");
- if(!hText) printf("No hText\n");
+ TText *runInfo = (TText*)list->FindObject("text");
+ if(!runInfo) printf("No runInfo string\n");
+
+ TText *cuts = (TText*)list->FindObject("cuts");
+ if(!cuts) printf("No cuts string\n");
 
  TString folder = "GlobalTask_";
- folder += hText->GetTitle();
+ folder += runInfo->GetTitle();
  folder.ReplaceAll(" ",""); 
  folder.ReplaceAll(",","_");
  gSystem->Exec("mkdir "+folder); // create a folder whose name contains run number and date of run
@@ -163,12 +167,19 @@ void drawGlobalESDHistograms(const char* filename="HLT-OFFLINE-GLOBAL-comparison
  c4->cd(1);
  plot(h1,h2);
 
- TLegend *leg2 = new TLegend(0.6,0.2,0.8,0.5);
- leg2->SetFillColor(10);
- leg2->SetLineColor(10);
- leg2->AddEntry(h1,"HLT", "l");
- leg2->AddEntry(h2,"HLT with cuts", "l");
- leg2->Draw("same");
+
+ TPaveText *pave = new TPaveText(2.1,24000,8.3,31600);
+ pave->SetFillColor(kWhite);
+ pave->SetLineColor(kWhite);
+ pave->SetShadowColor(kWhite);
+ TString tmp=cuts->GetTitle();
+ pave->SetTextColor(2);
+ pave->AddText(tmp);
+ pave->SetTextFont(42);
+ pave->SetTextSize(0.04);
+ pave->Draw();
+ c4->Update();
+
 
 //-------------------------------------------------