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