本文整理汇总了C++中AliAnalysisManager::GetCommonInputContainer方法的典型用法代码示例。如果您正苦于以下问题:C++ AliAnalysisManager::GetCommonInputContainer方法的具体用法?C++ AliAnalysisManager::GetCommonInputContainer怎么用?C++ AliAnalysisManager::GetCommonInputContainer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AliAnalysisManager
的用法示例。
在下文中一共展示了AliAnalysisManager::GetCommonInputContainer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AliAnalysisTaskFilterFriend
AliAnalysisTaskFilterFriend *AddTaskFilterFriend()
{
// pointer to the analysis manager
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
Error("AddTaskTOFCalib", "No analysis manager to connect to.");
return NULL;
}
// check the input handler
if (!mgr->GetInputEventHandler()) {
::Error("AddTask", "This task requires an input event handler");
return NULL;
}
TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
// create the task
AliAnalysisTaskFilterFriend* filter = new AliAnalysisTaskFilterFriend("filter_1");
mgr->AddTask(filter);
// connecting the input/output containers
AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer();
AliAnalysisDataContainer *coutput0 = mgr->GetCommonOutputContainer();
mgr->ConnectInput (filter, 0, cinput0 );
//mgr->ConnectOutput(filter, 0, coutput0);
return filter;
}
示例2:
AliAnalysisTask *AddEventMixingTestTask(TString format = "esd", Bool_t useMC = kFALSE,TString postfix="")
{
// create manager
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) mgr = new AliAnalysisManager("MIX test");
// create our task
AliAnalysisTaskEx02 *task = new AliAnalysisTaskEx02("AliAnalysisTaskEx02");
// create output container
AliAnalysisDataContainer *output1 = mgr->CreateContainer("cEx2", TList::Class(), AliAnalysisManager::kOutputContainer, "MixTestOutput.root");
// add our task to the manager
mgr->AddTask(task);
// finaly connect input and output
mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
mgr->ConnectOutput(task, 1, output1);
// Option for test (only experts)
// task->SetLoopInUserExecMix(kTRUE);
// task->SetUseLoopMixedEvent(kTRUE);
// task->SetLoopV0(kTRUE);
return task;
}
示例3: AddTaskPHOSEpRatio
AliAnalysisTaskEpRatio* AddTaskPHOSEpRatio (Bool_t kMC = kFALSE,
const char* name = "PHOSEpRatio",
const char* options = "",
UInt_t offlineTriggerMask = AliVEvent::kINT7 )
{
//Add a task AliAnalysisTaskEpRatio to the analysis train.
//Author: Boris Polishchuk.
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
::Error("AddTaskPHOSEpRatio", "No analysis manager to connect to");
return NULL;
}
if (!mgr->GetInputEventHandler()) {
::Error("AddTaskPHOSEpRatio", "This task requires an input event handler");
return NULL;
}
AliAnalysisTaskEpRatio* task = new AliAnalysisTaskEpRatio(Form("%sTask", name));
if(!kMC) task->SelectCollisionCandidates(offlineTriggerMask);
mgr->AddTask(task);
mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer() );
TString cname(Form("%sCoutput1", name));
TString pname(Form("%s:%s", AliAnalysisManager::GetCommonFileName(), name));
AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(cname.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, pname.Data());
mgr->ConnectOutput(task, 1, coutput1);
return task;
}
示例4: Error
AliAnalysisTaskADQA *AddTaskADQA(){
//--- get the current analysis manager ---//
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
Error("AddTask_ADQA", "No analysis manager found.");
return 0;
}
// Check the analysis type using the event handlers connected to the analysis manager.
//==============================================================================
if (!mgr->GetInputEventHandler()) {
Error("AddTask_ADQA", "This task requires an input event handler");
return 0;
}
// Create tasks
AliAnalysisTaskADQA *task = new AliAnalysisTaskADQA("ESD");
mgr->AddTask(task);
// Create containers for input/output
AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
AliAnalysisDataContainer *coutput = mgr->CreateContainer("ADQAListHist", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:ADQA", AliAnalysisManager::GetCommonFileName()));
// Connect input/output
mgr->ConnectInput(task, 0, cinput);
mgr->ConnectOutput(task, 1, coutput);
return task;
}
示例5: AddTaskADCalib
AliAnalysisTaskADCalib* AddTaskADCalib(Int_t bcExtrapolationMin=9,
Int_t bcExtrapolationMax=15) {
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
Error("AddTask_ADCalib", "No analysis manager found.");
return NULL;
}
if (!mgr->GetInputEventHandler()) {
Error("AddTask_ADCalib", "This task requires an input event handler");
return 0;
}
AliAnalysisTaskADCalib *task = new AliAnalysisTaskADCalib();
task->SetBCRangeExtrapolation(bcExtrapolationMin, bcExtrapolationMax);
mgr->AddTask(task);
// Create containers for input/output
AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
AliAnalysisDataContainer *coutput = mgr->CreateContainer("ADCalibListHist",
TList::Class(),
AliAnalysisManager::kOutputContainer,
Form("%s:ADCalib", AliAnalysisManager::GetCommonFileName()));
// Connect input/output
mgr->ConnectInput (task, 0, cinput);
mgr->ConnectOutput(task, 1, coutput);
return task;
}
示例6: AliJEfficiencyTask
//_____________________________________________________________________
AliAnalysisTask *AddTaskJCORRANEfficiency(TString taskName, int fTriggerMask){
// Load Custom Configuration and parameters
// override values with parameters
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
//==== JCORRAN Efficiency TASK
AliJEfficiencyTask *jefftask = new AliJEfficiencyTask(taskName.Data(),"JOD");
jefftask->SetDebugLevel(0);
jefftask->SetFilterTaskName("PWGCFJCORRANTask");
AliJEfficiencyScanner *fEffScanner;
fEffScanner = new AliJEfficiencyScanner("EfficiencyScanner");
fEffScanner->SetMBTriggMask( fTriggerMask );
jefftask->SetJEfficiencyScanner( fEffScanner );
mgr->AddTask((AliAnalysisTask*) jefftask);
// Create containers for input/output
AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
// Connect input/output
mgr->ConnectInput(jefftask, 0, cinput);
// Connect input/output
AliAnalysisDataContainer *effHist = mgr->CreateContainer(Form("%scontainer",jefftask->GetName()), TDirectory::Class(), AliAnalysisManager::kOutputContainer, Form("%s:%s",AliAnalysisManager::GetCommonFileName(), jefftask->GetName()));
mgr->ConnectOutput(jefftask, 1, effHist );
return jefftask;
}
示例7: AliAnalysisTaskMuonAODCreation
AliAnalysisTaskMuonAODCreation *AddTaskMuonAODCreation()
{
// Creates a filter task to copy muon tracks from the Standard AOD to the Muon AOD
// R. Arnaldi - 6/10/09
// Get the pointer to the existing analysis manager via the static access method.
//==============================================================================
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
::Error("AddTaskMuonAODCreation", "No analysis manager to connect to.");
return NULL;
}
// Get input handler
TString type = mgr->GetInputEventHandler()->GetDataType();
// Define output
AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("chist0",TList::Class(),AliAnalysisManager::kOutputContainer,"MuonPlots.root");
// Create the task, add it to the manager and configure it.
//===========================================================================
AliAnalysisTaskMuonAODCreation *muonAODtask = new AliAnalysisTaskMuonAODCreation("Muon AOD creation");
mgr->AddTask(muonAODtask);
// Create ONLY the output containers for the data produced by the task.
// Get and connect other common input/output containers via the manager as below
//==============================================================================
mgr->ConnectInput (muonAODtask, 0, mgr->GetCommonInputContainer());
mgr->ConnectOutput (muonAODtask, 0, mgr->GetCommonOutputContainer());
mgr->ConnectOutput (muonAODtask, 1, coutput1);
return muonAODtask;
}
示例8: Printf
AliAnalysisTaskStrangenessVsMultiplicityMC *AddTaskStrangenessVsMultiplicityMC( Bool_t lSaveV0 = kFALSE, Bool_t lSaveCascade = kTRUE, const TString lMasterJobSessionFlag = "")
{
// Creates, configures and attaches to the train a cascades check task.
// Get the pointer to the existing analysis manager via the static access method.
//==============================================================================
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
::Error("AddTaskStrangenessVsMultiplicity", "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("AddTaskStrangenessVsMultiplicity", "This task requires an input event handler");
return NULL;
}
TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
// Create and configure the task
AliAnalysisTaskStrangenessVsMultiplicityMC *taskAuxiliary = new AliAnalysisTaskStrangenessVsMultiplicityMC("taskAuxiliary");
mgr->AddTask(taskAuxiliary);
TString outputFileName = AliAnalysisManager::GetCommonFileName();
outputFileName += ":PWGLF_StrVsMult";
if (mgr->GetMCtruthEventHandler()) outputFileName += "_MC";
Printf("Set OutputFileName : \n %s\n", outputFileName.Data() );
AliAnalysisDataContainer *coutputList = mgr->CreateContainer("cList",
TList::Class(),
AliAnalysisManager::kOutputContainer,
outputFileName );
AliAnalysisDataContainer *coutputTree = mgr->CreateContainer("cTreeEvent",
TTree::Class(),
AliAnalysisManager::kOutputContainer,
outputFileName );
AliAnalysisDataContainer *coutputTreeV0 = mgr->CreateContainer("cTreeV0",
TTree::Class(),
AliAnalysisManager::kOutputContainer,
outputFileName );
AliAnalysisDataContainer *coutputTreeCascade = mgr->CreateContainer("cTreeCascade",
TTree::Class(),
AliAnalysisManager::kOutputContainer,
outputFileName );
//This one you should merge in file-resident ways...
coutputTree->SetSpecialOutput();
coutputTreeV0->SetSpecialOutput();
coutputTreeCascade->SetSpecialOutput();
//Recommendation: Tree as a single output slot
mgr->ConnectInput (taskAuxiliary, 0, mgr->GetCommonInputContainer());
mgr->ConnectOutput(taskAuxiliary, 1, coutputList);
mgr->ConnectOutput(taskAuxiliary, 2, coutputTree);
mgr->ConnectOutput(taskAuxiliary, 3, coutputTreeV0);
mgr->ConnectOutput(taskAuxiliary, 4, coutputTreeCascade);
return taskAuxiliary;
}
示例9: AddClusterSelectionTask
void AddClusterSelectionTask(TString name = "ClusterSelectionTask")
{
gSystem->AddIncludePath("-I$ALICE_ROOT/include");
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
::Error("AddTaskPHOSPi0Flow", "No analysis manager to connect to");
return NULL;
}
if (!mgr->GetInputEventHandler()) {
::Error("AddTaskPHOSPi0Flow", "This task requires an input event handler");
return NULL;
}
gROOT->LoadMacro("ClusterSelectionTask.cxx+g");
ClusterSelectionTask * task = new ClusterSelectionTask(name);
mgr->AddTask(task);
mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer() );
TString cname(Form("HistList", name));
TString pname(Form("%s:%s", AliAnalysisManager::GetCommonFileName(), name));
AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(cname.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, pname.Data());
mgr->ConnectOutput(task, 1, coutput1);
cname = Form("SelectedPhotons", name);
AliAnalysisDataContainer *cexchange2 = mgr->CreateContainer(cname.Data(), TList::Class(), AliAnalysisManager::kExchangeContainer, pname.Data());
mgr->ConnectOutput(task, 2, cexchange2);
return task;
}
示例10: AliAnalysisTaskPIDCORR
AliAnalysisTaskPIDCORR *AddTaskPIDCORR()
{
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
return NULL;
}
AliAnalysisTaskPIDCORR* task = new AliAnalysisTaskPIDCORR("PIDCORR_pp7TeV");
mgr->AddTask(task);
TString outputFileName = AliAnalysisManager::GetCommonFileName();
AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
AliAnalysisDataContainer *coutput = mgr->CreateContainer("PIDCORR_pp7TeV", TList::Class(), AliAnalysisManager::kOutputContainer, outputFileName.Data());
outputFileName.Data()
// connect input/output
mgr->ConnectInput(task, 0, cinput);
mgr->ConnectOutput(task, 1, coutput);
return task;
}
示例11: printf
AliAnalysisTaskSEF01710fromAODtracks *AddTaskF01710fromAODtracks(
Int_t antype = 0,
Bool_t theMCon=kFALSE,
Bool_t writeVariableTree=kFALSE,
Int_t nTour=0
)
{
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
::Error("AddTaskLc2V0YW", "No analysis manager to connect to.");
return NULL;
}
//CREATE THE TASK
printf("CREATE TASK\n");
AliAnalysisTaskSEF01710fromAODtracks *task = new AliAnalysisTaskSEF01710fromAODtracks("AliAnalysisTaskSEF01710fromAODtracks",writeVariableTree);
task->SetMC(theMCon);
task->SetDebugLevel(1);
task->SetAnalysisType(antype);
if(antype==2 || antype == 3){
task->SetProdV0DaughterDcaToPrimVertex(0.1);
task->SetProdRfidMinV0(5.);
}
task->SetEventMixingWithPools();
//task->SetEventMixingOff();
Double_t pvzbinlimits[] = {-12,-10,-8,-6,-4,-2,0,2,4,6,8,10,12};
Int_t pvzbinnumb = sizeof(pvzbinlimits)/sizeof(Double_t) - 1;
task->SetPoolPVzBinLimits(pvzbinnumb,pvzbinlimits);
Double_t cent_mult_binlimitspp[] = { 0,100};
Int_t cent_mult_bin_numbpp = sizeof(cent_mult_binlimitspp)/sizeof(Double_t) - 1;
task->SetPoolCentBinLimits(cent_mult_bin_numbpp,cent_mult_binlimitspp);
task->SetNumberOfEventsForMixing(10);//pp
mgr->AddTask(task);
// Create and connect containers for input/output
TString outputfile = AliAnalysisManager::GetCommonFileName();
outputfile += ":PWGLF_RES_F01710_";
outputfile += nTour;
mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
// ----- output data -----
AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(Form("f0hist%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // general histos
mgr->ConnectOutput(task,1,coutput1);
AliAnalysisDataContainer *coutputL2 = mgr->CreateContainer(Form("F0variables%1d",nTour),TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());
mgr->ConnectOutput(task,2,coutputL2);
AliAnalysisDataContainer *coutputL3 = mgr->CreateContainer(Form("F0All%1d",nTour),TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); // general histos
mgr->ConnectOutput(task,3,coutputL3);
return task;
}
示例12: Error
AliAnalysisTaskFemto *AddTaskFemto(const char *configMacroName="ConfigFemtoAnalysis.C", const char *configMacroParameters="" )
{
// Creates a proton analysis task and adds it to the analysis manager.
// A. Get the pointer to the existing analysis manager via the static access method.
//==============================================================================
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
Error("AddTaskFemto", "No analysis manager to connect to.");
return NULL;
}
// B. Check the analysis type using the event handlers connected to the analysis
// manager. The availability of MC handler cann also be checked here.
//==============================================================================
if (!mgr->GetInputEventHandler()) {
::Error("AddTaskFemto", "This task requires an input event handler");
return NULL;
}
TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
cout << "Found " <<type << " event handler" << endl;
// C. Create the task, add it to manager.
//===========================================================================
// gSystem->SetIncludePath("-I$ROOTSYS/include -I./PWG2AOD/AOD -I./PWG2femtoscopy/FEMTOSCOPY/AliFemto -I./PWG2femtoscopyUser/FEMTOSCOPY/AliFemtoUser -I$ALICE_PHYSICS/include");
if (TProofMgr::GetListOfManagers()->GetEntries()) {
// if (dynamic_cast<TProofLite *> gProof) {
// char *macrocommand[10000];
// sprintf(macrocommand, ".L %s", configMacroName);
// gProof->Exec(macrocommand);
// }
// else
gProof->Load(configMacroName);
}
// gROOT->LoadMacro("ConfigFemtoAnalysis.C++");
AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto",configMacroName,configMacroParameters);
mgr->AddTask(taskfemto);
// D. Configure the analysis task. Extra parameters can be used via optional
// arguments of the AddTaskXXX() function.
//===========================================================================
// E. Create ONLY the output containers for the data produced by the task.
// Get and connect other common input/output containers via the manager as below
//==============================================================================
TString outputfile = AliAnalysisManager::GetCommonFileName();
outputfile += ":PWGCFEMTO_PLam";
AliAnalysisDataContainer *cout_femto = mgr->CreateContainer("femtolist_PLam", TList::Class(),
AliAnalysisManager::kOutputContainer,outputfile);
mgr->ConnectInput(taskfemto, 0, mgr->GetCommonInputContainer());
mgr->ConnectOutput(taskfemto, 0, cout_femto);
// Return task pointer at the end
return taskfemto;
}
示例13: AddTaskPsEfficiency
AliAnalysisTaskPsEfficiency* AddTaskPsEfficiency(bool isMC=true,TString suffix = ""){
// Creates, configures and attaches to the train the task for pi, K , p spectra
// with ITS standalone tracks
// Get the pointer to the existing analysis manager via the static access method.
//==============================================================================
::Info("AddTaskPsEfficiency","Adding a new task with this settings isMC = %i",isMC);
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
::Error("AddTaskPsEfficiency", "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("AddTaskPsEfficiency", "This task requires an input event handler");
return NULL;
}
TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
if(type.Contains("ESD")){
::Error("AddTaskPsEfficiency", "This task requires to run on AOD");
return NULL;
}
// Add MC handler (for kinematics)
if(isMC){
AliMCEventHandler* handler = new AliMCEventHandler;
handler->SetReadTR(kFALSE);
mgr->SetMCtruthEventHandler(handler);
}
// Create and configure the task
TString tskname = "Pentaquark";
tskname.Append(Form("%s",suffix.Data()));
AliAnalysisTaskPsEfficiency *taskPs = new AliAnalysisTaskPsEfficiency(tskname);
//taskPs->SetMC(isMC);
mgr->AddTask(taskPs);
// Create ONLY the output containers for the data produced by the task.
// Get and connect other common input/output containers via the manager as below
//==============================================================================
TString outputFileName = AliAnalysisManager::GetCommonFileName();
outputFileName += ":AODpentaquark";
AliAnalysisDataContainer *coutput =0x0;
coutput = mgr->CreateContainer(Form("lbariogl_%s",tskname.Data()),
TList::Class(),
AliAnalysisManager::kOutputContainer,
AliAnalysisManager::GetCommonFileName());
mgr->ConnectInput(taskPs, 0, mgr->GetCommonInputContainer());
mgr->ConnectOutput(taskPs, 1, coutput);
return taskPs;
}
示例14: runProofFwdDetsQA
void runProofFwdDetsQA(const char * dataset = "/COMMON/COMMON/LHC09a4_run8101X",Long64_t nentries=100000, Long64_t firstentry=0)
{
gSystem->Load("libANALYSIS");
gSystem->Load("libANALYSISalice");
gSystem->AddIncludePath("-I$ALICE_ROOT/include");
// Connect to Proof
gEnv->SetValue("XSec.GSI.DelegProxy","2");
TProof::Open("cheshkov:[email protected]");
// Upload and enable packages: please use the correct version!
gProof->UploadPackage("/afs/cern.ch/alice/caf/sw/ALICE/PARs/v4-16-Release/AF-v4-16");
gProof->EnablePackage("/afs/cern.ch/alice/caf/sw/ALICE/PARs/v4-16-Release/AF-v4-16");
// Create the analysis manager
AliAnalysisManager *mgr = new AliAnalysisManager("AliAnaFwdDetsQA");
AliVEventHandler* esdH = new AliESDInputHandler();
mgr->SetInputEventHandler(esdH);
// Enable MC event handler
AliVEventHandler* handler = new AliMCEventHandler;
mgr->SetMCtruthEventHandler(handler);
// Create task
gProof->Load(Form("%s/PWGPP/AliAnaFwdDetsQA.cxx++g",
gSystem->Getenv("ALICE_ROOT")));
AliAnalysisTask *task = new AliAnaFwdDetsQA("AliAnaFwdDetsQA");
// Add task
mgr->AddTask(task);
// Create containers for input/output
AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
AliAnalysisDataContainer *coutput =
mgr->CreateContainer("coutput", TList::Class(),
AliAnalysisManager::kOutputContainer, "FwdDetsQA.root");
// Connect input/output
mgr->ConnectInput(task, 0, cinput);
mgr->ConnectOutput(task, 1, coutput);
// Enable debug printouts
mgr->SetDebugLevel(3);
if (!mgr->InitAnalysis())
return;
mgr->PrintStatus();
TFileCollection *proofColl = gProof->GetDataSet(dataset);
TChain *chain = new TChain("esdTree");
chain->AddFileInfoList((TCollection*)(proofColl->GetList()));
mgr->StartAnalysis("proof", chain, nentries, firstentry);
// mgr->StartAnalysis("proof",dataset,nentries,firstentry);
}
示例15: RunLinkToMCAnalysisExample
void RunLinkToMCAnalysisExample(const char* esdFile = "./AliESDs.root")
{
// Load needed libraries
gSystem->Load("libTree");
gSystem->Load("libGeom");
gSystem->Load("libVMC");
gSystem->Load("libPhysics");
gSystem->Load("libSTEERBase");
gSystem->Load("libESD");
gSystem->Load("libAOD");
gSystem->Load("libANALYSIS");
gSystem->Load("libANALYSISalice");
gSystem->Load("libPWGHFbase");
gSystem->Load("libPWGmuon");
// Create the TChain for esdTrees in the AliESDs.root file.
TChain* chain = new TChain("esdTree");
chain->Add(esdFile);
if (!chain) return;
// Create the analysis manager and event handlers.
AliAnalysisManager* mgr = new AliAnalysisManager("Analysis Train", "An example analysis train setup for AliAnalysisTaskLinkToMC.");
AliESDInputHandler* esdHandler = new AliESDInputHandler();
mgr->SetInputEventHandler(esdHandler);
AliMCEventHandler* mcHandler = new AliMCEventHandler();
mgr->SetMCtruthEventHandler(mcHandler);
mcHandler->SetReadTR(kTRUE);
AliAODHandler* aodHandler = new AliAODHandler();
mgr->SetOutputEventHandler(aodHandler);
aodHandler->SetOutputFileName("AliAOD.root");
// Create the analysis task and setup the parameters.
AliAnalysisTaskLinkToMC* linktask = new AliAnalysisTaskLinkToMC("Task to link ESD tracks to corresponding MC tracks.");
linktask->MinClusters(6);
linktask->HardCutLimitX(4);
linktask->HardCutLimitY(4);
linktask->SigmaCut(5.);
linktask->MinClustersInSt45(3);
linktask->StationMustMatch(1, true); // At least one cluster in station 1 must match.
linktask->StationMustMatch(2, true); // At least one cluster in station 2 must match.
linktask->StationMustMatch(3, true); // At least one cluster in station 3 must match.
linktask->GenerateHistograms(true);
mgr->AddTask(linktask);
// Create the input and output containers and connect them up to the analysis task.
AliAnalysisDataContainer* cinEsd = mgr->GetCommonInputContainer();
AliAnalysisDataContainer* coutAod = mgr->GetCommonOutputContainer();
AliAnalysisDataContainer* coutHists = mgr->CreateContainer("cHists", TList::Class(), AliAnalysisManager::kOutputContainer, "hists.root");
mgr->ConnectInput(linktask, 0, cinEsd);
mgr->ConnectOutput(linktask, 0, coutAod);
mgr->ConnectOutput(linktask, 1, coutHists);
if (mgr->InitAnalysis())
{
mgr->PrintStatus();
mgr->StartAnalysis("local", chain);
}
}