]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGGA/EMCALTasks/macros/AddTaskEMCALIsoPhoton.C
including QA histograms and an additional output container to hold them
[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",
e856eaaa 6 TString geoname="EMCAL_COMPLETEV1",
7 TString pathstrsel = "/"
751194e8 8 )
30159e6f 9{
10 // Get the pointer to the existing analysis manager via the static access method.
11 //==============================================================================
12 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
13 if (!mgr) {
14 ::Error("AddTaskEMCALIsoPhoton", "No analysis manager to connect to.");
15 return NULL;
16 }
17
18 // Create the task and configure it.
19 //===========================================================================
20 AliAnalysisTaskEMCALIsoPhoton* ana = new AliAnalysisTaskEMCALIsoPhoton("");
21
30159e6f 22 Bool_t isMC = (mgr->GetMCtruthEventHandler() != NULL);
23
0778e9ec 24 if(!isMC)
25 ana->SelectCollisionCandidates( AliVEvent::kEMC1 | AliVEvent::kMB | AliVEvent::kEMC7 | AliVEvent::kINT7);
26
30159e6f 27 //ana->SetClusThreshold(clusTh);
bd0b68b7 28
30159e6f 29 ana->SetTrainMode(kTRUE);
751194e8 30 ana->SetTriggerBit(trigbitname);
0778e9ec 31 ana->SetMcMode(isMC);
cc0b6da4 32 ana->SetPathStringSelect(pathstrsel.Data());
30159e6f 33 AliESDtrackCuts *cutsp = new AliESDtrackCuts;
34 cutsp->SetMinNClustersTPC(70);
35 cutsp->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);
36 cutsp->SetMaxChi2PerClusterTPC(4);
37 cutsp->SetRequireTPCRefit(kTRUE);
38 cutsp->SetAcceptKinkDaughters(kFALSE);
39 cutsp->SetMaxDCAToVertexZ(3.2);
40 cutsp->SetMaxDCAToVertexXY(2.4);
41 cutsp->SetDCAToVertex2D(kTRUE);
42 cutsp->SetPtRange(0.2);
43 cutsp->SetEtaRange(-1.0,1.0);
44 ana->SetPrimTrackCuts(cutsp);
45 ana->SetPeriod(period.Data());
08bd8015 46 ana->SetGeoName(geoname.Data());
30159e6f 47 mgr->AddTask(ana);
d7e0c62f 48 TString containername = "histosEMCALIsoPhoton";
2b7205ad 49 TString containernameQA = "histosQA";
d7e0c62f 50 if(pathstrsel != "/"){
51 TString dirpth = (TSubString)pathstrsel.operator()(1,1);
52 containername += dirpth;
2b7205ad 53 containernameQA += dirpth;
d7e0c62f 54 }
30159e6f 55
56 // Create ONLY the output containers for the data produced by the task.
57 // Get and connect other common input/output containers via the manager as below
58 //==============================================================================
d7e0c62f 59 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(containername.Data(),
30159e6f 60 TList::Class(),AliAnalysisManager::kOutputContainer,
61 Form("%s", AliAnalysisManager::GetCommonFileName()));
2b7205ad 62 AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(containernameQA.Data(),
63 TList::Class(),AliAnalysisManager::kOutputContainer,
64 Form("%s", AliAnalysisManager::GetCommonFileName()));
30159e6f 65
66 mgr->ConnectInput (ana, 0, mgr->GetCommonInputContainer());
67 mgr->ConnectOutput (ana, 1, coutput1 );
2b7205ad 68 mgr->ConnectOutput (ana, 2, coutput2 );
30159e6f 69
70 return ana;
71}