]>
Commit | Line | Data |
---|---|---|
36f902bc | 1 | AliAnalysisTask *AddTaskNuclexFilterMC( Bool_t onlyMuon = kTRUE, |
2 | Bool_t keepAllEvents = kTRUE, | |
3 | Int_t mcMode = 0, | |
4 | Int_t nsigmaTrk1 = 3, | |
5 | Int_t partType1 = 2, | |
6 | Int_t nsigmaTrk2 = 5, | |
7 | Int_t partType2 = 7 | |
8 | ) | |
9 | { | |
10 | ||
11 | //get the current analysis manager | |
12 | ||
13 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
14 | if (!mgr) { | |
15 | Error("AddTaskNuclexFilter", "No analysis manager found."); | |
16 | return 0; | |
17 | } | |
18 | ||
19 | //check for output aod handler | |
20 | if (!mgr->GetOutputEventHandler()||mgr->GetOutputEventHandler()->IsA()!=AliAODHandler::Class()) { | |
21 | Warning("AddTaskNuclExFilter","No AOD output handler available. Not adding the task!"); | |
22 | return 0; | |
23 | } | |
24 | ||
25 | //Do we have an MC handler? | |
26 | // Bool_t hasMC=(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()!=0x0)||hasMC_aod; | |
27 | /* | |
28 | //Do we run on AOD? | |
29 | Bool_t isAOD=mgr->GetInputEventHandler()->IsA()==AliAODInputHandler::Class(); | |
30 | ||
31 | //Allow merging of the filtered aods on grid trains | |
32 | if(mgr->GetGridHandler()) { | |
33 | printf(" SET MERGE FILTERED AODs \n"); | |
34 | mgr->GetGridHandler()->SetMergeAOD(kTRUE); | |
35 | } | |
36 | ||
37 | if(isAOD) { | |
38 | //add options to AliAODHandler to duplicate input event | |
39 | AliAODHandler *aodHandler = (AliAODHandler*)mgr->GetOutputEventHandler(); | |
40 | aodHandler->SetCreateNonStandardAOD(); | |
41 | } | |
42 | */ | |
43 | ||
44 | Bool_t isAOD=mgr->GetInputEventHandler()->IsA()==AliAODInputHandler::Class(); | |
45 | if ( !isAOD) { | |
46 | Printf("ERROR! This task can only run on AODs!"); | |
47 | } | |
48 | ||
49 | ||
50 | ||
51 | //========= Add task to the ANALYSIS manager ===== | |
52 | ||
53 | cout<<"\n\n=============== addtask Nuclex =================== "<<endl<<endl; | |
54 | ||
55 | //AliAnalysisTaskSE *esdnuclexfilter = new AliAnalysisTaskESDNuclExFilter("NuclEx Filter",onlyMuon,keepAllEvents,mcMode,nsigmaTrk1,partType1,nsigmaTrk2,partType2); | |
56 | ||
57 | AliAnalysisTaskESDNuclExFilterMC *esdnuclexfilter = new AliAnalysisTaskESDNuclExFilterMC("NuclEx Filter MC",onlyMuon,keepAllEvents,mcMode,nsigmaTrk1,partType1,nsigmaTrk2,partType2); | |
58 | ||
59 | esdnuclexfilter->SetWriteMuonAOD(kTRUE); | |
60 | ||
61 | //================================================ | |
62 | // data containers | |
63 | //================================================ | |
64 | // find input container | |
65 | ||
66 | mgr->ConnectInput (esdnuclexfilter, 0, mgr->GetCommonInputContainer()); | |
67 | mgr->ConnectOutput (esdnuclexfilter, 0, mgr->GetCommonOutputContainer()); | |
68 | ||
69 | ||
70 | return esdnuclexfilter; | |
71 | } |