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


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

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


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

示例1: runAlien

//___________________________________________________________
void runAlien(TString data, TString mode = "test", Bool_t MC = kFALSE){  
  if(!gSystem->Getenv("ALICE_ROOT")){
    printf("AliRoot has to be initialized\n");  
    return;
  }
  
  // check for valid modes
  const int kModes = 5;
  TString allowed_modes[kModes] = {"proof", "prooftest", "test", "full", "submit"}; 
  Bool_t isValid = kFALSE;
  mode.ToLower();
  for(int imode = 0; imode < kModes; imode++){
    if(!mode.CompareTo(allowed_modes[imode])) isValid = kTRUE;
  }
  if(!isValid){
    printf("invalid analysis mode selected\n");
    return;
  }
  analysis_mode = mode; 
  Bool_t proofmode = mode.Contains("proof");
  // libraries to be loaded
  gSystem->Load("libANALYSIS");
  gSystem->Load("libANALYSISalice");
  gSystem->Load("libCORRFW");
  gSystem->Load("libPWGhfe");
  
  // Create Analysis Manager
  AliAnalysisManager *runAnalysis = new AliAnalysisManager("Heavy Flavour Electron Analysis");
  runAnalysis->SetCommonFileName(output_file.Data());
  runAnalysis->SetInputEventHandler(new AliESDInputHandler); 
  if(MC) runAnalysis->SetMCtruthEventHandler(new AliMCEventHandler);
  AliAnalysisAlien *alienhandler = CreateAlienHandler(proofmode);
  printf("alienhandler %p\n", alienhandler);
  runAnalysis->SetGridHandler(alienhandler);
  //return;
  
  // Specify input (runs or dataset)
  if(!proofmode){
    // Query sample ID and runs
    TString sample;
    TArrayI listofruns;
    DecodeDataString(data, sample, listofruns);
    AddInput(alienhandler, sample, listofruns, MC);
  } else {
    alienhandler->SetProofDataSet(data);
  }

  // Add Tasks
  gROOT->LoadMacro(Form("%s/OADB/macros/AddTaskPhysicsSelection.C", gSystem->Getenv("ALICE_ROOT")));
  gROOT->LoadMacro(Form("%s/PWG3/hfe/macros/AddTaskHFE.C", gSystem->Getenv("ALICE_ROOT")));
  AddTaskPhysicsSelection(MC);
  AddTaskHFE();     // @TODO: MC and PbPb flag to be fixed

  // Run Analysis
  TString anamode = proofmode ? "proof" : "grid";
  if(runAnalysis->InitAnalysis()){
    runAnalysis->PrintStatus();
    runAnalysis->StartAnalysis(anamode);
  }
}
开发者ID:ktf,项目名称:AliPhysics,代码行数:61,代码来源:runAlien.C

示例2: 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);
}
开发者ID:ktf,项目名称:AliPhysics,代码行数:59,代码来源:runProofFwdDetsQA.C

示例3: 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);
	}
}
开发者ID:ktf,项目名称:AliPhysics,代码行数:58,代码来源:RunLinkToMCAnalysisExample.C

示例4: runTOFCalibTaskOnProof

void runTOFCalibTaskOnProof() {
	TStopwatch timer;
	timer.Start();
	
	printf("*** Open PROOF ***");

	gEnv->SetValue("XSec.GSI.DelegProxy","2");
	TProof::Open("alicecaf");
		
	gProof->UploadPackage("STEERBase.par");
	gProof->EnablePackage("STEERBase");
	gProof->UploadPackage("ESD.par");
	gProof->EnablePackage("ESD");
	gProof->UploadPackage("AOD.par");
	gProof->EnablePackage("AOD");
	gProof->UploadPackage("ANALYSIS.par");
	gProof->EnablePackage("ANALYSIS");
	gProof->UploadPackage("ANALYSISalice.par");
	gProof->EnablePackage("ANALYSISalice");
	
	gProof->Load("AliTOFArray.cxx++g");
	gProof->Load("AliTOFCalibTask.cxx++g");
	gROOT->LoadMacro("AddTaskTOFCalib.C");
	cout << "Loaded AddTaskTOFCalib macro "<< endl;
	
	gProof->ShowEnabledPackages();
	
	//ANALYSIS PART	
	//____________________________________________//
	// Make the analysis manager

	AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
	AliESDInputHandler* esdH = new AliESDInputHandler;
	
	esdH->SetInactiveBranches("FMD CaloCluster");
	mgr->SetInputEventHandler(esdH);  
	
	Bool_t domc = kFALSE;
	if (domc) {
		AliMCEventHandler *mcH = new AliMCEventHandler;
		mgr->SetMCtruthEventHandler(mcH);
	}

	//____________________________________________//
	// 1st TOFCalib task
	
	AliTOFCalibTask *taskTOFCalib = AddTaskTOFCalib();
	
	if (!mgr->InitAnalysis()) return;
	mgr->PrintStatus();
	mgr->StartAnalysis("proof","/COMMON/COMMON/LHC08c11_10TeV_0.5T",1000);
	
	timer.Stop();
	timer.Print();
}
开发者ID:alisw,项目名称:AliRoot,代码行数:55,代码来源:runTOFCalibTaskOnProof.C

示例5: rundStarTask

void rundStarTask(const char* mode = "test", bool isMC=true){
  // Include AliPhysics and AliRoot libraries
  gSystem->AddIncludePath("-I$ALICE_ROOT/include -I$ALICE_PHYSICS/include");
  //Check the run mode
  if(std::strcmp(mode,"local")!=0 && std::strcmp(mode,"grid")!=0 && std::strcmp(mode,"test")!=0){
    Printf("\n\tIncorrect run option, check first argument of run macro");
    Printf("\tmode = local, test or grid\n");
    return;
  }
  Printf("%s analysis chosen",mode);
  //Define the plugin
  AliAnalysisGrid *plugin = 0x0;
  TChain *chain = 0x0;
  if(std::strcmp(mode,"local")!=0) {
    plugin = CreateAlienHandler(mode,isMC);
    if(!plugin) return;
  }
  else {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWG/EMCAL/macros/CreateAODChain.C");
    chain = CreateAODChain("localdata.txt");
  }
  // Create the analysis manager
  AliAnalysisManager *mgr = new AliAnalysisManager(kTaskName);
  if(plugin) mgr->SetGridHandler(plugin);
  // Define input handlers
  if(isMC){
    AliMCEventHandler*  mcHandler = new AliMCEventHandler();
    if (plugin) mgr->SetMCtruthEventHandler(mcHandler);
  }
  AliAODInputHandler *aodH = new AliAODInputHandler();
  mgr->SetInputEventHandler(aodH);
  // Compile the class
  gROOT->LoadMacro("AliAnalysisTaskdStar.cxx++g");
  // PID response
  gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
  AliAnalysisTaskPIDResponse *pidTask = AddTaskPIDResponse(isMC); // useMC
  // dStar task
  gROOT->LoadMacro("AddTaskdStar.C");
  AliAnalysisTaskdStar *task = AddTaskdStar(isMC);
  // Disbale debug printouts
  mgr->SetDebugLevel(3);
  AliLog::SetGlobalLogLevel(AliLog::kFatal);
  AliLog::SetGlobalDebugLevel(0);
  if (!mgr->InitAnalysis()) return;
  mgr->PrintStatus();
  // Start analysis in grid.
  if (std::strcmp(mode,"local")==0)
    mgr->StartAnalysis(mode,chain);
  else
    mgr->StartAnalysis("grid");
}
开发者ID:ktf,项目名称:AliPhysics,代码行数:51,代码来源:rundStarTask.C

示例6: runProofT0analysis

void runProofT0analysis(const char * dataset = "/COMMON/COMMON/LHC09a4_10TeV_200k#esdTree",Long64_t nentries=20000, Long64_t firstentry=0)
{
// Connect to Proof
  TProof::Open("proof://[email protected]"); 
  //TProof::Open("lxb6046");

  // Upload and enable packages: please use the correct version!
  gProof->UploadPackage("AF-v4-16");
  gProof->EnablePackage("AF-v4-16");
  gProof->ShowDataSets();      
 
  // Create the analysis manager
  AliAnalysisManager *mgr = new AliAnalysisManager("AliT0MultiplicityTask");

  AliVEventHandler* esdH = new AliESDInputHandler();
  mgr->SetInputEventHandler(esdH);

  // Enable MC event handler
  AliVEventHandler* handler = new AliMCEventHandler;
  mgr->SetMCtruthEventHandler(handler);

  // Create task
  //  gProof->Load("AliMCComparisonTrack.cxx++g");
  gProof->Load("AliT0MultiplicityTask.cxx++g");
  AliAnalysisTask *task = new AliT0MultiplicityTask("AliT0MultiplicityTask");

  // Add task
  mgr->AddTask(task);

  // Create containers for input/output
  AliAnalysisDataContainer *cinput = 
    mgr->CreateContainer("cchain", TChain::Class(), AliAnalysisManager::kInputContainer);
  AliAnalysisDataContainer *coutput = 
    mgr->CreateContainer("coutput", TList::Class(), 
    AliAnalysisManager::kOutputContainer, "MultHist.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();

   mgr->StartAnalysis("proof",dataset,nentries,firstentry);
}
开发者ID:alisw,项目名称:AliRoot,代码行数:51,代码来源:runProofT0analysis.C

示例7: QAmerge

void QAmerge(const char *dir, Int_t stage)
{
// Merging method
  TStopwatch timer;
  timer.Start();
  TString outputDir = dir;
  TString outputFiles = "QAresults.root,EventStat_temp.root";
  TString mergeExcludes = "";
  TObjArray *list = outputFiles.Tokenize(",");
  TIter *iter = new TIter(list);
  TObjString *str;
  TString outputFile;
  Bool_t merged = kTRUE;
  while((str=(TObjString*)iter->Next())) {
    outputFile = str->GetString();
    // Skip already merged outputs
    if (!gSystem->AccessPathName(outputFile)) {
       printf("Output file <%s> found. Not merging again.",outputFile.Data());
       continue;
    }
    if (mergeExcludes.Contains(outputFile.Data())) continue;
    merged = AliAnalysisAlien::MergeOutput(outputFile, outputDir, 10, stage);
    if (!merged) {
       printf("ERROR: Cannot merge %s\n", outputFile.Data());
       continue;
    }
  }
  TString infolog = "fileinfo.log";
  AliAnalysisAlien::MergeInfo(infolog, dir); 
  // read the analysis manager from file
  if (!outputDir.Contains("Stage")) {
    ofstream out;
    out.open("outputs_valid", ios::out);
    out.close();    
    return;
  }
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  mgr->SetRunFromPath(mgr->GetRunFromAlienPath(dir));
  mgr->SetSkipTerminate(kFALSE);
  if (!mgr->InitAnalysis()) return;
  mgr->PrintStatus();
  AliLog::SetGlobalLogLevel(AliLog::kError);
  TTree *tree = NULL;
  gROOT->cd();
  mgr->StartAnalysis("gridterminate", tree);
  ofstream out;
  out.open("outputs_valid", ios::out);
  out.close();
  timer.Print();
}
开发者ID:preghenella,项目名称:AliDPG,代码行数:50,代码来源:QAtrainsim.C

示例8: AnalysisMacroGlob

void AnalysisMacroGlob(TString dataset="/alice/sim/LHC10f8f_130844",
		       TString outFName="glovar.root",
		       Int_t  nEvents     = 5000,
		       Int_t  nEventsSkip = 0) 
{
  //  
  TString format = GetFormatFromDataSet(dataset);
  //
  // ALICE stuff
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) mgr = new AliAnalysisManager("Test train");
  //
  Bool_t isMC = dataset.Contains("sim");
  InputHandlerSetup(format,kFALSE,isMC);
  gProof->Load("AliTaskGlobVar.cxx++g");
  //
  /*
  gROOT->LoadMacro("AddTaskGlobVar.C");
  AliTaskGlobVar *task = AddTaskGlobVar(outFName.Data());
  */
  AliTaskGlobVar *task = new AliTaskGlobVar("AliTaskGlobVar");
  // create output container
  AliAnalysisDataContainer *coutput1 = 
    mgr->CreateContainer("clist", TList::Class(),AliAnalysisManager::kOutputContainer,outFName.Data());
  // add our task to the manager
  mgr->AddTask(task);
  //
  // finaly connect input and output
  mgr->ConnectInput(task, 0,  mgr->GetCommonInputContainer());
  mgr->ConnectOutput(task,1,coutput1);
  //
  if (!isMC) {
    AddPhysicsSelection();
    task->SelectCollisionCandidates( AliVEvent::kUserDefined );
    task->SetUseMC(kFALSE);
  }
  else task->SetUseMC(kTRUE);
  //  else task->SelectCollisionCandidates( AliVEvent::kMB);
  //
  // Run analysis
  mgr->InitAnalysis();
  // process dataset  
  mgr->StartAnalysis("proof", dataset.Data(), nEvents, nEventsSkip); 
  //
  TString evstCmd = "if [ -e event_stat.root ]; then \nmv event_stat.root evstat_"; 
  evstCmd += outFName;  evstCmd += " \nfi";
  gSystem->Exec( evstCmd.Data() );
  
}
开发者ID:ktf,项目名称:AliPhysics,代码行数:49,代码来源:AnalysisMacroGlob.C

示例9: runProofTRDComparison

void runProofTRDComparison(const char *dataset="/PWG0/COMMON/run30000X_10TeV_0.5T",Long64_t nentries=1000, Long64_t firstentry=0)
{
  // Connect to Proof
  TProof::Open("lxb6046");

  // Upload and enable packages: please use the correct version!
  gProof->UploadPackage("AF-v4-14");
  gProof->EnablePackage("AF-v4-14");

  // Create the analysis manager
  AliAnalysisManager *mgr = new AliAnalysisManager("AliTRDComparison");

  AliVEventHandler* esdH = new AliESDInputHandler();
  mgr->SetInputEventHandler(esdH);

  // Enable MC event handler
  AliVEventHandler* handler = new AliMCEventHandler;
  mgr->SetMCtruthEventHandler(handler);

  // Create task
  gProof->Load("AliMCComparisonTrack.cxx++g");
  gProof->Load("AliTRDComparisonTask.cxx++g");
  AliAnalysisTask *task = new AliTRDComparisonTask("AliTRDComparisonTask");

  // Add task
  mgr->AddTask(task);

  // Create containers for input/output
  AliAnalysisDataContainer* cinput = mgr->GetCommonInputContainer();
  AliAnalysisDataContainer* coutput = 
    mgr->CreateContainer("coutput", TList::Class(), 
    AliAnalysisManager::kOutputContainer, "AliTRDComparisonHist.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();

  mgr->StartAnalysis("proof",dataset,nentries,firstentry);
}
开发者ID:ktf,项目名称:AliPhysics,代码行数:48,代码来源:runProofTRDComparison.C

示例10: runAliTask

void runAliTask() {
  TStopwatch timer;
  timer.Start();
//   gSystem->Load("libTree.so");
//   gSystem->Load("libGeom.so");
//   gSystem->Load("libVMC.so");
//   gSystem->Load("libPhysics.so");
//   //____________________________________________________//
//   //_____________Setting up required packages___________//
//   //____________________________________________________//
//   gSystem->Load("libSTEERBase.so");
//   gSystem->Load("libESD.so");
//   gSystem->Load("libAOD.so");
//   gSystem->Load("libANALYSIS.so");
//   gSystem->Load("libANALYSISalice.so");
//   gROOT->ProcessLine(".include $ALICE_ROOT/include");
// 
//   //___________Compile analysis task using AClic____________//
//   gROOT->LoadMacro("../task/AliAnalysisTaskPt.cxx+g");
// 
// 
//   gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C");

  TChain* chain = CreateESDChain("files.txt", 2);

  //____________________________________________//
  // Make the analysis manager
  AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
  AliESDInputHandler* esdH = new AliESDInputHandler();
  mgr->SetInputEventHandler(esdH);  
  //____________________________________________//
  // 1st Pt task
  AliAnalysisTaskPt *task1 = new AliAnalysisTaskPt("TaskPt");
  mgr->AddTask(task1);
  // Create containers for input/output
  AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer);
  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("chist1", TH1::Class(),AliAnalysisManager::kOutputContainer,"Pt.ESD.root");
  
  //____________________________________________//
  mgr->ConnectInput(task1,0,cinput1);
  mgr->ConnectOutput(task1,0,coutput1);
  if (!mgr->InitAnalysis()) return;
  mgr->PrintStatus();
  //mgr->StartAnalysis("local",chain);

  timer.Stop();
  timer.Print();
}
开发者ID:hqvigstad,项目名称:alilink,代码行数:48,代码来源:runAliTask.C

示例11: RunAnalysisManager

Bool_t RunAnalysisManager(TString anSrc = "proof", TString anMode = "test", Long64_t nEvents = 1e10, Long64_t nSkip = 0) {

   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();

   if (!mgr) { Printf("Error [RunAnalysisManager] : mgr is null !!!"); return kFALSE; }

   // Run analysis
   mgr->InitAnalysis();
   mgr->PrintStatus();

   if ((!anSrc.CompareTo("proof")) || (!anSrc.CompareTo("local"))) {
      mgr->StartAnalysis(anSrc.Data(), nEvents, nSkip);
   } else {
      mgr->StartAnalysis(anSrc.Data());
   }

   return kTRUE;
}
开发者ID:fbellini,项目名称:AliRsn,代码行数:18,代码来源:RunALICE.C

示例12: PrintManager

void PrintManager(TObject *mgrObj) {
   AliAnalysisManager *mgr = (AliAnalysisManager *)mgrObj;
   if (!mgr->InitAnalysis()) return;
   mgr->RunLocalInit();
   mgr->PrintStatus();

   Printf("Analysis Manager : %s '%s'",mgr->GetName(),mgr->GetTitle() );
   TObjArray *a = mgr->GetTasks();
   if (a) Printf("Tasks total : %d",a->GetEntries());
   TIter next(mgr->GetTasks());
   AliAnalysisTask *task;
   while ((task = (AliAnalysisTask *) next())) {
      if (task->IsA() == AliRsnMiniAnalysisTask::Class()) {
         Printf("   Task [RSN-MINI] : %s '%s'",task->GetName(),task->GetTitle());
         AliRsnMiniAnalysisTask *rsnMiniTask = (AliRsnMiniAnalysisTask *)task;
         rsnMiniTask->Print();
      } else if (task->IsA() == AliRsnAnalysisTask::Class()) {
         Printf("   Task [RSN-----] : %s '%s'",task->GetName(),task->GetTitle());
         AliRsnAnalysisTask *rsnTask = (AliRsnAnalysisTask *)task;
         rsnTask->Print();
         AliVEventHandler *ih = mgr->GetInputEventHandler();
         if (ih == AliMultiInputEventHandler::Class()) {
            AliMultiInputEventHandler *ihMulti = (AliMultiInputEventHandler *) ih;
            TIter nextIH(ihMulti->InputEventHandlers());
            AliRsnInputHandler *rsnIH = 0;
            while ((ih = (AliVEventHandler *) nextIH())) {
               if (ih->IsA() == AliRsnInputHandler::Class()) {
                  rsnIH = ih;
                  AliRsnDaughterSelector *ds =  rsnIH->GetSelector();
                  ds->Print();
               }
            }

         }
      } else {
         Printf("   Task [--------] : %s '%s'",task->GetName(),task->GetTitle());
      }

   }

}
开发者ID:musinsky,项目名称:AliRsnLite,代码行数:41,代码来源:RsnTrainInfo.C

示例13: runGridpPb

void runGridpPb(const char *config = "config.txt"){
        //
        // run analysis 
        //

        TGrid::Connect("alien://");

        // Create Lookup with sample information
        TMap sampleinfos;
        Generate_Sample_Lookup(sampleinfos);

        ConfigParser(config);

        // Configure alien plugin
        AliAnalysisAlien *plugin = CreateGridHandler();
        if(!CreateTrainDir(plugin, sampleinfos)){
                printf("Cannot setup output directory\n");
                return;
        }
        if(!MakeSample(plugin, sampleinfos)){
                printf("Cannot create data sample\n");
                return;
        }
        if(!g_plugin_mode.CompareTo("full")){
                // full mode, creating config files for the merging stage
                GenerateMergeConfigs();
        }

        AliAnalysisManager *mgr = new AliAnalysisManager("tpctofanalysis");
        mgr->SetGridHandler(plugin);
        
        SetupTrain(sampleinfos);

        // Run train
        if (!mgr->InitAnalysis()) return;
        mgr->PrintStatus();
        // Start analysis in grid.
        mgr->StartAnalysis("grid");
} 
开发者ID:ktf,项目名称:AliPhysics,代码行数:39,代码来源:runGridpPb.C

示例14: TaskBuzzer

void TaskBuzzer(UInt_t config, const char *collection="wn.xml") 
{
  printf("Running buzzer with: %s\n", ConfigName(config));
  TGrid::Connect("alien://");
  if (!gGrid || !gGrid->IsConnected()) {
    ::Error("PilotAnalysis", "No grid connection");
    return;
  }
  TChain *chain = CreateChain(collection, "ESD");
  // Load libraries
  gSystem->SetIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT -I$ALICE_ROOT/ITS -I$ALICE_ROOT/TRD");
  LoadLibraries();
  // Create manager
  AliAnalysisManager *mgr  = new AliAnalysisManager("ESDfiltering", "Production train");
  mgr->SetNSysInfo(100);
  // Input handler
  AliESDInputHandlerRP *esdHandler = new AliESDInputHandlerRP();
//  AliESDInputHandler *esdHandler = new AliESDInputHandler();
  esdHandler->SetReadFriends(kTRUE);
  esdHandler->SetActiveBranches("ESDfriend");
  mgr->SetInputEventHandler(esdHandler);
  if (config & kAOD) {
     // AOD output handler
     AliAODHandler* aodHandler   = new AliAODHandler();
     aodHandler->SetOutputFileName("AliAOD.root");
     if (!mergeExcludes.IsNull()) mergeExcludes += " ";
     mergeExcludes += "AliAOD.root";
     mgr->SetOutputEventHandler(aodHandler);
  }   
  // AnalysisTasks
  AddAnalysisTasks(config);

  mgr->SetDebugLevel(1);
  if (mgr->InitAnalysis()) {                                                                                                              
    mgr->PrintStatus(); 
    mgr->StartAnalysis("local", chain);
  }  
} 
开发者ID:alisw,项目名称:AliRoot,代码行数:38,代码来源:TaskBuzzer.C

示例15: AODmerge

//______________________________________________________________________________
void AODmerge()
{
// Merging method. No staging and no terminate phase.
  TStopwatch timer;
  timer.Start();
  TString outputDir = "wn.xml";
  TString outputFiles = "EventStat_temp.root,AODQA.root,AliAOD.root,AliAOD.VertexingHF.root,AliAODGammaConversion.root,FilterEvents_Trees.root,AliAOD.Muons.root";
  TString mergeExcludes = "";
  TObjArray *list = outputFiles.Tokenize(",");
  TIter *iter = new TIter(list);
  TObjString *str;
  TString outputFile;
  Bool_t merged = kTRUE;
  while((str=(TObjString*)iter->Next())) {
    outputFile = str->GetString();
    // Skip already merged outputs
    if (!gSystem->AccessPathName(outputFile)) {
       printf("Output file <%s> found. Not merging again.",outputFile.Data());
       continue;
    }
    if (mergeExcludes.Contains(outputFile.Data())) continue;
    merged = AliAnalysisAlien::MergeOutput(outputFile, outputDir, 10, 0);
    if (!merged) {
       printf("ERROR: Cannot merge %s\n", outputFile.Data());
       continue;
    }
  }
  // all outputs merged, validate
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  mgr->InitAnalysis();
  mgr->SetGridHandler(new AliAnalysisAlien);
  mgr->StartAnalysis("gridterminate",0);
  ofstream out;
  out.open("outputs_valid", ios::out);
  out.close();
  timer.Print();
}
开发者ID:preghenella,项目名称:AliDPG,代码行数:38,代码来源:AODtrain.C


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