]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGJE/EMCALJetTasks/macros/AddTaskEmcalDiJetResponse.C
Merge branch 'master' into TPCdev
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / macros / AddTaskEmcalDiJetResponse.C
CommitLineData
3773435b 1AliAnalysisTaskEmcalDiJetResponse* AddTaskEmcalDiJetResponse(TString kTracksName = "PicoTracks",
2 TString kClusName = "caloClusterCorr",
3 TString kMCTracksName = "MCParticles",
4 Double_t R = 0.4,
5 Double_t ptminTrack = 0.15,
6 Double_t etminClus = 0.3,
7 Int_t rhoType = 0,
8 TString trigClass = "",
9 const char *CentEst = "V0A",
10 Int_t pSel = AliVEvent::kINT7,
bb84b374 11 Int_t matchFullCh = AliAnalysisTaskEmcalDiJetBase::kNoMatching,
6ab30d5f 12 Double_t ptTrackBias = 0.,
13 Int_t responseVar = 0,
e50460de 14 Int_t corrType = AliAnalysisTaskEmcalDiJetBase::kCorrelateTwo,
15 Float_t nefCut = 0.95
3773435b 16 ) {
17
18 enum AlgoType {kKT, kANTIKT};
19 enum JetType {kFULLJETS, kCHARGEDJETS, kNEUTRALJETS};
20
21 // #### Define manager and data container names
22 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
23 if (!mgr) {
24 ::Error("AddTaskEmcalDiJet", "No analysis manager to connect to.");
25 return NULL;
26 }
27
28 // Check the analysis type using the event handlers connected to the analysis manager.
29 //==============================================================================
30 if (!mgr->GetInputEventHandler())
31 {
32 ::Error("AddTaskEmcalDiJet", "This task requires an input event handler");
33 return NULL;
34 }
35
36 // #### Add necessary jet finder tasks
37 gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskEmcalJet.C");
38
39 AliEmcalJetTask* jetFinderTaskFull = AddTaskEmcalJet(kTracksName, kClusName, kANTIKT, R, kFULLJETS, ptminTrack, etminClus);
40 AliEmcalJetTask* jetFinderTaskCharged = AddTaskEmcalJet(kTracksName, kClusName, kANTIKT, R, kCHARGEDJETS, ptminTrack, etminClus);
41
42 AliEmcalJetTask* jetFinderTaskFullMC = AddTaskEmcalJet(kMCTracksName ,"", kANTIKT, R, kFULLJETS, kPartLevPtCut, kPartLevPtCut);
43 AliEmcalJetTask* jetFinderTaskChargedMC = AddTaskEmcalJet(kMCTracksName ,"", kANTIKT, R, kCHARGEDJETS, kPartLevPtCut, kPartLevPtCut);
44
45
46 TString strJetsFull = jetFinderTaskFull->GetName();
47 TString strJetsCh = jetFinderTaskCharged->GetName();
48
49 TString strJetsFullMC = jetFinderTaskFullMC->GetName();
50 TString strJetsChMC = jetFinderTaskChargedMC->GetName();
51
52
6ab30d5f 53 TString wagonName = Form("DiJetResponse_%s_%s_Rho%dTC%sMatch%dHadTrig%dRV%d",strJetsFull.Data(),strJetsFullMC.Data(),rhoType,trigClass.Data(),matchFullCh,(Int_t)(ptTrackBias),responseVar);
3773435b 54
55 //Configure DiJet task
e50460de 56 AliAnalysisTaskEmcalDiJetResponse *taskDiJet = new AliAnalysisTaskEmcalDiJetResponse(wagonName.Data());
3773435b 57
58 Printf("strJetsFull: %s",strJetsFull.Data());
59 Printf("strJetsCh: %s",strJetsCh.Data());
60
8e49a788 61 taskDiJet->SetUseAliAnaUtils(kTRUE);
62 taskDiJet->SetIsPythia(kTRUE);
6ab30d5f 63
64 taskDiJet->SetJetCorrelationType(corrType);
65
3773435b 66 taskDiJet->SetContainerFull(0);
67 taskDiJet->SetContainerCharged(1);
68 taskDiJet->SetContainerFullMC(2);
69 taskDiJet->SetContainerChargedMC(3);
70
71 taskDiJet->AddParticleContainer(kTracksName.Data());
72 taskDiJet->AddClusterContainer(kClusName.Data());
73
3773435b 74 taskDiJet->AddJetContainer(strJetsFull.Data(),"EMCAL",R);
75 taskDiJet->AddJetContainer(strJetsCh.Data(),"TPC",R);
76 taskDiJet->AddJetContainer(strJetsFullMC.Data(),"EMCAL",R);
77 taskDiJet->AddJetContainer(strJetsChMC.Data(),"TPC",R);
78
9e5eee5d 79 taskDiJet->SetZLeadingCut(0.98,0.98,0);
80 taskDiJet->SetZLeadingCut(0.98,0.98,2);
81
e50460de 82 taskDiJet->SetNEFCut(0.,nefCut,0);
83 taskDiJet->SetNEFCut(0.,nefCut,2);
84
bb84b374 85 for(Int_t i=0; i<4; i++) {
eca9052c 86 taskDiJet->SetPercAreaCut(0.6, i);
bb84b374 87 taskDiJet->SetPtBiasJetTrack(ptTrackBias,i);
88 }
3773435b 89
90 taskDiJet->SetRhoType(rhoType);
91
92 taskDiJet->SetCentralityEstimator(CentEst);
93
94 taskDiJet->SelectCollisionCandidates(pSel);
95
96 taskDiJet->SetFullChargedMatchingType(matchFullCh);
97
98 taskDiJet->SetDoChargedCharged(kTRUE);
99 taskDiJet->SetDoFullCharged(kTRUE);
100 taskDiJet->SetMatchFullCharged(kTRUE);
101
6ab30d5f 102 taskDiJet->SetResponseVar(responseVar);
103
452d7395 104 taskDiJet->SetPtMinTriggerJet(0.);
105
3773435b 106 mgr->AddTask(taskDiJet);
107
108 //Connnect input
109 mgr->ConnectInput (taskDiJet, 0, mgr->GetCommonInputContainer() );
110
111 //Connect output
112 AliAnalysisDataContainer *coutput1 = 0x0;
113
6ab30d5f 114 TString contName(wagonName);
115 contName += "_histos";
3773435b 116
6ab30d5f 117 // TString outputfile = Form("%s:%s",AliAnalysisManager::GetCommonFileName(),wagonName.Data());
118 TString outputfile = Form("%s",AliAnalysisManager::GetCommonFileName());
3773435b 119
6ab30d5f 120 coutput1 = mgr->CreateContainer(contName.Data(), TList::Class(),AliAnalysisManager::kOutputContainer,outputfile);
3773435b 121
122 mgr->ConnectOutput(taskDiJet,1,coutput1);
123
124 return taskDiJet;
125}