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


C++ AliAnalysisManager类代码示例

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


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

示例1: RegisterStorage

  /** 
   * Register special putput storage 
   * 
   * @param url Url (root://host/full_path)
   * 
   * @return true on success
   */
  static Bool_t RegisterStorage(const TString& url)
  {
    if (url.IsNull()) { 
      Error("OutputUtilities::RegisterStorage", "No storage URI specified");
      return false;
    }

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

    TString u(url);
    if (u.EqualTo("auto")) {
      if (!StartXrootd(u)) {
	Warning("OutputUtilities::RegisterStorage",
		"Couldn't start the XRootD server");
	return false;
      }
    }

    cont->SetSpecialOutput();
    mgr->SetSpecialOutputLocation(u);

    return true;
  }
开发者ID:ktf,项目名称:AliPhysics,代码行数:39,代码来源:OutputUtilities.C

示例2: RegisteredDataset

  /** 
   * 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;
  }
开发者ID:ktf,项目名称:AliPhysics,代码行数:35,代码来源:OutputUtilities.C

示例3: 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;

}
开发者ID:ktf,项目名称:AliPhysics,代码行数:59,代码来源:AddTaskF01710fromAODtracks.C

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

示例5: 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;
}
开发者ID:hqvigstad,项目名称:anaExperiments,代码行数:32,代码来源:AddClusterSelectionTask.C

示例6: MSFT_AddSPmethod

void MSFT_AddSPmethod(char *name, TString myFolder, char *thecuts, int harmonic,
		      AliAnalysisDataContainer *flowEvent, AliFlowTrackSimpleCuts *cutsPOI=NULL,
		      char *Qvector) {
  TString fileName = AliAnalysisManager::GetCommonFileName();
  myFolder.Append( Form("v%d",harmonic) );
  TString myNameSP = Form("%sv%d%s_%s", name, harmonic, Qvector, thecuts);
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  AliAnalysisDataContainer *flowEvent2 
    = mgr->CreateContainer( Form("Filter_%s", myNameSP.Data()),
			    AliFlowEventSimple::Class(),
			    AliAnalysisManager::kExchangeContainer );
  AliAnalysisTaskFilterFE *tskFilter 
    = new AliAnalysisTaskFilterFE( Form("TaskFilter_%s",myNameSP.Data()),
				   NULL, cutsPOI);
  tskFilter->SetSubeventEtaRange( -5.0, -1.0, 1.0, +5.0 );
  mgr->AddTask(tskFilter);
  mgr->ConnectInput( tskFilter, 0, flowEvent);
  mgr->ConnectOutput(tskFilter, 1, flowEvent2);
  AliAnalysisDataContainer *outSP 
    = mgr->CreateContainer( myNameSP.Data(),TList::Class(),AliAnalysisManager::kOutputContainer,
			    Form("%s:FlowCascade_SP_%s",fileName.Data(),myFolder.Data()) );
  AliAnalysisTaskScalarProduct *tskSP 
    = new AliAnalysisTaskScalarProduct( Form("TaskScalarProduct_%s",myNameSP.Data()),kFALSE);
  tskSP->SetApplyCorrectionForNUA(kTRUE);
  tskSP->SetHarmonic(harmonic);
  tskSP->SetTotalQvector(Qvector);
  tskSP->SetBookOnlyBasicCCH(kTRUE);
  mgr->AddTask(tskSP);
  mgr->ConnectInput( tskSP,0,flowEvent2);
  mgr->ConnectOutput(tskSP,1,outSP);
}
开发者ID:ktf,项目名称:AliPhysics,代码行数:31,代码来源:AddTaskFlowCascade.C

示例7: MSFT_AddQCmethod

void MSFT_AddQCmethod(char *name, TString myFolder, char *thecuts, int harmonic, 
		      AliAnalysisDataContainer *flowEvent, 
		      AliFlowTrackSimpleCuts *cutsPOI=NULL) {
  TString fileName = AliAnalysisManager::GetCommonFileName();
  myFolder.Append( Form("v%d",harmonic) );
  TString myName = Form("%sv%d_%s", name, harmonic, thecuts);
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  AliAnalysisDataContainer *flowEvent2 
    = mgr->CreateContainer( Form("Filter_%s", myName.Data()),
			    AliFlowEventSimple::Class(),
			    AliAnalysisManager::kExchangeContainer );
  AliAnalysisTaskFilterFE *tskFilter 
    = new AliAnalysisTaskFilterFE( Form("TaskFilter_%s",myName.Data()),
				   NULL, cutsPOI);
  mgr->AddTask(tskFilter);
  mgr->ConnectInput( tskFilter, 0, flowEvent);
  mgr->ConnectOutput(tskFilter, 1, flowEvent2);

  AliAnalysisDataContainer *outQC 
    = mgr->CreateContainer( myName.Data(), TList::Class(), AliAnalysisManager::kOutputContainer,
			    Form("%s:FlowCascade_QC_%s", fileName.Data(), myFolder.Data()) );
  AliAnalysisTaskQCumulants *tskQC 
    = new AliAnalysisTaskQCumulants( Form("TaskQCumulants_%s",myName.Data()),kFALSE );
  tskQC->SetApplyCorrectionForNUA(kTRUE);
  tskQC->SetHarmonic(harmonic);
  tskQC->SetBookOnlyBasicCCH(kTRUE);
  mgr->AddTask(tskQC);
  mgr->ConnectInput( tskQC, 0, flowEvent2);
  mgr->ConnectOutput(tskQC, 1, outQC);
}
开发者ID:ktf,项目名称:AliPhysics,代码行数:30,代码来源:AddTaskFlowCascade.C

示例8: InputHandlerSetup

Bool_t InputHandlerSetup(TString format = "esd", Bool_t useRP=kFALSE, Bool_t useKine = kFALSE)
{
  format.ToLower();

  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();

  AliAnalysisDataContainer *cin = mgr->GetCommonInputContainer();

  if (cin) return;

  if (!format.CompareTo("esd"))
  {
    AliESDInputHandler *esdInputHandler = dynamic_cast<AliESDInputHandler*>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());

    if (!esdInputHandler)
    {
      Info("CustomAnalysisTaskInputSetup", "Creating esdInputHandler ...");
      if (useRP) esdInputHandler = new AliESDInputHandlerRP();
      else       esdInputHandler = new AliESDInputHandler();
      mgr->SetInputEventHandler(esdInputHandler);
    }
    
    if (useKine)
    {
      AliMCEventHandler* mcInputHandler = dynamic_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());

      if (!mcInputHandler)
      {
        Info("CustomAnalysisTaskInputSetup", "Creating mcInputHandler ...");
        AliMCEventHandler* mcInputHandler = new AliMCEventHandler();
        mgr->SetMCtruthEventHandler(mcInputHandler);
      }
    }

  }
  else if (!format.CompareTo("aod"))
  {
    AliAODInputHandler *aodInputHandler = dynamic_cast<AliAODInputHandler*>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());

    if (!aodInputHandler)
    {
      Info("CustomAnalysisTaskInputSetup", "Creating aodInputHandler ...");
      aodInputHandler = new AliAODInputHandler();
      mgr->SetInputEventHandler(aodInputHandler);
    }
  }
  else
  {
    Info("Wrong input format!!! Only ESD and AOD are supported. Skipping Task ...");
    return kFALSE;
  }

  return kTRUE;
}
开发者ID:ktf,项目名称:AliPhysics,代码行数:54,代码来源:AnalysisMacroGlob.C

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

示例10: OutputPath

  /** 
   * 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;
  }
开发者ID:ktf,项目名称:AliPhysics,代码行数:17,代码来源:LiteRailway.C

示例11: AddAMEventMixingTest

Bool_t AddAMEventMixingTest(TString analysisSource = "proof", TString analysisMode = "test",TString input="aod",TString inputMC="", TString postfix = "",TString idStr="0")
{
  
   Bool_t useEventMixingPar      = 1;
   Int_t usePhysSel              = 1;
   Bool_t useMC = !inputMC.CompareTo("mc");

   input.ToLower();

   // ALICE stuff
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) { Printf("Error[AddAMEventMixingTest] mgr is null !!!"); return kFALSE; }
   
   
   AliAnalysisGrid *analysisPlugin = mgr->GetGridHandler();
   if (!analysisPlugin) { Printf("Error[AddAMEventMixingTest] : analysisPlugin is null !!!"); return kFALSE; }

   TString myAdditionalLibs;
   if (useEventMixingPar) { AliAnalysisAlien::SetupPar("EventMixing"); myAdditionalLibs += " EventMixing.par"; }
   else { gSystem->Load("libEventMixing.so"); myAdditionalLibs += " libEventMixing.so"; }
   
   gROOT->LoadMacro("AliAnalysisTaskEx02.cxx++g");
   analysisPlugin->SetAnalysisSource("AliAnalysisTaskEx02.cxx+");
   myAdditionalLibs+=" AliAnalysisTaskEx02.h AliAnalysisTaskEx02.cxx";
   analysisPlugin->SetAdditionalLibs(myAdditionalLibs.Data());
   

  AliMultiInputEventHandler *multiInputHandler = mgr->GetInputEventHandler();

   if (usePhysSel && !input.CompareTo("esd")) {
      gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
      AddTaskPhysicsSelection(useMC);

      // maybe we can put it in $ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C
      AliMultiInputEventHandler *multiIH = dynamic_cast<AliMultiInputEventHandler *>(mgr->GetInputEventHandler());
      if (multiIH){
         AliESDInputHandler *esdIH = dynamic_cast<AliESDInputHandler *>(multiIH->GetFirstInputEventHandler());
         if (esdIH) esdIH->SetEventSelection(multiIH->GetEventSelection());
         AliAODInputHandler *aodIH = dynamic_cast<AliAODInputHandler *>(multiIH->GetFirstInputEventHandler());
         if (aodIH) aodIH->SetEventSelection(multiIH->GetEventSelection());
      }
   }

  // add mixing handler (uncomment to turn on Mixnig)
  gROOT->LoadMacro("AddMixingHandler.C");
  AddMixingHandler(multiInputHandler, input, useMC,postfix);

   // load and run AddTask macro
   gROOT->LoadMacro("AddEventMixingTestTask.C");
   AddEventMixingTestTask(input, useMC, postfix);

   return kTRUE;
}
开发者ID:musinsky,项目名称:AliRsnLite,代码行数:53,代码来源:AddAMEventMixingTest.C

示例12: AddTaskEMCALTriggerQA

AliAnalysisTaskEMCALTriggerQA * AddTaskEMCALTriggerQA(Bool_t kSimulation = kFALSE, TString outputFile = "")
{
  // Get the pointer to the existing analysis manager via the static access method.
  //==============================================================================
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) 
  {
    ::Error("AddTaskEMCALTriggerQA", "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("AddTaskEMCALTriggerQA", "This task requires an input event handler");
    return NULL;
  }
  
  TString taskName = "QAEMCALTrigger";
  
  AliAnalysisTaskEMCALTriggerQA * qatrigger = new AliAnalysisTaskEMCALTriggerQA(taskName);
    
  // Configuration
  
  Bool_t kUseKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
    
  if(kUseKinematics) kSimulation = kTRUE;
    
  if(kSimulation) qatrigger->SwitchOnMCData();
  else            qatrigger->SwitchOffMCData();
  
  TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
    
  if(inputDataType.Contains("AOD")) qatrigger->SwitchOffV0SignalHistograms();
  else                              qatrigger->SwitchOnV0SignalHistograms();
  
  // Define the input/output containers
    
  qatrigger->GetRecoUtils()->SwitchOnBadChannelsRemoval ();
  
  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
    
  if(outputFile.Length()==0) outputFile = AliAnalysisManager::GetCommonFileName();
 
  printf("*** Task Name %s; Output file name: %s ***\n",taskName.Data(),outputFile.Data());
  
  AliAnalysisDataContainer *coutput = mgr->CreateContainer(Form("%s",taskName.Data()), 
                                                           TList::Class(), AliAnalysisManager::kOutputContainer,
                                                           Form("%s",outputFile.Data()));

  mgr->AddTask(qatrigger);
  mgr->ConnectInput  (qatrigger, 0, cinput1);
  mgr->ConnectOutput (qatrigger, 1, coutput);
  
  return qatrigger;
}
开发者ID:ktf,项目名称:AliPhysics,代码行数:57,代码来源:AddTaskEMCALTriggerQA.C

示例13: next

Bool_t RsnConfigTest
(
   AliRsnAnalysisTask *task,
   Bool_t              isMC
)
{
	
// 	cutBPIDKaonSet
   // find the index of the corresponding list in the RsnInputHandler
   const char *listNameQuality = "qualityTPC";
   const char *listNamePID     = "kaonTPC";
   Int_t       qualityID       = -1;
   Int_t       pidID           = -1;
   AliAnalysisManager        *mgr   = AliAnalysisManager::GetAnalysisManager();
   AliMultiInputEventHandler *multi = dynamic_cast<AliMultiInputEventHandler*>(mgr->GetInputEventHandler());
   if (multi) {
      TObjArray *array = multi->InputEventHandlers();
      TObjArrayIter next(array);
      TObject *obj;
      while ( (obj = next()) ) {
         if (obj->InheritsFrom(AliRsnInputHandler::Class())) {
            AliRsnInputHandler *rsn = (AliRsnInputHandler*)obj;
            AliRsnDaughterSelector *sel = rsn->GetSelector();
            qualityID = sel->GetID(listNameQuality, kTRUE);
            pidID = sel->GetID(listNamePID, kTRUE);
         }
      }
   }
//    if (qualityID < 0) {
//       ::Error("RsnConfigTest", "Selector does not contain list for quality only");
//       return kFALSE;
//    }
//    if (pidID < 0) {
//       ::Error("RsnConfigTest", "Selector does not contain list for quality+PID");
//       return kFALSE;
//    }
   ::Info("RsnConfigTest", "ID for cut set named '%10s' = %d", listNameQuality, qualityID);
//    ::Info("RsnConfigTest", "ID for cut set named '%10s' = %d", listNamePID, pidID);
   
	   // add pair computation
   AddPairLoop(task, isMC, 0, 0, "test");
   // add monitor computation
   AddMonitorLoop(task, isMC, 0, "test");
	
//    // add pair computation
//    AddPairLoop(task, isMC, qualityID, qualityID, "test");
//    // add monitor computation
//    AddMonitorLoop(task, isMC, qualityID, "test");
// 	AddMonitorLoop(task, isMC, pidID, "test");
   return kTRUE;
}
开发者ID:sanyaade-speechtools,项目名称:alimv,代码行数:51,代码来源:RsnConfigTest.C

示例14: AddAnalysisManagerMixRsn

void AddAnalysisManagerMixRsn(TString analysisSource = "proof", TString analysisMode = "test", TString opts = "")
{

   Bool_t useMC = kFALSE;
   TString format = "esd";

   // ALICE stuff
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) mgr = new AliAnalysisManager("Martin Vala's AM");

   gROOT->LoadMacro("SetupAnalysisPlugin.C");
   AliAnalysisGrid *analysisPlugin = SetupAnalysisPlugin(analysisMode.Data());
   if (!analysisPlugin) return;

   gSystem->Load("libXMLParser.so");
   gSystem->Load("libANALYSIS.so");
   gSystem->Load("libANALYSISalice.so");
   gSystem->Load("libCORRFW.so");
   gSystem->Load("libEventMixing.so");
   gSystem->Load("libPWG2resonances.so");

   analysisPlugin->SetAliRootMode("ALIROOT"); // Loads AF libs by default
   // sets additional settings to plubin
   analysisPlugin->SetAdditionalLibs("libXMLParser.so libCORRFW.so libEventMixing.so  libPWG2resonances.so");
//     analysisPlugin->SetAdditionalLibs("libXMLParser.so libCORRFW.so libEventMixing.so  PWG2resonances.par RESONANCESMV.par");
//     analysisPlugin->SetAdditionalLibs("libXMLParser.so libCORRFW.so libEventMixing.so libPWG2resonances.so");

   // sets plugin to manager
   mgr->SetGridHandler(analysisPlugin);

   Info("AddAnalysisManagerMixRsn.C", "Creating AliMultiInputEventHandler ...");
   AliMultiInputEventHandler *mainInputHandler = new AliMultiInputEventHandler();
   Info("AddAnalysisManagerMixRsn.C", "Creating esdInputHandler ...");
   AliESDInputHandler *esdInputHandler = new AliESDInputHandler();
   mainInputHandler->AddInputEventHandler(esdInputHandler);

   if (useMC) {
      Info("AddAnalysisManagerMixRsn.C", "Creating mcInputHandler ...");
      AliMCEventHandler* mcInputHandler = new AliMCEventHandler();
      mainInputHandler->AddInputEventHandler(mcInputHandler);
   }
   // add main input handler (with mixing handler)
   mgr->SetInputEventHandler(mainInputHandler);

   // add mixing handler (uncomment to turn on Mixnig)
   gROOT->LoadMacro("MixingSetting.C");
   mainInputHandler->AddInputEventHandler(MixingSetting());
   // adds all tasks
   gROOT->LoadMacro("AddAnalysisTaskAllRsn.C");
   AddAnalysisTaskAllRsn(format, useMC, opts);
}
开发者ID:sanyaade-speechtools,项目名称:alimv,代码行数:51,代码来源:AddAnalysisManagerMixRsn.C

示例15: 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


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