]>
Commit | Line | Data |
---|---|---|
f6d1b1a7 | 1 | /* AddTask macro for class AliAnalysisTaskJetMatching |
f1354962 | 2 | * Redmer Alexander Bertens, rbertens@cern.ch |
3 | * Utrecht University, Utrecht, Netherlands */ | |
4 | ||
5 | AliAnalysisTaskJetMatching* AddTaskJetMatching( | |
6 | const char* sourceJets = "SourceJets", // source jets | |
7 | const char* targetJets = "TargetJets", // target jets | |
8 | const char* matchedJets = "MatchedJets",// matched jets | |
285db795 | 9 | UInt_t matchingScheme = AliAnalysisTaskJetMatching::kGeoR, |
f6d1b1a7 | 10 | Bool_t matchConstituents= kTRUE, |
285db795 | 11 | Float_t minFrReCon = .3, |
12 | Float_t minFrReConPt = .5, | |
f1354962 | 13 | const char *name = "AliAnalysisTaskJetMatching", |
c2460f8a | 14 | Bool_t cut = kTRUE, |
4f6d96b5 | 15 | const char* sourceType = "TPC", |
285db795 | 16 | Float_t sourceRadius = 0.3, |
c2460f8a | 17 | Float_t sourceAreaCut = .557, |
18 | Float_t sourcePtBias = 10., | |
4f6d96b5 | 19 | const char* targetType = "TPC", |
c2460f8a | 20 | Float_t targetRadius = 0.3, |
21 | Float_t targetAreaCut = .557, | |
22 | Float_t targetPtBias = 10. | |
f1354962 | 23 | ) |
24 | { | |
25 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
26 | if (!mgr) return 0x0; | |
27 | if (!mgr->GetInputEventHandler()) return 0x0; | |
28 | ||
29 | AliAnalysisTaskJetMatching* jetTask = new AliAnalysisTaskJetMatching(name); | |
30 | jetTask->SetDebugMode(-1); | |
f6d1b1a7 | 31 | jetTask->SetMatchConstituents(matchConstituents); |
32 | jetTask->SetMinFracRecoveredConstituents(minFrReCon); | |
285db795 | 33 | jetTask->SetMinFracRecoveredConstituentPt(minFrReConPt); |
f1354962 | 34 | jetTask->SetSourceJetsName(sourceJets); |
35 | jetTask->SetTargetJetsName(targetJets); | |
36 | jetTask->SetMatchedJetsName(matchedJets); | |
37 | jetTask->SetMatchingScheme(matchingScheme); | |
f6d1b1a7 | 38 | // if we want the jet package to cut on the source and target jets |
39 | jetTask->SetUseEmcalBaseJetCuts(cut); | |
40 | if(cut) { | |
4f6d96b5 | 41 | AliJetContainer* sourceContainer = jetTask->AddJetContainer(sourceJets, sourceType, sourceRadius); |
42 | if(sourceContainer) { | |
43 | sourceContainer->SetName("sourceJetContainer"); | |
44 | sourceContainer->SetPercAreaCut(sourceAreaCut); | |
45 | sourceContainer->SetPtBiasJetTrack(sourcePtBias); | |
46 | } | |
47 | AliJetContainer* targetContainer = jetTask->AddJetContainer(targetJets, targetType, targetRadius); | |
48 | if(targetContainer) { | |
49 | targetContainer->SetName("targetJetContainer"); | |
50 | targetContainer->SetPercAreaCut(targetAreaCut); | |
51 | targetContainer->SetPtBiasJetTrack(targetPtBias); | |
52 | } | |
f6d1b1a7 | 53 | } |
54 | ||
f1354962 | 55 | mgr->AddTask(jetTask); |
56 | // Create containers for input/output | |
57 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ; | |
58 | TString contname(name); | |
59 | contname += "_histos"; | |
60 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(), | |
61 | TList::Class(),AliAnalysisManager::kOutputContainer, | |
62 | Form("%s", AliAnalysisManager::GetCommonFileName())); | |
63 | mgr->ConnectInput (jetTask, 0, cinput1 ); | |
64 | mgr->ConnectOutput (jetTask, 1, coutput1 ); | |
65 | return jetTask; | |
66 | } |