]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/EMCALTasks/macros/AddTaskEMCALIsoPhoton.C
bd5c2db657ec53747c2efddd160bb3fe3af43253
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / macros / AddTaskEMCALIsoPhoton.C
1
2
3 AliAnalysisTaskEMCALIsoPhoton *AddTaskEMCALIsoPhoton(
4                                                      TString period = "LHC11d",
5                                                      TString trigbitname = "kEMC7",
6                                                      TString pathstrsel = "/"
7                                                      )
8 {
9   // Get the pointer to the existing analysis manager via the static access method.
10   //==============================================================================
11   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
12   if (!mgr) {
13     ::Error("AddTaskEMCALIsoPhoton", "No analysis manager to connect to.");
14     return NULL;
15   }  
16   
17   // Create the task and configure it.
18   //===========================================================================
19   AliAnalysisTaskEMCALIsoPhoton* ana = new  AliAnalysisTaskEMCALIsoPhoton("");
20   
21   Bool_t isMC = (mgr->GetMCtruthEventHandler() != NULL);
22
23   if(!isMC)
24     ana->SelectCollisionCandidates( AliVEvent::kEMC1 | AliVEvent::kMB | AliVEvent::kEMC7 | AliVEvent::kINT7);
25   
26   //ana->SetClusThreshold(clusTh);
27   
28   ana->SetTrainMode(kTRUE);
29   ana->SetTriggerBit(trigbitname);
30   ana->SetMcMode(isMC);
31   ana->SetPathStringSelect(pathstrsel.Data());
32   AliESDtrackCuts *cutsp = new AliESDtrackCuts;
33   cutsp->SetMinNClustersTPC(70);
34   cutsp->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);
35   cutsp->SetMaxChi2PerClusterTPC(4);
36   cutsp->SetRequireTPCRefit(kTRUE);
37   cutsp->SetAcceptKinkDaughters(kFALSE);
38   cutsp->SetMaxDCAToVertexZ(3.2);
39   cutsp->SetMaxDCAToVertexXY(2.4);
40   cutsp->SetDCAToVertex2D(kTRUE);
41   cutsp->SetPtRange(0.2);
42   cutsp->SetEtaRange(-1.0,1.0);
43   ana->SetPrimTrackCuts(cutsp);
44   ana->SetPeriod(period.Data());
45   if(period.Contains("11"))
46     ana->SetGeoName("EMCAL_COMPLETEV1");
47   else
48     ana->SetGeoName("EMCAL_FIRSTYEARV1");
49
50   
51   mgr->AddTask(ana);
52   
53   // Create ONLY the output containers for the data produced by the task.
54   // Get and connect other common input/output containers via the manager as below
55   //==============================================================================
56   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("histosEMCALIsoPhoton", 
57                                                             TList::Class(),AliAnalysisManager::kOutputContainer,
58                                                             Form("%s", AliAnalysisManager::GetCommonFileName()));
59   
60   mgr->ConnectInput  (ana, 0, mgr->GetCommonInputContainer());
61   mgr->ConnectOutput (ana, 1, coutput1 );
62    
63   return ana;
64 }