Beispiel #1
0
  /** 
   * Get the name of the registered data set
   * 
   * 
   * @return Name of the registered data set
   */
  static TString RegisteredDataset()
  {
    TString ret;

    AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
    AliVEventHandler*   oh  = mgr->GetOutputEventHandler();
    if (!oh) { 
      Warning("OutputUtilities::GetOutputDataSet", 
	      "No outout event handler defined");
      return ret;
    }
    AliAnalysisDataContainer* co  = mgr->GetCommonOutputContainer();
    if (!co) { 
      Warning("OutputUtilities::GetOutputDataSet", 
	      "No common output container defined");
      return ret;
    }
    if (!co->IsRegisterDataset()) { 
      Info("OutputUtilities::GetOutputDataSet", 
	   "Common output is not registered as dataset");
      return ret;
    }
    ret = oh->GetOutputFileName();
    // ret.ReplaceAll("TTree", "");
    ret.ReplaceAll(".root", "");
    // ret.Append(co->GetTitle());

    return ret;
  }
Beispiel #2
0
  /** 
   * Path of output 
   * 
   * @return Path to output - possibly a data set
   */
  virtual TString OutputPath() const 
  {
    AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
    if (!mgr) return "";

    AliVEventHandler* outH = mgr->GetOutputEventHandler();
    if (!outH) return "";
    
    TString ret = gSystem->ConcatFileName(gSystem->WorkingDirectory(),
					  outH->GetOutputFileName());
    return ret;
  }
AliAnalysisTask* AddTaskAOD2AODMuonOnly(const char* triggerinputs,Bool_t withSPDtracklets, Int_t mcMode)
{
  
  AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr)
  {
    ::Error("AddTaskAOD2AODMuonOnly", "No analysis manager to connect to.");
    return 0x0;
  }
  
  AliInputEventHandler* input = mgr->GetInputEventHandler();
  
  if (!input)
  {
    ::Error("AddTaskAOD2AODMuonOnly", "This task requires an input event handler");
    return 0x0;
  }
  
  TString inputDataType = input->GetDataType(); // can be "ESD" or "AOD"

  if (inputDataType != "AOD")
  {
    ::Error("AddTaskAOD2AODMuonOnly", "This task requires an AOD input event handler");
    return 0x0;
  }
  
  AliAODHandler* aodHandler = dynamic_cast<AliAODHandler*>(mgr->GetOutputEventHandler());
  if (!aodHandler)
  {
    ::Error("AddTaskAOD2AODMuonOnly", "This task requires an AOD output event handler");
    return 0x0;
  }
  
  aodHandler->SetCreateNonStandardAOD();

  AliMuonEventCuts* eventCuts = new AliMuonEventCuts("L0cutter","");
    
  eventCuts->SetTrigClassPatterns("0MSL|0MUL|0MSH|0MLL",triggerinputs);
  
  AliAnalysisTask* task = new AliAnalysisTaskAOD2MuonAOD(mcMode,withSPDtracklets,eventCuts);
    
  mgr->AddTask(task);
    
  // Connect input/output
  mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
  mgr->ConnectOutput(task, 0, mgr->GetCommonOutputContainer());

  return task;
}
Beispiel #4
0
  /** 
   * Register output data set 
   * 
   * @param dsname Data set name 
   * 
   * @return true on success
   */
  static Bool_t RegisterDataset(const TString& dsname)
  {
    // Get the manager
    AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();

    // If we are asked to make a data-set, get the output handler and
    // common output container.
    AliVEventHandler*         handler = mgr->GetOutputEventHandler();
    if (!handler) return true;

    // Get the container 
    AliAnalysisDataContainer* cont    = mgr->GetCommonOutputContainer();
    if (!cont) { 
      Warning("OutputUtilities::RegisterDataset", 
	      "No common output container defined");
      return false;
    }

    // Make the name 
    TString nme(dsname);
    if (nme.IsNull()) nme = mgr->GetName();
    if (nme.IsNull()) { 
      Error("OutputUtilities::RegisterDataset", "No data set name specified");
      return false;
    }

    // Flag for data-set creation
    cont->SetRegisterDataset(true);

    handler->SetOutputFileName(nme);
    // cont->SetFileName(nme);

    TString base(handler->GetOutputFileName());
    base.ReplaceAll(".root","");
    Info("OutputUtilities::RegisterDataset", 
	 "Will register tree output AODs (%s%s) as dataset",
	 base.Data(), cont->GetTitle());

    return true;
  }