1 AliAnalysisTaskSEMuonsHF* AddTaskMuonsHF(Int_t mode=0, Bool_t isMC=kFALSE, Bool_t isTree=kFALSE)
3 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
5 ::Error("AddTaskMuonsHF", "No analysis manager to connect to.");
8 TString type = mgr->GetInputEventHandler()->GetDataType();
9 if (!type.Contains("ESD") && !type.Contains("AOD")) {
10 ::Error("AddTaskMuonsHF", "MuonsHF task needs the manager to have an ESD or AOD input handler.");
13 if (isMC && type.Contains("ESD")) {
14 AliMCEventHandler *mcH = mgr->GetMCtruthEventHandler();
16 ::Error("AddTaskMuonsHF", "MuonsHF task needs the manager to have an MC evnet handler.");
21 AliAODHandler *aodH = (AliAODHandler*)mgr->GetOutputEventHandler();
23 ::Error("AddTaskMuonsHF", "MuonsHF task needs the manager to have an AOD output handler.");
28 // set cuts for events or muons selection
29 Double_t cutsEvsH[3] ={-999999.0, // low limit of Ncontrs
30 999999.0, // up limit of |vz|
31 999999.0}; // up limit of vt
32 Double_t cutsMuon[12]={-999999.0, // 0, min of 3-momentum
33 999999.0, // 1, max of 3-momnentum
34 -999999.0, // 2, PtMin
36 -999999.0, // 4, EtaMin
37 999999.0, // 5, EtaMax
38 -999999.0, // 6, DCAmin
39 999999.0, // 7, DCAmax
40 -999999.0, // 8, for trigger
41 999999.0, // 9, for trigger
42 -999999.0, // 10, RabsEndMin
43 999999.0,}; // 11, RabsEndMax
44 Double_t cutsDimu[12]={-999999.0, 999999.0, // single muon cuts used for dimuon selection
50 AliAnalysisTaskSEMuonsHF *taskMuonsHF = new AliAnalysisTaskSEMuonsHF("MuonsHF Analysis Task");
51 taskMuonsHF->SetAnaMode(mode);
52 taskMuonsHF->SetUseMC(isMC);
53 taskMuonsHF->SetIsOutputTree(isTree);
54 taskMuonsHF->SetEvsHCuts(cutsEvsH);
55 taskMuonsHF->SetMuonCuts(cutsMuon);
56 taskMuonsHF->SetDimuCuts(cutsDimu);
57 taskMuonsHF->SelectCollisionCandidates();
58 mgr->AddTask(taskMuonsHF);
60 mgr->ConnectInput(taskMuonsHF, 0, mgr->GetCommonInputContainer());
61 if (isTree) mgr->ConnectOutput(taskMuonsHF, 0, mgr->GetCommonOutputContainer());
63 char *fileName = "muonsHF.root";
64 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("histosList",TList::Class(),AliAnalysisManager::kOutputContainer,fileName);
65 mgr->ConnectOutput(taskMuonsHF,1,coutput1);