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