Ejemplo n.º 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;
}
Ejemplo n.º 2
0
AliAnalysisGrid *CreateAlienHandler()
{

  AliAnalysisAlien *plugin = new AliAnalysisAlien();
  //plugin->SetOverwriteMode();

  // Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
  //plugin->SetRunMode("test");
  plugin->SetRunMode("full");
  //plugin->SetRunMode("terminate");

  // Set versions of used packages
  plugin->SetAPIVersion("V1.1x");
  plugin->SetROOTVersion("v5-34-08-6");
  plugin->SetAliROOTVersion("vAN-20141031");

  // Set the path for finding the data
  plugin->SetGridDataDir("/alice/data/2010/LHC10h/");
  plugin->SetDataPattern("ESDs/pass2/AOD086/*/AliAOD.root"); // for testing over multiple files
  //plugin->SetDataPattern("ESDs/pass2/AOD086/0001/AliAOD.root"); // for testing over a single file
  plugin->SetRunPrefix("000");
  //plugin->AddRunNumber(137161);
  gROOT->ProcessLine(".L AddRunNumbers.C");
  int added = AddRunNumbers(plugin,0,95,"lhc10h");
  if(added<0) return NULL;

  // Set the path for the output
  plugin->SetGridWorkingDir("TaskExample"); // $HOME/TaskExample
  plugin->SetGridOutputDir("OutputTesting_X005"); // $HOME/TaskExample/OutputTesting

  // Specify the source code for the analysis
  plugin->SetAnalysisSource("AliAnalysisTaskExample.cxx"); // class file
  plugin->SetAdditionalLibs("AliAnalysisTaskExample.h AliAnalysisTaskExample.cxx"); // header space class

  // Default outputs (?)
  plugin->SetDefaultOutputs(); // ALWAYS use default outputs, code warns then crashes if not
  // The rest of these are optional, though some are very useful
  plugin->SetSplitMaxInputFileNumber(100); // default 100 input files/subjob
  plugin->SetMaxInitFailed(5); // default (?) jobs fail to kill waiting subjobs
  plugin->SetMasterResubmitThreshold(90); // default (?) resubmit threshold
  plugin->SetTTL(50000); // default 30000 sec time to live
  plugin->SetAnalysisMacro("TaskExample.C"); // default "MyAnalysis.C"
  plugin->SetExecutable("TaskExample.sh"); // default "analysis.sh"
  plugin->SetJDLName("TaskExample.jdl"); // default "analysis.jdl"
  plugin->SetInputFormat("xml-single"); // default "xml-single"
  plugin->SetPrice(1); // default 1 price to modify job
  plugin->SetSplitMode("se"); // default "se"

  return plugin;

}
Ejemplo n.º 3
0
// ======================================
// ===== ALIEN PLUGIN CONFIGURATION =====
// ======================================
//
// This macro configures an AliEn plugin in order to launch a job
// which runs a task from the resonance package on a list of runs
// which are processed separately.
//
// All the possible configuration parameters are arguments
// of the macro function, even if most of them have default
// values which the user will rarely change.
//
// The macro tries to synchronize some output names, using
// a unique name ('analysisName') to define all files that
// describe the output, the analysis macros/executables/JDL.
//
// Since the run mode can be more variable than the config
// it is not set here, but it is required in the run macro
// which uses the plugin.
//
// Considered that the arguments are many, they are explained
// inside the list of arguments in the macro definition.
// In ALL cases where a list of strings must be provided, its
// elements must be separated by a blank character.
//
AliAnalysisAlien* PluginByRunProof
(
   // all parameters which could often be customized
   // are placed at the beginning of the macro, while
   // all others can stay there with their default values:
   // -- analysisName   --> common name used for naming all analysis related files
   // -- dataset        --> dataset to be processed
   // -- testFile       --> used for test mode only
   // -- clusterName    --> PROOF cluster to be used
   const char *dataSet,
   const char *testFile,
   const char *clusterName,
   
   // -- proofReset     --> require or not the PROOF reset
   // -- alirootMode    --> the way AliROOT library are loaded
   // -- clearPack      --> to clear or not the PAR libraries
   Bool_t      proofReset  = kFALSE,
   const char *alirootMode = "default",
   Bool_t      clearPack   = kFALSE,

   // standard package versions
   const char *rootVersion    = "v5-28-00a",
   const char *aliVersion     = "v4-21-17a-AN"
)
{
   // create plugin object
   // with specifications which apply to a run-by-run execution
   // this creates by default also the job structure for merging
   AliAnalysisAlien *plugin = new AliAnalysisAlien;

   // package versions
   plugin->SetROOTVersion(rootVersion);
   plugin->SetAliROOTVersion(aliVersion);

   // additional libraries/includes
   //plugin->SetAdditionalLibs("libTENDER.so TENDERSupplies.par libEventMixing.so libPWG2resonances.so");
   plugin->SetAdditionalLibs("libEventMixing.so PWG2resonances.par");
   
   // PROOF-specific settings
   plugin->SetProofCluster(clusterName);
   plugin->SetProofDataSet(dataSet);
   plugin->SetProofReset(proofReset);
   plugin->SetProofConnectGrid(kTRUE);
   plugin->SetAliRootMode(alirootMode);
   plugin->SetClearPackages(clearPack);
   plugin->SetFileForTestMode(testFile);

   // the end!
   return plugin;
}
Ejemplo n.º 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;
}
Ejemplo n.º 5
0
AliAnalysisGrid *CreateAlienHandler()
{
    AliAnalysisAlien *plugin = new AliAnalysisAlien();

    plugin->SetRunMode("test"); // generate files and make local test on my PC
    //plugin->SetRunMode("offline"); // generate files that can be modified; no submission
    //plugin->SetRunMode("submit"); // submit files generated with offline mode
    //plugin->SetRunMode("full"); // generate files and submit
    //plugin->SetRunMode("terminate"); // do merging only in one job

    plugin->SetAPIVersion("V1.1x");
    plugin->SetAliPhysicsVersion("vAN-20151115-1");
    plugin->SetNtestFiles(1);
    //plugin->SetROOTVersion("v5-34-08-6");
    //plugin->SetAliROOTVersion("vAN-20141031");
    plugin->SetGridDataDir("/alice/data/2010/LHC10h/");
    plugin->SetDataPattern("ESDs/pass2/AOD160/0008/AliAOD.root");
    plugin->SetRunPrefix("000");

    int runNumber[] = {139510, 139507};
    int size = sizeof(runNumber)/sizeof(runNumber[0]);
    for(int i=0; i<size; i++) {
        plugin->AddRunNumber(runNumber[i]);
    }

    //plugin->AddRunNumber(139510);
    plugin->SetGridWorkingDir("TaskFlow"); // $HOME/TaskFlow
    plugin->SetGridOutputDir("OutputFlow"); // TaskFlow/OutputFlow
//  plugin->AddIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include");
    plugin->SetAnalysisSource("AliAnalysisTaskFlow.cxx");
    plugin->SetAdditionalLibs("AliAnalysisTaskFlow.h AliAnalysisTaskFlow.cxx");
    plugin->SetDefaultOutputs();
    plugin->SetOutputToRunNo();
    plugin->SetAnalysisMacro("Flow.C");
    plugin->SetSplitMaxInputFileNumber(400);
    plugin->SetMasterResubmitThreshold(90);
    plugin->SetTTL(20000);
    plugin->SetJDLName("Flow.jdl");
    plugin->SetExecutable("Flow.sh");
//	plugin->SetExecutableCommand("aliroot -b -q");

    return plugin;
}
Ejemplo n.º 6
0
void RunMacro(){
//     check the function for asymmetric TPC cut in ConfigHFEemcalMod....the rest is still necessary????

   // Firstly, set some variables
   const char* launch = "grid"; // grid, local (if your data is on your local machine, doesn't connect at all)
   const char*  mode = "test"; //test, full, terminate  (test= connect to grid but run locally, full= run on grid, terminate= merge output on grid)
   Bool_t pre_final_stage = kTRUE; //TRUE = merging done on grid, FALSE = merge happens locally   
   Int_t cyclenumber = 1;
   Bool_t debug = kTRUE;
   char* work_dir = "PhiCorrelations_LHC16q_0_20_noveto";
   char* output_dir = "output_2018_10_22_FAST";
   Int_t ttl = 50000;
   Int_t noffiles = 40;
   Int_t runcycle[]={0,1,31};
   //Int_t runcycle[]={0,16,31};
   Bool_t UseParfiles = kFALSE;

   // load libraries
   LoadLibraries();

// create and customize the alien handler
  AliAnalysisAlien *alienHandler = new AliAnalysisAlien();
      
    alienHandler->AddIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT -I$ALICE_ROOT/EMCAL -I$ALICE_ROOT/PYTHIA6 -I$ALICE_ROOT/ANALYSIS -I$ALICE_PHYSICS/PWGGA -I$ALICE_PHYSICS/PWGHF -I$ALICE_PHYSICS/PWGHF/hfe -I$ALICE_ROOT/CONTAINERS -I$ALICE_ROOT/STEER/STEER -I$ALICE_ROOT/STEER/STEERBase -I$ALICE_ROOT/STEER/ESD -I$ALICE_ROOT/STEER/AOD -I$ALICE_PHYSICS/OADB -I$ALICE_PHYSICS/PWGHF/base  -I$ALICE_ROOT/include -I$ALICE_ROOT/ITS -I$ALICE_ROOT/TPC -I$ALICE_ROOT/CONTAINERS -I$ALICE_ROOT/STEER -I$ALICE_ROOT/TRD -I$ALICE_ROOT/macros -I$ALICE_ROOT/ANALYSIS  -I$ALICE_PHYSICS/OADB/macros -I$ALICE_PHYSICS/PWGCF/Correlations -I$ALICE_PHYSICS/PWGCF -I$ALICE_PHYSICS/PWGCF/Correlations/Base -I$ALICE_PHYSICS/include -g");
    
    alienHandler->SetAdditionalLibs("AliAnalysisTaskHadronPhiCorr_current.cxx AliAnalysisTaskHadronPhiCorr_current.h AddTaskHadronPhiCorr_current.C libpythia6.so libEGPythia6.so libAliPythia6.so libPWGHFhfe.so libCDB.so libSTEER.so libCORRFW.so libPWGflowBase.so libPWGflowTasks.so libGui.so libProof.so libMinuit.so libXMLParser.so libRAWDatabase.so libRAWDatarec.so libCDB.so libSTEERBase.so libSTEER.so libTPCbase.so libTOFbase.so libTOFrec.so libTRDbase.so libVZERObase.so libVZEROrec.so libT0base.so libT0rec.so libPWGTools.so libPWGCFCorrelationsBase.so");
    
  alienHandler->SetAnalysisSource("AliAnalysisTaskHadronPhiCorr_current.cxx");
  //alienHandler->SetOverwriteMode();
  alienHandler->SetRunMode(mode);
  alienHandler->SetNtestFiles(2);
  //alienHandler->SetAPIVersion("V1.1x");
  alienHandler->SetAliPhysicsVersion("vAN-20170731-1");
  //alienHandler->SetFileForTestMode("File_LHC12dPass1.txt");  //txt file that tells where to look for local files if launch=local
  //alienHandler->SetGridDataDir("/alice/sim/LHC10d4/");
  //alienHandler->SetDataPattern("*ESDs.root");
  alienHandler->SetGridDataDir("//alice/data/2016/LHC16q/");
  alienHandler->SetDataPattern("*/pass1_FAST/AOD/*/*AOD.root");
  //alienHandler->SetDataPattern("*/pass4/AOD/*AOD.root");
  alienHandler->SetRunPrefix("000"); // IMPORTANT! Only need for real data, comment this line out for MC data

   
//LHC12d   
    //Int_t runArray[] = {186320, 186319, 186318, 186229, 186208, 186205, 186200, 186167, 186165, 186164, 186163, 185912, 185909, 185784, 185778, 185776, 185775, 185768, 185765, 185764, 185757, 185756, 185738, 185735, 185734, 185701, 185699, 185698, 185697, 185695, 185687, 185680, 185589, 185588, 185583, 185582, 185581, 185580, 185578};
  //Int_t runArray[] = {186320, 186319, 186318, 186229, 186208, 186205, 186200, 186167, 186165, 186164, 186163, 185912, 185909, 185784, 185778, 185776, 185775, 185768, 185765, 185764, 185757, 185756, 185738, 185735, 185734, 185701, 185699, 185698, 185697, 185695, 185687, 185680, 185589, 185588, 185583, 185582, 185581, 185580, 185578, 185575, 185574, 185565, 185563, 185474, 185465, 185461, 185457, 185375, 185371, 185363, 185362, 185361, 185360, 185359, 185356, 185351, 185350, 185349, 185303, 185302, 185300, 185299, 185296, 185293, 185292, 185291, 185289, 185288, 185284, 185282, 185221, 185217, 185208, 185206, 185203, 185198, 185196, 185189};

 //LHC13b
    //Int_t runArray[] = {195483, 195482, 195481, 195480, 195479, 195478, 195391, 195389, 195351, 195346, 195344}; 

 //LHC13c
    //Int_t runArray[] = {195529, 195531, 195566, 195567, 195568, 195592, 195593, 195596, 195633, 195635, 195644, 195673, 195675, 195677};

//LHC10d4 - MC Data
    //Int_t runArray[] = {119159, 119161, 119163, 119841, 119842, 119844, 119845, 119846, 119849, 119853, 119856, 119859, 119862, 120067, 120069, 120072, 120073, 120076, 120079, 120244, 120503, 120504, 120505, 120616, 120617, 120671, 120741, 120750, 120758, 120820, 120821, 120822, 120823, 120824, 120825, 120829};
   // Int_t runArray[] = {120073}; //for testing why files were being opened but not closed

//LHC16r - 8 TeV pPb data
    //Int_t runArray[] = {266318, 266317, 266316, 266305, 266304, 266300, 266299, 266296, 266208, 266197, 266196, 266193, 266190, 266189, 266187, 266117, 266086, 266085, 266084, 266083, 266081, 266076, 266074, 266034, 265797, 265795, 265789, 265788, 265756, 265754, 265746, 265744, 265742, 265741, 265714, 265713,265709, 265705, 265701, 265700, 265698, 265697, 265696, 265607, 265596, 265594};
   //Int_t runArray[] = {266318, 266317, 266316, 266208, 266197, 266196, 266187, 265754, 265744, 265607, 265596, 265594};

//LHC16q - 5 TeV pPb data
   Int_t runArray[] = {265525, 265521, 265501, 265500, 265499, 265435, 265427, 265426, 265425, 265424, 265422, 265421, 265420, 265419, 265388, 265387, 265385, 265384, 265383, 265381, 265378, 265377, 265344, 265343, 265342, 265339, 265338, 265336, 265334, 265332, 265309};  
    
  
  for (Int_t i =  runcycle[cyclenumber - 1]; i < runcycle[cyclenumber] ; i++)
   {
    if (i == sizeof(runArray) / sizeof(runArray[1])) break;
    alienHandler->AddRunNumber(runArray[i]);
   }

   printf("\n\nSetting Up alienHandler.\n\n");
   alienHandler->SetGridWorkingDir(work_dir);
   alienHandler->SetGridOutputDir(output_dir);
   alienHandler->SetDefaultOutputs(kTRUE);
   alienHandler->SetAnalysisMacro("PhiInvMass.C");
   alienHandler->SetSplitMaxInputFileNumber(noffiles);
   alienHandler->SetExecutable("PhiInvMass.sh");
   alienHandler->SetExecutableCommand("aliroot -b -q");
   alienHandler->SetTTL(ttl); //10000
   alienHandler->SetInputFormat("xml-single");
   alienHandler->SetJDLName("PhiInvMass.jdl");
   alienHandler->SetPrice(1);
   alienHandler->SetSplitMode("se");
   alienHandler->SetMasterResubmitThreshold(10);
   alienHandler->SetMergeExcludes("EventStat_temp.root");
   alienHandler->SetOutputToRunNo(kTRUE);
   alienHandler->SetKeepLogs(kTRUE);
   alienHandler->SetMaxMergeFiles(15);
   alienHandler->SetMaxMergeStages(7);
   alienHandler->SetMergeViaJDL(pre_final_stage);
//    alienHandler->SetOneStageMerging(kFALSE);   //???????????????????????????????-------------------
    if (!alienHandler) return;

    
// load the necessary macros
   //gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
   //gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
// Use AliRoot includes to compile our task
   gROOT->ProcessLine(".include $ALICE_ROOT/include");
   gROOT->ProcessLine(".include $ALICE_ROOT/EMCAL");
   gROOT->ProcessLine(".include $ALICE_PHYSICS/include");
   gROOT->ProcessLine(".include $ALICE_ROOT/ANALYSIS/");
   gROOT->ProcessLine(".include $PWD/.");

   gSystem->AddIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT -I$ALICE_ROOT/EMCAL -I$ALICE_ROOT/PYTHIA6 -I$ALICE_ROOT/ANALYSIS -I$ALICE_ROOT/CONTAINERS -I$ALICE_ROOT/STEER/STEER -I$ALICE_ROOT/STEER/STEERBase -I$ALICE_ROOT/STEER/ESD -I$ALICE_ROOT/STEER/AOD -I$ALICE_PHYSICS/OADB -I$ALICE_PHYSICS/PWGHF/base  -I$ALICE_ROOT/include -I$ALICE_ROOT/ITS -I$ALICE_ROOT/TPC -I$ALICE_ROOT/CONTAINERS -I$ALICE_ROOT/STEER -I$ALICE_ROOT/TRD -I$ALICE_ROOT/macros -I$ALICE_ROOT/ANALYSIS  -I$ALICE_PHYSICS/OADB -I$ALICE_ROOT/PWG/FLOW/Base -I$ALICE_PHYSICS/PWGCF/Correlations/Base -I$ALICE_PHYSICS/PWGCF/Correlations -g ");
   // gSystem->AddIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT -I$ALICE_ROOT/include -I$ALICE_ROOT/macros -I$ALICE_PHYSICS/include -g");

   //printf("\n!!!!!!!!!!!!!!!!!!!!!!\n AliAnalysis Manager \n\n");
   AliAnalysisManager *mgr = new AliAnalysisManager("PhiAnalysis");
   mgr->SetGridHandler(alienHandler);

   AliAODInputHandler* aodH = new AliAODInputHandler();
   mgr->SetInputEventHandler(aodH);
//   AliESDInputHandler* esdH = new AliESDInputHandler();
//   mgr->SetInputEventHandler(esdH);

//    AliMCEventHandler* mcH = new AliMCEventHandler();
//    mgr->SetMCtruthEventHandler(mcH);   
//    mcH->SetReadTR(kFALSE);

   //gROOT->LoadMacro("AddTaskPhiCorr.C");
   gROOT->LoadMacro("./AliAnalysisTaskHadronPhiCorr.cxx++g");
   //gROOT->LoadMacro("$ALICE_PHYSICS/OADB/macros/AddTaskPhysicsSelection.C");
   //gROOT->LoadMacro("$ALICE_PHYSICS/OADB/COMMON/MULTIPLICITY/macros/AddTaskMultSelection.C");
   //gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");


    //switch on aliphysicsselection
    gInterpreter->ProcessLine(Form(".x %s", gSystem->ExpandPathName("$ALICE_PHYSICS/OADB/COMMON/MULTIPLICITY/macros/AddTaskMultSelection.C")));
    AliPhysicsSelectionTask* physSelTask = reinterpret_cast<AliPhysicsSelectionTask*>(gInterpreter->ProcessLine(Form(".x %s(kFALSE, kTRUE)", gSystem->ExpandPathName("$ALICE_PHYSICS/OADB/macros/AddTaskPhysicsSelection.C")))); 
    //Only set true for MC
    Bool_t isMC = kFALSE;
    gInterpreter->ProcessLine(Form(".x %s(kFALSE)", gSystem->ExpandPathName("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C")));

    //create a task
    AliAnalysisTaskHadronPhiCorr_current *task1 = reinterpret_cast<AliAnalysisTaskHadronPhiCorr_current*>(gInterpreter->ProcessLine(Form(".x %s(kFALSE, 0.0, 20.0)", gSystem->ExpandPathName("AddTaskHadronPhiCorr_current.C"))));
    //AliAnalysisTaskHadronPhiCorr_current *task2 = reinterpret_cast<AliAnalysisTaskHadronPhiCorr_current*>(gInterpreter->ProcessLine(Form(".x %s(true, 10.0, 20.0)", gSystem->ExpandPathName("AddTaskHadronPhiCorr_current.C"))));
    //AliAnalysisTaskHadronPhiCorr_current *task3 = reinterpret_cast<AliAnalysisTaskHadronPhiCorr_current*>(gInterpreter->ProcessLine(Form(".x %s(kFALSE, 20.0, 40.0)", gSystem->ExpandPathName("AddTaskHadronPhiCorr_current.C"))));
    //AliAnalysisTaskHadronPhiCorr_current *task4 = reinterpret_cast<AliAnalysisTaskHadronPhiCorr_current*>(gInterpreter->ProcessLine(Form(".x %s(kTRUE, 40.0, 90.0)", gSystem->ExpandPathName("AddTaskHadronPhiCorr_current.C"))));

    task1->SetKaonEtaCut(0.8);
    task1->SetKaonTPCCut(3.0);
    task1->SetKaonTOFCut(3.0);
    task1->SetTOFVeto(kFALSE);
    task1->SetKaonTrkBit(1024);
    task1->SetAssocTrkBit(1024);
    task1->SetTrigTrkBit(AliAODTrack::kIsHybridGCG);
    task1->SetZVertexMin(-10.0);
    task1->SetZVertexMax(10.0);
    task1->SetZVertexNbins(10);
    task1->SetCentEstimator("V0A");


   if (!mgr->InitAnalysis())
     return;

   mgr->PrintStatus();
   //fprintf(stdout, "\n!!!!!!!!!!!!!\nAbout to launch analysis... \n");
   // Start analysis in grid.
   mgr->StartAnalysis(launch);
   //printf("\n!!!!!!!!!!!!!\nDone with StartAnalysis(launch)\n");
   fflush(stdout);
}
Ejemplo n.º 7
0
AliAnalysisGrid* runWithHandler()
{
	// Check if user has a valid token, otherwise make one. This has limitations.
	if (!AliAnalysisGrid::CreateToken()) return NULL;
	AliAnalysisAlien *plugin = new AliAnalysisAlien();
	// Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
	plugin->SetRunMode("full");
	
	// Set versions of used packages
	plugin->SetAPIVersion("V1.1x");
	plugin->SetROOTVersion("v5-26-00b-2");
	plugin->SetAliROOTVersion("v4-19-10-AN");
	
	// Declare input data to be processed.
	// Method 1: Create automatically XML collections using alien 'find' command.
	// Define production directory LFN
	//plugin->SetGridDataDir("/alice/sim/LHC10a6");
	// On real reconstructed data:
        plugin->SetGridDataDir("/alice/data/2009/LHC09d");
	// Set data search pattern
	//plugin->SetDataPattern("*ESDs.root");
	// Data pattern for reconstructed data
        plugin->SetDataPattern("*ESDs/pass4/*ESDs.root");
	plugin->SetRunPrefix("000");   // real data
	// ...then add run numbers to be considered
	plugin->AddRunNumber(104824);
	// plugin->AddRunNumber(104065);  // real data
	// 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("TrackletsTask");
	// 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("AliTrackletsTask.cxx");
	// 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("AliTrackletsTask.h AliTrackletsTask.cxx");
	// Declare the output file names separated by blancs.
	// (can be like: file.root or file.root@ALICE::Niham::File)
	//plugin->SetOutputFiles("Pt.ESD.1.root");
	plugin->SetDefaultOutputs();
	// Optionally define the files to be archived.
	//   plugin->SetOutputArchive("log_archive.zip:stdout,stderr@ALICE::NIHAM::File root_archive.zip:*.root@ALICE::NIHAM::File");
	plugin->SetOutputArchive("log_archive.zip:stdout,stderr");
	// Optionally set a name for the generated analysis macro (default MyAnalysis.C)
	plugin->SetAnalysisMacro("MacroTrackletsTask.C");
	// Optionally set maximum number of input files/subjob (default 100, put 0 to ignore)
	plugin->SetSplitMaxInputFileNumber(50);
	// Optionally modify the executable name (default analysis.sh)
	plugin->SetExecutable("ExecutableTrackletsTask.sh");
	// 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(28000);
	// Optionally set input format (default xml-single)
	plugin->SetInputFormat("xml-single");
	// Optionally modify the name of the generated JDL (default analysis.jdl)
	plugin->SetJDLName("JdlTrackletsTask.jdl");
	// Optionally modify job price (default 1)
	plugin->SetPrice(1);      
	// Optionally modify split mode (default 'se')    
	plugin->SetSplitMode("se");
	return plugin;
}
Ejemplo n.º 8
0
AliAnalysisGrid* CreateAlienHandlerTrigger(const char * run,const char * recopass="******", Bool_t isMC=kFALSE)
{
  

// 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.
  TGrid::Connect("alien:");
   AliAnalysisAlien *plugin = new AliAnalysisAlien();
// Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
   plugin->SetRunMode("full");
   //plugin->SetRunMode("test");
// Set versions of used packages
   plugin->SetAPIVersion("V1.1x");
   plugin->SetROOTVersion("v5-27-06-2");
   plugin->SetAliROOTVersion("v4-21-03-AN");
// Declare input data to be processed.
// Method 1: Create automatically XML collections using alien 'find' command.
// Define production directory LFN
// LHC09d
// /alice/data/2009/LHC09d/000104892/ESDs/pass6/
   if (!isMC)
     plugin->SetGridDataDir(Form("/alice/data/2010/LHC10h/%s/ESDs/%s/", run,recopass));
   else 
     plugin->SetGridDataDir(Form("/alice/sim/%s",recopass));     
// Set data search pattern
   plugin->SetDataPattern("AliESDs.root");
// ...then add run numbers to be considered
//   plugin->AddRunNumber(104892);
//   plugin->AddRunNumber(300001);
// 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(Form("MultPb/Task_%s_%s",run,recopass));
// Declare alien output directory. Relative to working directory.
   plugin->SetGridOutputDir("out"); 
// Declare the analysis source files names separated by blancs. To be compiled runtime
// using ACLiC on the worker nodes.
   plugin->SetAnalysisSource("AliAnalysisTaskTriggerStudy.cxx AliHistoListWrapper.cxx");
// 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("AliAnalysisTaskTriggerStudy.cxx AliHistoListWrapper.cxx AliAnalysisTaskTriggerStudy.h AliHistoListWrapper.h");
//   plugin->SetAdditionalLibs("AliCollisionsNormalization.cxx AliCollisionNormalizationTask.cxx AliPhysicsSelection.cxx AliCollisionsNormalization.h AliCollisionNormalizationTask.h AliPhysicsSelection.h");
   // I'm using a modified ANALYSISalice package, so I need to load par files for everything
   plugin->EnablePackage("STEERBase");
   plugin->EnablePackage("ESD");
   plugin->EnablePackage("AOD");
   plugin->EnablePackage("CORRFW");
   plugin->EnablePackage("ANALYSIS");
   plugin->EnablePackage("ANALYSISalice");

// Declare the output file names separated by blancs.
// (can be like: file.root or file.root@ALICE::Niham::File)
   plugin->SetDefaultOutputs(kFALSE);
   //   plugin->SetOutputFiles(Form("EventStat_temp.root %s",outfilename);
   plugin->SetOutputFiles("Trig_Temp.root");
// Optionally define the files to be archived.
//   plugin->SetOutputArchive("log_archive.zip:stdout,stderr@ALICE::NIHAM::File root_archive.zip:*.root@ALICE::NIHAM::File");
   plugin->SetOutputArchive("log_archive.zip:stdout,stderr");
// Optionally set a name for the generated analysis macro (default MyAnalysis.C)
   plugin->SetAnalysisMacro("AnalysisTrigger.C");
// Optionally set maximum number of input files/subjob (default 100, put 0 to ignore)
   plugin->SetSplitMaxInputFileNumber(100);
// 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("TaskNorm.jdl");
// Optionally modify job price (default 1)
   plugin->SetPrice(1);      
// Optionally modify split mode (default 'se')    
   plugin->SetSplitMode("se");
   return plugin;
}
Ejemplo n.º 9
0
//______________________________________________________________________________
AliAnalysisGrid* CreateAlienHandler(const char *taskname, const char *gridmode,
                                    const char *proofcluster, const char *proofdataset)
{
  AliAnalysisAlien *plugin = new AliAnalysisAlien();
  // Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
  plugin->SetRunMode(gridmode);
  
  // Set versions of used packages
  
  plugin->SetAPIVersion("V1.1x");
  plugin->SetROOTVersion("v5-34-08");
  plugin->SetAliROOTVersion("vAN-20140915");
  plugin->SetExecutableCommand("aliroot -b -q");
  
  // Declare input data to be processed.
  
  // Method 1: Create automatically XML collections using alien 'find' command.
  // Define production directory LFN
  //    plugin->SetGridDataDir("/alice/data/2010/LHC10h");
  
  // plugin->SetGridDataDir(" /alice/data/2011/LHC11h_2/"); //sim
  // plugin->SetDataPattern("pass2/*AliAOD.root"); // sim
  
  plugin->SetGridDataDir("/alice/data/2011/LHC11h_2/"); //sim
  plugin->SetDataPattern("*/pass2/*AliESDs.root"); // sim
  plugin->SetRunPrefix("000");   // real data
  
  Int_t runlist[] = {                                                               // Counter
    170309, 170308, 170306, 170270, 170269, 170268, 170230, 170228, 170204, 170203, // 10
    170193, 170163, 170159, 170155, 170081, 170027, 169859, 169858, 169855, 169846, // 20
    169838, 169837, 169835, 169417, 169415, 169411, 169238, 169167, 169160, 169156, // 30
    169148, 169145, 169144, 169138, 169094, 169091, 169035, 168992, 168988, 168826, // 40
    168777, 168514, 168512, 168511, 168467, 168464, 168460, 168458, 168362, 168361, // 50
    168342, 168341, 168325, 168322, 168311, 168310, 167988, 167987                  // 58
  };
  
  for(Int_t i = 0; i < 9; i++)
    plugin->AddRunNumber(runlist[i]);

  plugin->SetNrunsPerMaster(3);
  plugin->SetOutputToRunNo();
  
  
  // Method 2: Declare existing data files (raw collections, xml collections, root file)
  //   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(taskname);
  
  // Declare alien output directory. Relative to working directory.
  plugin->SetGridOutputDir("output"); // In this case will be $HOME/taskname/out
  
//  plugin->SetAdditionalLibs("libTree.so libGeom.so libPhysics.so libVMC.so libMinuit.so libSTEERBase.so libESD.so libAOD.so  libANALYSIS.so libOADB.so libANALYSISalice.so libCORRFW.so libPWGHFbase.so libPWGflowBase.so libPWGflowTasks.so libPWGHFvertexingHF.so");
  
  // plugin->SetAdditionalLibs("libCORRFW.so libPWGHFbase.so libPWGflowBase.so libPWGflowTasks.so libPWGHFvertexingHF.so");
  
  plugin->SetAnalysisSource("AliAnalysisTaskFlowd.cxx");
  //plugin->SetAdditionalLibs("AliAnalysisTaskFlowd.h AliAnalysisTaskFlowd.cxx ");
  cout<<"-->>>>>>>>>>>>>>>>>>>>>>>>> 1"<<endl;
  
  // Declare the analysis source files names separated by blancs. To be compiled runtime
  // using ACLiC on the worker nodes.
  //plugin->SetAdditionalLibs("libPWGHFbase.so libPWGflowBase.so libPWGflowTasks.so libPWGHFvertexingHF.so AliAODMuonReplicator0.so");
  
  cout<<"-->>>>>>>>>>>>>>>>>>>>>>>>> 2"<<endl;
  // plugin->SetAdditionalLibs("libTree.so libGeom.so libPhysics.so libVMC.so libMinuit.so libSTEERBase.so libESD.so libAOD.so libANALYSIS.so libOADB.so libANALYSISalice.so libCORRFW.so libPWGHFbase.so libPWGflowBase.so libPWGflowTasks.so libPWGHFvertexingHF.so");
  
  // plugin->SetAnalysisSource("AliAnalysisTaskESDMuonFilterO.cxx");
  //plugin->SetAnalysisSource("AliAODMuonReplicator0.cxx");
  
  // 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("AliAODMuonReplicator0_cxx.so");
  // plugin->SetAdditionalLibs("AliAnalysisTaskESDMuonFilterO_cxx.so");
  
  //questo
  plugin->SetAdditionalLibs("libSTEERBase.so libESD.so AliAnalysisTaskFlowd.h AliAnalysisTaskFlowd.cxx libPWGflowBase.so libPWGflowTasks.so libPWGHFbase.so libPWGHFvertexingHF.so");
  plugin->AddIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT -I$ALICE_ROOT/include -I$ALICE_ROOT/ITS -I$ALICE_ROOT/TPC -I$ALICE_ROOT/CONTAINERS -I$ALICE_ROOT/STEER/STEER -I$ALICE_ROOT/STEER/STEERBase -I$ALICE_ROOT/STEER/ESD -I$ALICE_ROOT/STEER/AOD -I$ALICE_ROOT/TRD -I$ALICE_ROOT/macros -I$ALICE_ROOT/ANALYSIS  -I$ALICE_ROOT/OADB -I$ALICE_ROOT/PWGHF -I$ALICE_ROOT/PWGHF/base -I$ALICE_ROOT/PWGHF/vertexingHF -I$ALICE_ROOT/PWG/FLOW/Base -I$ALICE_ROOT/PWG/FLOW/Tasks -g");
  
  
  // plugin->SetAdditionalLibs("AliAODMuonReplicator0.h AliAODMuonReplicator0.cxx");
  // plugin->SetAdditionalLibs("AliAnalysisTaskESDMuonFilterO.h AliAnalysisTaskESDMuonFilterO.cxx");
  
  //plugin->SetAdditionalLibs("AliAODMuonReplicator0.h AliAODMuonReplicator0.cxx AliAnalysisTaskESDMuonFilterO.h AliAnalysisTaskESDMuonFilterO.cxx");
  
  cout<<"-->>>>>>>>>>>>>>>>>>>>>>>>> 3"<<endl;
	
  // plugin->SetAdditionalLibs("AliAODMuonReplicator0.h AliAODMuonReplicator0.cxx");
  
  // plugin->SetAdditionalLibs("AliAnalysisTaskESDMuonFilterO.h AliAnalysisTaskESDMuonFilterO.cxx");
  
  // Declare the output file names separated by blancs.
  // (can be like: file.root or file.root@ALICE::Niham::File)
  // To only save certain files, use SetDefaultOutputs(kFALSE), and then
  // SetOutputFiles("list.root other.filename") to choose which files to save
  plugin->SetDefaultOutputs();
  //plugin->SetOutputFiles("list.root");
  
  // Optionally set a name for the generated analysis macro (default MyAnalysis.C)
  plugin->SetAnalysisMacro(Form("%s.C",taskname));
  
  // Optionally set maximum number of input files/subjob (default 100, put 0 to ignore)
  plugin->SetSplitMaxInputFileNumber(10);
  
  // Optionally modify the executable name (default analysis.sh)
  plugin->SetExecutable(Form("%s.sh",taskname));
  
  // set number of test files to use in "test" mode
  plugin->SetNtestFiles(1);
  
  // file containing a list of chuncks to be used for testin
  plugin->SetFileForTestMode("testdata");
  
  // 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(Form("%s.jdl",taskname));
  
  // Optionally modify job price (default 1)
  plugin->SetPrice(1);
  
  // Optionally modify split mode (default 'se')
  plugin->SetSplitMode("se");
  
  //----------------------------------------------------------
  //---      PROOF MODE SPECIFIC SETTINGS         ------------
  //----------------------------------------------------------
  // Proof cluster
  plugin->SetProofCluster(proofcluster);
  // Dataset to be used
  plugin->SetProofDataSet(proofdataset);
  // May need to reset proof. Supported modes: 0-no reset, 1-soft, 2-hard
  plugin->SetProofReset(0);
  // May limit number of workers
  plugin->SetNproofWorkers(0);
  // May limit the number of workers per slave
  plugin->SetNproofWorkersPerSlave(1);
  // May use a specific version of root installed in proof
  plugin->SetRootVersionForProof("current");
  // May set the aliroot mode. Check http://aaf.cern.ch/node/83
  plugin->SetAliRootMode("default"); // Loads AF libs by default
  // May request ClearPackages (individual ClearPackage not supported)
  plugin->SetClearPackages(kFALSE);
  // Plugin test mode works only providing a file containing test file locations, used in "local" mode also
  plugin->SetFileForTestMode("files.txt"); // file should contain path name to a local directory containg *ESDs.root etc
  // Request connection to alien upon connection to grid
  plugin->SetProofConnectGrid(kFALSE);
  
  cout<<"-->>>>>>>>>>>>>>>>>>>>>>>>> 4"<<endl;
	
  
  return plugin;
  
  cout<<"-->>>>>>>>>>>>>>>>>>>>>>>>> 5"<<endl;
	
}
Ejemplo n.º 10
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;
} 
Ejemplo n.º 11
0
//     const char*   cDataType      = "AOD",       // set the analysis type, AOD or ESD
//##################################################
AliAnalysisManager* EmcalJetCDF (
    const char*   cRunPeriod     = "LHC11d",    // set the run period
    const char*   cLocalFiles    = "data.txt",  // set the local list file
    const Int_t   arg_sel_chg    = 3145763,   // "mykEMC_noGA",  // physics selection
    const Int_t   arg_sel_full   = 3145763,   // "mykEMC_noGA",  // physics selection
    const Int_t   mgr_mode       = 0,         // local = 0, proof = 1, grid = 2, mixing = 3
    const Int_t   alien_mode     = 0,         // test = 0, offline = 1, submit = 2, merge = 3, full = 4
    const char*   cTaskName      = "CDFJets",   // sets name of task manager
    unsigned int  iNumFiles      = 100,         // numger of files to process from list file
    unsigned int  iNumEvents     = 999999999,   // number of events to be analyzed
    bool          bDoChargedJets = true,        // enable charge jets
    bool          bDoFullJets    = false        // enable full jets
) {
//Load needed libs
TString     ListLibs      = ""; // string list of loaded libs
TString     ListLibsExtra = ""; // string list of loaded extra libs
LoadLibs( ListLibs, ListLibsExtra );

AnalysisType  ManagerMode = static_cast<AnalysisType>(mgr_mode);
PluginType    PluginMode  = static_cast<PluginType>(alien_mode);

namespace CDF = PWGJE::EMCALJetTasks::AliAnalysisTaskEmcalJetCDF_NS; // shortcut to task namespace
unsigned int       kGridFilesPerJob         = iNumFiles;      // Maximum number of files per job (gives size of AOD)
unsigned int       kTTL                     = 64800 ;         // Time To Live; 18h = 64800; 12h = 43200

bool bDoBackgroundSubtraction = true;
bool bDoEmbedding = false;

// Embeded Configuration options
// Embedding files list
const TString embeddedFilesList = "aodFilesEmbed.txt";
// If true, events that are not selected in the PbPb will not be used for embedding.
// This ensures that good embedded events are not wasted on bad PbPb events.
const bool internalEventSelection = true;
// Do jet matching
const bool useJetTagger = true;


TString sGridMode ("test");
if ( PluginMode == PluginType::offline ) { sGridMode = "offline"; }
if ( PluginMode == PluginType::submit )  { sGridMode = "submit"; }
if ( PluginMode == PluginType::merge )   { sGridMode = "merge"; }
if ( PluginMode == PluginType::full )    { sGridMode = "full"; }
const char* cGridMode = sGridMode.Data();

TString sAnalysisType ("local");
if ( ManagerMode == AnalysisType::proof )  { sAnalysisType = "proof"; }
if ( ManagerMode == AnalysisType::grid )   { sAnalysisType = "grid"; }
if ( ManagerMode == AnalysisType::mixing ) { sAnalysisType = "mix"; }
const char* cAnalysisType = sAnalysisType.Data();

cout << std::endl << ">>>>>>>> ManagerMode : " << ManagerMode << " ; String value : " << cAnalysisType << std::endl << ">>>>>>>> PluginMode : " << PluginMode << " ; String value : " << cGridMode << std::endl << std::endl;

//---------------------------------------------------------------------------------------------
TRegexp false_regex ("[f,F][a,A][l,L][s,S][e,E]");
TRegexp true_regex ("[t,T][r,R][u,U][e,E]");
TRegexp enable_regex ("[e,E][n,N][a,A][b,B][l,L][e,E]");
TRegexp disable_regex ("[d,D][i,I][s,S][a,A][b,B][l,L][e,E]");

bool  bDoSample = false;
TString ENV_doSAMPLE = gSystem->Getenv("CDF_doSAMPLE");
if (!ENV_doSAMPLE.IsNull() && ( ENV_doSAMPLE.EqualTo("0") || ENV_doSAMPLE.Contains(false_regex) ) ) { bDoSample = kFALSE; }
if (!ENV_doSAMPLE.IsNull() && ( ENV_doSAMPLE.EqualTo("1") || ENV_doSAMPLE.Contains(true_regex)  ) ) { bDoSample = kTRUE; }

bool  bDoCDF    = true;
TString ENV_doCDF = gSystem->Getenv("CDF_doCDF");
if (!ENV_doCDF.IsNull() && ( ENV_doCDF.EqualTo("0") || ENV_doCDF.Contains(false_regex) ) ) { bDoCDF = kFALSE; }
if (!ENV_doCDF.IsNull() && ( ENV_doCDF.EqualTo("1") || ENV_doCDF.Contains(true_regex)  ) ) { bDoCDF = kTRUE; }

// ######   DEBUG    ######
Int_t           debug              =  0 ; // kFatal = 0, kError, kWarning, kInfo, kDebug, kMaxType
UInt_t          mgr_debug          =  0 ; // AliAnalysisManager debug level
UInt_t          kUseSysInfo        =  0 ; // activate debugging

TString ENV_DEBUG = gSystem->Getenv("CDF_DEBUG");
if (!ENV_DEBUG.IsNull() && ENV_DEBUG.IsDigit() ) { debug = ENV_DEBUG.Atoi(); }

TString ENV_DEBUG_MGR = gSystem->Getenv("CDF_DEBUG_MGR");
if (!ENV_DEBUG_MGR.IsNull() && ENV_DEBUG_MGR.IsDigit() ) { mgr_debug = ENV_DEBUG_MGR.Atoi(); }

TString ENV_NSYSINFO = gSystem->Getenv("CDF_NSYSINFO");
if (!ENV_NSYSINFO.IsNull() && ENV_NSYSINFO.IsDigit() ) { kUseSysInfo = ENV_NSYSINFO.Atoi(); }

if ( debug == 0 ) { AliLog::SetGlobalLogLevel ( AliLog::kFatal   ); }
if ( debug == 1 ) { AliLog::SetGlobalLogLevel ( AliLog::kError   ); }
if ( debug == 2 ) { AliLog::SetGlobalLogLevel ( AliLog::kWarning ); }
if ( debug == 3 ) { AliLog::SetGlobalLogLevel ( AliLog::kInfo    ); }
if ( debug >= 4 ) { AliLog::SetGlobalLogLevel ( AliLog::kDebug   ); }

// Progress bar
Bool_t bUseProgBar = kFALSE; // N.B. !! if true will set fDebug to 0
TString ENV_USEPROGBAR = gSystem->Getenv("PROGRESSBAR");
if (!ENV_USEPROGBAR.IsNull() && ( ENV_USEPROGBAR.EqualTo("1") || ENV_USEPROGBAR.Contains(true_regex) ) )  { bUseProgBar = kTRUE; }

//##################################################
//        AliEN plugin variables
//##################################################
const char* curdir = gSystem->BaseName(gSystem->pwd());
TString     kJobTag (curdir);

TString execArgs (" -l -b -q -x");
TString exec =
//               "aliroot";
              "root.exe";

TString     kPluginExecutableCommand = exec + execArgs;

TString     kAliPhysicsVersion       = "vAN-20190304-1";

// == grid plugin files rules
TString     kGridExtraFiles          = ""; // extra files that will be added to the input list in the JDL
TString     kGridMergeExclude        = "AliAOD.root AliAOD.Jets.root"; // Files that should not be merged
TString     kGridOutputStorages      = "disk=2"; // Make replicas on the storages

// FILES USED IN MACRO
TString     kCommonOutputFileName    = "AnalysisResults.root";

//--------------------
//   PROOF SETTINGS
//--------------------
TString kAAF        = "";
Int_t   kProofReset = 0; (void)kProofReset;
Int_t   kWorkers    = 20; (void)kWorkers;
Int_t   kCores      = 8  ; (void)kCores;
// AliRoot mode among the list supported by the proof cluster.
// TString     kAlirootMode             = "ALIROOT";     // STEERBase,ESD,AOD,ANALYSIS,ANALYSISalice (default aliroot mode)

//############################################################
// const AliAnalysisTaskEmcal::EDataType_t kAod = AliAnalysisTaskEmcal::kAOD;
// const AliAnalysisTaskEmcal::EDataType_t kEsd = AliAnalysisTaskEmcal::kESD;

const AliJetContainer::EJetType_t    fulljet = AliJetContainer::kFullJet;
const AliJetContainer::EJetType_t     chgjet = AliJetContainer::kChargedJet;
const AliJetContainer::EJetAlgo_t     antikt = AliJetContainer::antikt_algorithm;
const AliJetContainer::EJetAlgo_t         kt = AliJetContainer::kt_algorithm;
const AliJetContainer::ERecoScheme_t  recomb = AliJetContainer::pt_scheme;

// kTPC, kTPCfid, kEMCAL, kEMCALfid, kDCAL, kDCALfid, kDCALonly, kDCALonlyfid, kPHOS, kPHOSfid, kUser
const AliEmcalJet::JetAcceptanceType acc_chgjets  = AliEmcalJet::kTPCfid;
const AliEmcalJet::JetAcceptanceType acc_fulljets = AliEmcalJet::kEMCALfid;
//############################################################

// data source name
TString kDataSource (cLocalFiles);

// label of dataset from InputData.C
TString kGridDataSet ("");
if ( ManagerMode == AnalysisType::grid ) { kGridDataSet = kDataSource;}

//############################################################
// SETUP OF TRIGGERS
const AliEmcalPhysicsSelection::EOfflineEmcalTypes mykEMCAL  = AliEmcalPhysicsSelection::kEmcalOk;
const AliVEvent::EOfflineTriggerTypes  mykEMC             = static_cast<AliVEvent::EOfflineTriggerTypes>(AliVEvent::kEMC1 | AliVEvent::kEMC7 | AliVEvent::kEMC8 | AliVEvent::kEMCEJE | AliVEvent::kEMCEGA);
const AliVEvent::EOfflineTriggerTypes  mykEMC_noGA        = static_cast<AliVEvent::EOfflineTriggerTypes>(AliVEvent::kEMC1 | AliVEvent::kEMC7 | AliVEvent::kEMC8 | AliVEvent::kEMCEJE);

const AliVEvent::EOfflineTriggerTypes  mykMB              = AliVEvent::kAnyINT;
const AliVEvent::EOfflineTriggerTypes  mykMB_central      = static_cast<AliVEvent::EOfflineTriggerTypes>(AliVEvent::kAnyINT | AliVEvent::kCentral);
const AliVEvent::EOfflineTriggerTypes  mykMB_semicentral  = static_cast<AliVEvent::EOfflineTriggerTypes>(AliVEvent::kAnyINT | AliVEvent::kSemiCentral);
const AliVEvent::EOfflineTriggerTypes  mykMB_mostcentral  = static_cast<AliVEvent::EOfflineTriggerTypes>(AliVEvent::kAnyINT | AliVEvent::kCentral | AliVEvent::kSemiCentral);

AliVEvent::EOfflineTriggerTypes kPhysSel   = mykMB; //AliVEvent::kAnyINT; // physics selection
// AliVEvent::EOfflineTriggerTypes kSel_tasks = mykMB;

AliVEvent::EOfflineTriggerTypes kSel_chg   = static_cast<AliVEvent::EOfflineTriggerTypes>(arg_sel_chg);
AliVEvent::EOfflineTriggerTypes kSel_full  = static_cast<AliVEvent::EOfflineTriggerTypes>(arg_sel_full);

//############################################################
// Analysis manager
  AliAnalysisManager* pMgr = new AliAnalysisManager(cTaskName);
  pMgr->SetDebugLevel(mgr_debug);
  if ( kUseSysInfo > 0 ) { pMgr->SetNSysInfo ( kUseSysInfo ); }

  // actual runName in the form of LHCXXX....
  TString sRunName;
  Bool_t kIsAOD = kTRUE;
  AliAnalysisTaskEmcal::EDataType_t iDataType = AliAnalysisTaskEmcal::kAOD; // assuming default is to process AOD
  TString file;
  AliAnalysisAlien* plugin = NULL;
  if ( ManagerMode == AnalysisType::grid ) {  // start grid analysis
    // ( const char* gridMode, const char* tag, unsigned int nr_test_files, unsigned int TTL, const char* outdir, const char subworkdir, const char* extradirlvl);
    plugin = CreateAlienHandler(cGridMode, kJobTag.Data(), kGridFilesPerJob, kTTL);
    if ( !plugin ) { ::Error ( "runEMCalJetSampleTask.C - StartGridAnalysis", "plugin invalid" ); return NULL; }
    pMgr->SetGridHandler(plugin);

    // use this command to run the macro
    plugin->SetExecutableCommand(kPluginExecutableCommand.Data());

    // AliPhysics version.
    plugin->SetAliPhysicsVersion ( kAliPhysicsVersion.Data() ); // Here you can set the (Ali)PHYSICS version you want to use

    gROOT->LoadMacro("InputData.C");
    InputData(kGridDataSet);
    sRunName = CDF::GetPeriod( plugin->GetGridDataDir() );

    file = CDF::GetFileFromPath(plugin->GetDataPattern());
    if (file.Contains("AliESD")) { iDataType = AliAnalysisTaskEmcal::kESD; kIsAOD = kFALSE; }

    plugin->SetMergeExcludes(kGridMergeExclude.Data());
    }

  if ( ManagerMode == AnalysisType::local ) { // start local analysis
    if ( kDataSource.IsNull() ) { Printf("You need to provide the list of local files!"); return NULL; }
    TChain* pChain = CDF::CreateChain(kDataSource.Data(), "auto", "", iNumFiles);
    if (!pChain) { std::cout << ">>>>>>>>>>>>>>   CHAIN NOT CREATED   <<<<<<<<<<<<<<" << std::endl; return NULL; }
    Printf("Setting local analysis for %d files from list %s, max events = %d", iNumFiles, kDataSource.Data(), iNumEvents);

    // get the path of first file
    file = pChain->GetFile()->GetEndpointUrl()->GetUrl();
    sRunName = CDF::GetPeriod(file.Data()); // get the run name : first token beggining with lhc
    if ( CDF::GetFileFromPath(file).Contains("AliESD") ) { iDataType = AliAnalysisTaskEmcal::kESD; kIsAOD = kFALSE; }
    }

  TString sDataType ("AOD");
  if (!kIsAOD) { sDataType = "ESD"; }
  std::cout << ">>> Analysis data type : " << sDataType.Data() << std::endl;

  // name of de period (for MC is the name of "achored to" production)
  TString sRunPeriod (cRunPeriod);
  sRunPeriod.ToLower();

  bool isMC = false;
  isMC = CDF::PeriodIsMC(sRunName.Data());

  // EMCAL corrections task configuration file
  TString EMCALcfg ("CDF_CorrectionsConf.yaml");
  if (isMC) {EMCALcfg = "CDF_MC_CorrectionsConf.yaml";}

  if ( !kGridExtraFiles.IsNull() ) {kGridExtraFiles += " ";}
  kGridExtraFiles += EMCALcfg;

  AliAnalysisTaskEmcal::BeamType iBeamType = AliAnalysisTaskEmcal::kpp;
  Bool_t bIsRun2 = kFALSE;

  if (sRunPeriod.Length() == 6 && (sRunPeriod.BeginsWith("lhc15") || sRunPeriod.BeginsWith("lhc16") || sRunPeriod.BeginsWith("lhc17") || sRunPeriod.BeginsWith("lhc18") ) ) { bIsRun2 = kTRUE; }

  if (sRunPeriod == "lhc10h" || sRunPeriod == "lhc11h" || sRunPeriod == "lhc15o" || sRunPeriod == "lhc17n" )                            { iBeamType = AliAnalysisTaskEmcal::kAA; }
  if (sRunPeriod == "lhc12g" || sRunPeriod == "lhc13b" || sRunPeriod == "lhc13c" || sRunPeriod == "lhc13d" || sRunPeriod == "lhc13e" ||
      sRunPeriod == "lhc13f" || sRunPeriod == "lhc16q" || sRunPeriod == "lhc16r" || sRunPeriod == "lhc16s" || sRunPeriod == "lhc16t" )  { iBeamType = AliAnalysisTaskEmcal::kpA; }

  Double_t kGhostArea = 0.01;
  if (iBeamType != AliAnalysisTaskEmcal::kpp) { kGhostArea = 0.005; }

  AliTrackContainer::SetDefTrackCutsPeriod(sRunPeriod);
  Printf("Default track cut period set to: %s", AliTrackContainer::GetDefTrackCutsPeriod().Data());

  Bool_t bDoEmcalCorrections  = kFALSE;
  if (bDoFullJets) { bDoEmcalCorrections  = kTRUE; }

// ###   Containers and string definitions
  TString name_tracks   = "usedefault";
  TString name_clusters = "usedefault";
  TString name_cells    = "usedefault";
  // Set centrality estimator for centrality task
  TString cent_est_chg  = "V0M" ;
  TString cent_est_full = "V0M" ;

  TString mc_container ("");
  if (isMC) { mc_container = "mcparticles"; }

/*
  // General input object names
  TString tracksName             = AliEmcalContainerUtils::DetermineUseDefaultName(AliEmcalContainerUtils::kTrack);
  TString clustersName           = AliEmcalContainerUtils::DetermineUseDefaultName(AliEmcalContainerUtils::kCluster);
  TString emcalCellsName         = AliEmcalContainerUtils::DetermineUseDefaultName(AliEmcalContainerUtils::kCaloCells);
  // Combined (PbPb + embedded det level)
  TString emcalCellsCombined = emcalCellsName + "Combined";
  TString clustersCombined = clustersName + "Combined";
*/

//##########################
//   TASKS DEFINITIONS   ###
//##########################
  AliAODInputHandler* pAODHandler = NULL;
  AliESDInputHandler* pESDHandler = NULL;
  if (kIsAOD)
    { pAODHandler = AliAnalysisTaskEmcal::AddAODHandler(); }
  else
    { pESDHandler = AliAnalysisTaskEmcal::AddESDHandler(); }

  // CDBconnect task
  AliTaskCDBconnect* taskCDB = AliTaskCDBconnect::AddTaskCDBconnect();
  taskCDB->SetFallBackToRaw(kTRUE); // Needed for the moment as not all grid sites do support cvmfs OCDB for the moment
  if (!taskCDB) { std::cout << "--------->>>>  taskCDB :: could not connect!!!! CHECK CVMFS" << std::endl; return NULL;}

  // Physics selection task
  AliPhysicsSelectionTask* pPhysSelTask = NULL;
  if (!kIsAOD) {
    // signature : (Bool_t mCAnalysisFlag = kFALSE, Bool_t applyPileupCuts = kFALSE, UInt_t deprecatedFlag2 = 0, Bool_t useSpecialOutput=kFALSE)
    pPhysSelTask = AliPhysicsSelectionTask::AddTaskPhysicsSelection();
    }

  // Centrality task
  // The Run 2 condition is too restrictive, but until the switch to MultSelection is complete, it is the best we can do
  AliCentralitySelectionTask* pCentralityTask = NULL;
  if ( !kIsAOD && (iBeamType != AliAnalysisTaskEmcal::kpp && bIsRun2) ) {
    //signature : (Bool_t fillHistos=kTRUE, Bool_t aod=kFALSE)
    pCentralityTask = AliCentralitySelectionTask::AddTaskCentrality(kFALSE, kIsAOD);
    pCentralityTask->SelectCollisionCandidates(AliVEvent::kAny);
    }

  // AliMultSelection
  AliMultSelectionTask* pMultSelTask = NULL;
  if (bIsRun2) {
    // signature : ( Bool_t lCalibration = kFALSE, TString lExtraOptions = "", Int_t lNDebugEstimators = 1, const TString lMasterJobSessionFlag = "")
    pMultSelTask = AliMultSelectionTask::AddTaskMultSelection();
    pMultSelTask->SelectCollisionCandidates(AliVEvent::kAny);
    }

  // Embedding task
  if (bDoEmbedding) {
    // Debug options
    //AliLog::SetClassDebugLevel("AliAnalysisTaskEmcalEmbeddingHelper", AliLog::kDebug+0);

    // Setup embedding task
    AliAnalysisTaskEmcalEmbeddingHelper * embeddingHelper = AliAnalysisTaskEmcalEmbeddingHelper::AddTaskEmcalEmbeddingHelper();
    embeddingHelper->SelectCollisionCandidates(kPhysSel);
    // The pt hard bin should be set via the filenames in this file
    // If using a file pattern, it could be configured via embeddingHelper->SetPtHardBin(ptHardBin);
    embeddingHelper->SetFileListFilename(embeddedFilesList.Data());

    // Some example settings for LHC12a15e_fix (anchored to LHC11h)
    embeddingHelper->SetNPtHardBins(11);
    embeddingHelper->SetMCRejectOutliers();

    // Setup internal event selection and additional configuration options
    embeddingHelper->SetConfigurationPath("EmbeddingConfigurationExample.yaml");

    // Initialize the task to complete the setup.
    embeddingHelper->Initialize();
    }

  // EMCal corrections
  AliEmcalCorrectionTask* correctionTask = NULL;
  if (bDoEmcalCorrections) {
    // Configuration of the Correction Task is handled via a YAML file, which is setup below
    // signature : (TString suffix)
    correctionTask = AliEmcalCorrectionTask::AddTaskEmcalCorrectionTask();
//  correctionTask = AliEmcalCorrectionTask::ConfigureEmcalCorrectionTaskOnLEGOTrain(suffix);
    correctionTask->SelectCollisionCandidates(kPhysSel);
    correctionTask->SetUseNewCentralityEstimation(bIsRun2);
    correctionTask->SetForceBeamType(static_cast<AliEmcalCorrectionTask::BeamType>(iBeamType));

    // Configure and initialize
    correctionTask->SetUserConfigurationFilename( EMCALcfg.Data() );
    //correctionTask->SetUserConfigurationFilename("alien:///alice/cern.ch/user/m/mfasel/EMCALCorrectionConfig/ConfigDataPWGJEhighClusterThresholds.yaml");
    correctionTask->Initialize(true);

    }

//     TObjArray correctionTasks;
//
//     // Create the Correction Tasks
//     // "data" corresponds to the PbPb level
//     // "embed" corresponds to the embedded detector level
//     // "combined" corresponds to the hybrid (PbPb + embedded detector) level
//     correctionTasks.Add(AliEmcalCorrectionTask::AddTaskEmcalCorrectionTask("data"));
//     correctionTasks.Add(AliEmcalCorrectionTask::AddTaskEmcalCorrectionTask("embed"));
//     // It is important that combined is last!
//     correctionTasks.Add(AliEmcalCorrectionTask::AddTaskEmcalCorrectionTask("combined"));
//
//     // Loop over all of the correction tasks to configure them
//     AliEmcalCorrectionTask * tempCorrectionTask = 0;
//     TIter next(&correctionTasks);
//     while (( tempCorrectionTask = static_cast<AliEmcalCorrectionTask *>(next()))) {
//       tempCorrectionTask->SelectCollisionCandidates(kPhysSel);
//       // Configure centrality
//       tempCorrectionTask->SetNCentBins(5);
//       tempCorrectionTask->SetUseNewCentralityEstimation(bIsRun2);
//       tempCorrectionTask->SetUserConfigurationFilename("$ALICE_PHYSICS/PWGJE/EMCALJetTasks/macros/EMCalCorrectionTaskEmbeddingExample.yaml");
//
//       tempCorrectionTask->Initialize(true);
//       }

  // Background
  TString sRhoChName;
  TString sRhoFuName;
  AliAnalysisTaskRho* pRhoTask = NULL;
  if ( bDoBackgroundSubtraction && iBeamType != AliAnalysisTaskEmcal::kpp ) {
    sRhoChName = "Rho";
    sRhoFuName = "Rho_Scaled";

    AliEmcalJetTask* pKtChJetTask = AliEmcalJetTask::AddTaskEmcalJet(name_tracks.Data(), "", kt, 0.4, chgjet, 0.15, 0, kGhostArea, recomb, "Jet", 0., kFALSE, kFALSE);
    pKtChJetTask->SelectCollisionCandidates(kPhysSel);

    //signature :
    // const char* nTracks = "usedefault", const char* nClusters = "usedefault", const char* nRho = "Rho", Double_t jetradius = 0.2, UInt_t acceptance = AliEmcalJet::kTPCfid,
    // AliJetContainer::EJetType_t jetType = AliJetContainer::kChargedJet, const Bool_t histo = kFALSE, AliJetContainer::ERecoScheme_t rscheme = AliJetContainer::pt_scheme, const char* suffix = ""
    pRhoTask = AliAnalysisTaskRho::AddTaskRhoNew(name_tracks.Data(), name_clusters.Data(), sRhoChName, 0.4);
    pRhoTask->SetExcludeLeadJets(2);
    pRhoTask->SelectCollisionCandidates(kPhysSel);
    pRhoTask->SetRecycleUnusedEmbeddedEventsMode(internalEventSelection);

    if (bDoFullJets) {
      TString sFuncPath = "alien:///alice/cern.ch/user/s/saiola/LHC11h_ScaleFactorFunctions.root";
      TString sFuncName = "LHC11h_HadCorr20_ClustersV2";
      pRhoTask->LoadRhoFunction(sFuncPath, sFuncName);
      }
    }

  // Find Charged jets
  AliEmcalJetTask* pChJet02Task = NULL;
  AliEmcalJetTask* pChJet04Task = NULL;
  AliEmcalJetTask* pChJet02Task_MC = NULL;
  AliEmcalJetTask* pChJet04Task_MC = NULL;
  if (bDoChargedJets) {
    pChJet02Task = AliEmcalJetTask::AddTaskEmcalJet(name_tracks.Data(), "", antikt, 0.2, chgjet, 0.15, 0, kGhostArea, recomb, "Jet", 1., kFALSE, kFALSE);
    pChJet02Task->SelectCollisionCandidates(kSel_chg);

    pChJet04Task = AliEmcalJetTask::AddTaskEmcalJet(name_tracks.Data(), "", antikt, 0.4, chgjet, 0.15, 0, kGhostArea, recomb, "Jet", 1., kFALSE, kFALSE);
    pChJet04Task->SelectCollisionCandidates(kSel_chg);

    if (isMC) {
      pChJet02Task_MC = AliEmcalJetTask::AddTaskEmcalJet(mc_container.Data(), "", antikt, 0.2, chgjet, 0.15, 0, kGhostArea, recomb, "Jet", 1., kFALSE, kFALSE);
      pChJet02Task_MC->SelectCollisionCandidates(kSel_chg);
      if (bDoEmbedding) {
        pChJet02Task_MC->SetRecycleUnusedEmbeddedEventsMode(internalEventSelection);
        AliParticleContainer* partLevelTracks02Task_MC = pChJet02Task_MC->GetParticleContainer(0);
        // Called Embedded, but really just means get from an external event!
        partLevelTracks02Task_MC->SetIsEmbedding(kTRUE);
        }

      pChJet04Task_MC = AliEmcalJetTask::AddTaskEmcalJet(mc_container.Data(), "", antikt, 0.4, chgjet, 0.15, 0, kGhostArea, recomb, "Jet", 1., kFALSE, kFALSE);
      pChJet04Task_MC->SelectCollisionCandidates(kSel_chg);
      if (bDoEmbedding) {
        pChJet04Task_MC->SetRecycleUnusedEmbeddedEventsMode(internalEventSelection);
        AliParticleContainer* partLevelTracks04Task_MC = pChJet04Task_MC->GetParticleContainer(0);
        // Called Embedded, but really just means get from an external event!
        partLevelTracks04Task_MC->SetIsEmbedding(kTRUE);
        }
      } // isMC
    } // bDoChargedJets

  // Find Full jets
  AliEmcalJetTask* pFuJet02Task = NULL;
  AliEmcalJetTask* pFuJet04Task = NULL;
  AliEmcalJetTask* pFuJet02Task_MC = NULL;
  AliEmcalJetTask* pFuJet04Task_MC = NULL;
  if (bDoFullJets) {
    pFuJet02Task = AliEmcalJetTask::AddTaskEmcalJet(name_tracks.Data(), name_clusters.Data(), antikt, 0.2, fulljet, 0.15, 0.30, kGhostArea, recomb, "Jet", 1., kFALSE, kFALSE);
    pFuJet02Task->SelectCollisionCandidates(kSel_full);
    pFuJet02Task->GetClusterContainer(0)->SetDefaultClusterEnergy(AliVCluster::kHadCorr);

    pFuJet04Task = AliEmcalJetTask::AddTaskEmcalJet(name_tracks.Data(), name_clusters.Data(), antikt, 0.4, fulljet, 0.15, 0.30, kGhostArea, recomb, "Jet", 1., kFALSE, kFALSE);
    pFuJet04Task->SelectCollisionCandidates(kSel_full);
    pFuJet04Task->GetClusterContainer(0)->SetDefaultClusterEnergy(AliVCluster::kHadCorr);

    if (isMC) {
      pFuJet02Task_MC = AliEmcalJetTask::AddTaskEmcalJet(mc_container.Data(), name_clusters.Data(), antikt, 0.2, fulljet, 0.15, 0, kGhostArea, recomb, "Jet", 1., kFALSE, kFALSE);
      pFuJet02Task_MC->SelectCollisionCandidates(kSel_chg);
      if (bDoEmbedding) {
        pFuJet02Task_MC->SetRecycleUnusedEmbeddedEventsMode(internalEventSelection);
        AliParticleContainer* partLevelTracks02Task_MC = pFuJet02Task_MC->GetParticleContainer(0);
        // Called Embedded, but really just means get from an external event!
        partLevelTracks02Task_MC->SetIsEmbedding(kTRUE);
        }

      pFuJet04Task_MC = AliEmcalJetTask::AddTaskEmcalJet(mc_container.Data(), name_clusters.Data(), antikt, 0.4, fulljet, 0.15, 0, kGhostArea, recomb, "Jet", 1., kFALSE, kFALSE);
      pFuJet04Task_MC->SelectCollisionCandidates(kSel_chg);
      pFuJet04Task_MC->SetRecycleUnusedEmbeddedEventsMode(internalEventSelection);
      if (bDoEmbedding) {
        pFuJet04Task_MC->SetRecycleUnusedEmbeddedEventsMode(internalEventSelection);
        AliParticleContainer* partLevelTracks04Task_MC = pFuJet04Task_MC->GetParticleContainer(0);
        // Called Embedded, but really just means get from an external event!
        partLevelTracks04Task_MC->SetIsEmbedding(kTRUE);
        }
      } // isMC
    } // bDoFullJets

////////////////////////
//   ANALYSIS TASKS   //
////////////////////////

  // Sample task - charge jets
  AliAnalysisTaskEmcalJetSample* sampleTaskchg = NULL;
  if (bDoSample && bDoChargedJets) {
    sampleTaskchg = AliAnalysisTaskEmcalJetSample::AddTaskEmcalJetSample(name_tracks.Data(), "", "", "SMPCHG");
    sampleTaskchg->SetHistoBins(600, 0, 300);
    sampleTaskchg->SelectCollisionCandidates(kSel_chg);
    sampleTaskchg->SetDebugLevel(debug);

    AliParticleContainer* sampleTaskchg_partCont = sampleTaskchg->GetParticleContainer(0);
    sampleTaskchg_partCont->SetParticlePtCut(0.15);

    if (bDoEmbedding) { sampleTaskchg_partCont->SetIsEmbedding(kTRUE); }

    if ( pMultSelTask ) {
      sampleTaskchg->SetUseNewCentralityEstimation(bIsRun2);
      sampleTaskchg->SetNCentBins(5);
      }
    }

  // Sample task - full jets
  AliAnalysisTaskEmcalJetSample* sampleTaskfull = NULL;
  if (bDoSample && bDoFullJets) {
    sampleTaskfull = AliAnalysisTaskEmcalJetSample::AddTaskEmcalJetSample(name_tracks.Data(), name_clusters.Data(), name_cells.Data(), "SMPFULL");
    sampleTaskfull->SetHistoBins(600, 0, 300);
    sampleTaskfull->SelectCollisionCandidates(kSel_full);
    sampleTaskfull->SetDebugLevel(debug);

    AliParticleContainer* sampleTaskfull_partCont = sampleTaskfull->GetParticleContainer(0);
    sampleTaskfull_partCont->SetParticlePtCut(0.15);

    AliClusterContainer* sampleTaskfull_clusCont = sampleTaskfull->GetClusterContainer(0);
    sampleTaskfull_clusCont->SetClusECut(0.);
    sampleTaskfull_clusCont->SetClusPtCut(0.);
    sampleTaskfull_clusCont->SetClusNonLinCorrEnergyCut(0.);
    sampleTaskfull_clusCont->SetClusHadCorrEnergyCut(0.30);
    sampleTaskfull_clusCont->SetDefaultClusterEnergy(AliVCluster::kHadCorr);

    if (bDoEmbedding) {
      sampleTaskfull_partCont->SetIsEmbedding(kTRUE);
      sampleTaskfull_clusCont->SetIsEmbedding(kTRUE);
      }

    if ( pMultSelTask ) {
      sampleTaskfull->SetUseNewCentralityEstimation(bIsRun2);
      sampleTaskfull->SetNCentBins(5);
      }
    }


  //###   CDF task - charged jets
  AliAnalysisTaskEmcalJetCDF* anaTaskCDFchg = NULL;
  AliAnalysisTaskEmcalJetCDF* anaTaskCDFchg_MC = NULL;
  if (bDoCDF && bDoChargedJets) {
    anaTaskCDFchg = CDF::AddTaskEmcalJetCDF ( name_tracks.Data(), "", "", "", "CDFchg" );
    anaTaskCDFchg->SetHistoBins(600, 0, 300);
    anaTaskCDFchg->SelectCollisionCandidates(kSel_chg);
    anaTaskCDFchg->SetDebugLevel(debug);

    AliParticleContainer* anaTaskCDFchg_partCont = anaTaskCDFchg->GetParticleContainer(0);
    anaTaskCDFchg_partCont->SetParticlePtCut(0.15);

    if (bDoEmbedding) { anaTaskCDFchg_partCont->SetIsEmbedding(kTRUE); }

    if ( pMultSelTask ) {
      anaTaskCDFchg->SetUseNewCentralityEstimation(bIsRun2);
      anaTaskCDFchg->SetNCentBins(5);
      anaTaskCDFchg->SetCentralityEstimator(cent_est_chg.Data());
      }

    //#################################################
    if (isMC){
      anaTaskCDFchg_MC = CDF::AddTaskEmcalJetCDF ( mc_container.Data(), "", "", "", "CDFchgMC" );
      anaTaskCDFchg_MC->SetHistoBins(600, 0, 300);
      anaTaskCDFchg_MC->SelectCollisionCandidates(kSel_chg);
      anaTaskCDFchg_MC->SetDebugLevel(debug);

      AliParticleContainer* anaTaskCDFchg_partCont_MC = anaTaskCDFchg_MC->GetMCParticleContainer(0);
      anaTaskCDFchg_partCont->SetParticlePtCut(0.15);

      if (bDoEmbedding) { anaTaskCDFchg_partCont_MC->SetIsEmbedding(kTRUE); }

      if ( pMultSelTask ) {
        anaTaskCDFchg_MC->SetUseNewCentralityEstimation(bIsRun2);
        anaTaskCDFchg_MC->SetNCentBins(5);
        anaTaskCDFchg_MC->SetCentralityEstimator(cent_est_chg.Data());
        }
      }
    }

  //###   CDF task - full jets
  AliAnalysisTaskEmcalJetCDF* anaTaskCDFfull = NULL;
  if (bDoCDF && bDoFullJets) {
    anaTaskCDFfull = CDF::AddTaskEmcalJetCDF ( name_tracks.Data(), name_clusters.Data(), name_cells.Data(), mc_container.Data(), "CDFfull" );
    anaTaskCDFfull->SetHistoBins(600, 0, 300);
    anaTaskCDFfull->SelectCollisionCandidates(kSel_full);
    anaTaskCDFfull->SetDebugLevel(debug);

    AliParticleContainer* anaTaskCDFfull_partCont = anaTaskCDFfull->GetParticleContainer(0);
    anaTaskCDFfull_partCont->SetParticlePtCut(0.15);

    AliClusterContainer* anaTaskCDFfull_clusCont = anaTaskCDFfull->GetClusterContainer(0);
    anaTaskCDFfull_clusCont->SetClusECut(0.);
    anaTaskCDFfull_clusCont->SetClusPtCut(0.);
    anaTaskCDFfull_clusCont->SetClusNonLinCorrEnergyCut(0.);
    anaTaskCDFfull_clusCont->SetClusHadCorrEnergyCut(0.30);
    anaTaskCDFfull_clusCont->SetDefaultClusterEnergy(AliVCluster::kHadCorr);

    if (bDoEmbedding) {
      anaTaskCDFfull_partCont->SetIsEmbedding(kTRUE);
      anaTaskCDFfull_clusCont->SetIsEmbedding(kTRUE);
      }

    if ( pMultSelTask ) {
      anaTaskCDFfull->SetUseNewCentralityEstimation(bIsRun2);
      anaTaskCDFfull->SetNCentBins(5);
      anaTaskCDFfull->SetCentralityEstimator(cent_est_full.Data());
      }
    }

//########################
//   ANALYSIS TASKS - CONTAINERS SETUP
//########################

//   AliEmcalJetTask* pChJet02Task_MC = NULL;
//   AliEmcalJetTask* pChJet04Task_MC = NULL;

// add jet containers to CDF task for charged jets
  if (bDoChargedJets && bDoCDF) {
    AliJetContainer* jetcont_chg = NULL;
    for ( Float_t fi = 0 ; fi<=100 ; fi+=10) {
      // CHG JETS 0.2
      jetcont_chg  = anaTaskCDFchg->AddJetContainer(chgjet, antikt, recomb, 0.2, acc_chgjets, "Jet");
      CDF::jetContSetParams (jetcont_chg,    fi,   fi+10, 0, 0);

      // CHG JETS 0.4
      jetcont_chg  = anaTaskCDFchg->AddJetContainer(chgjet, antikt, recomb, 0.4, acc_chgjets, "Jet");
      CDF::jetContSetParams (jetcont_chg,    fi,   fi+10, 0, 0);

      if (isMC) {
        // CHG JETS MC 0.2
        jetcont_chg = AddJetContainerJetTask(dynamic_cast<AliAnalysisTaskEmcalJetCDF*>(anaTaskCDFchg_MC), pChJet02Task_MC, acc_chgjets);
        CDF::jetContSetParams (jetcont_chg,    fi,   fi+10, 0, 0);

        // CHG JETS MC 0.4
        jetcont_chg = AddJetContainerJetTask(dynamic_cast<AliAnalysisTaskEmcalJetCDF*>(anaTaskCDFchg_MC), pChJet04Task_MC, acc_chgjets);
        CDF::jetContSetParams (jetcont_chg,    fi,   fi+10, 0, 0);
        }
      }

    jetcont_chg   = anaTaskCDFchg->AddJetContainer(chgjet, antikt, recomb, 0.2, acc_chgjets, "Jet");
    CDF::jetContSetParams (jetcont_chg,     1., 500., 0, 0);
    jetcont_chg   = anaTaskCDFchg->AddJetContainer(chgjet, antikt, recomb, 0.4, acc_chgjets, "Jet");
    CDF::jetContSetParams (jetcont_chg,     1., 500., 0, 0);

    if (isMC) {
      jetcont_chg = AddJetContainerJetTask(dynamic_cast<AliAnalysisTaskEmcalJetCDF*>(anaTaskCDFchg_MC), pChJet02Task_MC, acc_chgjets);
      CDF::jetContSetParams (jetcont_chg,     1., 500., 0, 0);

      jetcont_chg = AddJetContainerJetTask(dynamic_cast<AliAnalysisTaskEmcalJetCDF*>(anaTaskCDFchg_MC), pChJet04Task_MC, acc_chgjets);
      CDF::jetContSetParams (jetcont_chg,     1., 500., 0, 0);
      }

    jetcont_chg = NULL;
    }

  // add jet containers to CDF task for full jets
  if (bDoFullJets && bDoCDF) {
    AliJetContainer* jetcont_full = NULL;
    for ( Float_t fi = 0 ; fi<=100 ; fi+=10) {
      // FULL JETS 0.2
      jetcont_full  = anaTaskCDFfull->AddJetContainer(fulljet, antikt, recomb, 0.2, acc_fulljets, "Jet");
      CDF::jetContSetParams (jetcont_full,    fi,   fi+10, 0, 2);

      // FULL JETS 0.4
      jetcont_full  = anaTaskCDFfull->AddJetContainer(fulljet, antikt, recomb, 0.4, acc_fulljets, "Jet");
      CDF::jetContSetParams (jetcont_full,    fi,   fi+10, 0, 2);

      if (isMC) {
        // CHG JETS MC 0.2
        jetcont_full = AddJetContainerJetTask(dynamic_cast<AliAnalysisTaskEmcalJetCDF*>(anaTaskCDFfull_MC), pFuJet02Task_MC, acc_fulljets);
        CDF::jetContSetParams (jetcont_full,    fi,   fi+10, 0, 0);

        // CHG JETS MC 0.4
        jetcont_full = AddJetContainerJetTask(dynamic_cast<AliAnalysisTaskEmcalJetCDF*>(anaTaskCDFfull_MC), pFuJet04Task_MC, acc_fulljets);
        CDF::jetContSetParams (jetcont_full,    fi,   fi+10, 0, 0);
        }
      }

    jetcont_full   = anaTaskCDFfull->AddJetContainer(fulljet, antikt, recomb, 0.2, acc_fulljets, "Jet");
    CDF::jetContSetParams (jetcont_full,     1., 500., 0, 2);

    jetcont_full   = anaTaskCDFfull->AddJetContainer(fulljet, antikt, recomb, 0.4, acc_fulljets, "Jet");
    CDF::jetContSetParams (jetcont_full,     1., 500., 0, 2);

    if (isMC) {
      jetcont_full = AddJetContainerJetTask(dynamic_cast<AliAnalysisTaskEmcalJetCDF*>(anaTaskCDFfull_MC), pFuJet02Task_MC, acc_fulljets);
      CDF::jetContSetParams (jetcont_full,     1., 500., 0, 0);

      jetcont_full = AddJetContainerJetTask(dynamic_cast<AliAnalysisTaskEmcalJetCDF*>(anaTaskCDFfull_MC), pFuJet04Task_MC, acc_fulljets);
      CDF::jetContSetParams (jetcont_full,     1., 500., 0, 0);
      }
    jetcont_full = NULL;
    }

  // add jet containers to sample task for charged jets
  if (bDoChargedJets && bDoSample) {
    AliJetContainer* jetCont02chg_sample = sampleTaskchg->AddJetContainer(chgjet, antikt, recomb, 0.2, acc_chgjets, "Jet");
    AliJetContainer* jetCont04chg_sample = sampleTaskchg->AddJetContainer(chgjet, antikt, recomb, 0.4, acc_chgjets, "Jet");

    if (iBeamType != AliAnalysisTaskEmcal::kpp) {
      jetCont02chg_sample->SetRhoName(sRhoChName);
      jetCont02chg_sample->SetPercAreaCut(0.6);

      jetCont04chg_sample->SetRhoName(sRhoChName);
      jetCont04chg_sample->SetPercAreaCut(0.6);
      }
    }

  // add jet containers to sample task for full jets
  if (bDoFullJets && bDoSample) {
    AliJetContainer* jetCont02full_sample = sampleTaskfull->AddJetContainer(fulljet, antikt, recomb, 0.2, acc_fulljets, "Jet");
    AliJetContainer* jetCont04full_sample = sampleTaskfull->AddJetContainer(fulljet, antikt, recomb, 0.4, acc_fulljets, "Jet");

    if (iBeamType != AliAnalysisTaskEmcal::kpp) {
      jetCont02full_sample->SetRhoName(sRhoFuName);
      jetCont02full_sample->SetPercAreaCut(0.6);

      jetCont04full_sample->SetRhoName(sRhoFuName);
      jetCont04full_sample->SetPercAreaCut(0.6);
      }
    }


  TObjArray* tasks_list = pMgr->GetTasks(); TIter task_iter (tasks_list); AliAnalysisTaskSE* task = NULL;
  while (( task = dynamic_cast<AliAnalysisTaskSE*>(task_iter.Next()) )) {
    if (task->InheritsFrom("AliAnalysisTaskEmcal")) {
      Printf("Setting beam type %d for task %s", iBeamType, static_cast<AliAnalysisTaskEmcal*>(task)->GetName());
      static_cast<AliAnalysisTaskEmcal*>(task)->SetForceBeamType(iBeamType);
      }
    }

  //   Let's start #########################################################################################################
  if ( !pMgr->InitAnalysis() ) { std::cout << ">>>>>>>>>>>>>> AliAnalysisManager Initialising FAILED!!! " << std::endl; return NULL; }
  std::cout << "##-->> Initialising Analysis :: Status :" << std::endl;
  pMgr->PrintStatus();
  pMgr->SetUseProgressBar(bUseProgBar, 100);

  // task profiling
  if ( kUseSysInfo > 0 ) {
    for ( int i = 0; i < pMgr->GetTopTasks()->GetEntries(); i++ ) { pMgr->ProfileTask (i); }
    }

  CDF::SaveManager("train.root");

  if ( ManagerMode == AnalysisType::local ) { // start local analysis
    // enable class level debugging for these classes
    if ( debug > 2 ) {
    //   pMgr->AddClassDebug("AliJetContainer", 100);
    //   pMgr->AddClassDebug("AliEmcalJetTask", 100);
      if (bDoCDF)    { pMgr->AddClassDebug("AliAnalysisTaskEmcalJetCDF", 100); }
      if (bDoSample) { pMgr->AddClassDebug("AliAnalysisTaskEmcalJetSample", 100); }
      }

    TChain* pChain = CDF::CreateChain(kDataSource.Data(), "auto", "", iNumFiles);
    if (!pChain) { std::cout << ">>>>>>>>>>>>>>   CHAIN NOT CREATED   <<<<<<<<<<<<<<" << std::endl; return NULL; }

    // start analysis
    Printf("Starting LOCAL Analysis...");
    pMgr->StartAnalysis( cAnalysisType, pChain, iNumEvents );
    }

  if ( ManagerMode == AnalysisType::grid ) {  // start grid analysis
    // start analysis
    Printf("Starting GRID Analysis...");

    ListLibs += kGridExtraFiles;
    if ( ListLibs.Length() )       { plugin->SetAdditionalLibs     ( ListLibs.Data() ); }
    if ( ListLibsExtra.Length() )  { plugin->SetAdditionalRootLibs ( ListLibsExtra.Data() ); }

    if ( PluginMode == PluginType::test )
      { plugin->StartAnalysis(iNumEvents); }
    else {
      pMgr->SetDebugLevel(0);
      plugin->StartAnalysis();
      }
    }

cout << "END of EmcalJetCDF.C" << std::endl;
return pMgr;
}
Ejemplo n.º 12
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;
}
Ejemplo n.º 13
0
//______________________________________________________________________________
AliAnalysisGrid* CreateAlienHandler(Bool_t bAOD, Int_t bunchN, const char *taskname, const char *gridmode, const char *proofcluster, const char *proofdataset)
{
    AliAnalysisAlien *plugin = new AliAnalysisAlien();
    // Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
    plugin->SetRunMode(gridmode);

    // Set versions of used packages
    plugin->SetAPIVersion("V1.1x");
    plugin->SetROOTVersion("v5-34-08");
    plugin->SetAliROOTVersion("v5-05-19-AN");

    // Declare input data to be processed.

    // Method 1: Create automatically XML collections using alien 'find' command.
    // Define production directory LFN
    plugin->SetGridDataDir("/alice/data/2010/LHC10h/");
    // On real reconstructed data:
    // plugin->SetGridDataDir("/alice/data/2009/LHC09d");

    // Set data search pattern
    //plugin->SetDataPattern("*ESDs.root"); // THIS CHOOSES ALL PASSES
    // Data pattern for reconstructed data
    if(!bAOD){
      plugin->SetDataPattern("*ESDs/pass2/*ESDs.root"); // CHECK LATEST PASS OF DATA SET IN ALIENSH
    } 
    else{
      plugin->SetDataPattern("*ESDs/pass2/AOD086/*/AliAOD.root");
    }

    plugin->SetRunPrefix("000");   // real data
    // ...then add run numbers to be considered
    //plugin->SetRunRange(114917,115322);

    if(bunchN==0){
      plugin->AddRunNumber(137366);
    }
    
    //bunch1
    else if(bunchN == 1){
      plugin->AddRunNumber(139510);
      plugin->AddRunNumber(139507);
      plugin->AddRunNumber(139505);
      plugin->AddRunNumber(139503); 
      plugin->AddRunNumber(139465); 
      plugin->AddRunNumber(139438);
      plugin->AddRunNumber(139437);
      plugin->AddRunNumber(139360); 
      plugin->AddRunNumber(139329);
      plugin->AddRunNumber(139328); 
    }

    //bunch2
    else if(bunchN == 2){
      plugin->AddRunNumber(139314); 
      plugin->AddRunNumber(139310);
      plugin->AddRunNumber(139309); 
      plugin->AddRunNumber(139173); 
      plugin->AddRunNumber(139107); 
      plugin->AddRunNumber(139105); 
      plugin->AddRunNumber(139038); 
      plugin->AddRunNumber(139037); 
      plugin->AddRunNumber(139036); 
      plugin->AddRunNumber(139029); 
      plugin->AddRunNumber(139028); 
      plugin->AddRunNumber(138872); 
      plugin->AddRunNumber(138871); 
      plugin->AddRunNumber(138870); 
      plugin->AddRunNumber(138837); 
      plugin->AddRunNumber(138732); 
      plugin->AddRunNumber(138730);
      plugin->AddRunNumber(138666);
      plugin->AddRunNumber(138662); 
      plugin->AddRunNumber(138653); 
    }

    else if(bunchN == 3){
      plugin->AddRunNumber(138652);
      plugin->AddRunNumber(138638);
      plugin->AddRunNumber(138624); 
      plugin->AddRunNumber(138621); 
      plugin->AddRunNumber(138583); 
      plugin->AddRunNumber(138582); 
      plugin->AddRunNumber(138579); 
      plugin->AddRunNumber(138578);
      plugin->AddRunNumber(138534);
      plugin->AddRunNumber(138469); 
    }

    else if(bunchN == 4){
      
      plugin->AddRunNumber(138442);
      plugin->AddRunNumber(138439);
      plugin->AddRunNumber(138438);
      plugin->AddRunNumber(138396); 
      plugin->AddRunNumber(138364); 
      plugin->AddRunNumber(138275); 
      plugin->AddRunNumber(138225); 
      plugin->AddRunNumber(138201);
      plugin->AddRunNumber(138197); 
      plugin->AddRunNumber(138192); 
    }

    else if(bunchN == 5){

      plugin->AddRunNumber(138190);
      plugin->AddRunNumber(137848); 
      plugin->AddRunNumber(137844); 
      plugin->AddRunNumber(137752); 
      plugin->AddRunNumber(137751); 
      plugin->AddRunNumber(137724); 
      plugin->AddRunNumber(137722); 
      plugin->AddRunNumber(137718); 
      plugin->AddRunNumber(137704); 
      plugin->AddRunNumber(137693);
    }

    else if(bunchN == 6){

      plugin->AddRunNumber(137692); 
      plugin->AddRunNumber(137691); 
      plugin->AddRunNumber(137686); 
      plugin->AddRunNumber(137685); 
      plugin->AddRunNumber(137639); 
      plugin->AddRunNumber(137638);
      plugin->AddRunNumber(137608); 
      plugin->AddRunNumber(137595);
      plugin->AddRunNumber(137549);
      plugin->AddRunNumber(137546); 

    }

    else if(bunchN == 7){

      plugin->AddRunNumber(137544); 
      plugin->AddRunNumber(137541); 
      plugin->AddRunNumber(137539); 
      plugin->AddRunNumber(137531); 
      plugin->AddRunNumber(137530); 
      plugin->AddRunNumber(137443); 
      plugin->AddRunNumber(137441); 
      plugin->AddRunNumber(137440); 
      plugin->AddRunNumber(137439); 
      plugin->AddRunNumber(137434); 

    }

    else if(bunchN == 8){

      plugin->AddRunNumber(137432); 
      plugin->AddRunNumber(137431); 
      plugin->AddRunNumber(137430); 
      plugin->AddRunNumber(137366); 
      plugin->AddRunNumber(137243); 
      plugin->AddRunNumber(137236);
      plugin->AddRunNumber(137235);
      plugin->AddRunNumber(137232); 
      plugin->AddRunNumber(137231); 
      plugin->AddRunNumber(137162); 
      plugin->AddRunNumber(137161);
    }

    else{

      stderr<<"BUNCH NOT THERE"<<endl;
      return NULL;

    }

    //plugin->AddRunList("139510, 139507, 139505, 139503, 139465, 139438, 139437, 139360, 139329, 139328, 139314, 139310, 139309, 139173, 139107, 139105, 139038, 139037, 139036, 139029, 139028, 138872, 138871, 138870, 138837, 138732, 138730, 138666, 138662, 138653, 138652, 138638, 138624, 138621, 138583, 138582, 138579, 138578, 138534, 138469, 138442, 138439, 138438, 138396, 138364, 138275, 138225, 138201, 138197, 138192, 138190, 137848, 137844, 137752, 137751, 137724, 137722, 137718, 137704, 137693, 137692, 137691, 137686, 137685, 137639, 137638, 137608, 137595, 137549, 137546, 137544, 137541, 137539, 137531, 137530, 137443, 137441, 137440, 137439, 137434, 137432, 137431, 137430, 137366, 137243, 137236, 137235, 137232, 137231, 137162, 137161");





    plugin->SetNrunsPerMaster(1);
    plugin->SetOutputToRunNo();
    // comment out the next line when using the "terminate" option, unless
    // you want separate merged files for each run
    plugin->SetMergeViaJDL();

    // 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(taskname);

    // Declare alien output directory. Relative to working directory.
    plugin->SetGridOutputDir("out"); // In this case will be $HOME/taskname/out

   // Declare the analysis source files names separated by blancs. To be compiled runtime
    // using ACLiC on the worker nodes.
    plugin->SetAnalysisSource("AliBalance.cxx AliAnalysisTaskBF.cxx");

    // 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->AddIncludePath("-I.");
    //plugin->SetAdditionalLibs("libPWGCFebye.so");
    plugin->SetAdditionalLibs("AliBalance.cxx AliBalance.h AliAnalysisTaskBF.cxx AliAnalysisTaskBF.h");

     // Declare the output file names separated by blancs.
    // (can be like: file.root or file.root@ALICE::Niham::File)
    // To only save certain files, use SetDefaultOutputs(kFALSE), and then
    // SetOutputFiles("list.root other.filename") to choose which files to save
    plugin->SetDefaultOutputs();
    //plugin->SetOutputFiles("list.root");

    // Optionally set a name for the generated analysis macro (default MyAnalysis.C)
    plugin->SetAnalysisMacro(Form("%s.C",taskname));

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

    // Optionally modify the executable name (default analysis.sh)
    plugin->SetExecutable(Form("%s.sh",taskname));

    // set number of test files to use in "test" mode
    plugin->SetNtestFiles(1);

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

    // Optionally set time to live (default 30000 sec)
    plugin->SetTTL(90000);

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

    // Optionally modify the name of the generated JDL (default analysis.jdl)
    plugin->SetJDLName(Form("%s.jdl",taskname));

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

    // Optionally modify split mode (default 'se')    
    plugin->SetSplitMode("se");

    //plugin->SetUseSubmitPolicy();
    //plugin->SetKeepLogs();
    
    //----------------------------------------------------------
    //---      PROOF MODE SPECIFIC SETTINGS         ------------
    //---------------------------------------------------------- 
    // Proof cluster
    plugin->SetProofCluster(proofcluster);
    // Dataset to be used   
    plugin->SetProofDataSet(proofdataset);
    // May need to reset proof. Supported modes: 0-no reset, 1-soft, 2-hard
    plugin->SetProofReset(0);
    // May limit number of workers
    plugin->SetNproofWorkers(0);
    // May limit the number of workers per slave
    plugin->SetNproofWorkersPerSlave(1);   
    // May use a specific version of root installed in proof
    plugin->SetRootVersionForProof("current");
    // May set the aliroot mode. Check http://aaf.cern.ch/node/83 
    plugin->SetAliRootMode("default"); // Loads AF libs by default
    // May request ClearPackages (individual ClearPackage not supported)
    plugin->SetClearPackages(kFALSE);
    // Plugin test mode works only providing a file containing test file locations, used in "local" mode also
    plugin->SetFileForTestMode("files.txt"); // file should contain path name to a local directory containg *ESDs.root etc
    // Request connection to alien upon connection to grid
    plugin->SetProofConnectGrid(kFALSE);

    plugin->Print();

    return plugin;
}
Ejemplo n.º 14
0
AliAnalysisGrid* CreateAlienHandler(const char* mode = "offline")
{

  //if (!AliAnalysisGrid::CreateToken()) return NULL;

   AliAnalysisAlien *plugin = new AliAnalysisAlien();
   
   plugin->SetRunMode(mode); // "full", "test", "offline", "submit" or "terminate"
   plugin->SetMergeViaJDL(kTRUE);
   plugin->SetOneStageMerging(kFALSE);
   plugin->SetMaxMergeStages(2);

   plugin->SetAPIVersion("V1.1x");
   plugin->SetROOTVersion("v5-30-03");
   plugin->SetAliROOTVersion("v5-02-16-AN");

   // add data through aliensh find procedure.
   //plugin->SetGridDataDir("/alice/sim/LHC11d2/");
   plugin->SetGridDataDir("/alice/data/2011/LHC11e");
   //plugin->SetDataPattern("*pass1/*ESDs.root");
   //plugin->SetDataPattern("*tag.root");
   //plugin->SetDataPattern("*pass1/*tag.root");
   plugin->SetDataPattern("*AOD.root");
   //plugin->AddRunNumber(119161);
   //plugin->AddRunNumber("000162740");
   //plugin->AddRunNumber("000161585");
   plugin->AddRunNumber("000162644");
   
   
   // Method 2: Declare existing data files 
   //plugin->AddDataFile("tag.xml");
   // plugin->AddDataFile("/alice/data/2008/LHC08c/000057657/raw/Run57657.Merged.RAW.tag.root");

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

   // TString source = "";
   // source += "EtaCandidate.cxx ";
   // source += "EtaPriCandidate.cxx ";
   // source += "EtaConfig.cxx ";
   // source += "EtaOutput.cxx ";
   // source += "EtaAnalysis.cxx ";
   // source += "EtaTask.cxx ";
   // plugin->SetAnalysisSource(source);
   plugin->SetAnalysisSource("EtaCandidate.cxx EtaPriCandidate.cxx EtaConfig.cxx EtaOutput.cxx EtaAnalysis.cxx EtaTask.cxx");
   
   // TString libs = source;
   // libs += "EtaCandidate.h ";
   // libs += " EtaPriCandidate.h";
   // libs += " EtaConfig.h";
   // libs += " EtaOutput.h";
   // libs += " EtaAnalysis.h";
   // libs += " EtaTask.h";
   // plugin->SetAdditionalLibs(libs);
   plugin->SetAdditionalLibs("EtaCandidate.h EtaCandidate.cxx EtaPriCandidate.h EtaPriCandidate.cxx EtaConfig.h EtaConfig.cxx EtaOutput.h EtaOutput.cxx EtaAnalysis.h EtaAnalysis.cxx EtaTask.h EtaTask.cxx");

   plugin->SetDefaultOutputs(kTRUE);
   //plugin->SetDefaultOutputs(kFALSE);
   //plugin->SetOutputFiles("eta.output.ESD.root EventStat_temp.root");
   
   
   // Optionally define the files to be archived.
   // plugin->SetOutputArchive("log_archive.zip:stdout,stderr@ALICE::NIHAM::File root_archive.zip:*.root@ALICE::NIHAM::File");
   // plugin->SetOutputArchive("log_archive.zip:stdout,stderr");

   // Optionally set a name for the generated analysis macro (default MyAnalysis.C)
   plugin->SetAnalysisMacro("EtaAnalysis.C");
   plugin->SetExecutable("runEtaAnalysis.sh");
   plugin->SetJDLName("EtaAnalysis.jdl");

   plugin->SetSplitMaxInputFileNumber(100);
   plugin->SetMaxInitFailed(5);
   plugin->SetMasterResubmitThreshold(90);
   plugin->SetTTL(43200);
   plugin->SetInputFormat("xml-single");
   plugin->SetPrice(1);      
   plugin->SetSplitMode("se");

   return plugin;
}