Hanseul task
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 10 Jun 2012 04:53:01 +0000 (04:53 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 10 Jun 2012 04:53:01 +0000 (04:53 +0000)
PWGGA/CMakelibPWGGAEMCALJetTasks.pkg
PWGGA/CMakelibPWGGAEMCALTasks.pkg
PWGGA/EMCALJetTasks/AliAnalysisTaskSOH.cxx [new file with mode: 0644]
PWGGA/EMCALJetTasks/AliAnalysisTaskSOH.h [new file with mode: 0644]
PWGGA/EMCALJetTasks/macros/AddTaskSOH.C [new file with mode: 0644]
PWGGA/PWGGAEMCALJetTasksLinkDef.h
PWGGA/PWGGAEMCALTasksLinkDef.h

index 5ca9ecf..41e9945 100644 (file)
@@ -1,4 +1,5 @@
 # -*- mode: Makefile -*-
+# $Id: $
 #--------------------------------------------------------------------------------#
 # Variables Defined :                                                            #
 #                                                                                #
@@ -30,8 +31,6 @@ set ( SRCS
  EMCALJetTasks/AliAnalysisTaskRho.cxx
  EMCALJetTasks/AliAnalysisTaskRhoAverage.cxx
  EMCALJetTasks/AliAnalysisTaskRhoBase.cxx
- EMCALJetTasks/AliAnalysisTaskSAJF.cxx
- EMCALJetTasks/AliAnalysisTaskSAQA.cxx
  EMCALJetTasks/AliAnalysisTaskScale.cxx
  EMCALJetTasks/AliEmcalJet.cxx
  EMCALJetTasks/AliEmcalJetTask.cxx
@@ -41,6 +40,9 @@ set ( SRCS
  EMCALJetTasks/AliJetRandomizerTask.cxx
  EMCALJetTasks/AliJetResponseMaker.cxx
  EMCALJetTasks/AliRhoParameter.cxx
+ EMCALJetTasks/AliAnalysisTaskSAJF.cxx
+ EMCALJetTasks/AliAnalysisTaskSAQA.cxx
+ EMCALJetTasks/AliAnalysisTaskSOH.cxx
 )
 
 set ( DHDR  PWGGAEMCALJetTasksLinkDef.h)
index eeb920e..502b8a5 100644 (file)
@@ -1,4 +1,5 @@
 # -*- mode: Makefile -*-
+# $Id: $
 #--------------------------------------------------------------------------------#
 # Variables Defined :                                                            #
 #                                                                                #
 set ( SRCS 
  EMCALTasks/AliAnalysisTaskEMCALClusterize.cxx 
  EMCALTasks/AliAnalysisTaskEMCALClusterizeFast.cxx
+ EMCALTasks/AliAnalysisTaskEMCALIsoPhoton.cxx
  EMCALTasks/AliAnalysisTaskEMCALPhoton.cxx
  EMCALTasks/AliAnalysisTaskEMCALPi0CalibSelection.cxx 
  EMCALTasks/AliAnalysisTaskEMCALPi0PbPb.cxx
  EMCALTasks/AliAnalysisTaskEMCALTriggerQA.cxx
  EMCALTasks/AliAnalysisTaskESDfilterEMCALEventSelect.cxx
+ EMCALTasks/AliAnalysisTaskEmcal.cxx
+ EMCALTasks/AliAnalysisTaskPi0V2.cxx
+ EMCALTasks/AliAnalysisTaskSATR.cxx
  EMCALTasks/AliAnalysisTaskTrgContam.cxx
+ EMCALTasks/AliEmcalClusTrackMatcherTask.cxx
  EMCALTasks/AliEmcalCompatTask.cxx
  EMCALTasks/AliEmcalEsdTpcTrackTask.cxx
+ EMCALTasks/AliEmcalMCTrackSelector.cxx
+ EMCALTasks/AliEmcalParticle.cxx
+ EMCALTasks/AliEmcalParticleMaker.cxx
  EMCALTasks/AliEmcalPhysicsSelection.cxx
  EMCALTasks/AliEmcalPhysicsSelectionTask.cxx
  EMCALTasks/AliEmcalPicoTrackMaker.cxx
@@ -45,14 +54,6 @@ set ( SRCS
  EMCALTasks/AliEsdTrackExt.cxx
  EMCALTasks/AliPicoTrack.cxx
  EMCALTasks/AliStaObjects.cxx
- EMCALTasks/AliAnalysisTaskSATR.cxx
- EMCALTasks/AliEmcalMCTrackSelector.cxx
- EMCALTasks/AliEmcalParticle.cxx
- EMCALTasks/AliEmcalParticleMaker.cxx
- EMCALTasks/AliAnalysisTaskEmcal.cxx
- EMCALTasks/AliEmcalClusTrackMatcherTask.cxx
- EMCALTasks/AliAnalysisTaskPi0V2.cxx
- EMCALTasks/AliAnalysisTaskEMCALIsoPhoton.cxx
 )
 
 string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
diff --git a/PWGGA/EMCALJetTasks/AliAnalysisTaskSOH.cxx b/PWGGA/EMCALJetTasks/AliAnalysisTaskSOH.cxx
new file mode 100644 (file)
index 0000000..fbe5c49
--- /dev/null
@@ -0,0 +1,422 @@
+// $Id$\r
+//\r
+// Simulation EMCal task.\r
+//\r
+// Author: Saehanseul Oh\r
+\r
+#include "AliAnalysisTaskSOH.h"\r
+\r
+#include <TH1F.h>\r
+#include <TH2F.h>\r
+\r
+#include "AliAnalysisManager.h"\r
+#include "AliAnalysisTask.h"\r
+#include "AliEMCALRecoUtils.h"\r
+#include "AliEMCALTrack.h"\r
+#include "AliESDCaloCluster.h"\r
+#include "AliESDEvent.h"\r
+#include "AliESDInputHandler.h"\r
+#include "AliESDtrack.h"\r
+#include "AliESDtrackCuts.h"\r
+#include "AliExternalTrackParam.h"\r
+#include "AliLog.h"\r
+#include "AliMCEvent.h"\r
+\r
+ClassImp(AliAnalysisTaskSOH)\r
+\r
+//________________________________________________________________________\r
+AliAnalysisTaskSOH::AliAnalysisTaskSOH() :\r
+  AliAnalysisTaskSE(), \r
+  fESD(0), \r
+  fMC(0), \r
+  fEsdTrackCuts(0x0),\r
+  fHybridTrackCuts1(0x0),\r
+  fHybridTrackCuts2(0x0),\r
+  fTrackIndices(0x0),\r
+  fOutputList(0x0),        \r
+  fHEventStat(0),      \r
+  fHTrkEffParGenPt(0), \r
+  fHTrkEffDetGenPt(0), \r
+  fHTrkEffDetRecPt(0), \r
+  fHEOverPVsPt(0x0),\r
+  fHEMCalResponsePion(0x0), \r
+  fHEMCalResponseElec(0x0),\r
+  fHEMCalResponseProton(0x0), \r
+  fHEMCalRecPhiEtaClus(0x0),\r
+  fHEMCalRecPhiEtaTrk(0x0), \r
+  fHClsPhiEta(0x0),\r
+  fHEMCalRecdPhidEta(0x0),\r
+  fHEMCalRecdPhidEtaP(0x0),\r
+  fHEMCalRecdPhidEtaM(0x0),\r
+  fHEMCalRecdPhidEta_Truth(0x0),\r
+  fHEMCalRecdPhidEtaP_Truth(0x0),\r
+  fHEMCalRecdPhidEtaM_Truth(0x0),\r
+  fHEMCalRecdPhidEtaposEta(0x0),\r
+  fHEMCalRecdPhidEtanegEta(0x0)\r
+{\r
+  // Constructor\r
+\r
+  // Output slot #1 writes into a TH1 container\r
+  DefineOutput(1, TList::Class());\r
+}\r
+\r
+\r
+//________________________________________________________________________\r
+AliAnalysisTaskSOH::AliAnalysisTaskSOH(const char *name) :\r
+  AliAnalysisTaskSE(name), \r
+  fESD(0), \r
+  fMC(0), \r
+  fEsdTrackCuts(0x0),\r
+  fHybridTrackCuts1(0x0),\r
+  fHybridTrackCuts2(0x0),\r
+  fTrackIndices(0x0),\r
+  fOutputList(0x0),        \r
+  fHEventStat(0),      \r
+  fHTrkEffParGenPt(0), \r
+  fHTrkEffDetGenPt(0), \r
+  fHTrkEffDetRecPt(0), \r
+  fHEOverPVsPt(0x0),\r
+  fHEMCalResponsePion(0x0), \r
+  fHEMCalResponseElec(0x0),\r
+  fHEMCalResponseProton(0x0), \r
+  fHEMCalRecPhiEtaClus(0x0),\r
+  fHEMCalRecPhiEtaTrk(0x0), \r
+  fHClsPhiEta(0x0),\r
+  fHEMCalRecdPhidEta(0x0),\r
+  fHEMCalRecdPhidEtaP(0x0),\r
+  fHEMCalRecdPhidEtaM(0x0),\r
+  fHEMCalRecdPhidEta_Truth(0x0),\r
+  fHEMCalRecdPhidEtaP_Truth(0x0),\r
+  fHEMCalRecdPhidEtaM_Truth(0x0),\r
+  fHEMCalRecdPhidEtaposEta(0x0),\r
+  fHEMCalRecdPhidEtanegEta(0x0)\r
+{\r
+  // Constructor\r
+\r
+  // Output slot #1 writes into a TH1 container\r
+  DefineOutput(1, TList::Class());\r
+}\r
+\r
+\r
+//________________________________________________________________________\r
+AliAnalysisTaskSOH::~AliAnalysisTaskSOH()\r
+{\r
+  // Destructor.\r
+\r
+  delete fEsdTrackCuts;\r
+  delete fHybridTrackCuts1;\r
+  delete fHybridTrackCuts2;\r
+  delete fTrackIndices;\r
+}\r
+\r
+\r
+//________________________________________________________________________\r
+void AliAnalysisTaskSOH::UserCreateOutputObjects()\r
+{\r
+  // Create histograms, called once.\r
+\r
+  OpenFile(1);\r
+  \r
+  fOutputList = new TList();\r
+  fOutputList->SetOwner(1);\r
+\r
+  fHEventStat = new TH1F("fHEventStat","Event statistics for analysis",1,0,1);\r
+  fHEventStat->GetXaxis()->SetBinLabel(1,"Event");\r
+  fOutputList->Add(fHEventStat);\r
+\r
+  fHTrkEffParGenPt = new TH1F("fHTrkEffParGenPt", "Particle level truth p_{T} distribution of generated primary charged pions;p_{T}^{gen} (GeV/c)",15,0.15,3.1);\r
+  fOutputList->Add(fHTrkEffParGenPt);\r
+\r
+  fHTrkEffDetGenPt = new TH1F("fHTrkEffDetGenPt", "Detector level truth p_{T} distribution of primary charged pions;p_{T}^{gen} (GeV/c)",15,0.15,3.1);\r
+  fOutputList->Add(fHTrkEffDetGenPt);\r
+\r
+  fHTrkEffDetRecPt = new TH1F("fHTrkEffDetRecPt", "Reconstructed track p_{T} distribution of primary charged pions;p_{T}^{rec} (GeV/c)",15,0.15,3.1);\r
+  fOutputList->Add(fHTrkEffDetRecPt);\r
+\r
+  fHEOverPVsPt = new TH2F("fHEOverPVsPt", "E/P vs track p_{T}; p_{T} (GeV/c); E/P", 20 , 0, 4, 40, 0, 3.2);\r
+  fOutputList->Add(fHEOverPVsPt);\r
+\r
+  fHEMCalResponsePion = new TH2F("fHEMCalResponsePion", "Pion E/P vs track p_{T}; p_{T} (GeV/c); E/P", 100 , 0, 4, 100, 0, 3.2);\r
+  fOutputList->Add(fHEMCalResponsePion);\r
+\r
+  fHEMCalResponseElec = new TH2F("fHEMCalResponseElec", "Electron E/P vs track p_{T};  p_{T} (GeV/c); E/P", 100 , 0, 4, 100, 0, 3.2);\r
+  fOutputList->Add(fHEMCalResponseElec);\r
+\r
+  fHEMCalResponseProton = new TH2F("fHEMCalResponseProton", "Proton E/P vs track p_{T};  p_{T} (GeV/c); E/P", 100 , 0, 4, 100, 0, 3.2);\r
+  fOutputList->Add(fHEMCalResponseElec);\r
+\r
+  fHEMCalRecPhiEtaClus = new TH2F("fHEMCalRecPhiEtaClus","EMCAL Cluster#phi-#eta; #eta; #phi",1000,-3,3,1000,-4,4);\r
+  fOutputList->Add(fHEMCalRecPhiEtaClus);\r
+\r
+  fHEMCalRecPhiEtaTrk = new TH2F("fHEMCalRecPhiEtaTrk","EMCAL Track #phi-#eta; #eta; #phi",1000,-3,3,1000,-4,4);\r
+  fOutputList->Add(fHEMCalRecPhiEtaTrk);\r
+\r
+  fHClsPhiEta = new TH2F("fHClsPhiEta", "cluster #phi-#eta; #eta; #phi",1000,-3,3,1000,-4,4);\r
+  fOutputList->Add(fHClsPhiEta);\r
+\r
+  fHEMCalRecdPhidEta = new TH2F("fHEMCalRecdPhidEta","EMCAL Cluster-Track #Delta#phi-#Delta#eta; #Delta#eta; #Delta#phi",1000,-0.1,0.1,1000,-0.5,0.5);\r
+  fOutputList->Add(fHEMCalRecdPhidEta);\r
+\r
+  fHEMCalRecdPhidEtaP = new TH2F("fHEMCalRecdPhidEtaP","EMCAL Charge+ Cluster-Track #Delta#phi-#Delta#eta; #Delta#eta; #Delta#phi",1000,-0.1,0.1,1000,-0.5,0.5);\r
+  fOutputList->Add(fHEMCalRecdPhidEtaP);\r
+\r
+  fHEMCalRecdPhidEtaM = new TH2F("fHEMCalRecdPhidEtaM","EMCAL Charge- Cluster-Track #Delta#phi-#Delta#eta; #Delta#eta; #Delta#phi",1000,-0.1,0.1,1000,-0.5,0.5);\r
+  fOutputList->Add(fHEMCalRecdPhidEtaM);\r
+\r
+  fHEMCalRecdPhidEta_Truth = new TH2F("fHEMCalRecdPhidEta_Truth","EMCAL Cluster-Track(Truth matched) #Delta#phi-#Delta#eta; #Delta#eta; #Delta#phi",1000,-0.1,0.1,1000,-0.5,0.5);\r
+  fOutputList->Add(fHEMCalRecdPhidEta_Truth);\r
+\r
+  fHEMCalRecdPhidEtaP_Truth = new TH2F("fHEMCalRecdPhidEtaP_Truth","EMCAL Charge+ Cluster-Track(Truth matched) #Delta#phi-#Delta#eta; #Delta#eta; #Delta#phi",1000,-0.1,0.1,1000,-0.5,0.5);\r
+  fOutputList->Add(fHEMCalRecdPhidEtaP_Truth);\r
+\r
+  fHEMCalRecdPhidEtaM_Truth = new TH2F("fHEMCalRecdPhidEtaM_Truth","EMCAL Charge- Cluster-Track(Truth matched) #Delta#phi-#Delta#eta; #Delta#eta; #Delta#phi",1000,-0.1,0.1,1000,-0.5,0.5);\r
+  fOutputList->Add(fHEMCalRecdPhidEtaM_Truth);\r
+\r
+  fHEMCalRecdPhidEtaposEta = new TH2F("fHEMCalRecdPhidEtaposEta","(+eta track) EMCAL Cluster-Track #Delta#phi-#Delta#eta; #Delta#eta; #Delta#phi",1000,-0.1,0.1,1000,-0.5,0.5);\r
+  fOutputList->Add(fHEMCalRecdPhidEtaposEta);\r
+\r
+  fHEMCalRecdPhidEtanegEta = new TH2F("fHEMCalRecdPhidEtanegEta","(-eta track) EMCAL Cluster-Track #Delta#phi-#Delta#eta; #Delta#eta; #Delta#phi",1000,-0.1,0.1,1000,-0.5,0.5);\r
+  fOutputList->Add(fHEMCalRecdPhidEtanegEta);\r
+  fTrackIndices = new TArrayI();\r
+\r
+  PostData(1, fOutputList);\r
+}\r
+\r
+//________________________________________________________________________\r
+void AliAnalysisTaskSOH::UserExec(Option_t *) \r
+{\r
+  // Main loop, called for each event.\r
+\r
+  // Post output data.\r
+  fESD = dynamic_cast<AliESDEvent*>(InputEvent());\r
+  if (!fESD) {\r
+    printf("ERROR: fESD not available\n");\r
+    return;\r
+  }\r
+\r
+  fMC = MCEvent();\r
+  if (!fMC) {\r
+    printf("ERROR: fMC not available\n");\r
+    return;\r
+  }\r
+\r
+  fHEventStat->Fill(0.5);\r
+\r
+  if(fTrackIndices) \r
+    fTrackIndices->Reset();\r
+\r
+  ProcessTrack();\r
+  ProcessMc();\r
+  \r
+  PostData(1, fOutputList);\r
+}   \r
+   \r
+//________________________________________________________________________\r
+void  AliAnalysisTaskSOH::ProcessTrack()\r
+{\r
+  // Process track.\r
+\r
+  fTrackIndices->Set(fESD->GetNumberOfTracks());\r
+  AliDebug(3,Form("%s:%d Selecting tracks",(char*)__FILE__,__LINE__));\r
+\r
+  Int_t isMth = 0;\r
+  Int_t nTracks = 0;\r
+\r
+  Float_t ClsPos[3] = {-999,-999,-999};\r
+  Double_t emcTrkpos[3] = {-999,-999,-999};\r
+\r
+  for(Int_t itr=0; itr<fESD->GetNumberOfCaloClusters(); itr++)\r
+  {\r
+    AliESDCaloCluster *cluster = fESD->GetCaloCluster(itr);\r
+    if(!cluster) continue;\r
+    cluster->GetPosition(ClsPos);\r
+    TVector3 VClsPos(ClsPos[0], ClsPos[1], ClsPos[2]);\r
+    fHClsPhiEta->Fill(VClsPos.Eta(), VClsPos.Phi());\r
+  }\r
+\r
+  for(Int_t itr=0; itr<fESD->GetNumberOfTracks(); itr++)\r
+  {\r
+    AliESDtrack *esdtrack = fESD->GetTrack(itr);\r
+    if(!esdtrack)continue;\r
+    AliESDtrack *newTrack = GetAcceptTrack(esdtrack);\r
+    if(!newTrack) continue;\r
+  \r
+    Double_t clsE = -1;\r
+    Int_t clsIndex = newTrack->GetEMCALcluster();\r
+    if(newTrack->GetEMCALcluster()>-1)\r
+    {\r
+      AliESDCaloCluster *cluster = fESD->GetCaloCluster(clsIndex);\r
+      if(IsGoodCluster(cluster))\r
+      {\r
+        isMth=1;\r
+             \r
+        cluster->GetPosition(ClsPos);\r
+        TVector3 VClsPos(ClsPos[0], ClsPos[1], ClsPos[2]);\r
+             \r
+        AliEMCALTrack EMCTrk(*newTrack);\r
+        if(!EMCTrk.PropagateToGlobal(ClsPos[0], ClsPos[1], ClsPos[2], 0.0, 0.0)) {\r
+          continue;\r
+        }\r
+        EMCTrk.GetXYZ(emcTrkpos);\r
+        TVector3 VemcTrkPos(emcTrkpos[0],emcTrkpos[1],emcTrkpos[2]);\r
+             \r
+        fHEMCalRecPhiEtaClus->Fill(VClsPos.Eta(), VClsPos.Phi());\r
+        fHEMCalRecPhiEtaTrk->Fill(VemcTrkPos.Eta(), VemcTrkPos.Phi());\r
+             \r
+        Double_t dPhi = VClsPos.Phi() - VemcTrkPos.Phi();\r
+        if (dPhi < -1*TMath::Pi()) dPhi += (2*TMath::Pi());\r
+        else if (dPhi > TMath::Pi()) dPhi -= (2*TMath::Pi());\r
+             \r
+        Double_t dEta = VClsPos.Eta() - VemcTrkPos.Eta();\r
+             \r
+        fHEMCalRecdPhidEta->Fill(dEta, dPhi);  \r
+\r
+        if((newTrack->GetLabel())>-1 && (newTrack->GetLabel()) < fMC->GetNumberOfTracks())\r
+        {\r
+          AliVParticle *vParticle = fMC->GetTrack(newTrack->GetLabel());\r
+          if(IsGoodMcParticle(vParticle, newTrack->GetLabel()))\r
+          {\r
+            fHEMCalRecdPhidEta_Truth->Fill(dEta, dPhi);\r
+            if(vParticle->Charge() > 0) fHEMCalRecdPhidEtaP_Truth->Fill(dEta, dPhi);\r
+            if(vParticle->Charge() < 0) fHEMCalRecdPhidEtaM_Truth->Fill(dEta, dPhi);\r
+          }\r
+        }\r
+\r
+        if(esdtrack->Charge() > 0) {fHEMCalRecdPhidEtaP->Fill(dEta, dPhi);}\r
+        if(esdtrack->Charge() < 0) {fHEMCalRecdPhidEtaM->Fill(dEta, dPhi);}\r
+\r
+        if(VemcTrkPos.Eta() > 0) fHEMCalRecdPhidEtaposEta->Fill(dEta, dPhi);\r
+        if(VemcTrkPos.Eta() < 0) fHEMCalRecdPhidEtanegEta->Fill(dEta, dPhi);\r
+             \r
+        clsE = cluster->E();\r
+        if(newTrack->P()>0) fHEOverPVsPt->Fill(newTrack->Pt(),clsE/newTrack->P());\r
+      }\r
+         \r
+      Int_t ipart = newTrack->GetLabel();\r
+      if(ipart>-1 && ipart<fMC->GetNumberOfTracks())\r
+      {\r
+        AliVParticle* vParticle = fMC->GetTrack(ipart);\r
+        if(isMth && vParticle)\r
+        {\r
+          if(TMath::Abs(vParticle->PdgCode())==211)\r
+          {\r
+            fHEMCalResponsePion->Fill(newTrack->Pt(),clsE/newTrack->P());\r
+          }\r
+          if(TMath::Abs(vParticle->PdgCode())==11)\r
+          {\r
+            fHEMCalResponseElec->Fill(newTrack->Pt(),clsE/newTrack->P());\r
+          }\r
+          if(TMath::Abs(vParticle->PdgCode())==2212)\r
+          {\r
+            fHEMCalResponseProton->Fill(newTrack->Pt(),clsE/newTrack->P());\r
+          }\r
+        }\r
+      }\r
+    }\r
+    fTrackIndices->AddAt(itr,nTracks);\r
+    nTracks++;\r
+  }\r
+  fTrackIndices->Set(nTracks);\r
+}\r
+\r
+//________________________________________________________________________\r
+void AliAnalysisTaskSOH::ProcessMc()\r
+{\r
+  // Process MC.\r
+\r
+  for(Int_t ipart=0; ipart<fMC->GetNumberOfTracks(); ipart++)\r
+  {\r
+    AliVParticle* vParticle = fMC->GetTrack(ipart);\r
+    if(!IsGoodMcParticle(vParticle, ipart)) continue;\r
+    Int_t pdgCode = vParticle->PdgCode();\r
+      \r
+    //tracking effciency\r
+    if(TMath::Abs(vParticle->Eta())<0.9 && TMath::Abs(pdgCode==211))\r
+    {\r
+      fHTrkEffParGenPt->Fill(vParticle->Pt());\r
+      for(Int_t j=0; j<fTrackIndices->GetSize(); j++)\r
+      {\r
+        AliESDtrack *esdtrack = fESD->GetTrack(fTrackIndices->At(j));\r
+        if(esdtrack && esdtrack->GetLabel()==ipart)\r
+        {\r
+          fHTrkEffDetGenPt->Fill(vParticle->Pt());\r
+          fHTrkEffDetRecPt->Fill(esdtrack->Pt());\r
+          break;\r
+        }\r
+      }\r
+    }\r
+  } \r
+}\r
+\r
+//________________________________________________________________________\r
+AliESDtrack *AliAnalysisTaskSOH::GetAcceptTrack(AliESDtrack *esdtrack)\r
+{\r
+  // Get accepted track.\r
+\r
+  static AliESDtrack newTrack;\r
+  if(fEsdTrackCuts->AcceptTrack(esdtrack))\r
+  {\r
+    esdtrack->Copy(newTrack);\r
+    newTrack.SetTRDQuality(0);\r
+  }\r
+  else if(fHybridTrackCuts1->AcceptTrack(esdtrack))\r
+  {\r
+    if(esdtrack->GetConstrainedParam())\r
+    {\r
+      esdtrack->Copy(newTrack);\r
+      const AliExternalTrackParam* constrainParam = esdtrack->GetConstrainedParam();\r
+      newTrack.Set(constrainParam->GetX(),constrainParam->GetAlpha(),constrainParam->GetParameter(),constrainParam->GetCovariance());\r
+      newTrack.SetTRDQuality(1);               \r
+    }\r
+    else \r
+      return 0x0;\r
+  }\r
+  else if(fHybridTrackCuts2->AcceptTrack(esdtrack))\r
+  {\r
+    if(esdtrack->GetConstrainedParam())\r
+    {\r
+      esdtrack->Copy(newTrack);\r
+      const AliExternalTrackParam* constrainParam = esdtrack->GetConstrainedParam();\r
+      newTrack.Set(constrainParam->GetX(),constrainParam->GetAlpha(),constrainParam->GetParameter(),constrainParam->GetCovariance());\r
+      newTrack.SetTRDQuality(2);               \r
+    }\r
+    else \r
+      return 0x0;\r
+  }\r
+  else\r
+  {\r
+    return 0x0;\r
+  }\r
+\r
+  return &newTrack;\r
+}\r
+\r
+//________________________________________________________________________\r
+Bool_t AliAnalysisTaskSOH::IsGoodMcParticle(AliVParticle* vParticle, Int_t ipart)\r
+{\r
+  // Return true if good MC particle.\r
+\r
+  if(!vParticle) return kFALSE;\r
+  if(!fMC->IsPhysicalPrimary(ipart)) return kFALSE;\r
+  if (TMath::Abs(vParticle->Eta())>2) return kFALSE;\r
+  if(vParticle->Pt()<0.15) return kFALSE;\r
+  return kTRUE;\r
+}\r
+\r
+\r
+//________________________________________________________________________\r
+Bool_t AliAnalysisTaskSOH::IsGoodCluster(AliESDCaloCluster *cluster)\r
+{\r
+  // Return true if good cluster.\r
+\r
+  if(!cluster) return kFALSE;\r
+  if (!cluster->IsEMCAL()) return kFALSE;\r
+  return kTRUE;\r
+}\r
+\r
+\r
+//________________________________________________________________________\r
+void AliAnalysisTaskSOH::Terminate(Option_t *) \r
+{\r
+  // Terminate analysis.\r
+}\r
diff --git a/PWGGA/EMCALJetTasks/AliAnalysisTaskSOH.h b/PWGGA/EMCALJetTasks/AliAnalysisTaskSOH.h
new file mode 100644 (file)
index 0000000..9864e92
--- /dev/null
@@ -0,0 +1,72 @@
+#ifndef ALIANALYSISTASKSOH_cxx
+#define ALIANALYSISTASKSOH_cxx
+
+// $Id$
+
+class TList;
+class TH1F;
+class TH2F;
+class TArrayI;
+class AliESDEvent;
+class AliMCEvent;
+class AliESDtrack;
+class AliESDCaloCluster;
+class AliESDtrackCuts;
+
+#include "AliAnalysisTaskSE.h"
+
+class AliAnalysisTaskSOH : public AliAnalysisTaskSE {
+ public:
+  AliAnalysisTaskSOH();
+  AliAnalysisTaskSOH(const char *name);
+  virtual ~AliAnalysisTaskSOH();
+  
+  void                UserCreateOutputObjects();
+  void                UserExec(Option_t *option);
+  void                Terminate(Option_t *);
+  
+  void                SetEsdTrackCuts(AliESDtrackCuts *cuts)         { fEsdTrackCuts     = cuts ; }
+  void                SetHybridTrackCuts1(AliESDtrackCuts *cuts)     { fHybridTrackCuts1 = cuts ; }
+  void                SetHybridTrackCuts2(AliESDtrackCuts *cuts)     { fHybridTrackCuts2 = cuts ; }
+
+ private:
+
+  AliESDtrack        *GetAcceptTrack(AliESDtrack *esdtrack) ;
+  Bool_t              IsGoodCluster(AliESDCaloCluster *cluster)             ;
+  Bool_t              IsGoodMcParticle(AliVParticle* vParticle, Int_t ipart);
+  void                ProcessTrack()                       ;
+  void                ProcessMc()                          ;
+
+  AliESDEvent        *fESD;                      //!esd event
+  AliMCEvent         *fMC;                       //!mv event
+  AliESDtrackCuts    *fEsdTrackCuts;             // esd track cuts
+  AliESDtrackCuts    *fHybridTrackCuts1;         // hybrid track cuts
+  AliESDtrackCuts    *fHybridTrackCuts2;         // hybrid track cuts
+  TArrayI            *fTrackIndices;             //!selected track index
+  TList              *fOutputList;               //!output list
+  TH1F               *fHEventStat;               //!statistics histo
+  TH1F               *fHTrkEffParGenPt;          //!mc truth pt spectrum
+  TH1F               *fHTrkEffDetGenPt;          //!mc detector level pt spectrum
+  TH1F               *fHTrkEffDetRecPt;          //!reconstructed detector level pt spectrum
+  TH2F               *fHEOverPVsPt;              //!(cluster energy over reconstructed track p) vs. track pt
+  TH2F               *fHEMCalResponsePion;       //!same as above for pions 
+  TH2F               *fHEMCalResponseElec;       //!same as above for electrons
+  TH2F               *fHEMCalResponseProton;     //!same as above for protons
+  TH2F               *fHEMCalRecPhiEtaClus;      //!EMCal cluster phi vs. eta
+  TH2F               *fHEMCalRecPhiEtaTrk;       //!EMCal cluster label matched track phi vs. eta
+  TH2F               *fHClsPhiEta;               //!EMCal cluster phi vs. eta
+  TH2F               *fHEMCalRecdPhidEta;        //!(EMCal cluster phi - track phi) vs. (EMCal cluster eta - track eta)
+  TH2F               *fHEMCalRecdPhidEtaP;       //!same as above for positive charge tracks
+  TH2F               *fHEMCalRecdPhidEtaM;       //!same as above for negative charge tracks
+  TH2F               *fHEMCalRecdPhidEta_Truth;  //!same as above with mc truth matching
+  TH2F               *fHEMCalRecdPhidEtaP_Truth; //!same as above with positive truth charge matching
+  TH2F               *fHEMCalRecdPhidEtaM_Truth; //!same as above with negative truth charge matching
+  TH2F               *fHEMCalRecdPhidEtaposEta;  //!same as above for positive eta
+  TH2F               *fHEMCalRecdPhidEtanegEta;  //!same as above for negative eta
+
+  AliAnalysisTaskSOH(const AliAnalysisTaskSOH&); // not implemented
+  AliAnalysisTaskSOH& operator=(const AliAnalysisTaskSOH&); // not implemented
+  
+  ClassDef(AliAnalysisTaskSOH, 1); // Analysis task Saehanseul Oh
+};
+#endif
diff --git a/PWGGA/EMCALJetTasks/macros/AddTaskSOH.C b/PWGGA/EMCALJetTasks/macros/AddTaskSOH.C
new file mode 100644 (file)
index 0000000..41ac814
--- /dev/null
@@ -0,0 +1,66 @@
+// $Id$\r
+\r
+AliAnalysisTaskSOH* AddTaskSOH()\r
+{\r
+  // Get the pointer to the existing analysis manager via the static access method.\r
+  //==============================================================================\r
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
+  if (!mgr)\r
+  {\r
+    ::Error("AddTaskSOH", "No analysis manager to connect to.");\r
+    return NULL;\r
+  }  \r
+  \r
+  // Check the analysis type using the event handlers connected to the analysis manager.\r
+  //==============================================================================\r
+  if (!mgr->GetInputEventHandler())\r
+  {\r
+    ::Error("AddTaskSOH", "This task requires an input event handler");\r
+    return NULL;\r
+  }\r
+\r
+  //-------------------------------------------------------\r
+  // Init the task and do settings\r
+  //-------------------------------------------------------\r
+\r
+  AliAnalysisTaskSOH *taskSOH = new AliAnalysisTaskSOH("AliAnalysisTaskSOH");\r
+\r
+  AliESDtrackCuts *esdTrackCuts = 0x0;\r
+  AliESDtrackCuts *hybridTrackCuts1 = 0x0;\r
+  AliESDtrackCuts *hybridTrackCuts2 = 0x0;\r
+  gROOT->LoadMacro("$ALICE_ROOT/PWGJE/macros/CreateTrackCutsPWGJE.C");\r
+\r
+  esdTrackCuts = CreateTrackCutsPWGJE(10001006);\r
+  hybridTrackCuts1 = CreateTrackCutsPWGJE(1006);\r
+  hybridTrackCuts2 = CreateTrackCutsPWGJE(10041006);\r
+  \r
+  taskSOH->SetEsdTrackCuts(esdTrackCuts);\r
+  taskSOH->SetHybridTrackCuts1(hybridTrackCuts1);\r
+  taskSOH->SetHybridTrackCuts2(hybridTrackCuts2);\r
+  taskSOH->SetCutOnGGCChi2(0);\r
+\r
+  // Add task(s)\r
+  mgr->AddTask(taskSOH); \r
+\r
+  // ESD handler\r
+  AliESDInputHandler* esdH = new AliESDInputHandler();\r
+  mgr->SetInputEventHandler(esdH);\r
+  \r
+  // MC truth handler\r
+  AliMCEventHandler* mcEvtHdl = new AliMCEventHandler();\r
+  mcEvtHdl->SetReadTR(kTRUE);\r
+  mgr->SetMCtruthEventHandler(mcEvtHdl); \r
+\r
+  // Create containers for input/output\r
+  AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();\r
+  AliAnalysisDataContainer *coutputpt = mgr->CreateContainer("soh", \r
+                                                             TList::Class(), \r
+                                                             AliAnalysisManager::kOutputContainer, \r
+                                                             "AnalysisResults.root");\r
+\r
+  // Connect input/output\r
+  mgr->ConnectInput(taskSOH, 0, cinput);\r
+  mgr->ConnectOutput(taskSOH, 1, coutputpt);\r
+\r
+  return taskSOH;\r
+}\r
index 8dfa844..08d818c 100644 (file)
@@ -1,3 +1,5 @@
+// $Id$
+
 #ifdef __CINT__
  
 #pragma link off all globals;
@@ -9,8 +11,6 @@
 #pragma link C++ class AliAnalysisTaskRho+;
 #pragma link C++ class AliAnalysisTaskRhoAverage+;
 #pragma link C++ class AliAnalysisTaskRhoBase+;
-#pragma link C++ class AliAnalysisTaskSAJF+;
-#pragma link C++ class AliAnalysisTaskSAQA+;
 #pragma link C++ class AliAnalysisTaskScale+;
 #pragma link C++ class AliEmcalJet+;
 #pragma link C++ class AliEmcalJetTask+;
@@ -21,4 +21,9 @@
 #pragma link C++ class AliJetResponseMaker+;
 #pragma link C++ class AliRhoParameter+;
 
+// user tasks
+#pragma link C++ class AliAnalysisTaskSAJF+;
+#pragma link C++ class AliAnalysisTaskSAQA+;
+#pragma link C++ class AliAnalysisTaskSOH+;
+
 #endif
index 8f3cd93..2ea7df0 100644 (file)
@@ -1,3 +1,5 @@
+// $Id: $
+
 #ifdef __CINT__
  
 #pragma link off all globals;