AliAnalysisTaskSpectraAllChNanoAOD* AddTaskSpectraAllChAOD(
Bool_t mc=kFALSE,
Double_t CentCutMin=0,
Double_t CentCutMax=100,
Double_t QvecCutMin=0,
Double_t QvecCutMax=100,
Double_t EtaMin=-0.8,
Double_t EtaMax=0.8,
Double_t pt=50.,
Double_t ptTofMatch=.6,
UInt_t trkbit=1,
Double_t DCA=100000,
UInt_t minNclsTPC=70,
Double_t nsigmacut=5.,
Int_t PIDtype=3,
TString opt=""){
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr)
{
::Error("AddAliAnalysisTaskSpectraAllChAOD", "No analysis manager to connect to.");
return NULL;
}
// Check the analysis type using the event handlers connected to the analysis manager.
//==============================================================================
if (!mgr->GetInputEventHandler())
{
::Error("AliAnalysisTaskSpectraAllChAOD", "This task requires an input event handler");
return NULL;
}
TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
if(type.Contains("ESD"))
{
::Error("AliAnalysisTaskSpectraAllChAOD", "This task requires to run on AOD");
return NULL;
}
AliSpectraAODTrackCuts * trcuts = new AliSpectraAODTrackCuts(Form("TrackCuts%s",opt.Data()));
trcuts->SetDCA(DCA);
trcuts->SetTrackBits(trkbit);
trcuts->SetPt(pt);
trcuts->SetPtTOFMatching(ptTofMatch);
trcuts->SetEta(EtaMin,EtaMax);
trcuts->SetMinTPCcls(minNclsTPC);
trcuts->PrintCuts();
AliSpectraAODEventCuts * evcuts = new AliSpectraAODEventCuts(Form("EventCuts%s",opt.Data()));
evcuts->SetQVectorCut(QvecCutMin,QvecCutMax);
evcuts->SetCentralityCutMax(CentCutMax);
evcuts->SetCentralityCutMin(CentCutMin);
if(mc==1)evcuts->SetIsMC(kTRUE);
evcuts->PrintCuts();
AliHelperPID *pid=new AliHelperPID();
pid->SetName(Form("HelperPID%s",opt.Data()));
pid->SetNSigmaCut(nsigmacut);
pid->SetPIDType(PIDtype);
if(PIDtype==3){
AliPIDCombined *pidc=new AliPIDCombined();
pidc->SetDefaultTPCPriors();
pid->SetPIDCombined(pidc);
}
AliAnalysisTaskSpectraAllChNanoAOD *task = new AliAnalysisTaskSpectraAllChNanoAOD(Form("TaskAODSpectraCent%.0fto%.0f_QVec%.1fto%.1f_Eta%.1fto%.1f_TrBit%d%s",
CentCutMin,
CentCutMax,
QvecCutMin,
QvecCutMax,
EtaMin,
EtaMax,
trkbit,
opt.Data()));
task->SetEventCuts(evcuts);
task->SetTrackCuts(trcuts);
task->SetHelperPID(pid);
if(mc==1)task->SetIsMC(kTRUE);
TString outputFileName = AliAnalysisManager::GetCommonFileName();
TString typeofdata=mc?"MC":"Data";
outputFileName += Form(":SpectraESE_%s%s",typeofdata.Data(),opt.Data());
cout<<"outputFileName: "<<outputFileName<<endl;
AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
AliAnalysisDataContainer *coutputpt1 = mgr->CreateContainer(Form("chist%s",opt.Data()), TList::Class(), AliAnalysisManager::kOutputContainer,outputFileName);
AliAnalysisDataContainer *coutputpt2 = mgr->CreateContainer(Form("cvcut%s",opt.Data()), AliSpectraAODEventCuts::Class(), AliAnalysisManager::kOutputContainer,outputFileName);
AliAnalysisDataContainer *coutputpt3 = mgr->CreateContainer(Form("ctcut%s",opt.Data()), AliSpectraAODTrackCuts::Class(), AliAnalysisManager::kOutputContainer, outputFileName);
AliAnalysisDataContainer *coutputpt4 = mgr->CreateContainer(Form("cpid%s",opt.Data()), AliHelperPID::Class(), AliAnalysisManager::kOutputContainer, outputFileName);
mgr->AddTask(task);
mgr->ConnectInput(task, 0, cinput);
mgr->ConnectOutput(task, 1, coutputpt1);
mgr->ConnectOutput(task, 2, coutputpt2);
mgr->ConnectOutput(task, 3, coutputpt3);
mgr->ConnectOutput(task, 4, coutputpt4);
return task;
}
AddTaskSpectraAllChNanoAOD.C:1 AddTaskSpectraAllChNanoAOD.C:2 AddTaskSpectraAllChNanoAOD.C:3 AddTaskSpectraAllChNanoAOD.C:4 AddTaskSpectraAllChNanoAOD.C:5 AddTaskSpectraAllChNanoAOD.C:6 AddTaskSpectraAllChNanoAOD.C:7 AddTaskSpectraAllChNanoAOD.C:8 AddTaskSpectraAllChNanoAOD.C:9 AddTaskSpectraAllChNanoAOD.C:10 AddTaskSpectraAllChNanoAOD.C:11 AddTaskSpectraAllChNanoAOD.C:12 AddTaskSpectraAllChNanoAOD.C:13 AddTaskSpectraAllChNanoAOD.C:14 AddTaskSpectraAllChNanoAOD.C:15 AddTaskSpectraAllChNanoAOD.C:16 AddTaskSpectraAllChNanoAOD.C:17 AddTaskSpectraAllChNanoAOD.C:18 AddTaskSpectraAllChNanoAOD.C:19 AddTaskSpectraAllChNanoAOD.C:20 AddTaskSpectraAllChNanoAOD.C:21 AddTaskSpectraAllChNanoAOD.C:22 AddTaskSpectraAllChNanoAOD.C:23 AddTaskSpectraAllChNanoAOD.C:24 AddTaskSpectraAllChNanoAOD.C:25 AddTaskSpectraAllChNanoAOD.C:26 AddTaskSpectraAllChNanoAOD.C:27 AddTaskSpectraAllChNanoAOD.C:28 AddTaskSpectraAllChNanoAOD.C:29 AddTaskSpectraAllChNanoAOD.C:30 AddTaskSpectraAllChNanoAOD.C:31 AddTaskSpectraAllChNanoAOD.C:32 AddTaskSpectraAllChNanoAOD.C:33 AddTaskSpectraAllChNanoAOD.C:34 AddTaskSpectraAllChNanoAOD.C:35 AddTaskSpectraAllChNanoAOD.C:36 AddTaskSpectraAllChNanoAOD.C:37 AddTaskSpectraAllChNanoAOD.C:38 AddTaskSpectraAllChNanoAOD.C:39 AddTaskSpectraAllChNanoAOD.C:40 AddTaskSpectraAllChNanoAOD.C:41 AddTaskSpectraAllChNanoAOD.C:42 AddTaskSpectraAllChNanoAOD.C:43 AddTaskSpectraAllChNanoAOD.C:44 AddTaskSpectraAllChNanoAOD.C:45 AddTaskSpectraAllChNanoAOD.C:46 AddTaskSpectraAllChNanoAOD.C:47 AddTaskSpectraAllChNanoAOD.C:48 AddTaskSpectraAllChNanoAOD.C:49 AddTaskSpectraAllChNanoAOD.C:50 AddTaskSpectraAllChNanoAOD.C:51 AddTaskSpectraAllChNanoAOD.C:52 AddTaskSpectraAllChNanoAOD.C:53 AddTaskSpectraAllChNanoAOD.C:54 AddTaskSpectraAllChNanoAOD.C:55 AddTaskSpectraAllChNanoAOD.C:56 AddTaskSpectraAllChNanoAOD.C:57 AddTaskSpectraAllChNanoAOD.C:58 AddTaskSpectraAllChNanoAOD.C:59 AddTaskSpectraAllChNanoAOD.C:60 AddTaskSpectraAllChNanoAOD.C:61 AddTaskSpectraAllChNanoAOD.C:62 AddTaskSpectraAllChNanoAOD.C:63 AddTaskSpectraAllChNanoAOD.C:64 AddTaskSpectraAllChNanoAOD.C:65 AddTaskSpectraAllChNanoAOD.C:66 AddTaskSpectraAllChNanoAOD.C:67 AddTaskSpectraAllChNanoAOD.C:68 AddTaskSpectraAllChNanoAOD.C:69 AddTaskSpectraAllChNanoAOD.C:70 AddTaskSpectraAllChNanoAOD.C:71 AddTaskSpectraAllChNanoAOD.C:72 AddTaskSpectraAllChNanoAOD.C:73 AddTaskSpectraAllChNanoAOD.C:74 AddTaskSpectraAllChNanoAOD.C:75 AddTaskSpectraAllChNanoAOD.C:76 AddTaskSpectraAllChNanoAOD.C:77 AddTaskSpectraAllChNanoAOD.C:78 AddTaskSpectraAllChNanoAOD.C:79 AddTaskSpectraAllChNanoAOD.C:80 AddTaskSpectraAllChNanoAOD.C:81 AddTaskSpectraAllChNanoAOD.C:82 AddTaskSpectraAllChNanoAOD.C:83 AddTaskSpectraAllChNanoAOD.C:84 AddTaskSpectraAllChNanoAOD.C:85 AddTaskSpectraAllChNanoAOD.C:86 AddTaskSpectraAllChNanoAOD.C:87 AddTaskSpectraAllChNanoAOD.C:88 AddTaskSpectraAllChNanoAOD.C:89 AddTaskSpectraAllChNanoAOD.C:90 AddTaskSpectraAllChNanoAOD.C:91 AddTaskSpectraAllChNanoAOD.C:92 AddTaskSpectraAllChNanoAOD.C:93 AddTaskSpectraAllChNanoAOD.C:94 AddTaskSpectraAllChNanoAOD.C:95 AddTaskSpectraAllChNanoAOD.C:96 AddTaskSpectraAllChNanoAOD.C:97 AddTaskSpectraAllChNanoAOD.C:98 AddTaskSpectraAllChNanoAOD.C:99 AddTaskSpectraAllChNanoAOD.C:100 AddTaskSpectraAllChNanoAOD.C:101 AddTaskSpectraAllChNanoAOD.C:102