当前位置: 首页>>代码示例>>C++>>正文


C++ AliAnalysisManager::SetEventPool方法代码示例

本文整理汇总了C++中AliAnalysisManager::SetEventPool方法的典型用法代码示例。如果您正苦于以下问题:C++ AliAnalysisManager::SetEventPool方法的具体用法?C++ AliAnalysisManager::SetEventPool怎么用?C++ AliAnalysisManager::SetEventPool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AliAnalysisManager的用法示例。


在下文中一共展示了AliAnalysisManager::SetEventPool方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: anaM

//________________________
/// Main execution method.
//________________________
void anaM()
{
  // Main
  //--------------------------------------------------------------------
  // Load analysis libraries
  // Look at the method below, 
  // change whatever you need for your analysis case
  // ------------------------------------------------------------------
  LoadLibraries() ;
  
  //-------------------------------------------------------------------------------------------------
  // Create chain from ESD and from cross sections files, look below for options.
  //------------------------------------------------------------------------------------------------- 
  if(kInputData == "ESD") kTreeName = "esdTree" ;
  else if(kInputData == "AOD") kTreeName = "aodTree" ;
  else if (kInputData == "MC") kTreeName = "TE" ;
  else {
    cout<<"Wrong  data type "<<kInputData<<endl;
    break;
  }
  
  TChain * chain   = new TChain(kTreeName) ;
  
  CreateChain(mode, chain);//, chainxs);
  cout<<"Chain created"<<endl;
  
  if( chain )
  {
    AliLog::SetGlobalLogLevel(AliLog::kError);//Minimum prints on screen
    
    //--------------------------------------
    // Make the analysis manager
    //-------------------------------------
    AliAnalysisManager *mgr  = new AliAnalysisManager("Manager", "Manager");
    // MC handler
    if( (kMC && (kInputData == "ESD")) || kInputData == "MC"){
      AliMCEventHandler* mcHandler = new AliMCEventHandler();
      mcHandler->SetReadTR(kFALSE);//Do not search TrackRef file
      mgr->SetMCtruthEventHandler(mcHandler);
      if( kInputData == "MC") mgr->SetInputEventHandler(NULL);
    }
    
//    // AOD output handler
//    AliAODHandler* aodoutHandler   = new AliAODHandler();
//    aodoutHandler->SetOutputFileName("AliAOD.root");
//    mgr->SetOutputEventHandler(aodoutHandler);
    
    //input
    Int_t maxiterations = 1;
    AliEventPoolLoop* pool = new AliEventPoolLoop(maxiterations);
    pool->SetChain(chain);
    Int_t eventsInPool = 10;
    AliMultiEventInputHandler *inpHandler = NULL ; 
    if(kInputData == "ESD"){
      // ESD handler
      printf("ESD MultiInput \n");
      inpHandler = new AliMultiEventInputHandler(eventsInPool, 0);
    }
    if(kInputData == "AOD"){
      // AOD handler
      inpHandler = new AliMultiEventInputHandler(eventsInPool, 1);	   	  
    }
    mgr->SetInputEventHandler(inpHandler);
    cout<<"Input handler "<<mgr->GetInputEventHandler()<<endl;
    mgr->SetEventPool(pool);
    inpHandler->SetEventPool(pool);
    
    //mgr->SetDebugLevel(-1); // For debugging, do not uncomment if you want no messages.
    
    // select triigger events for physics run
    
//    if(!kMC){
//      gROOT->LoadMacro("AddTaskPhysicsSelection.C");
//      AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection();
//      mgr->AddTask(physSelTask);    
//    }
    
    //-------------------------------------------------------------------------
    //Define task, put here any other task that you want to use.
    //-------------------------------------------------------------------------
    
    //correlation analysis
    gROOT->LoadMacro("AddTaskCaloTrackCorrM.C");
    
    AliAnalysisTaskCaloTrackCorrelationM *taskEMCAL = AddTaskCaloTrackCorrM(kInputData,"EMCAL",kFALSE);

    mgr->AddTask(taskEMCAL);
    
    AliAnalysisTaskCaloTrackCorrelationM *taskPHOS  = AddTaskCaloTrackCorrM(kInputData,"PHOS", kFALSE);

    mgr->AddTask(taskPHOS);
    
    //gROOT->LoadMacro("AddTaskChargeCorr.C");
    AliAnalysisTaskCaloTrackCorrelationM *taskCharge  = AddTaskCaloTrackCorrM(kInputData, "CTS",kFALSE);
//    if(!kMC)
//      taskCharge->SelectCollisionCandidates();
    mgr->AddTask(taskCharge);
//.........这里部分代码省略.........
开发者ID:ktf,项目名称:AliPhysics,代码行数:101,代码来源:anaM.C


注:本文中的AliAnalysisManager::SetEventPool方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。