more options in AddTasks and fastjet3
authorcbianchi <cbianchi@cern.ch>
Tue, 7 Oct 2014 12:44:29 +0000 (14:44 +0200)
committermvl <marco.van.leeuwen@cern.ch>
Tue, 7 Oct 2014 12:54:59 +0000 (14:54 +0200)
PWGJE/FlavourJetTasks/macros/AddTaskDFilterAndCorrelations.C
PWGJE/FlavourJetTasks/macros/AddTasksFlavourJet.C
PWGJE/FlavourJetTasks/macros/AnalysisTrainCorrJetsLocal.C

index 63322fe..d9acd50 100644 (file)
@@ -57,7 +57,8 @@ void *AddTaskDFilterAndCorrelations(
 
   TString candname="DStar"; 
   if(cand==0)  candname="D0";
-
+  TString sR = Form("R%.1f",R);
+  
   TString taskFiltername="DmesonsFilterCJ";
   taskFiltername+=candname;
   taskFiltername+=suffix;
@@ -65,13 +66,15 @@ void *AddTaskDFilterAndCorrelations(
   if(!reco)   taskFiltername+="gen";
   
   AliAnalysisTaskSEDmesonsFilterCJ* taskFilter = mgr->GetTask(taskFiltername.Data());
+  Bool_t bTaskFilter=kTRUE;
   if (!taskFilter){
+     bTaskFilter=kFALSE;
      taskFilter = new AliAnalysisTaskSEDmesonsFilterCJ(taskFiltername.Data(),analysiscuts,cand);
      if(!theMCon) reco=kTRUE;
      taskFilter->SetMC(theMCon); //D meson settings
      taskFilter->SetUseReco(reco);
      mgr->AddTask(taskFilter);
-  }
+  } else Printf("Task %s already exist, continue",taskFiltername.Data());
 
   // create the task
   TString taskCorrName="TaskFlavourJetCorrelations";
@@ -81,7 +84,7 @@ void *AddTaskDFilterAndCorrelations(
   if(!reco)   taskCorrName+="gen";
   taskCorrName+=cutType;
   taskCorrName+=Form("PTj%.0f",jptcut);
-  taskCorrName+="";
+  taskCorrName+=sR;
   
   AliAnalysisTaskFlavourJetCorrelations *taskCorr = new AliAnalysisTaskFlavourJetCorrelations(taskCorrName.Data(), 
      analysiscuts, cand);
@@ -142,25 +145,41 @@ void *AddTaskDFilterAndCorrelations(
   nameContainerFC2 += suffix;
   nameContainerFC3 += suffix;
   
-
+  nameContainerC0+=sR;
+  nameContainerC1+=sR;
+  
   // ------ input data ------
   AliAnalysisDataContainer *cinput0  = mgr->GetCommonInputContainer();
   cinput0->SetName(Form("in%s%s",candname.Data(),suffix.Data()));
   
   // ----- output data -----
+  AliAnalysisDataContainer *coutputF0;
+  AliAnalysisDataContainer *coutputF1;
+  AliAnalysisDataContainer *coutputFC2;
+  AliAnalysisDataContainer *coutputFC3;
+  
+  if(!bTaskFilter){
+  coutputF0 = mgr->CreateContainer(nameContainerF0, TList::Class(),AliAnalysisManager::kOutputContainer,outputfileF.Data());
   
-  AliAnalysisDataContainer *coutputF0 = mgr->CreateContainer(nameContainerF0, TList::Class(),AliAnalysisManager::kOutputContainer,outputfileF.Data());
+  coutputF1 = mgr->CreateContainer(nameContainerF1, AliRDHFCuts::Class(),AliAnalysisManager::kOutputContainer, outputfileF.Data());
   
-  AliAnalysisDataContainer *coutputF1 = mgr->CreateContainer(nameContainerF1, AliRDHFCuts::Class(),AliAnalysisManager::kOutputContainer, outputfileF.Data());
+  coutputFC2 = mgr->CreateContainer(nameContainerFC2, TClonesArray::Class(),AliAnalysisManager::kExchangeContainer, outputfileF.Data()); // exchange
+  
+  coutputFC3 = mgr->CreateContainer(nameContainerFC3, TClonesArray::Class(),AliAnalysisManager::kExchangeContainer, outputfileF.Data()); // exchange
+
+  } else {
+     TObjArray * cnt = mgr->GetContainers();
+     coutputF0 = (AliAnalysisDataContainer*)cnt->FindObject(nameContainerF0);
+     coutputF1 = (AliAnalysisDataContainer*)cnt->FindObject(nameContainerF1);
+     coutputFC2= (AliAnalysisDataContainer*)cnt->FindObject(nameContainerFC2);
+     coutputFC3= (AliAnalysisDataContainer*)cnt->FindObject(nameContainerFC3);
+  }
   
   AliAnalysisDataContainer *coutputC0 = mgr->CreateContainer(nameContainerC0, TList::Class(),AliAnalysisManager::kOutputContainer,outputfileC.Data());
 
   AliAnalysisDataContainer *coutputC1 = mgr->CreateContainer(nameContainerC1, AliRDHFCuts::Class(),AliAnalysisManager::kOutputContainer, outputfileC.Data());
   
-  AliAnalysisDataContainer *coutputFC2 = mgr->CreateContainer(nameContainerFC2, TClonesArray::Class(),AliAnalysisManager::kExchangeContainer, outputfileF.Data()); //
-  
-  AliAnalysisDataContainer *coutputFC3 = mgr->CreateContainer(nameContainerFC3, TClonesArray::Class(),AliAnalysisManager::kExchangeContainer, outputfileF.Data()); //
-  
+    
   mgr->ConnectInput(taskFilter,0,cinput0);
   mgr->ConnectInput(taskCorr,0,cinput0);
   
index a9c5f1a..8ed2e08 100644 (file)
@@ -19,11 +19,7 @@ void AddTasksFlavourJet(const Int_t iCandType = 1 /*0 = D0, 1=Dstar...*/,
    TString sInputTrk = bIsReco ? sInputTrkRec : sInputTrkMC;
    const Int_t iJetAlgo = 1;
    const Int_t iJetType = 1;
-   /*
-   const Int_t    nRadius = 3;
-   const Double_t aRadius[] = {  0.2,   0.4,   0.6  };
-   const TString  sRadius[] = { "R02", "R04", "R06" };
-   */
    const Int_t    nRadius = 1;
    const Double_t aRadius[] = {  0.4  };
    const TString  sRadius[] = { "R04" };
@@ -159,3 +155,122 @@ void AddTasksFlavourJet(const Int_t iCandType = 1 /*0 = D0, 1=Dstar...*/,
    
    return;
 }
+
+
+void AddMoreJetFinders(
+   /*input for Jet Finder*/   
+   const UInt_t uTriggerMask = AliVEvent::kMB, /*for jets; the D mesons trigger is defined in the cut object*/
+   const TString sRunPeriod = "LHC13b", /*for track selection*/
+   Bool_t tmpoadb2012flag=kFALSE, /*kTRUE for LHC12h and LHC12i*/
+   const Bool_t bIsMC = kFALSE,
+   /*input for D mesons*/ 
+   const Int_t iCandType = 1 /*0 = D0, 1=Dstar...*/,
+   const TString sCutFile = "cutsHF/D0toKpiCutsppRecVtxNoPileupRejNoEMCAL.root",
+   const Double_t dJetPtCut   = 1.,
+   const Double_t dJetAreaCut = 0.,
+   const char *acctype = "TPC",
+   const Bool_t bIsReco = kFALSE,
+   const Bool_t bIsMap = kFALSE,
+   TString sText="",/*completes the name of the candidate task lists*/
+   Bool_t triggerOnLeadingJet = kFALSE
+){
+   
+   const Int_t    nRadius = 3;
+   const Double_t aRadius[] = {  0.2,   0.4,   0.6  };
+   const TString  sRadius[] = { "R02", "R04", "R06" };
+
+   const TString sInputTrkMC  = "MCParticlesSelected";
+   const TString sInputTrkRec  = "tracks";
+   const TString sUsedTrks  = "PicoTracks";
+   const TString sUsedClus  = "";
+   TString sInputTrk = bIsReco ? sInputTrkRec : sInputTrkMC;
+   const Int_t iJetAlgo = 1;
+   const Int_t iJetType = 1;
+
+   //=============================================================================
+   
+   UInt_t uAnaType = (((iJetType==0) ||     (iJetType==2)) ? 1 : 0);
+   Int_t  iLeading =  ((iJetType==0) ? 3 : ((iJetType==1)  ? 0 : 1));
+   Int_t leadHadType=0; /* 0=charged, 1=neutral, 2=both*/
+   
+   // EMCal framework
+   // -- Physics selection task
+   if(!bIsMC){
+      gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEmcalPhysicsSelection.C");
+      AliPhysicsSelectionTask *physSelTask = AddTaskEmcalPhysicsSelection(kTRUE, kTRUE, uTriggerMask, 5, 5, 10, kTRUE, -1, -1, -1, -1);
+      
+      if (!physSelTask) {
+        cout << "no physSelTask"; 
+        return; 
+      }
+   }
+   // -- EMCal setup
+   gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/AddTaskEmcalSetup.C");
+   AliEmcalSetupTask *taskSetupEMCal = AddTaskEmcalSetup();
+   if(tmpoadb2012flag) taskSetupEMCal->SetOcdbPath("raw://"); //needed for period LHC12h and i
+   else taskSetupEMCal->SetGeoPath("$ALICE_ROOT/OADB/EMCAL");
+   taskSetupEMCal->SelectCollisionCandidates(uTriggerMask);
+   
+   // Jet preparation
+   gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskJetPreparation.C");
+   AddTaskJetPreparation(sRunPeriod,"PicoTracks",bIsMC ? "MCParticlesSelected" : "",/*next 7 emcal default settings*/"","",2.,0.,0.03,0.015,0.15,uTriggerMask, kFALSE /*track cluster*/,kFALSE /*do histos*/,kTRUE /*make pico tracks*/,kTRUE /*make emcal trigger*/,kFALSE /*is emcal train*/);
+   
+   
+   gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskEmcalJet.C");
+   
+  for (Int_t i=0; i<nRadius; i++) {
+      //jet reconstruction
+      AliEmcalJetTask *taskFJ = AddTaskEmcalJet(sUsedTrks.Data(),sUsedClus.Data(),iJetAlgo,aRadius[i],iJetType);
+      
+      taskFJ->SelectCollisionCandidates(uTriggerMask);
+      
+      Printf("Now Jet Finder with R = %f",aRadius[i]);
+      //sText=sRadius;
+      //my code
+      AddMyAnalysis(taskFJ,aRadius[i],iCandType,sCutFile,dJetPtCut,dJetAreaCut,
+        acctype,bIsMC,bIsReco,bIsMap,sText,triggerOnLeadingJet);
+  }
+}
+
+void AddMyAnalysis(AliAnalysisTaskSE *jetTask, Double_t aRadius,
+   const Int_t iCandType = 1 /*0 = D0, 1=Dstar...*/,
+   const TString sCutFile = "cutsHF/D0toKpiCutsppRecVtxNoPileupRejNoEMCAL.root",
+   const Double_t dJetPtCut   = 1.,
+   const Double_t dJetAreaCut = 0.,
+   const char *acctype = "TPC",
+   const Bool_t bIsMC = kFALSE,
+   const Bool_t bIsReco = kFALSE,
+   const Bool_t bIsMap = kFALSE,
+   TString sText="",/*completes the name of the candidate task lists*/
+   Bool_t triggerOnLeadingJet = kFALSE
+){
+   
+   AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
+   //D mesons -- PID
+   TString pidTaskName="PIDResponseTask";
+   if(!mgr->GetTask(pidTaskName)){
+      gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
+      AliAnalysisTaskSE *taskRespPID = AddTaskPIDResponse(bIsMC);
+   }
+   
+   gROOT->LoadMacro("$ALICE_ROOT/PWGJE/FlavourJetTasks/macros/AddTaskDFilterAndCorrelations.C");
+  
+   //Filter and correlation with D meson
+   
+   AddTaskDFilterAndCorrelations(
+      iCandType,
+      sCutFile,
+      bIsMC,
+      bIsReco,
+      sText,
+      jetTask->GetName(),
+      //Form("JetR%s",sRadius[i].Data()),
+      triggerOnLeadingJet,
+      0,
+      aRadius,
+      dJetPtCut,
+      acctype
+      //percjetareacut=1.
+      );
+   
+}
index 32b0b0d..ff5977a 100644 (file)
@@ -254,17 +254,18 @@ void LoadLibs()
   //gSystem->Load("libPWGCFCorrelationsBase");
   //gSystem->Load("libPWGCFCorrelationsDPhi");
 
-  //load CGAL, Fastjet and SISCone
+  //load CGAL, Fastjet3 
   //gSystem->Load("libCGAL");
   gSystem->Load("libfastjet");
-  gSystem->Load("libSISConePlugin");
+  gSystem->Load("libfastjet");
+  gSystem->Load("libsiscone");
+  gSystem->Load("libsiscone_spherical");
+  gSystem->Load("libfastjetplugins");
+  gSystem->Load("libfastjettools");
+  gSystem->Load("libfastjetcontribfragile");
   gSystem->Load("libJETAN");
   gSystem->Load("libFASTJETAN");
-  gSystem->Load("libCDFConesPlugin");
   gSystem->Load("libPWGGAEMCALTasks");
-  gSystem->Load("libPWGTools");
-  //gSystem->Load("libPWGCFCorrelationsBase");
-  //gSystem->Load("libPWGCFCorrelationsDPhi");
 
   gSystem->Load("libPWGJEEMCALJetTasks");
   gSystem->Load("libPWGJEFlavourJetTasks");
@@ -295,7 +296,7 @@ AliAnalysisGrid* CreateAlienHandler(const char* uniqueName, const char* gridDir,
   }else tmpName +="_20130412_122423";
   */
   TString tmpAdditionalLibs("");
-  tmpAdditionalLibs = Form("libTree.so libVMC.so libGeom.so libGui.so libXMLParser.so libMinuit.so libMinuit2.so libProof.so libPhysics.so libSTEERBase.so libESD.so libESDfilter.so libAOD.so libOADB.so libANALYSIS.so libCDB.so libRAWDatabase.so libSTEER.so libANALYSISalice.so libCORRFW.so libPWGTools.so libPWGHFbase.so libPWGflowBase.so libPWGflowTasks.so libPWGHFvertexingHF.so libEMCALUtils.so libEMCALraw.so libEMCALbase.so libTENDER.so libPWGEMCAL.so libPWGGAEMCALTasks.so libPWGTools.so libCGAL.so libfastjet.so libJETAN.so libFASTJETAN.so libSISConePlugin.so libCDFConesPlugin.so libPWGJE.so libPWGmuon.so libPWGJEEMCALJetTasks.so libPWGJEFlavourJetTasks.so %s %s",additionalCode.Data(),additionalHeaders.Data());
+  tmpAdditionalLibs = Form("libTree.so libVMC.so libGeom.so libGui.so libXMLParser.so libMinuit.so libMinuit2.so libProof.so libPhysics.so libSTEERBase.so libESD.so libESDfilter.so libAOD.so libOADB.so libANALYSIS.so libCDB.so libRAWDatabase.so libSTEER.so libANALYSISalice.so libCORRFW.so libPWGTools.so libPWGHFbase.so libPWGflowBase.so libPWGflowTasks.so libPWGHFvertexingHF.so libEMCALUtils.so libEMCALraw.so libEMCALbase.so libTENDER.so libPWGEMCAL.so libPWGGAEMCALTasks.so libPWGTools.so libCGAL.so libfastjet.so libsiscone.so libsiscone_spherical.so libfastjetplugins.so libfastjettools.so libfastjetcontribfragile.so libJETAN.so libFASTJETAN.so  libPWGJE.so libPWGJEEMCALJetTasks.so libPWGJEFlavourJetTasks.so %s %s",additionalCode.Data(),additionalHeaders.Data());
 
 
   TString macroName("");
@@ -311,8 +312,8 @@ AliAnalysisGrid* CreateAlienHandler(const char* uniqueName, const char* gridDir,
 
   // Here you can set the (Ali)ROOT version you want to use
   plugin->SetAPIVersion("V1.1x");
-  plugin->SetROOTVersion("v5-34-08-4");
-  plugin->SetAliROOTVersion("v5-05-63-AN");
+  plugin->SetROOTVersion(":v5-34-08-6");
+  plugin->SetAliROOTVersion("vAN-20141005");
 
   plugin->SetGridDataDir(gridDir); // e.g. "/alice/sim/LHC10a6"
   plugin->SetDataPattern(pattern); //dir structure in run directory
@@ -329,9 +330,9 @@ AliAnalysisGrid* CreateAlienHandler(const char* uniqueName, const char* gridDir,
   plugin->SetAnalysisSource(additionalCode.Data());
   plugin->SetAdditionalLibs(tmpAdditionalLibs.Data());
   plugin->AddIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT -I$ALICE_ROOT/include -I$ALICE_ROOT/STEER/STEER -I$ALICE_ROOT/STEER/STEERBase -I$ALICE_ROOT/STEER/ESD -I$ALICE_ROOT/STEER/AOD -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  -I$ALICE_ROOT/PWGJE  -I$ALICE_ROOT/JETAN -I$ALICE_ROOT/PWGJE/EMCALJetTasks -I$ALICE_ROOT/PWGJE/FlavourJetTasks -g");
-  plugin->AddExternalPackage("boost::v1_43_0");
-  plugin->AddExternalPackage("cgal::v3.6");
-  plugin->AddExternalPackage("fastjet::v2.4.2");
+  plugin->AddExternalPackage("boost::v1_53_0");
+  plugin->AddExternalPackage("cgal::v4.4");
+  plugin->AddExternalPackage("fastjet::v3.0.6_1.012");
 
   plugin->SetDefaultOutputs(kTRUE);
   // merging via jdl