Move trigger container name to the add macro level
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / macros / AddTaskPtEMCalTrigger.C
CommitLineData
46f589c2 1#if !defined (__CINT__) || defined (__MAKECINT__)
2#include "AliAnalysisManager.h"
3#include "AliAnalysisTaskPtEMCalTrigger.h"
4#include "AliESDtrackCuts.h"
5#include <TList.h>
362b23c7 6#include <TString.h>
46f589c2 7#endif
8
67c14c6d 9AliAnalysisTask* AddTaskPtEMCalTrigger(bool usePythiaHard, const char *period ="LHC13d", const char *triggerContainer = ""){
cdc26d91 10 //AliLog::SetClassDebugLevel("EMCalTriggerPtAnalysis::AliAnalysisTaskPtEMCalTrigger", 2);
46f589c2 11 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
12
13 if (!mgr) {
14 ::Error("AddTaskPtEMCalTrigger", "No analysis manager to connect to.");
15 return NULL;
16 }
17
18 if (!mgr->GetInputEventHandler()) {
19 ::Error("AddTaskPtEMCalTrigger", "This task requires an input event handler");
20 return NULL;
21 }
22
23 EMCalTriggerPtAnalysis::AliAnalysisTaskPtEMCalTrigger *pttriggertask = new EMCalTriggerPtAnalysis::AliAnalysisTaskPtEMCalTrigger("ptemcaltriggertask");
f9e83256 24 //pttriggertask->SelectCollisionCandidates(AliVEvent::kINT7 | AliVEvent::kEMC7); // Select both INT7 or EMC7 triggered events
25 pttriggertask->SelectCollisionCandidates(AliVEvent::kAny);
bd1a1d65 26 if(!TString(period).CompareTo("LHC13f")) pttriggertask->SetSwapEta();
46f589c2 27 mgr->AddTask(pttriggertask);
bf9501c1 28 pttriggertask->SetPtRange(2., 100.);
67c14c6d 29 if(usePythiaHard){
cdc26d91 30 pttriggertask->SetIsPythia(kTRUE);
31 }
67c14c6d 32 pttriggertask->SetCaloTriggerPatchInfoName(triggerContainer);
46f589c2 33
34 // Create charged hadrons pPb standard track cuts
35 AliESDtrackCuts *standardTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(true, 1);
36 standardTrackCuts->SetName("Standard Track cuts");
37 standardTrackCuts->SetMinNCrossedRowsTPC(120);
38 standardTrackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01");
cdc26d91 39 pttriggertask->AddESDTrackCuts(standardTrackCuts);
46f589c2 40
41 // Create hybrid track cuts as used in the jet analysis
42 AliESDtrackCuts* hybridTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kFALSE);
43 hybridTrackCuts->SetName("Global Hybrid tracks, loose DCA");
44 hybridTrackCuts->SetMaxDCAToVertexXY(2.4);
45 hybridTrackCuts->SetMaxDCAToVertexZ(3.2);
46 hybridTrackCuts->SetDCAToVertex2D(kTRUE);
47 hybridTrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
48 hybridTrackCuts->SetMaxFractionSharedTPCClusters(0.4);
cdc26d91 49 pttriggertask->AddESDTrackCuts(hybridTrackCuts);
46f589c2 50
362b23c7 51 TString containerName = mgr->GetCommonFileName();
52 containerName += ":PtEMCalTriggerTask";
53 printf("container name: %s\n", containerName.Data());
54
46f589c2 55 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
362b23c7 56 AliAnalysisDataContainer *coutput = mgr->CreateContainer("results", TList::Class(), AliAnalysisManager::kOutputContainer, containerName.Data());
46f589c2 57
58 //Connect input/output
59 mgr->ConnectInput(pttriggertask, 0, cinput);
60 mgr->ConnectOutput(pttriggertask, 1, coutput);
61
62 return pttriggertask;
63}