Example #1
0
AliAnalysisAlien *CreateGridHandler(){
        //
        // Setup main settings of the Alien plugin
        //
        AliAnalysisAlien *plugin = new AliAnalysisAlien();
        plugin->SetRunMode(g_plugin_mode.Data());
        if(!g_plugin_mode.CompareTo("Terminate"))
                plugin->SetMergeViaJDL(kFALSE);
        else
                plugin->SetMergeViaJDL(kTRUE);
        plugin->SetOverwriteMode();
        plugin->SetNtestFiles(1);

        plugin->SetAPIVersion("V1.1x");
        plugin->SetROOTVersion(g_root_version.Data());
        plugin->SetAliROOTVersion(g_aliroot_version.Data());

        plugin->SetOutputToRunNo();
        plugin->AddIncludePath("-I. .I$ALIEN_ROOT/api/lib -I$ROOTSYS/lib -I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT/PWGHF/ -I$ALICE_ROOT/PWGHF/hfe/macros -I$ALICE_ROOT/PWGHF/hfe -I$ALICE_ROOT/ANALYSIS -I$ALICE_ROOT/TENDER/Tender -I$ALICE_ROOT/TENDER/TenderSupplies -I$ALICE_ROOT/PWG/ -I$ALICE_ROOT/PWG/FLOW -I$ALICE_ROOT/PWG/Base -I$ALICE_ROOT/PWG/Tasks");
        plugin->SetAdditionalLibs("libGui.so  libXMLParser.so libSTEERBase.so libESD.so libAOD.so libCDB.so libANALYSIS.so libANALYSISalice.so libCORRFW.so  libPWGflowBase.so libPWGflowTasks.so libPWGHFhfe.so libTender.so libProof.so libRAWDatabase.so libSTEER.so libTOFbase.so libPWGTRD.so");
   
        plugin->SetDefaultOutputs(kFALSE);
        plugin->SetOutputFiles("AnalysisResults.root"); 
        plugin->SetExecutableCommand("aliroot -b -q");
        plugin->SetTTL(30000);
        plugin->SetInputFormat("xml-single");
        plugin->SetPrice(1);      
        plugin->SetSplitMode("se");
        return plugin;
}
AliAnalysisGrid *AnalysisConfig(TString analysisMode,
                                const char *aliphyiscsVersion,
                                const char *alirootVersion,
                                const char *rootVersion) {

  AliAnalysisAlien *plugin = new AliAnalysisAlien();

  // Setting software versions
  plugin->SetROOTVersion(rootVersion);
  plugin->SetAliROOTVersion(alirootVersion);
  plugin->SetAliPhysicsVersion(aliphyiscsVersion);

  // Overwrite all generated files, datasets and output results from a previous
  // session
  plugin->SetOverwriteMode();
  // Set the run mode (can be "full", "test", "offline", "submit" or
  // "terminate")
  plugin->SetRunMode(analysisMode.Data()); // VERY IMPORTANT - DECRIBED BELOW

  // adds Proof setting
  MySetupAnalysisPluginProof(plugin, analysisMode);

  // adds AliEn settings
  MySetupAnalysisPluginAliEn(plugin);

  return plugin;
}
Example #3
0
AliAnalysisGrid* CreateAlienHandler(TString mode="test",TString fname="testName"){
  AliAnalysisAlien *plugin = new AliAnalysisAlien();
  plugin->SetOverwriteMode();
  plugin->SetExecutableCommand("aliroot -q -b");  
  plugin->SetRunMode(mode.Data());
  plugin->SetNtestFiles(20);
  // Set versions of used packages
  plugin->SetAPIVersion("V1.1x");
  //plugin->SetROOTVersion("v5-34-26");
  plugin->SetAliROOTVersion("v5-07-20");
  plugin->SetAliPhysicsVersion("vAN-20160203");
  // Declare input data to be processed.
  plugin->SetNrunsPerMaster(100);
  plugin->SetSplitMaxInputFileNumber(15); // 3 in the LEGO trains

    plugin->SetGridDataDir("/alice/data/2013/LHC13c/");
    plugin->SetGridWorkingDir(Form("%s/",fname.Data()));
    plugin->SetRunPrefix("000"); 
    plugin->SetDataPattern("/ESDs/pass2/*/AliESDs.root");
    plugin->SetAnalysisMacro("TaskDeuteronTreeTest.C");
    plugin->SetExecutable("TaskDeuteronTreeTest.sh");
    plugin->SetJDLName("TaskDeuteronTreeTest.jdl");
    Int_t runnumbers[]={195596,195592};

    for(Int_t irun=0;irun<2;irun++){
      Printf("%d %d",irun,runnumbers[irun]);
      plugin->AddRunNumber(runnumbers[irun]);
    }

 

    TString extraLibs;
  plugin->AddIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_PHYSICS/include");
  
  //plugin->SetAdditionalLibs("libCORRFW.so libPWGTools.so libPWGCFCorrelationsBase.so libPWGCFCorrelationsDPhi.so AliAnalysisTaskPhiCorrelations.cxx AliAnalysisTaskPhiCorrelations.h");
  //plugin->SetAnalysisSource("AliAnalysisTaskPhiCorrelations.cxx");

  plugin->SetGridOutputDir("output"); // In this case will be $HOME/work/output
  
  // Declare the output file names separated by blancs.
  // (can be like: file.root or file.root@ALICE::Niham::File)
  //plugin->SetDefaultOutputs(0);
  //plugin->SetOutputFiles("AnalysisResults.root.root");
  plugin->SetMergeViaJDL(kTRUE);
  plugin->SetOneStageMerging(kFALSE);
  //plugin->SetMaxMergeFiles(40);
  //plugin->SetMaxMergeStages(4);
  
  plugin->SetTTL(50000);
  // Optionally set input format (default xml-single)
  plugin->SetInputFormat("xml-single");
  // Optionally modify job price (default 1)
  plugin->SetPrice(1);      
  // Optionally modify split mode (default 'se')    
  //plugin->SetSplitMaxInputFileNumber();
  plugin->SetSplitMode("se");
  return plugin;
}
Example #4
0
//___________________________________________________________
AliAnalysisAlien *CreateAlienHandler(Bool_t isProof){
  //if(!AliAnalysisGrid::CreateToken()) return NULL;
  if(!FindDependentPackages()) return NULL;
  AliAnalysisAlien *alienplugin = new AliAnalysisAlien;
   
  // common settings
  alienplugin->SetAliROOTVersion(aliroot_version);
  alienplugin->SetROOTVersion(root_version);
  alienplugin->SetAPIVersion(api_version);
  alienplugin->SetAdditionalLibs("libPWGHFhfe.so");
  alienplugin->SetDefaultOutputs(kTRUE);
  if(isProof){
    // proof mode
    if(analysis_mode.Contains("test")) alienplugin->SetRunMode("test");
    alienplugin->SetProofCluster("alice_caf.cern.ch");
    alienplugin->SetRootVersionForProof(root_version);
    alienplugin->SetAliRootMode("aliroot");
  } else {
    // grid mode
    alienplugin->SetRunMode(analysis_mode.Data());
    // default setting that need no deeper logic
    alienplugin->SetJDLName("hfeanalysis.jdl");
    alienplugin->SetExecutable("hfeanalysis.sh");
    alienplugin->SetAnalysisMacro("hfeanalysis.C");
    alienplugin->SetValidationScript("hfevalidate.sh");
    alienplugin->SetGridWorkingDir("hfeanalysis");
    /*alienplugin->SetOutputArchive();
    alienplugin->SetDefaultOutputs();*/
    alienplugin->SetOverwriteMode();
    alienplugin->SetFastReadOption();
    alienplugin->SetSplitMaxInputFileNumber(5);
    alienplugin->SetTTL(30000);
    alienplugin->SetInputFormat("xml-single");
    alienplugin->SetPrice(1);
    alienplugin->SetSplitMode("se");
    alienplugin->SetNtestFiles(1);

    // Merging setting, only needed in terminate or full mode
    if(analysis_mode.Contains("full") || analysis_mode.Contains("terminate")){
      alienplugin->SetMergeViaJDL();
      alienplugin->SetMaxMergeFiles(50);
      alienplugin->SetMaxMergeStages(5);
    }
  }
  return alienplugin;
}
Example #5
0
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 !!!");
}
Example #6
0
AliAnalysisGrid* CreateAlienHandlerHadEt(Int_t dataset, Bool_t data, Int_t test, Int_t material, Bool_t altV0Scale = kFALSE, bool runCompiledVersion = kFALSE, int simflag = 0)
{
  // Check if user has a valid token, otherwise make one. This has limitations.
  // One can always follow the standard procedure of calling alien-token-init then
  //   source /tmp/gclient_env_$UID in the current shell.
  //if (!AliAnalysisGrid::CreateToken()) return NULL;
  AliAnalysisAlien *plugin = new AliAnalysisAlien();

  // Overwrite all generated files, datasets and output results from a previous session
  plugin->SetOverwriteMode();
  // Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
  if(test==1){
    plugin->SetRunMode("test");  // VERY IMPORTANT - DECRIBED BELOW
  }
  else{
    if(test==0){
      plugin->SetRunMode("full");  // VERY IMPORTANT - DECRIBED BELOW
    }
    else{
      plugin->SetRunMode("terminate");  // VERY IMPORTANT - DECRIBED BELOW
    }
  }
  //needed for local testing?
  //plugin->SetFileForTestMode("files.txt"); // file should contain path name to a local directory containg *ESDs.root etc
  // Set versions of used packages 
   plugin->SetAPIVersion("V1.1x");
   plugin->SetROOTVersion("v5-34-08-6");
   plugin->SetAliROOTVersion("vAN-20140624");
  // Declare input data to be processed.

   plugin->AddIncludePath("-I$ALICE_ROOT/PWGUD/base  -I$ALICE_ROOT/ANALYSIS -I$ALICE_ROOT/PWGPP -I$ALICE_ROOT/PWGPP/ITS");
  // Method 1: Create automatically XML collections using alien 'find' command.
  // Define production directory LFN
  //   plugin->SetGridDataDir("/alice/sim/LHC10a18");
  // Set data search pattern
  //   plugin->SetDataPattern("*ESDs.root");  // simulated, tags not used
  //   plugin->SetDataPattern("*ESDs/pass4/*ESDs.root"); // real data check reco pass and data base directory
  //   plugin->SetRunPrefix("000");   // real data
  //   plugin->SetDataPattern("*tag.root");  // Use ESD tags (same applies for AOD's)
  // ...then add run numbers to be considered
  //   plugin->AddRunNumber(125020);    // simulated
  //   plugin->AddRunNumber(104065);  // real data

  // Method 2: Declare existing data files (raw collections, xml collections, root file)
  // If no path mentioned data is supposed to be in the work directory (see SetGridWorkingDir())
  // XML collections added via this method can be combined with the first method if
  // the content is compatible (using or not tags)
  //plugin->AddDataFile("tag.xml");
  //   plugin->AddDataFile("/alice/data/2008/LHC08c/000057657/raw/Run57657.Merged.RAW.tag.root");
   TString outputdir = "etPbPbSim";
   if(data)outputdir = "etPbPbData";
  if(dataset==20100){//PbPb 2.76 TeV
    if(data){//185 jobs
      cout<<"Running over data"<<endl;
      plugin->SetGridDataDir("/alice/data/2010/LHC10h");//PbPb data
      plugin->SetDataPattern("*ESDs/pass2/*ESDs.root");
      plugin->SetRunPrefix("000");   // real data

    }
    else{
      cout<<"Running over MC"<<endl;
      if(material==0){
	  plugin->SetGridDataDir("/alice/sim/LHC11a10a_bis");
	//plugin->SetGridDataDir("/alice/sim/LHC11a4_bis");//PbPb simulation
      }
      if(material==1){//7% more material
	plugin->SetGridDataDir("/alice/sim/LHC10h9");//PbPb simulation
      }
      if(material==-1){//7% less material
	plugin->SetGridDataDir("/alice/sim/LHC10h10");//PbPb simulation
      }
      if(material==10){//OK it's a cheat but this runs on DPM jet
	plugin->SetGridDataDir("/alice/sim/LHC10h2");//PbPb simulation
      }
      if(material==11){//OK it's a cheat but this runs on AMPT
	plugin->SetGridDataDir(" /alice/sim/LHC11a9a");//PbPb simulation
	plugin->AddRunNumber(137366);
      }
      plugin->SetDataPattern("*ESDs.root");
      //plugin->SetGridWorkingDir("etPbPbSim");
    }
    if(simflag==0){//not really using it as a simflag but that way I don't need a new argument...
      plugin->AddRunNumber(139465);
      outputdir += "139465";
    }
    if(simflag==1){//not really using it as a simflag but that way I don't need a new argument...
      outputdir += "138442";
      plugin->AddRunNumber(138442);
    }
    if(simflag==2){//not really using it as a simflag but that way I don't need a new argument...
      outputdir += "138364";
      plugin->AddRunNumber(138364);
    }
    if(simflag==3){//not really using it as a simflag but that way I don't need a new argument...
      outputdir += "138396";
      plugin->AddRunNumber(138396);
    }
    if(simflag==4){//not really using it as a simflag but that way I don't need a new argument...
      outputdir += "137722";
      plugin->AddRunNumber(137722);
    }
    if(simflag==5){//not really using it as a simflag but that way I don't need a new argument...
      outputdir += "137366";
      plugin->AddRunNumber(137366);
    }
    if(simflag==6){//not really using it as a simflag but that way I don't need a new argument...
      outputdir += "137161";
      plugin->AddRunNumber(137161);
    }
    cout<<"writing to "<<outputdir.Data()<<endl;
  }
  else{
    if(dataset==2011){//PbPb 2.76 TeV
      if(data){//185 jobs
	cout<<"Running over data"<<endl;
	 plugin->SetGridDataDir("/alice/data/2011/LHC11h_2");//PbPb data
	 plugin->SetDataPattern("*ESDs/pass2/*ESDs.root");
	 plugin->SetRunPrefix("000");   // real data
      }
      else{
	cout<<"Running over MC"<<endl;
	if(simflag==0){//2011 production - 0-10%
	  cout<<"I am here setting grid data dir"<<endl;
// 	  outputDir = outputDir + "LHC13e1a";
	  plugin->SetGridDataDir("/alice/sim/2013/LHC13e1a");
	}
	if(simflag==1){//2011 production - 0-10%
	  cout<<"I am here setting grid data dir"<<endl;
// 	  outputDir = outputDir + "LHC13e1a";
	  plugin->SetGridDataDir("/alice/sim/2013/LHC13e1b");
	}
	if(simflag==2){//2011 production - 0-10%
	  cout<<"I am here setting grid data dir"<<endl;
// 	  outputDir = outputDir + "LHC13e1a";
	  plugin->SetGridDataDir("/alice/sim/2013/LHC13e1b");
	}
      }
      plugin->AddRunNumber(168464);
    }
    if(dataset==2009){//pp 900 GeV
      if(data){//only 233 jobs!
	cout<<"Running over data"<<endl;
	plugin->SetGridDataDir("/alice/data/2010/LHC10c");//PbPb data
	//plugin->SetDataPattern("*ESDs/pass3/*ESDs.root");
	plugin->SetDataPattern("*ESDs/pass3/*ESDs.root");
	plugin->SetRunPrefix("000");   // real data
      }
      else{//sim over 1500 jobs, some get killed because it's above quota
	cout<<"Running over MC"<<endl;
	if(simflag==0){
	  if(material==0){
	    plugin->SetGridDataDir("/alice/sim/LHC11b1a");//PbPb simulation
	  }
	  if(material==1){//10% more material budget
	    plugin->SetGridDataDir("/alice/sim/LHC11b1b");//PbPb simulation
	  }
	  if(material==-1){//10% less material budget
	    plugin->SetGridDataDir("/alice/sim/LHC11b1c");//PbPb simulation
	  }
	}
	if(simflag==1)	plugin->SetGridDataDir("/alice/sim/2011/LHC11h1a");//PYTHIA
	if(simflag==2)	plugin->SetGridDataDir("/alice/sim/2011/LHC11h1b");//PHOJET
	if(simflag==3)	plugin->SetGridDataDir("/alice/sim/2011/LHC11h1c");//PYTHIA Flat
	plugin->SetDataPattern("*ESDs.root");
      }
      plugin->AddRunNumber(118506);
//       plugin->AddRunNumber(121040);
//       plugin->AddRunNumber(121039);
//       plugin->AddRunNumber(118561);
//       plugin->AddRunNumber(118560);
//       plugin->AddRunNumber(118558);
//       plugin->AddRunNumber(118557);
//       plugin->AddRunNumber(118556);
//       plugin->AddRunNumber(118518);
//       plugin->AddRunNumber(118512);
//       plugin->AddRunNumber(118507);
//       plugin->AddRunNumber(118506);
//if(data){
// 	plugin->AddRunNumber(118504);
// 	plugin->AddRunNumber(118503);
//    }
    }
  
    if(dataset==20111){//pp 2.76 TeV 
      if(data){//257 jobs
	cout<<"Running over data"<<endl;
	plugin->SetGridDataDir("/alice/data/2011/LHC11a");//
	plugin->SetDataPattern("*ESDs/pass4_with_SDD/*ESDs.root");
	plugin->SetRunPrefix("000");   // real data
      }
      else{//sim - 332 jobs
	cout<<"Running over MC"<<endl;
	if(simflag==0)	plugin->SetGridDataDir("/alice/sim/LHC11b10a");//
	if(simflag==1)	plugin->SetGridDataDir("/alice/sim/2011/LHC11h5a");//PYTHIA
	if(simflag==2)	plugin->SetGridDataDir("/alice/sim/2011/LHC11h5b");//PHOJET
	if(simflag==3)	plugin->SetGridDataDir("/alice/sim/2011/LHC11h5c");//PYTHIA Flat
	plugin->SetDataPattern("*ESDs.root");
      }
//       plugin->AddRunNumber(146860);
//       plugin->AddRunNumber(146859);
//       plugin->AddRunNumber(146856);
//       plugin->AddRunNumber(146824);
//       plugin->AddRunNumber(146817);
//       plugin->AddRunNumber(146806);
//       plugin->AddRunNumber(146805);
//       plugin->AddRunNumber(146804);
//       plugin->AddRunNumber(146803);
//       plugin->AddRunNumber(146802);
//       plugin->AddRunNumber(146801);
//       plugin->AddRunNumber(146748);
//       plugin->AddRunNumber(146747);
//       plugin->AddRunNumber(146746);

  //     plugin->AddRunNumber(146860);
//       plugin->AddRunNumber(146859);
//       plugin->AddRunNumber(146858);
//       plugin->AddRunNumber(146857);
//       plugin->AddRunNumber(146856);
      //        plugin->AddRunNumber(146824);
      //        if(data){//these productions are not yet done for MC
      // 	 plugin->AddRunNumber(146817);
      // 	 plugin->AddRunNumber(146807);
      // 	 plugin->AddRunNumber(146806);
      // 	 plugin->AddRunNumber(146805);
      // 	 plugin->AddRunNumber(146804);
      // 	 plugin->AddRunNumber(146803);
      // 	 plugin->AddRunNumber(146802);
      //        }
      plugin->AddRunNumber(146805);

    }
    if(dataset==2010){//pp 7 TeV
      if(data){//data - 569 jobs
	cout<<"Running over 7 TeV data"<<endl;
	plugin->SetGridDataDir("/alice/data/2010/LHC10e");//PbPb data
	plugin->SetDataPattern("*ESDs/pass2/*ESDs.root");
	cout<<"Setting run prefix to be 000"<<endl;
	plugin->SetRunPrefix("000");   // real data
      }
      else{//sim- 346 jobs
	if(simflag==0)	plugin->SetGridDataDir("/alice/sim/LHC10e20");//
	if(simflag==1)	plugin->SetGridDataDir("/alice/sim/2011/LHC11h4a");//PYTHIA
	if(simflag==2)	plugin->SetGridDataDir("/alice/sim/2011/LHC11h4b");//PHOJET
	if(simflag==3)	plugin->SetGridDataDir("/alice/sim/2011/LHC11h4c");//PYTHIA Flat
	plugin->SetDataPattern("*ESDs.root");
      }
      plugin->AddRunNumber("130795");
// 	plugin->AddRunNumber("130840");
// 	plugin->AddRunNumber("130834");
// 	plugin->AddRunNumber("130833");
// 	plugin->AddRunNumber("130831");
// 	plugin->AddRunNumber("130804");
// 	plugin->AddRunNumber("130803");
// 	plugin->AddRunNumber("130802");
// 	plugin->AddRunNumber("130799");
// 	plugin->AddRunNumber("130798");
// 	plugin->AddRunNumber("130795");
    }

    if(dataset==2012){//pp 8 TeV
      if(data){//data - 569 jobs
	cout<<"Running over 8 TeV data"<<endl;
	plugin->SetGridDataDir("/alice/data/2012/LHC12b");//PbPb data
	plugin->SetDataPattern("*ESDs/pass1/*ESDs.root");
	cout<<"Setting run prefix to be 000"<<endl;
	plugin->SetRunPrefix("000");   // real data
      }
      else{//sim- 346 jobs
	plugin->SetGridDataDir("/alice/sim/2012/LHC12c1b");//
      }
      //plugin->AddRunNumber("177799");
      plugin->AddRunNumber("178030");
    }
    if(dataset==2013){//pPb 
      if(data){//data - 569 jobs
	cout<<"Running over pPb data"<<endl;
	plugin->SetGridDataDir("/alice/data/2013/LHC13b");//PbPb data
	plugin->SetDataPattern("*ESDs/pass3/*ESDs.root");
	cout<<"Setting run prefix to be 000"<<endl;
	plugin->SetRunPrefix("000");   // real data
      }
      else{//sim- 346 jobs
	plugin->SetGridDataDir("/alice/sim/2013/LHC13b3");//
      }
      plugin->AddRunNumber("195483");
    }
  }


  if(dataset==20100){//PbPb 2.76 TeV
    if(data){
      //plugin->SetGridWorkingDir("etPbPbData");
      plugin->SetGridWorkingDir(outputdir.Data());
    }
    else{
      if(material==0){plugin->SetGridWorkingDir(outputdir.Data());}
      if(material==-1) plugin->SetGridWorkingDir("etPbPbSimMatBudLow");
      if(material==1) plugin->SetGridWorkingDir("etPbPbSimMatBudHigh");
      if(material==10)  plugin->SetGridWorkingDir("etPbPbSimDPMJET");
       if(material==11)  plugin->SetGridWorkingDir("etPbPbSimAMPT");
    }
  }
  else{
    if(dataset==2011){//PbPb 2.76 TeV
      if(data){
	plugin->SetGridWorkingDir("etPbPbData2011");
      }
      else{
	if(simflag==0){plugin->SetGridWorkingDir("etPbPbSim2011LHC13e1a");}
	if(simflag==1){plugin->SetGridWorkingDir("etPbPbSim2011LHC13e1b");}
	if(simflag==2){plugin->SetGridWorkingDir("etPbPbSim2011LHC13e1c");}
      }
    }
    if(dataset==2009){//pp 900 GeV
      if(data){
	plugin->SetGridWorkingDir("etpp900GeVData");
      }
      else{
	if(simflag==0){
	  if(material==0) plugin->SetGridWorkingDir("etpp900GeVSim");
	  if(material==-1) plugin->SetGridWorkingDir("etpp900GeVSimMatBudLow");
	  if(material==1) plugin->SetGridWorkingDir("etpp900GeVSimMatBudHigh");
	}
	if(simflag==1)	plugin->SetGridWorkingDir("etpp900GeVSimPYTHIA");//PYTHIA
	if(simflag==2)	plugin->SetGridWorkingDir("etpp900GeVSimPHOJET");//PHOJET
	if(simflag==3)	plugin->SetGridWorkingDir("etpp900GeVSimPYTHIAFLAT");//PYTHIA Flat
      }
    }
    if(dataset==20111){//pp 2.76 TeV
      if(data){
	//plugin->SetGridWorkingDir("etpp276TeVData");
      }
      else{
	if(altV0Scale) plugin->SetGridWorkingDir("etpp276TeVSimAlt");
	else{
	  // plugin->SetGridWorkingDir("etpp276TeVSim");
	  
	  if(simflag==0)	plugin->SetGridWorkingDir("etpp276TeVSim");//
	  if(simflag==1)	plugin->SetGridWorkingDir("etpp276TeVSimPYTHIA");//PYTHIA
	  if(simflag==2)	plugin->SetGridWorkingDir("etpp276TeVSimPHOJET");//PHOJET
	  if(simflag==3)	plugin->SetGridWorkingDir("etpp276TeVSimPYTHIAFLAT");//PYTHIA Flat
	}
      }
    }
    if(dataset==2010){//pp 7 TeV
      if(data){
	plugin->SetGridWorkingDir("etpp7TeVData");
      }
      else{
	if(simflag==0)	plugin->SetGridWorkingDir("etpp7TeVSim");//
	if(simflag==1)	plugin->SetGridWorkingDir("etpp7TeVSimPYTHIA");//PYTHIA
	if(simflag==2)	plugin->SetGridWorkingDir("etpp7TeVSimPHOJET");//PHOJET
	if(simflag==3)	plugin->SetGridWorkingDir("etpp7TeVSimPYTHIAFLAT");//PYTHIA Flat
      }
    }
    if(dataset==2012){//pp 8 TeV
      if(data){
	plugin->SetGridWorkingDir("etpp8TeVData");
      }
      else{
	plugin->SetGridWorkingDir("etpp8TeVSim");
      }
    }
    if(dataset==2013){//pPb
      if(data){
	plugin->SetGridWorkingDir("etpPb5TeVData");
      }
      else{
	plugin->SetGridWorkingDir("etpPb5TeVSim");
      }
    }
  }

    cout<<"writing to "<<outputdir.Data()<<endl;

  // Define alien work directory where all files will be copied. Relative to alien $HOME.
  //plugin->SetGridWorkingDir("et");
  // Declare alien output directory. Relative to working directory.
  plugin->SetGridOutputDir("output"); // In this case will be $HOME/work/output
  // Declare the analysis source files names separated by blancs. To be compiled runtime IN THE SAME ORDER THEY ARE LISTED
  // using ACLiC on the worker nodes.
  //plugin->SetAnalysisSource("AliAnalysisTaskHadEt.cxx");
  //plugin->SetAnalysisSource("AliAnalysisEt.cxx AliAnalysisEtMonteCarlo.cxx AliAnalysisEtMonteCarloPhos.cxx AliAnalysisEtReconstructed.cxx AliAnalysisEtReconstructedPhos.cxx AliAnalysisHadEt.cxx AliAnalysisHadEtMonteCarlo.cxx AliAnalysisHadEtReconstructed.cxx AliAnalysisTaskHadEt.cxx AliAnalysisTaskTotEt.cxx");
  //TString sourcefiles = "AliAnalysisEtCuts.cxx AliAnalysisHadEtCorrections.cxx AliAnalysisEtCommon.cxx AliAnalysisHadEt.cxx AliAnalysisHadEtMonteCarlo.cxx AliAnalysisHadEtReconstructed.cxx AliAnalysisEtSelectionContainer.cxx AliAnalysisEtSelectionHandler.cxx AliAnalysisTaskTransverseEnergy.cxx AliAnalysisTaskHadEt.cxx";
  //plugin->SetAnalysisSource(sourcefiles.Data());
  if(!runCompiledVersion){
    plugin->SetAnalysisSource("AliAnalysisEtCuts.cxx AliAnalysisHadEtCorrections.cxx AliAnalysisEtCommon.cxx AliAnalysisHadEt.cxx AliAnalysisHadEtMonteCarlo.cxx AliAnalysisHadEtReconstructed.cxx AliAnalysisTaskTransverseEnergy.cxx AliAnalysisTaskHadEt.cxx");
  }
   
  //cout<<"Setting source files "<<sourcefiles<<endl;
  // Declare all libraries (other than the default ones for the framework. These will be
  // loaded by the generated analysis macro. Add all extra files (task .cxx/.h) here.
  //TString additionallibs = "AliAnalysisEtCuts.h AliAnalysisEtCuts.cxx AliAnalysisHadEtCorrections.h AliAnalysisHadEtCorrections.cxx  AliAnalysisEtSelectionContainer.cxx AliAnalysisEtSelectionHandler.cxx AliAnalysisTaskTransverseEnergy.cxx AliAnalysisEtCommon.h AliAnalysisEtCommon.cxx AliAnalysisHadEt.cxx AliAnalysisHadEtMonteCarlo.cxx AliAnalysisHadEtReconstructed.cxx AliAnalysisTaskHadEt.cxx AliAnalysisHadEt.h AliAnalysisHadEtMonteCarlo.h AliAnalysisHadEtReconstructed.h AliAnalysisTaskHadEt.h  AliAnalysisEtSelectionContainer.h AliAnalysisEtSelectionHandler.h AliAnalysisTaskTransverseEnergy.h corrections.root ConfigHadEtAnalysis.C ConfigHadEtMonteCarlo.C ConfigHadEtReconstructed.C physicsSelections.root";
  //TString additionallibs = "AliAnalysisEtCuts.h AliAnalysisEtCuts.cxx AliAnalysisHadEtCorrections.h AliAnalysisHadEtCorrections.cxx  AliAnalysisEtSelectionContainer.cxx AliAnalysisEtSelectionHandler.cxx AliAnalysisTaskTransverseEnergy.cxx AliAnalysisEtCommon.h AliAnalysisEtCommon.cxx AliAnalysisHadEt.cxx AliAnalysisHadEtMonteCarlo.cxx AliAnalysisHadEtReconstructed.cxx AliAnalysisTaskHadEt.cxx AliAnalysisHadEt.h AliAnalysisHadEtMonteCarlo.h AliAnalysisHadEtReconstructed.h AliAnalysisTaskHadEt.h  AliAnalysisEtSelectionContainer.h AliAnalysisEtSelectionHandler.h AliAnalysisTaskTransverseEnergy.h physicsSelections.root ConfigHadEtMonteCarlo.C  ConfigHadEtReconstructed.C corrections.root";
  //plugin->SetAdditionalLibs(additionallibs.Data());
  if(!runCompiledVersion){//
    plugin->SetAdditionalLibs( "libPWGUDbase.so AliAnalysisEtCuts.h AliAnalysisEtCuts.cxx AliAnalysisHadEtCorrections.h AliAnalysisHadEtCorrections.cxx AliAnalysisTaskTransverseEnergy.cxx AliAnalysisEtCommon.h AliAnalysisEtCommon.cxx AliAnalysisHadEt.cxx AliAnalysisHadEtMonteCarlo.cxx AliAnalysisHadEtReconstructed.cxx AliAnalysisTaskHadEt.cxx AliAnalysisHadEt.h AliAnalysisHadEtMonteCarlo.h AliAnalysisHadEtReconstructed.h AliAnalysisTaskHadEt.h AliAnalysisTaskTransverseEnergy.h ConfigHadEtMonteCarlo.C  ConfigHadEtReconstructed.C corrections.root");
  }
  else{
    plugin->SetAdditionalLibs( "ConfigHadEtMonteCarlo.C  ConfigHadEtReconstructed.C corrections.root libPWGUDbase.so libPWGLFtotEt.so");
  }
  // No need for output file names. Procedure is automatic. <-- not true
  //plugin->SetDefaultOutputs(kFALSE);
  //plugin->SetOutputFiles("Et.ESD.new.sim.root");
  // No need define the files to be archived. Note that this is handled automatically by the plugin.
  //   plugin->SetOutputArchive("log_archive.zip:stdout,stderr");
  // Set a name for the generated analysis macro (default MyAnalysis.C) Make this unique !
  plugin->SetAnalysisMacro("ChristinesEtAnalysis.C");
  // Optionally set maximum number of input files/subjob (default 100, put 0 to ignore). The optimum for an analysis
  // is correlated with the run time - count few hours TTL per job, not minutes !
  plugin->SetSplitMaxInputFileNumber(50);
  if(dataset==2013){//pPb 
    plugin->SetSplitMaxInputFileNumber(20);
    }
  // Optionally set number of failed jobs that will trigger killing waiting sub-jobs.
  //plugin->SetMaxInitFailed(5);
  // Optionally resubmit threshold.
  //plugin->SetMasterResubmitThreshold(90);
  // Optionally set time to live (default 30000 sec)
  plugin->SetTTL(20000);
  // Optionally set input format (default xml-single)
  plugin->SetInputFormat("xml-single");
  // Optionally modify the name of the generated JDL (default analysis.jdl)
  plugin->SetJDLName("TaskEt.jdl");
  // Optionally modify job price (default 1)
  plugin->SetPrice(1); 
  // Optionally modify split mode (default 'se')    
  plugin->SetSplitMode("se");
  plugin->SetTerminateFiles("event_stat.root") ;
  plugin->SetKeepLogs();
  plugin->SetMergeViaJDL();
  return plugin;
} 
Example #7
0
//######################################################################################################################################
AliAnalysisAlien* CreateAlienHandler ( const char* gridMode, const char* tag, unsigned int nr_test_files, unsigned int TTL,
                                       const char* outdir, const char subworkdir, const char* extradirlvl ) {

  AliAnalysisAlien* plugin = new AliAnalysisAlien();
  if ( !plugin ) { std::cout << "!!! -->> alien handler could not be created <<-- !!!" << std::endl; return NULL;}

  plugin->AddIncludePath("-I.");
  plugin->AddIncludePath("-I$ALICE_PHYSICS/include");
  plugin->AddIncludePath("-I$ALICE_ROOT/include");
  plugin->AddIncludePath("-I$FASTJET/include");
  plugin->AddIncludePath("-I/usr/include");

//   unsigned int       kGridMaxMergeFiles       = 100;            // Number of files merged in a chunk grid run range
//   unsigned int       kMaxInitFailed           = 10 ;            // Optionally set number of failed jobs that will trigger killing waiting sub-jobs.

  TString     kGridOutdir              = outdir ;       // AliEn output directory. If blank will become output_<kTrainName>
  TString     kGridSubWorkDir          = subworkdir ;   // sub working directory not to confuse different run xmls
  TString     kGridExtraAliendirLevel  = extradirlvl ;  // sub working directory not to confuse different run xmls
  TString     kWorkDir                 = tag;           // AliEn work dir; relative to AliEn $HOME
  TString     kTrainName               = "cdfjets";     // *CHANGE ME* (no blancs or special characters)

  TString macroName("");  macroName = Form("%s.C", kTrainName.Data());
  TString execName("");   execName  = Form("%s.sh", kTrainName.Data());
  TString jdlName("");    jdlName   = Form("%s.jdl", kTrainName.Data());

  // Set run mode.  Can be "full", "test", "offline", "submit" or "merge"
  plugin->SetRunMode(gridMode);
  if (std::strcmp(gridMode, "test")) { plugin->SetCheckCopy(kFALSE); }

  // Set the number of test files; set to kGridFilesPerJob as to evaluate the memory consumption and ttl on grid
  plugin->SetNtestFiles ( nr_test_files );

  // Job tag
  plugin->SetJobTag(tag);

  // AliEn directory containing the input packages
  plugin->SetGridWorkingDir(tag);

  // Declare alien output directory. Relative to working directory.
  plugin->SetGridOutputDir( kGridOutdir.Data() ); // In this case will be $HOME/work/output

  // Optionally modify the executable name (default analysis.sh)
  plugin->SetExecutable(execName.Data());

  // Optionally set a name for the generated analysis macro (default MyAnalysis.C)
  plugin->SetAnalysisMacro(macroName.Data());

  // Optionally modify the name of the generated JDL (default analysis.jdl)
  plugin->SetJDLName(jdlName.Data());

  // Use the output files connected to output containers from the analysis manager
  // rather than the files defined by SetOutputFiles
  plugin->SetDefaultOutputs(kTRUE);

  //********************   PLUGIN OPTIONS   ************************
  // min (nr,4) replicas in grid storage
  plugin->SetNumberOfReplicas(2);

  // Optionally set time to live
  plugin->SetTTL(TTL);

  // Optionally set maximum number of input files/subjob (default 100, put 0 to ignore)
  plugin->SetSplitMaxInputFileNumber ( nr_test_files );

  // Use xrootd tweaks to reduce timeouts in file access
  plugin->SetFastReadOption ( kFALSE );

  // Maximum initial consecutive subjobs accepted to fail.
  // plugin->SetMaxInitFailed ( kMaxInitFailed );

  // Optionally resubmit threshold.
  // plugin->SetMasterResubmitThreshold(90);

  // Number of runs per masterjob
  // plugin->SetNrunsPerMaster(1);

  // exit from aliensh after submmiting job
  plugin->SetDropToShell ( kTRUE );

  // Overwrite existing files if any
  plugin->SetOverwriteMode();

  // write the output to subdirs named after run number
  // plugin->SetOutputToRunNo(1);

  // Optionally set input format (default xml-single)
  plugin->SetInputFormat("xml-single");

  // Optionally modify job price (default 1)
  plugin->SetPrice(1);

  // We split per SE or file
  plugin->SetSplitMode("se");

  // MERGING - Enable merging via automatic JDL
  plugin->SetMergeViaJDL(kTRUE);

  // Maximum number of files to be merged in one chunk
  plugin->SetOneStageMerging(kFALSE);

  // Maximum number of merging stages
  plugin->SetMaxMergeStages(2);

  // Optionally set maximum number of files merged in a chunk (default 100, put 0 to ignore)
  // plugin->SetMaxMergeFiles ( kGridMaxMergeFiles );

  return plugin;
}
Example #8
0
AliAnalysisGrid* CreateAlienHandlerPbPb()
{
// Check if user has a valid token, otherwise make one. This has limitations.
// One can always follow the standard procedure of calling alien-token-init then
//   source /tmp/gclient_env_$UID in the current shell.
//   if (!AliAnalysisGrid::CreateToken()) return NULL;
   AliAnalysisAlien *plugin = new AliAnalysisAlien();
   plugin->SetOverwriteMode();
// Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
   plugin->SetRunMode("test");
//   plugin->SetRunMode("offline");
//   plugin->SetRunMode("full");
//   plugin->SetRunMode("terminate");
   plugin->SetNtestFiles(1);
// Set versions of used packages

   plugin->SetAPIVersion("V1.1x");
   plugin->SetROOTVersion("v5-33-02a");
   plugin->SetAliROOTVersion("v5-03-19-AN");
// Declare input data to be processed.
// Method 1: Create automatically XML collections using alien 'find' command.
// Define production directory LFN
// On real reconstructed data:
 plugin->SetGridDataDir("/alice/data/2011/LHC11h_2");
// Set data search pattern
plugin->SetDataPattern("*/pass2/*/AliESDs.root");

//same for pp MC:
//   plugin->SetGridDataDir("/alice/sim/LHC10f6a");
//  plugin->SetDataPattern("*/*/AliESDs.root");
// Data pattern for reconstructed data
//   plugin->SetDataPattern("*AliAOD.root"); //esta linea sirve para pruebas

   plugin->SetRunPrefix("000");   // real data

// ...then add run numbers to be considered
//   plugin->SetRunRange(122374,126437); //sim data
//10d
// plugin->AddRunNumber(126437); //sim data
//11h.pass2
plugin->AddRunNumber(170040); 
//   plugin->SetOutputSingleFolder("output");
   plugin->SetOutputToRunNo();
// Method 2: Declare existing data files (raw collections, xml collections, root file)
// If no path mentioned data is supposed to be in the work directory (see SetGridWorkingDir())
// XML collections added via this method can be combined with the first method if
// the content is compatible (using or not tags)
//   plugin->AddDataFile("tag.xml");
//   plugin->AddDataFile("/alice/data/2008/LHC08c/000057657/raw/Run57657.Merged.RAW.tag.root");
// Define alien work directory where all files will be copied. Relative to alien $HOME.
   plugin->SetGridWorkingDir("work");
// Declare alien output directory. Relative to working directory.
   plugin->SetGridOutputDir("output"); // In this case will be $HOME/work/output
// Declare the analysis source files names separated by blancs. To be compiled runtime
// using ACLiC on the worker nodes.
//   plugin->SetAnalysisSource("AliAnalysisHelperJetTasks.cxx AliAnalysisTaskPartonDisc.cxx");
   plugin->AddIncludePath("-I. .I$ALIEN_ROOT/api/lib -I$ROOTSYS/lib -I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT/PWGDQ/ -I$ALICE_ROOT/PWGDQ/dielectron/macrosLMEE -I$ALICE_ROOT/PWGDQ/dielectron -I$ALICE_ROOT/ANALYSIS -I$ALICE_ROOT/TENDER/Tender -I$ALICE_ROOT/TENDER/TenderSupplies");
 //  plugin->SetAdditionalLibs("libGui.so libXMLParser.so libSTEERBase.so libESD.so libAOD.so libCDB.so libANALYSIS.so libANALYSISalice.so libCORRFW.so libTender.so libProof.so libRAWDatabase.so libSTEER.so libTOFbase.so libPWGDQdielectron.so");// ConfigLowMassDiE.C")
   plugin->SetAdditionalLibs("libGui.so libXMLParser.so libSTEERBase.so libESD.so libAOD.so libCDB.so libANALYSIS.so libANALYSISalice.so libCORRFW.so libTender.so libProof.so libRAWDatabase.so libSTEER.so libTOFbase.so libPWGDQdielectron.so ConfigLowMassDiE.C");
   
// Declare all libraries (other than the default ones for the framework. These will be
// loaded by the generated analysis macro. Add all extra files (task .cxx/.h) here.
//   plugin->SetAdditionalLibs("AliAnalysisHelperJetTasks.h AliAnalysisHelperJetTasks.cxx AliAnalysisTaskPartonDisc.h AliAnalysisTaskPartonDisc.cxx");
// Declare the output file names separated by blancs.
// (can be like: file.root or file.root@ALICE::Niham::File)
//   plugin->SetOutputFiles("Output.root");
   plugin->SetDefaultOutputs(); 
   //or specify files:
   //plugin->SetDefaultOutputs(kFALSE);
     //plugin->SetOutputFiles("cbaumann_LMEEpp2010_out.root"); 
     
//   plugin->SetOutputFiles("cbaumann_lowmass_out.root cbaumann_lowmass_CF.root");
// Optionally define the files to be archived.
//   plugin->SetOutputArchive("log_archive.zip:stdout,stderr@disk=2 root_archive.zip:*.root@disk=2");
//   plugin->SetOutputArchive("log_archive.zip:stdout,stderr");
// Optionally set a name for the generated analysis macro (default MyAnalysis.C)
   plugin->SetAnalysisMacro("DielAnalysis.C");
// Optionally set maximum number of input files/subjob (default 100, put 0 to ignore)
//   plugin->SetSplitMaxInputFileNumber(2);
// Optionally modify the executable name (default analysis.sh)
   plugin->SetExecutable("DielAnalysis.sh");
   plugin->SetExecutableCommand("aliroot -b -q");
// Optionally set number of failed jobs that will trigger killing waiting sub-jobs.
//   plugin->SetMaxInitFailed(5);
// Optionally resubmit threshold.
//   plugin->SetMasterResubmitThreshold(90);
// Optionally set time to live (default 30000 sec)
   plugin->SetTTL(30000);
// Optionally set input format (default xml-single)
   plugin->SetInputFormat("xml-single");
// Optionally modify the name of the generated JDL (default analysis.jdl)
   plugin->SetJDLName("DielAnalysis.jdl");
// Optionally modify job price (default 1)
   plugin->SetPrice(1);      
// Optionally modify split mode (default 'se')    
   plugin->SetSplitMode("se");
   return plugin;
}