updated to some AddTasks, added second mc case for taskJets setuppar
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 8 May 2009 11:45:50 +0000 (11:45 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 8 May 2009 11:45:50 +0000 (11:45 +0000)
PWG4/macros/AddTaskESDfilter.C
PWG4/macros/AddTaskJetSpectrum.C
PWG4/macros/AddTaskJets.C
PWG4/macros/AnalysisTrainCAF.C

index b6d86ad82ea05f54f25f16af7013fe8071fb9f75..09bfa862e40f4723f8c4d613d9e45c475f337764 100644 (file)
@@ -82,7 +82,7 @@ AliESDtrackCuts *CreateCuts(Int_t iCut){
     esdTrackCuts->SetMaxChi2PerClusterTPC(3.5);\r
     esdTrackCuts->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);\r
     esdTrackCuts->SetRequireTPCRefit(kTRUE);\r
-    esdTrackCuts->SetMinNsigmaToVertex(3);\r
+    esdTrackCuts->SetMaxNsigmaToVertex(3);\r
     esdTrackCuts->SetRequireSigmaToVertex(kTRUE);\r
     esdTrackCuts->SetAcceptKingDaughters(kFALSE);\r
   }\r
index d104af2b49e4570921c4274c9167acd484c12172..aabc7e5d3c022a044b19a47ca90a6f94b1567482 100644 (file)
@@ -26,8 +26,8 @@ AliAnalysisTaskJetSpectrum *AddTaskJetSpectrum()
    pwg4spec->SetAnalysisType(AliAnalysisTaskJetSpectrum::kAnaMC);\r
    //      if(iAODanalysis)pwg4spec->SetAODInput(kTRUE);\r
    // pwg4spec->SetDebugLevel(11); \r
-   //      pwg4spec->SetBranchRec("jetsMC"); \r
-   //      pwg4spec->SetBranchGen("jetsMC"); \r
+   pwg4spec->SetBranchGen("jetsMC"); \r
+   pwg4spec->SetBranchRec("jetsMC2"); \r
    mgr->AddTask(pwg4spec);\r
 \r
 \r
index c61c38ecc1efd989c07c9fe34f1054c5173d593d..8eb7ea38a09207a5c320f4104a35520fc3334782 100644 (file)
@@ -144,21 +144,38 @@ AliJetFinder *CreateJetFinder(Char_t *jf){
   case "UA1":\r
     AliUA1JetHeaderV1 *jh=new AliUA1JetHeaderV1();\r
     jh->SetComment("UA1 jet code with default parameters");\r
-    jh->BackgMode(2);\r
-    jh->SetRadius(1.0);\r
+    jh->BackgMode(0);\r
+    jh->SetRadius(0.4);\r
     jh->SetEtSeed(4.);\r
     jh->SetLegoNbinPhi(432);\r
     jh->SetLegoNbinEta(274);\r
     jh->SetLegoEtaMin(-2);\r
     jh->SetLegoEtaMax(+2);\r
-    jh->SetJetEtaMax(0.5);\r
-    jh->SetJetEtaMin(-0.5);\r
     jh->SetMinJetEt(10.);\r
+    jh->SetJetEtaMax(1.5);\r
+    jh->SetJetEtaMin(-1.5);\r
 \r
     jetFinder = new AliUA1JetFinderV1();\r
     if (jh) jetFinder->SetJetHeader(jh);\r
     break;\r
 \r
+  case "UA1MC":\r
+    AliUA1JetHeaderV1 *jh=new AliUA1JetHeaderV1();\r
+    jh->SetComment("UA1 jet code with default MC parameters");\r
+    jh->BackgMode(0);\r
+    jh->SetRadius(1.0);\r
+    jh->SetEtSeed(4.);\r
+    jh->SetLegoNbinPhi(432);\r
+    jh->SetLegoNbinEta(274);\r
+    jh->SetLegoEtaMin(-2);\r
+    jh->SetLegoEtaMax(+2);\r
+    jh->SetMinJetEt(10.);\r
+    jh->SetJetEtaMax(1.5);\r
+    jh->SetJetEtaMin(-1.5);\r
+\r
+    jetFinder = new AliUA1JetFinderV1();\r
+    if (jh) jetFinder->SetJetHeader(jh);\r
+    break;\r
   case default:\r
     ::Error("AddTaskJets", "Wrong jet finder selected\n");\r
     return 0;\r
@@ -183,7 +200,17 @@ AliJetReader *CreateJetReader(Char_t *jr){
     er = new AliJetKineReader();\r
     er->SetReaderHeader(jrh);\r
     break;\r
-\r
+  case "MC2":\r
+    AliJetKineReaderHeader *jrh = new AliJetKineReaderHeader();\r
+    jrh->SetComment("MC full Kinematics spearate config");\r
+    jrh->SetFastSimTPC(kFALSE);\r
+    jrh->SetFastSimEMCAL(kFALSE);\r
+    jrh->SetPtCut(0.);\r
+    jrh->SetFiducialEta(-2.1,2.1); // to take all MC particles default is 0 .9                                                                             \r
+    // Define reader and set its header                                     \r
+    er = new AliJetKineReader();\r
+    er->SetReaderHeader(jrh);\r
+    break;\r
   case "ESD":\r
     AliJetESDReaderHeader *jrh = new AliJetESDReaderHeader();\r
     jrh->SetComment("Testing");\r
index ac7347899b5941cd3279f7eda984787aa07e1f37..a911a5ba457ddf35fdc05af665a1802531e9bb3e 100644 (file)
@@ -12,7 +12,7 @@ void AnalysisTrainCAF(Int_t nEvents = 10000, Int_t nOffset = 0, char *ds = "/PWG
   Bool_t readTR        = kFALSE;\r
   Bool_t bPROOF        = kFALSE;\r
   Bool_t bOLD          = kFALSE;  // a flag to be compatible with the older AF, to be removed ASA grid and proof are updated\r
-\r
+  Bool_t bLOCALPAR     = kTRUE;  // flag that swtiches on loading of local par files insead of loading libs, needed for grid and local testing\r
 \r
     \r
   Int_t iAODanalysis   = 0;\r
@@ -21,6 +21,7 @@ void AnalysisTrainCAF(Int_t nEvents = 10000, Int_t nOffset = 0, char *ds = "/PWG
   Int_t iJETAN         = 1;\r
   Int_t iJETANESD      = 1;\r
   Int_t iJETANMC       = 1;\r
+  Int_t iJETANMC2       = 1;\r
   Int_t iDIJETAN       = 1;\r
   Int_t iPWG4SPECTRUM  = 1;\r
   Int_t iPWG4UE        = 1;\r
@@ -52,6 +53,7 @@ void AnalysisTrainCAF(Int_t nEvents = 10000, Int_t nOffset = 0, char *ds = "/PWG
   if (iJETAN)       printf("=  Jet analysis from AOD                                         =\n");\r
   if (iJETANESD)    printf("=  Jet analysis from ESD                                         =\n");\r
   if (iJETANMC)     printf("=  Jet analysis from Kinematics                                  =\n");\r
+  if (iJETANMC2)     printf("=  Jet analysis 2 from Kinematics                                  =\n");\r
   if (iDIJETAN)     printf("=  DiJet analysis                                                =\n");\r
   if (iPWG4SPECTRUM)printf("=  PWG4 Jet spectrum analysis                                    =\n");\r
   if (iPWG4UE)      printf("=  PWG4 UE                                                       =\n");\r
@@ -74,7 +76,8 @@ void AnalysisTrainCAF(Int_t nEvents = 10000, Int_t nOffset = 0, char *ds = "/PWG
   // TProof::Reset("alicecaf"); \r
   // One may enable a different ROOT version on CAF\r
   \r
-  const char* proofNode = "localhost";\r
+  //  const char* proofNode = "localhost";\r
+  const char* proofNode = "alicecaf";\r
   \r
   // Connect to proof\r
   if(bPROOF){\r
@@ -90,30 +93,30 @@ void AnalysisTrainCAF(Int_t nEvents = 10000, Int_t nOffset = 0, char *ds = "/PWG
     // root[0] TProof::Mgr("lxb6064")->GetSessionLogs()->Display("*",0,10000);\r
     // Common packages\r
     // --- Enable the STEERBase Package\r
-    gProof->UploadPackage("${ALICE_ROOT}/STEERBase.par");\r
-    gProof->EnablePackage("STEERBase");\r
-    // --- Enable the ESD Package\r
-    gProof->UploadPackage("${ALICE_ROOT}/ESD.par");\r
-    gProof->EnablePackage("ESD");\r
-    // --- Enable the AOD Package\r
-    gProof->UploadPackage("${ALICE_ROOT}/AOD.par");\r
-    gProof->EnablePackage("AOD");\r
-    // --- Enable the ANALYSIS Package\r
-    gProof->UploadPackage("${ALICE_ROOT}/ANALYSIS.par");\r
-    gProof->EnablePackage("ANALYSIS");\r
+    gProof->UploadPackage("STEERBase.par");\r
+    gProof->EnablePackage("STEERBase");           \r
+    // --- Enable the ESD Package         \r
+    gProof->UploadPackage("ESD.par");     \r
+    gProof->EnablePackage("ESD");         \r
+    // --- Enable the AOD Package         \r
+    gProof->UploadPackage("AOD.par");     \r
+    gProof->EnablePackage("AOD");         \r
+    // --- Enable the ANALYSIS Package    \r
+    gProof->UploadPackage("ANALYSIS.par"); \r
+    gProof->EnablePackage("ANALYSIS");    \r
     // --- Enable the ANALYSISalice Package\r
-    gProof->UploadPackage("${ALICE_ROOT}/ANALYSISalice.par");\r
+    gProof->UploadPackage("ANALYSISalice.par");\r
     gProof->EnablePackage("ANALYSISalice");\r
     \r
       \r
     // --- Enable the JETAN Package\r
-    if (iJETAN||iJETANESD||iJETANMC) {\r
-      gProof->UploadPackage("${ALICE_ROOT}/JETAN.par");\r
+    if (iJETAN||iJETANESD||iJETANMC||iJETANMC2) {\r
+      gProof->UploadPackage("JETAN.par");\r
       gProof->EnablePackage("JETAN");\r
     }   \r
     // --- Enable particle correlation analysis\r
     if (iPWG4UE||iPWG4SPECTRUM) {\r
-      gProof->UploadPackage("${ALICE_ROOT}/PWG4JetTasks.par");\r
+      gProof->UploadPackage("PWG4JetTasks.par");\r
       gProof->EnablePackage("PWG4JetTasks");\r
     }   \r
     \r
@@ -131,17 +134,27 @@ void AnalysisTrainCAF(Int_t nEvents = 10000, Int_t nOffset = 0, char *ds = "/PWG
     chain = CreateChainFromCollection("wn.xml","esdTree",2); \r
     */\r
 \r
-    gSystem->Load("libSTEERBase");\r
-    gSystem->Load("libESD");\r
-    gSystem->Load("libAOD");\r
-    gSystem->Load("libANALYSIS");\r
-    gSystem->Load("libANALYSISalice");\r
-    \r
-    \r
-    // --- Enable the JETAN Package\r
-    if (iJETAN||iJETANESD||iJETANMC) gSystem->Load("libJETAN");\r
-    // --- Enable particle correlation analysis\r
-    if (iPWG4UE||iPWG4SPECTRUM)gSystem->Load("libPWG4JetTasks"); \r
+    if(bLOCALPAR){\r
+      SetupPar("STEERBase");\r
+      SetupPar("ESD");  \r
+      SetupPar("AOD");    \r
+      SetupPar("ANALYSIS"); \r
+      SetupPar("ANALYSISalice");\r
+      if (iJETAN||iJETANESD||iJETANMC||iJETANMC2)SetupPar("JETAN");       \r
+      if (iPWG4UE||iPWG4SPECTRUM)SetupPar("PWG4JetTasks");\r
+    }\r
+    else{\r
+      gSystem->Load("libSTEERBase");\r
+      gSystem->Load("libESD");\r
+      gSystem->Load("libAOD");\r
+      gSystem->Load("libANALYSIS");\r
+      gSystem->Load("libANALYSISalice");  \r
+      // --- Enable the JETAN Package\r
+      if (iJETAN||iJETANESD||iJETANMC||iJETANMC2) gSystem->Load("libJETAN");\r
+      // --- Enable particle correlation analysis\r
+      if (iPWG4UE||iPWG4SPECTRUM)gSystem->Load("libPWG4JetTasks"); \r
+    }\r
+\r
   }\r
 \r
 \r
@@ -218,14 +231,22 @@ void AnalysisTrainCAF(Int_t nEvents = 10000, Int_t nOffset = 0, char *ds = "/PWG
       jetanaESD->SetNonStdBranch("jetsESD");    \r
     }   \r
     // Jet analysisMC\r
-    if (iJETANMC && useMC) {\r
+    if (iJETANMC && useMC)\r
       gROOT->LoadMacro("AddTaskJets.C");\r
       AliAnalysisTaskJets *jetanaMC = 0;\r
-      if(bOLD)jetanaMC = AddTaskJets("MC","UA1",mgr,cinput);\r
-      else jetanaMC = AddTaskJets("MC","UA1");\r
+      if(bOLD)jetanaMC = AddTaskJets("MC","UA1MC",mgr,cinput);\r
+      else jetanaMC = AddTaskJets("MC","UA1MC");\r
       jetanaMC->SetDebugLevel(10);\r
       jetanaMC->SetNonStdBranch("jetsMC");\r
     }   \r
+    if (iJETANMC2 && useMC){ \r
+      gROOT->LoadMacro("AddTaskJets.C");\r
+      AliAnalysisTaskJets *jetanaMC2 = 0;\r
+      if(bOLD)jetanaMC = AddTaskJets("MC2","UA1",mgr,cinput);\r
+      else jetanaMC = AddTaskJets("MC2","UA1");\r
+      jetanaMC->SetDebugLevel(10);\r
+      jetanaMC->SetNonStdBranch("jetsMC2");\r
+    }   \r
     // Dijet analysis\r
     if(iDIJETAN){\r
       gROOT->LoadMacro("AddTaskDiJets.C");\r
@@ -282,3 +303,56 @@ TChain *CreateChainFromCollection(const char* xmlfile, const char *treeName="esd
   chain->ls();\r
   return chain;\r
 }\r
+\r
+\r
+void SetupPar(char* pararchivename)\r
+{\r
+  //Load par files, create analysis libraries                                                         \r
+  //For testing, if par file already decompressed and modified                                        \r
+  //classes then do not decompress.                                                                   \r
+\r
+  TString cdir(Form("%s", gSystem->WorkingDirectory() )) ;\r
+  TString parpar(Form("%s.par", pararchivename)) ;\r
+  /*\r
+  if ( gSystem->AccessPathName(parpar.Data()) ) {\r
+    gSystem->ChangeDirectory(gSystem->Getenv("ALICE_ROOT")) ;\r
+    TString processline(Form(".! make %s", parpar.Data())) ;\r
+    gROOT->ProcessLine(processline.Data()) ;\r
+    gSystem->ChangeDirectory(cdir) ;\r
+    processline = Form(".! mv /tmp/%s .", parpar.Data()) ;\r
+    gROOT->ProcessLine(processline.Data()) ;\r
+  }\r
+  */\r
+\r
+  if (!gSystem->AccessPathName(pararchivename) ) {\r
+    TString processline = Form(".! tar xvzf %s",parpar.Data()) ;\r
+    gROOT->ProcessLine(processline.Data());\r
+  }\r
+\r
+  TString ocwd = gSystem->WorkingDirectory();\r
+  gSystem->ChangeDirectory(pararchivename);\r
+\r
+  // check for BUILD.sh and execute                                                                   \r
+  if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {\r
+    printf("*******************************\n");\r
+    printf("*** Building PAR archive    ***\n");\r
+    cout<<pararchivename<<endl;\r
+    printf("*******************************\n");\r
+\r
+    if (gSystem->Exec("PROOF-INF/BUILD.sh")) {\r
+      Error("runProcess","Cannot Build the PAR Archive! - Abort!");\r
+      return -1;\r
+    }\r
+  }\r
+  // check for SETUP.C and execute                                                                    \r
+  if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {\r
+    printf("*******************************\n");\r
+    printf("*** Setup PAR archive       ***\n");\r
+    cout<<pararchivename<<endl;\r
+    printf("*******************************\n");\r
+    gROOT->Macro("PROOF-INF/SETUP.C");\r
+  }\r
+\r
+  gSystem->ChangeDirectory(ocwd.Data());\r
+  printf("Current dir: %s\n", ocwd.Data());\r
+}\r