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


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

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


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

示例1: AddAnalysisTasks

//______________________________________________________________________________                                                           
void AddAnalysisTasks(const char *cdb_location)
{
  // Add all analysis task wagons to the train                                                                                               
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();                                                                     

  //
  // Tender and supplies. Needs to be called for every event.
  //
   AliAnalysisManager::SetCommonFileName("AODQA.root");
   if (useTender) {
      gROOT->LoadMacro("$ALICE_PHYSICS/ANALYSIS/TenderSupplies/AddTaskTender.C");
      // IF V0 tender needed, put kTRUE below
      AliAnalysisTaskSE *tender = AddTaskTender(useV0tender);
//      tender->SetDebugLevel(2);
   }
   
   // Clean Geometry: Ruben
//  gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/CalibMacros/commonMacros/CleanGeom.C++");
//  CleanGeom* clgmTask = new CleanGeom("cleanGeom");
//  mgr->AddTask(clgmTask);
//  AliAnalysisDataContainer *dummyInp = mgr->GetCommonInputContainer();
//  if (dummyInp) mgr->ConnectInput(clgmTask,0,dummyInp);  
 
   
   //
  // PIDResponse(JENS)
  //
  if (doPIDResponse) {
    gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C"); 
    AliAnalysisTaskPIDResponse *PIDResponse = AddTaskPIDResponse();
 //    PIDResponse->SetUserDataRecoPass(1);
//    PIDResponse->SelectCollisionCandidates(AliVEvent::kAny);
  }  
 
  //
  // PIDqa(JENS)
  //
  if (doPIDqa) {
    gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDqa.C");
    AliAnalysisTaskPIDqa *PIDQA = AddTaskPIDqa();
    PIDQA->SelectCollisionCandidates(AliVEvent::kAny);
  }  
  // CDB connection
  //
  if (doCDBconnect && !useTender) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/PilotTrain/AddTaskCDBconnect.C");
    AliTaskCDBconnect *taskCDB = AddTaskCDBconnect(cdb_location, 0 /*run_number*/);
    if (!taskCDB) return;
    AliCDBManager *cdb = AliCDBManager::Instance();
    cdb->SetDefaultStorage(cdb_location);
//    taskCDB->SetRunNumber(run_number);
  }    
 
   if (usePhysicsSelection) {
   // Physics selection task
      gROOT->LoadMacro("$ALICE_PHYSICS/OADB/macros/AddTaskPhysicsSelection.C");
      mgr->RegisterExtraFile("event_stat.root");
      AliPhysicsSelectionTask *physSelTask = AddTaskPhysicsSelection(useMC);
      mgr->AddStatisticsTask(AliVEvent::kAny);
   }
   

//Jacek
   if (iPWGPP) {
      gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/macros/AddTaskFilteredTree.C");
      AddTaskFilteredTree("FilterEvents_Trees.root");
   }   
   
   // Centrality 
   if (useCentrality) {
      if ( run_flag >= 1500 )
      {
        gROOT->LoadMacro("$ALICE_PHYSICS/OADB/COMMON/MULTIPLICITY/macros/AddTaskMultSelection.C");
        AliMultSelectionTask *taskMult = AddTaskMultSelection();
      }
      else
      {
        // old scheme is only valid for PbPb
        if ( iCollision == kPbPb )
        {
          gROOT->LoadMacro("$ALICE_PHYSICS/OADB/macros/AddTaskCentrality.C");
          AliCentralitySelectionTask *taskCentrality = AddTaskCentrality();
          //taskCentrality->SelectCollisionCandidates(AliVEvent::kAny);
        }
      }
   }
   
// --- PWGLF - Forward ([email protected]) -----------------------------
   if (iPWGLFForward && usePhysicsSelection) { 
        gROOT->LoadMacro("$ALICE_PHYSICS/PWGLF/FORWARD/analysis2/AddTaskForwardMult.C");
     UShort_t pwglfForwardSys = 0; // iCollision+1; // pp:1, PbPb:2, pPb:3
     UShort_t pwglfSNN        = 0;            // GeV, 0==unknown
     Short_t  pwglfField      = 0;
     AddTaskForwardMult(useMC && useTR,        // Need track-refs 
			pwglfForwardSys,       // Collision system
			pwglfSNN, 
			pwglfField);
        gROOT->LoadMacro("$ALICE_PHYSICS/PWGLF/FORWARD/analysis2/AddTaskCentralMult.C");
        AddTaskCentralMult(useMC, pwglfForwardSys, pwglfSNN, pwglfField);
//.........这里部分代码省略.........
开发者ID:preghenella,项目名称:AliDPG,代码行数:101,代码来源:AODtrain.C

示例2: QAtrainAOD

void QAtrainAOD(Bool_t isMC=kFALSE, Int_t iCollisionType=0){

  

  if(gSystem->Getenv("ALIEN_JDL_LPMINTERACTIONTYPE")){
    for (Int_t icoll = 0; icoll < kNSystem; icoll++)
      if (strcmp(gSystem->Getenv("ALIEN_JDL_LPMINTERACTIONTYPE"), CollisionSystem[icoll]) == 0){
        iCollisionType = icoll;
	break;
      }
  }
  printf("--------------------------------------\n");
  if(isMC) printf("Run the AOD QA train for Monte Carlo\n");
  else printf("Run the AOD QA train for data\n");
  printf("Collision System is %s\n",CollisionSystem[iCollisionType]);
  printf("--------------------------------------\n");
 
  UInt_t kTriggerMask =  AliVEvent::kINT7 | AliVEvent::kINT8;
  if(gSystem->Getenv("ALIEN_JDL_LPMANCHORYEAR"))
  {
    Int_t year = atoi(gSystem->Getenv("ALIEN_JDL_LPMANCHORYEAR"));
    if(year <= 2015) 
      kTriggerMask = AliVEvent::kAnyINT;
  }
  // Create manager
  AliAnalysisManager *mgr  = new AliAnalysisManager("QAtrainAOD", "AOD QA train");
  mgr->SetCacheSize(0);
  mgr->SetCommonFileName("QAresults_AOD.root");

  // Input handler
  AliESDInputHandlerRP *esdHandler = new AliESDInputHandlerRP();
  AliAODInputHandler* aodHandler = new AliAODInputHandler();
  mgr->SetInputEventHandler(aodHandler);
  if(isMC){
    AliMCEventHandler* MChandler = new AliMCEventHandler;
    MChandler->SetReadTR(kFALSE);
    mgr->SetMCtruthEventHandler(MChandler);      
  }
  TString macroName="";

  // Physics selection
  gROOT->LoadMacro("$ALICE_PHYSICS/OADB/macros/AddTaskPhysicsSelection.C");
  AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(isMC);
  mgr->AddStatisticsTask(kTriggerMask);
  AliAnalysisDataContainer *cstatsout = (AliAnalysisDataContainer*)mgr->GetOutputs()->FindObject("cstatsout");
  cstatsout->SetFileName("EventStat_temp_AOD.root");

  // PID response
  gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
  AliAnalysisTaskSE *setupTask = AddTaskPIDResponse(isMC);
  
  // PIDqa
  gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDqa.C");
  AliAnalysisTaskPIDqa *PIDQA = AddTaskPIDqa();
  PIDQA->SelectCollisionCandidates(AliVEvent::kAny);

  // MultSelection
  gROOT->LoadMacro("$ALICE_PHYSICS/OADB/COMMON/MULTIPLICITY/macros/AddTaskMultSelection.C");
  AliMultSelectionTask *taskMult = AddTaskMultSelection();
  if(isMC){
    if (gSystem->Getenv("CONFIG_PERIOD")){
      TString periodName = gSystem->Getenv("CONFIG_PERIOD");
      taskMult->SetAlternateOADBforEstimators(periodName);
    }
  }
  // Vertex QA
  macroName="$ALICE_PHYSICS/PWGPP/macros/AddTaskCheckVertexAOD.C";
  if(gSystem->Exec(Form("ls %s > /dev/null 2>&1",macroName.Data()))==0){
    gROOT->LoadMacro(macroName.Data());
    Double_t maxMult=500.;
    if(iCollisionType==kPbPb || iCollisionType==kXeXe) maxMult=10000.;
    AliAnalysisTaskCheckVertexAOD *taskVert =  AddTaskCheckVertexAOD("QA",maxMult,AliVEvent::kAnyINT,isMC);
  }else{
    printf("Macro %s not found -> task will not be executed\n",macroName.Data());
  }

  // Track QA
  macroName="$ALICE_PHYSICS/PWGPP/macros/AddTaskCheckAODTracks.C";
  if(gSystem->Exec(Form("ls %s > /dev/null 2>&1",macroName.Data()))==0){
    gROOT->LoadMacro(macroName.Data());
    Bool_t usMCtruthForPID=isMC;
    AliAnalysisTaskCheckAODTracks* taskAODtr = AddTaskCheckAODTracks("QA",isMC,usMCtruthForPID);
    if(iCollisionType==kPbPb || iCollisionType==kXeXe) taskAODtr->SetUpperMultiplicity(10000.);
  }else{
    printf("Macro %s not found -> task will not be executed\n",macroName.Data());
  }


  // HF deltaAOD QA
  macroName="$ALICE_PHYSICS/PWGHF/vertexingHF/macros/AddTaskBasicHFQA.C";
  if(gSystem->Exec(Form("ls %s > /dev/null 2>&1",macroName.Data()))==0){
    gROOT->LoadMacro(macroName.Data());
    AliAnalysisTaskSEHFQA* dqaHF = AddTaskBasicHFQA(AliAnalysisTaskSEHFQA::kD0toKpi,isMC,"QA");
  }else{
    printf("Macro %s not found -> task will not be executed\n",macroName.Data());
  }

  if(isMC){
    macroName="$ALICE_PHYSICS/PWGHF/vertexingHF/macros/AddTaskDmesonMCPerform.C";
    if(gSystem->Exec(Form("ls %s > /dev/null 2>&1",macroName.Data()))==0){
//.........这里部分代码省略.........
开发者ID:preghenella,项目名称:AliDPG,代码行数:101,代码来源:QAtrainAOD.C

示例3: AddAnalysisTasks

void AddAnalysisTasks(const char *cdb_location)
{
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  mgr->SetCommonFileName("QAresults.root");
  // Statistics task
  mgr->AddStatisticsTask(kTriggerMask);
  //
  // CDB connection
  //
  if (doCDBconnect) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/PilotTrain/AddTaskCDBconnect.C");
    AliTaskCDBconnect *taskCDB = AddTaskCDBconnect(cdb_location, run_number);
    if (!taskCDB) return;
  }    
  
  //
  // Event Statistics (Jan Fiete)
  //
  if (doEventStat) {
      gROOT->LoadMacro("$ALICE_PHYSICS/OADB/macros/AddTaskPhysicsSelection.C");
      AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(kTRUE /*MC*/);
  }
  //
  // PIDResponse(JENS)
  //
  if (doPIDResponse) {
    gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C"); 
    AliAnalysisTaskPIDResponse *PIDResponse = AddTaskPIDResponse(kTRUE);
    PIDResponse->SelectCollisionCandidates(kTriggerMask);
  }  

   
  //
  // Centrality (A. Toia)
  //
  if (doCentrality) 
  {
    if(run_flag >= 1500)
    {
      gROOT->LoadMacro("$ALICE_PHYSICS/OADB/COMMON/MULTIPLICITY/macros/AddTaskMultSelection.C");
      AliMultSelectionTask *taskMult = AddTaskMultSelection();
      taskMult->SetAlternateOADBforEstimators(periodName);
    }
    else
      // old scheme is only valid for PbPb
      if (iCollisionType == kPbPb)
      {
        gROOT->LoadMacro("$ALICE_PHYSICS/OADB/macros/AddTaskCentrality.C");
        AliCentralitySelectionTask *taskCentrality = AddTaskCentrality();
        taskCentrality->SetMCInput();
      }
  }   
  
  // Vertexing (A. Dainese)
  // 
  if (doVertex) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/macros/AddTaskVertexESD.C");
    // Specific setting for MC
    AliAnalysisTaskVertexESD* taskvertexesd =  AddTaskVertexESD(kTRUE, kTriggerMask);
    taskvertexesd->SelectCollisionCandidates(kTriggerMask);
  }  

  // TPC QA (E. Sicking)
  //
  if (doQAsym) {
  // offline trigger in AddTask
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/PilotTrain/AddTaskQAsym.C");
    AliAnalysisTaskSE * taskqasim = AddTaskQAsym(0, kTriggerMask, kTriggerHM, kTriggerEMC, kTriggerMuonBarell);
  }  
  //
  // VZERO QA  (C. Cheshkov)
  //
  if (doVZERO) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/PilotTrain/AddTaskVZEROQA.C");
    AliAnalysisTaskSE * taskv0qa = AddTaskVZEROQA(0);
//  taskv0qa->SelectCollisionCandidates();
  }
  if (doVZEROPbPb) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/VZERO/AddTaskVZEROPbPb.C");
    AliAnaVZEROPbPb* taskV0PbPb = (AliAnaVZEROPbPb*)AddTaskVZEROPbPb(run_number);
//    taskV0PbPb->SetClassesNames("CTRUE-,C0HWU-,CPBI2WU_B1-,CPBI2_B1-,CPBI1WU-,CPBI1-,CVHNWU-,CVHN-,CVLNWU-,CVLN-");
//    taskV0PbPb->SetClassesNames("CTRUE-,C0HWU-,CPBI2WU,CPBI2,CPBI1WU-,CPBI1-,CVHNWU,CVHN,CVLNWU,CVLN");
//    taskV0PbPb->SetClassesNames("CTRUE-,C0HWU-,CPBI2WU-,CPBI2-,CPBI2WU_B1-,CPBI2_B1-,CPBI1WU-,CPBI1-,CVHNWU-,CVHN-,CVHN_R2-,CVHNWU_R2-,CVLNWU-,CVLN-,CVLN_B2-,CVLNWU_B2-");
//    taskV0PbPb->SetClassesNames("CTRUE-,C0HWU-,CPBI2WU-,CPBI2-,CPBI2WU_B1-,CPBI2_B1-,CPBI1WU-,CPBI1-,CVHNWU-,CVHN-,CVHN_R2-,CVHNWU_R2-,CVLNWU-,CVLN-,CVLN_R1-,CVLN_B2-,CVLNWU_R1-,CVLNWU_B2-");
//    taskV0PbPb->SetClassesNames("CTRUE-,C0HWU-,CPBI2WU-,CPBI2-,CPBI2WU_B1-,CPBI2_B1-,CPBI1WU-,CPBI1-,CVHNWU-,CVHN-,CVHN_R2-,CVHNWU_R2-,CVLNWU-,CVLN-,CVLN_R1-,CVLN_B2-,CVLNWU_R1-,CVLNWU_B2-,CSEMI_R1-,CSEMIWU_R1-,CCENT_R2-,CCENTWU_R2-");
  }
  //
  // TPC (Jacek Otwinowski & Michael Knichel)
  //
  //
  // Optionally MC information can be used by setting the 1st argument to true
  // Optionally friends information can be switched off by setting the 2st argument 
  // to false
  // Optionally highMult axis can be used by setting the 3st argument to true (for PbPb)
  if (doTPC) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/TPC/macros/AddTaskPerformanceTPCdEdxQA.C");
    AliPerformanceTask *tpcQA = 0;
    if (iCollisionType==kPbPb  || iCollisionType == kXeXe) {
       // High multiplicity Pb-Pb
       tpcQA = AddTaskPerformanceTPCdEdxQA(kTRUE, kTRUE, kTRUE);
//.........这里部分代码省略.........
开发者ID:preghenella,项目名称:AliDPG,代码行数:101,代码来源:QAtrainsim.C


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