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


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

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


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

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

示例2: InputData

//______________________________________________________________________________
// function to add specific data to be processed
Bool_t InputData ( const char* label ) {
TString datarun (label);

//______________________________________________________________________________
//  DEFINED INPUT DATA
if ( datarun.IsNull() ) { printf ( "InputData :: no data input" ); return kFALSE; }

// Get the pointer to the existing analysis manager via the static access method.
//==============================================================================
AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
if ( !mgr ) { ::Error ( "InputData.C", "No analysis manager to connect to." ); return kFALSE; }

// Check the analysis type using the event handlers connected to the analysis manager.
//==============================================================================
AliAnalysisAlien* plugin =  dynamic_cast <AliAnalysisAlien*> ( mgr->GetGridHandler() );
if ( !plugin ) { ::Error ( "InputData.C", "InputData :: plugin invalid" ); return kFALSE; }

TString     kGridRunPattern = "000"; // important for leading zeroes!!
Printf ( "data = %s" , datarun.Data() );

// ##################################################################################

// FILTER_p-p_113_LHC11a: Standard AODs + deltas  pp 2.76 GeV
// runlist for lego dataset LHC11a_pass4_AOD (pass4_wSDD) ; Jets_EMC_pp train
// MC anchored lhc11a : http://alimonitor.cern.ch/job_details.jsp?jt_description=LHC11a
if ( datarun.EqualTo ( "pp_lhc11a_aod" ) ) {
    plugin->SetRunPrefix ( kGridRunPattern.Data() );

    // AliEn data production directory
    plugin->SetGridDataDir ( "/alice/data/2011/LHC11a" );

    // Can be like: *AliESDs.root, */pass1/*AliESDs.root, ...
    plugin->SetDataPattern ( "*ESDs/pass4_with_SDD/AOD113/*AliAOD.root" );

    plugin->AddRunList ("146860 146859 146858 146856 146824 146817 146807 146806 146805 146804 146803 146802 146801 146748 146747 146746");
    return kTRUE;
    }

// ##################################################################################

// AOD LHC10d; 7 TeV
// MC anchored 10d :http://alimonitor.cern.ch/job_details.jsp?jt_description=LHC10d
// runlist for lego dataset LHC10d_pass4_AOD ; Jets_EMC_pp train
else if ( datarun.EqualTo ( "pp_lhc10d_aod" ) ) {
    plugin->SetRunPrefix ( kGridRunPattern.Data() );

    // AliEn data production directory
    plugin->SetGridDataDir ( "/alice/data/2010/LHC10d" );

    // Can be like: *AliESDs.root, */pass1/*AliESDs.root, ...
    plugin->SetDataPattern ( "*pass4/AOD172/*AliAOD.root" );

    TString list_lhc10d_AN_1 = "126432 126425 126424 126422 126409 126408 126407 126406 126405 126404 126403 126359 126352 126351 126350 126285 126284";
    TString list_lhc10d_AN_2 = "126283 126168 126167 126160 126158 126097 126090 126088 126082 126081 126078 126073 126008 126007 126004 125855 125851";
    TString list_lhc10d_AN_3 = "125850 125849 125848 125847 125844 125843 125842 125633 125632 125630 125628 125296 125295 125186 125156 125140 125139";
    TString list_lhc10d_AN_4 = "125134 125133 125101 125100 125097 125085 125083 125023 124751 122375 122374";

    plugin->AddRunList ( list_lhc10d_AN_1.Data() );
    plugin->AddRunList ( list_lhc10d_AN_2.Data() );
    plugin->AddRunList ( list_lhc10d_AN_3.Data() );
    plugin->AddRunList ( list_lhc10d_AN_4.Data() );
    return kTRUE;
    }

// ##################################################################################

// AOD LHC10e; 7 TeV
// MC anchored 10e : http://alimonitor.cern.ch/job_details.jsp?jt_description=LHC10e
// runlist for lego dataset LHC10e_pass4_AOD ; Jets_EMC_pp train
else if ( datarun.EqualTo ( "pp_lhc10e_aod" ) ) {
    plugin->SetRunPrefix ( kGridRunPattern.Data() );

    // AliEn data production directory
    plugin->SetGridDataDir ( "/alice/data/2010/LHC10e" );

    // Can be like: *AliESDs.root, */pass1/*AliESDs.root, ...
    plugin->SetDataPattern ( "*pass4/AOD172/*AliAOD.root" );

    TString list_lhc10e_AN_1 = "130850 130848 130847 130844 130842 130840 130834 130799 130798 130795 130793 130704 130696 130628 130623 130621 130620 130609 130608 130526";
    TString list_lhc10e_AN_2 = "130524 130520 130519 130517 130481 130480 130479 130375 130360 130358 130356 130354 130342 130178 130172 130168 130158 130157 130149 129983";
    TString list_lhc10e_AN_3 = "129966 129962 129961 129960 129744 129742 129738 129736 129735 129734 129729 129726 129725 129723 129666 129659 129653 129652 129651 129650";
    TString list_lhc10e_AN_4 = "129647 129641 129639 129599 129587 129586 129540 129536 129528 129527 129525 129524 129523 129521 129520 129519 129516 129515 129514 129513";
    TString list_lhc10e_AN_5 = "129512 129042 128913 128855 128853 128850 128843 128836 128835 128834 128833 128824 128823 128820 128819 128778 128777 128678 128677 128621";
    TString list_lhc10e_AN_6 = "128615 128611 128609 128605 128596 128594 128592 128582 128506 128505 128504 128503 128498 128495 128494 128486 128452 128366";

    plugin->AddRunList ( list_lhc10e_AN_1.Data() );
    plugin->AddRunList ( list_lhc10e_AN_2.Data() );
    plugin->AddRunList ( list_lhc10e_AN_3.Data() );
    plugin->AddRunList ( list_lhc10e_AN_4.Data() );
    plugin->AddRunList ( list_lhc10e_AN_5.Data() );
    plugin->AddRunList ( list_lhc10e_AN_6.Data() );
    return kTRUE;
    }

// ##################################################################################
// MC anchored lhc13g : http://alimonitor.cern.ch/job_details.jsp?jt_description=LHC13g
// AOD LHC13g; 2.76 TeV
// LHC13g_AOD155 Jets_EMC_pp train
//.........这里部分代码省略.........
开发者ID:adriansev,项目名称:jetfinder,代码行数:101,代码来源:InputData.C

示例3: RsnGridPlugin

void RsnGridPlugin(TString analysisMode) {

   Bool_t valid = kTRUE;
   TString dsConfig = AliAnalysisManager::GetGlobalStr("rsnTrainDSConfig",valid);
   Int_t globalTrainID = AliAnalysisManager::GetGlobalInt("rsnGlobalTrainID",valid);

   Int_t numRuns = AliAnalysisManager::GetGlobalInt("rsnGridNumRuns",valid);
   Int_t numRunsSkip = AliAnalysisManager::GetGlobalInt("rsnGridNumRunsSkip",valid);

   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) {
      Printf("Error[RsnGridPlugin] mgr is null !!!");
      return;
   }

   AliAnalysisAlien *plugin = (AliAnalysisAlien *) mgr->GetGridHandler();
   if (!plugin) {
      Printf("Error[RsnGridPlugin] : plugin is null !!!");
      return;
   }

   // getting latest train id
   TString rsnTrainName = gSystem->BaseName(dsConfig.Data());
   rsnTrainName.ReplaceAll(".txt","");
   rsnTrainName.Append(TString::Format("/%03d/%d_%d",globalTrainID,numRunsSkip,numRuns).Data());

   if (!gGrid) TGrid::Connect("alien://");
   if (!gGrid) return;
   TGridResult *r = gGrid->Query(TString::Format("%s/RsnTrain/%s",gGrid->GetHomeDirectory(),rsnTrainName.Data()).Data(),"*/analysis.root");
   Int_t idRsnTrain = 0;
   if (r) {
      TString s = r->GetKey(r->GetSize()-1,"lfn");
      s.ReplaceAll("/analysis.root","");
      s = gSystem->BaseName(s);
      if (!s.IsNull()) idRsnTrain = s.Atoi();
      if (!analysisMode.CompareTo("full")) idRsnTrain++;
   }
   rsnTrainName.Append(Form("/%03d",idRsnTrain));

   TString rsnTrainWkDir = TString::Format("RsnTrain/%s",rsnTrainName.Data()).Data();
   Info("RsnGridPlugin()",TString::Format("RSN Train directory : %s%s",gGrid->GetHomeDirectory(),rsnTrainWkDir.Data()).Data());

   plugin->SetGridWorkingDir(rsnTrainWkDir.Data());
   plugin->SetGridOutputDir("output"); // In this case will be $HOME/work/output

   plugin->SetAPIVersion("V1.1x");

   TString rootver = AliAnalysisManager::GetGlobalStr("rsnLegoTrainROOTversion",valid);
   plugin->SetROOTVersion(rootver.Data());

   TString alirootVersion = AliAnalysisManager::GetGlobalStr("rsnLegoTrainAliROOTversion",valid);
   if (alirootVersion.IsNull()) {
      if (gSystem->Getenv("ALICE_ROOT")) alirootVersion = gSystem->GetFromPipe("aliroot --version | awk '{print $3}'");
   }
   plugin->SetAliROOTVersion(alirootVersion.Data());

   plugin->SetExecutableCommand("aliroot -b -q");

   plugin->SetAnalysisMacro("RsnTrain.C");
   plugin->SetMasterResubmitThreshold(90);
   plugin->SetTTL(84600);
   plugin->SetInputFormat("xml-single");
   plugin->SetJDLName("RsnTrain.jdl");
   plugin->SetPrice(1);
   plugin->SetSplitMode("se");
   plugin->SetNtestFiles(2);
   plugin->SetMergeViaJDL();
   plugin->SetOverwriteMode(kFALSE);
   //    plugin->SetKeepLogs(kTRUE);

   RsnSetData(plugin,dsConfig,numRuns,numRunsSkip,1000);

   plugin->SetSplitMaxInputFileNumber(25);

   //   Fatal("RsnDataSet","No dataset found !!!");
}
开发者ID:fbellini,项目名称:AliRsn,代码行数:76,代码来源:RsnGridPlugin.C


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