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