making the container name parameterized
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / macros / AddTaskEMCALIsoPhoton.C
CommitLineData
30159e6f 1
2
bd0b68b7 3AliAnalysisTaskEMCALIsoPhoton *AddTaskEMCALIsoPhoton(
751194e8 4 TString period = "LHC11d",
f3843637 5 TString trigbitname = "kEMC7",
6 TString pathstrsel = "/"
751194e8 7 )
30159e6f 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
30159e6f 21 Bool_t isMC = (mgr->GetMCtruthEventHandler() != NULL);
22
0778e9ec 23 if(!isMC)
24 ana->SelectCollisionCandidates( AliVEvent::kEMC1 | AliVEvent::kMB | AliVEvent::kEMC7 | AliVEvent::kINT7);
25
30159e6f 26 //ana->SetClusThreshold(clusTh);
bd0b68b7 27
30159e6f 28 ana->SetTrainMode(kTRUE);
751194e8 29 ana->SetTriggerBit(trigbitname);
0778e9ec 30 ana->SetMcMode(isMC);
cc0b6da4 31 ana->SetPathStringSelect(pathstrsel.Data());
30159e6f 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);
d7e0c62f 52 TString containername = "histosEMCALIsoPhoton";
53 if(pathstrsel != "/"){
54 TString dirpth = (TSubString)pathstrsel.operator()(1,1);
55 containername += dirpth;
56 }
30159e6f 57
58 // Create ONLY the output containers for the data produced by the task.
59 // Get and connect other common input/output containers via the manager as below
60 //==============================================================================
d7e0c62f 61 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(containername.Data(),
30159e6f 62 TList::Class(),AliAnalysisManager::kOutputContainer,
63 Form("%s", AliAnalysisManager::GetCommonFileName()));
64
65 mgr->ConnectInput (ana, 0, mgr->GetCommonInputContainer());
66 mgr->ConnectOutput (ana, 1, coutput1 );
67
68 return ana;
69}