Several updates for grid running (B. Bathen and J. Klein)
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 21 Jan 2011 19:37:51 +0000 (19:37 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 21 Jan 2011 19:37:51 +0000 (19:37 +0000)
JETAN/AliAnalysisTaskFastEmbedding.cxx
JETAN/AliAnalysisTaskFastEmbedding.h
PWG4/CMakelibPWG4JetTasks.pkg
PWG4/PWG4JetTasksLinkDef.h
PWG4/macros/AddTaskFastEmbedding.C

index e970443..c798921 100644 (file)
@@ -53,7 +53,7 @@ AliAnalysisTaskFastEmbedding::AliAnalysisTaskFastEmbedding()
       ,fAODevent(0)
       ,fAODtree(0)
       ,fAODfile(0)
-      ,rndm(new TRandom3())
+      ,rndm(0)
       ,fAODPathArray(0)
       ,fAODPath("AliAOD.root")
       ,fTrackBranch("aodExtraTracks")
@@ -97,7 +97,7 @@ AliAnalysisTaskFastEmbedding::AliAnalysisTaskFastEmbedding(const char *name)
       ,fAODevent(0)
       ,fAODtree(0)
       ,fAODfile(0)
-      ,rndm(new TRandom3())
+      ,rndm(0)
       ,fAODPathArray(0)
       ,fAODPath("AliAOD.root")
       ,fTrackBranch("aodExtraTracks")
@@ -233,6 +233,11 @@ void AliAnalysisTaskFastEmbedding::UserCreateOutputObjects()
     // create output objects
     if(fDebug > 1) Printf("AliAnalysisTaskFastEmbedding::UserCreateOutputObjects()");
 
+    rndm = new TRandom3();
+    Int_t id = GetJobID();
+    if(id>-1) rndm->SetSeed(id);
+    else      rndm->SetSeed();   // a TTUID is generated and used for seed
+    AliInfo(Form("TRandom3 seed: %d", rndm->GetSeed()));
 
 
     // embed mode with AOD
@@ -338,8 +343,6 @@ void AliAnalysisTaskFastEmbedding::Init()
     // Initialization
     if(fDebug > 1) Printf("AliAnalysisTaskFastEmbedding::Init()");
 
-
-    // set seed for rndm according to sub-job id  *not implemented yet*
 }
 
 
@@ -544,7 +547,7 @@ void AliAnalysisTaskFastEmbedding::UserExec(Option_t *)
                                              fToyFilterMap,  // select info
                                              -999.    // chi2 per NDF
                                            );
-          tmpTr->SetFlags(1);
+          tmpTr->SetFlags(1<<27);
 
            new((*tracks)[nAODtracks++]) AliAODTrack(*tmpTr);
            dummy = (*tracks)[nAODtracks-1];
@@ -572,13 +575,13 @@ void AliAnalysisTaskFastEmbedding::Terminate(Option_t *)
 }
 
 //__________________________________________________________________________
-/* NEEDS TO BE TESTED
+/* NEEDS TO BE TESTED */
 Int_t AliAnalysisTaskFastEmbedding::GetJobID()
 {
-   Int_t id=0;
+   Int_t id=-1;
 
-   const char* env = gSystem->Getenv("ALIENCOUNTER"); // GRID
-   if(!env || !strlen(env)) env = gSystem->Getenv("LSB_JOBINDEX"); // GSI
+   const char* env = gSystem->Getenv("ALIEN_PROC_ID"); // GRID
+   //if(!env || !strlen(env)) env = gSystem->Getenv("LSB_JOBINDEX"); // GSI
 
    if(env && strlen(env)){
        id= atoi(env);
@@ -586,13 +589,15 @@ Int_t AliAnalysisTaskFastEmbedding::GetJobID()
    }
    else{
        AliInfo("Job index not found. Okay if running locally.");
+       /*
        Int_t nEvents = fAODtree->GetEntries();
        fNEntriesPerJob = nEvents;
        AliInfo(Form("Asuming single job, set entries per job to maximum %d", fNEntriesPerJob));
+       */
    }
 
    return id;
-}*/
+}
 
 //__________________________________________________________________________
 
index 468ec50..e5fc864 100644 (file)
@@ -29,6 +29,7 @@ class AliAnalysisTaskFastEmbedding : public AliAnalysisTaskSE {
        virtual ~AliAnalysisTaskFastEmbedding();
 
        virtual void UserCreateOutputObjects();
+       virtual void LocalInit() { Init(); }
        virtual void Init();
         virtual void UserExec(Option_t*);
        virtual void Terminate(Option_t */*option*/);
@@ -115,10 +116,10 @@ class AliAnalysisTaskFastEmbedding : public AliAnalysisTaskSE {
         TH1F  *fh1MCTrackN;        //! nb. of MC tracks
 
         // NEEDS TO BE TESTED
-       //Int_t GetJobID();    // get job id (i.e. aliencounter on the GRID)  // not tested yet
+       Int_t GetJobID();    // get job id (sub-job id on the GRID)
 
 
-       ClassDef(AliAnalysisTaskFastEmbedding, 1);
+       ClassDef(AliAnalysisTaskFastEmbedding, 2);
 };
 
 #endif
index 3219c12..a1fb9fd 100644 (file)
@@ -25,7 +25,7 @@
 # SHLIBS - Shared Libraries and objects for linking (Executables only)           #
 #--------------------------------------------------------------------------------#
 
-set ( SRCS  JetTasks/AliAnalysisTaskUE.cxx JetTasks/AliHistogramsUE.cxx JetTasks/AliAnalyseUE.cxx JetTasks/AliAnalysisTaskJetSpectrum.cxx JetTasks/AliAnalysisTaskJetSpectrum2.cxx JetTasks/AliAnalysisHelperJetTasks.cxx JetTasks/AliAnalysisTaskJetServices.cxx JetTasks/AliAnalysisTaskPWG4PidDetEx.cxx JetTasks/AliJetSpectrumUnfolding.cxx JetTasks/AliAnalysisTaskJFSystematics.cxx JetTasks/AliAnalysisTaskJetCorrections.cxx JetTasks/AliAnalysisTaskThreeJets.cxx JetTasks/AliPWG4HighPtQATPConly.cxx JetTasks/AliPWG4HighPtQAMC.cxx JetTasks/AliPWG4HighPtSpectra.cxx JetTasks/AliPWG4CosmicCandidates.cxx JetTasks/AliAnalysisTaskJetChem.cxx JetTasks/AliAnalysisTaskFragmentationFunction.cxx JetTasks/AliAnalysisTaskMinijet.cxx JetTasks/AliUEHist.cxx JetTasks/AliUEHistograms.cxx JetTasks/AliAnalyseLeadingTrackUE.cxx JetTasks/AliAnalysisTaskLeadingTrackUE.cxx JetTasks/AliAnalysisTaskQGSep.cxx JetTasks/AliAnalysisTaskJetsTM.cxx JetTasks/AliAnalysisTaskPhiCorrelations.cxx)
+set ( SRCS  JetTasks/AliAnalysisTaskUE.cxx JetTasks/AliHistogramsUE.cxx JetTasks/AliAnalyseUE.cxx JetTasks/AliAnalysisTaskJetSpectrum.cxx JetTasks/AliAnalysisTaskJetSpectrum2.cxx JetTasks/AliAnalysisHelperJetTasks.cxx JetTasks/AliAnalysisTaskJetServices.cxx JetTasks/AliAnalysisTaskPWG4PidDetEx.cxx JetTasks/AliJetSpectrumUnfolding.cxx JetTasks/AliAnalysisTaskJFSystematics.cxx JetTasks/AliAnalysisTaskJetCorrections.cxx JetTasks/AliAnalysisTaskThreeJets.cxx JetTasks/AliPWG4HighPtQATPConly.cxx JetTasks/AliPWG4HighPtQAMC.cxx JetTasks/AliPWG4HighPtSpectra.cxx JetTasks/AliPWG4CosmicCandidates.cxx JetTasks/AliAnalysisTaskJetChem.cxx JetTasks/AliAnalysisTaskFragmentationFunction.cxx JetTasks/AliAnalysisTaskMinijet.cxx JetTasks/AliUEHist.cxx JetTasks/AliUEHistograms.cxx JetTasks/AliAnalyseLeadingTrackUE.cxx JetTasks/AliAnalysisTaskLeadingTrackUE.cxx JetTasks/AliAnalysisTaskQGSep.cxx JetTasks/AliAnalysisTaskJetsTM.cxx JetTasks/AliAnalysisTaskPhiCorrelations.cxx JetTasks/AliAnalysisTaskJetResponse.cxx)
 
 string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
 
index 6f40f1c..8e547fa 100644 (file)
@@ -36,5 +36,6 @@
 #pragma link C++ class AliAnalysisTaskJetsTM+;
 #pragma link C++ class AliAnalysisTaskQGSep+;
 #pragma link C++ class AliAnalysisTaskPhiCorrelations+;
+#pragma link C++ class AliAnalysisTaskJetResponse+;
 
 #endif
index d731705..090bbec 100644 (file)
@@ -19,7 +19,7 @@ AliAnalysisTaskFastEmbedding* AddTaskFastEmbedding(){
 
     // ## set ranges for toy ##
     //SetToyTrackRanges(
-    Double_t minPt = 70.;   Double_t maxPt = 70.;
+    Double_t minPt = 40.;   Double_t maxPt = 300.;
     Double_t minEta = -0.5; Double_t maxEta = 0.5;
     Double_t minPhi = 0.;   Double_t maxPhi = 2*TMath::Pi();
     //fToyDistributionTrackPt: 0 = uniform distribution