updates from Salvatore
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 24 May 2012 13:24:04 +0000 (13:24 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 24 May 2012 13:24:04 +0000 (13:24 +0000)
13 files changed:
PWGGA/CMakelibPWGGAEMCALJetTasks.pkg
PWGGA/EMCALJetTasks/AliAnalysisTaskRho.cxx
PWGGA/EMCALJetTasks/AliAnalysisTaskRho.h
PWGGA/EMCALJetTasks/AliAnalysisTaskRhoAverage.cxx [new file with mode: 0644]
PWGGA/EMCALJetTasks/AliAnalysisTaskRhoAverage.h [new file with mode: 0644]
PWGGA/EMCALJetTasks/AliAnalysisTaskSAJF.cxx
PWGGA/EMCALJetTasks/AliAnalysisTaskSAJF.h
PWGGA/EMCALJetTasks/macros/AddTaskEmcalJetSpectra.C
PWGGA/EMCALJetTasks/macros/AddTaskHadCorr.C
PWGGA/EMCALJetTasks/macros/AddTaskRho.C
PWGGA/EMCALJetTasks/macros/runJetAna.C
PWGGA/EMCALTasks/AliEmcalCompatTask.cxx
PWGGA/PWGGAEMCALJetTasksLinkDef.h

index 9194ff0..7b5294e 100644 (file)
@@ -36,6 +36,7 @@ set ( SRCS
  EMCALJetTasks/AliAnalysisTaskEmcalJetSpectra.cxx
  EMCALJetTasks/AliAnalysisTaskRhoBase.cxx
  EMCALJetTasks/AliAnalysisTaskRho.cxx
+ EMCALJetTasks/AliAnalysisTaskRhoAverage.cxx
 )
 
 set ( DHDR  PWGGAEMCALJetTasksLinkDef.h)
index b4dff30..e033208 100644 (file)
@@ -27,7 +27,6 @@ AliAnalysisTaskRho::AliAnalysisTaskRho() :
   AliAnalysisTaskRhoBase(),
   fTracksName("tracks"),
   fJetsName("KtJets"),
-  fClustersName("caloClusters"),
   fRhoScaledName(""),
   fPhiMin(0),
   fPhiMax(0),
@@ -63,7 +62,6 @@ AliAnalysisTaskRho::AliAnalysisTaskRho(const char *name) :
   AliAnalysisTaskRhoBase(name),
   fTracksName("tracks"),
   fJetsName("KtJets"),
-  fClustersName("caloClusters"),
   fRhoScaledName(""),
   fPhiMin(0),
   fPhiMax(0),
@@ -100,7 +98,6 @@ AliAnalysisTaskRho::AliAnalysisTaskRho(const char *name, Bool_t histo) :
   AliAnalysisTaskRhoBase(name),
   fTracksName("tracks"),
   fJetsName("KtJets"),
-  fClustersName("caloClusters"),
   fRhoScaledName(""),
   fPhiMin(0),
   fPhiMax(0),
index bf9e87e..377b3e4 100644 (file)
@@ -39,7 +39,6 @@ class AliAnalysisTaskRho : public AliAnalysisTaskRhoBase {
 
   TString                fTracksName;                    // name of track collection
   TString                fJetsName;                      // name of jet collection
-  TString                fClustersName;                  // name of clusters collection
   TString                fRhoScaledName;                 // name of scaled rho object
   Double_t               fPhiMin;                        // minimum phi
   Double_t               fPhiMax;                        // maximum phi
diff --git a/PWGGA/EMCALJetTasks/AliAnalysisTaskRhoAverage.cxx b/PWGGA/EMCALJetTasks/AliAnalysisTaskRhoAverage.cxx
new file mode 100644 (file)
index 0000000..f193db0
--- /dev/null
@@ -0,0 +1,211 @@
+// $Id$
+//
+// Calculation of rho, method: sum of all particle pt / full acceptance area
+//
+// Authors: Salvatore Aiola
+
+#include <TList.h>
+#include <TClonesArray.h>
+#include <TMath.h>
+
+#include "AliLog.h"
+#include "AliAnalysisManager.h"
+#include "AliVEventHandler.h"
+#include "AliCentrality.h"
+#include "AliEmcalJet.h"
+#include "AliVTrack.h"
+#include "AliVCluster.h"
+
+#include "AliAnalysisTaskRhoAverage.h"
+
+ClassImp(AliAnalysisTaskRhoAverage)
+
+//________________________________________________________________________
+AliAnalysisTaskRhoAverage::AliAnalysisTaskRhoAverage() : 
+  AliAnalysisTaskRhoBase(),
+  fTracksName("tracks"),
+  fClustersName("caloClusters"),
+  fJetsName("KtJets"),
+  fEtaMin(-0.9),
+  fEtaMax(0.9),
+  fPhiMin(0),
+  fPhiMax(2 * TMath::Pi()),
+  fPtMin(0.15)
+{
+  // Constructor
+}
+
+//________________________________________________________________________
+AliAnalysisTaskRhoAverage::AliAnalysisTaskRhoAverage(const char *name) :
+  AliAnalysisTaskRhoBase(name),
+  fTracksName("tracks"),
+  fClustersName("caloClusters"),
+  fJetsName("KtJets"),
+  fEtaMin(-0.9),
+  fEtaMax(0.9),
+  fPhiMin(0),
+  fPhiMax(2 * TMath::Pi()),
+  fPtMin(0.15)
+{
+  // Constructor
+
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskRhoAverage::UserExec(Option_t *) 
+{
+  // Main loop, called for each event.
+  
+  AliAnalysisTaskRhoBase::UserExec("");
+
+  fRho->SetVal(-1);
+
+  TClonesArray *jets = 0;
+  TClonesArray *tracks = 0;
+  TClonesArray *clusters = 0;
+
+  tracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTracksName));
+  if (!tracks) {
+  AliError(Form("Pointer to tracks %s == 0", fTracksName.Data() ));
+   return;
+  }
+
+  if (fClustersName != "") {
+    clusters = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fClustersName));
+    if (!clusters) {
+      AliError(Form("Pointer to clusters %s == 0", fClustersName.Data() ));
+      return;
+    }
+  }
+
+  if (fJetsName != "") {
+    jets = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fJetsName));
+    if (!jets) {
+      AliError(Form("Pointer to jets %s == 0", fJetsName.Data() ));
+      return;
+    }
+  }
+
+  Double_t rho = 0;
+  
+  Int_t Ntracks = tracks->GetEntries();
+
+  Int_t Nclusters = 0;
+  if (clusters)
+    Nclusters = clusters->GetEntries();
+
+  Int_t Njets = 0;
+  if (jets)
+    Njets = jets->GetEntries();
+
+  Float_t maxJetPt = 0;
+  Float_t maxJetId = -1;
+  AliEmcalJet *maxJet = 0;
+  for (Int_t ij = 0; ij < Njets; ij++) {
+      
+    AliEmcalJet *jet = static_cast<AliEmcalJet*>(jets->At(ij));
+  
+    if (!jet) {
+      AliError(Form("Could not receive jet %d", ij));
+      continue;
+    } 
+  
+    if (jet->Pt() > maxJetPt) {
+      maxJetPt = jet->Pt();
+      maxJetId = ij;
+    }
+  }
+
+  if (maxJetId >= 0)
+    maxJet = static_cast<AliEmcalJet*>(jets->At(maxJetId));
+
+  for (Int_t it = 0; it < Ntracks; it++) {
+      
+    AliVTrack *track = static_cast<AliVTrack*>(tracks->At(it));
+  
+    if (!track) {
+      AliError(Form("Could not receive track %d", it));
+      continue;
+    } 
+
+    if (track->Eta() < fEtaMin || track->Eta() > fEtaMax || track->Phi() < fPhiMin || track->Phi() > fPhiMax)
+      continue;
+
+    if (track->Pt() < fPtMin)
+      continue;
+
+    if (maxJet && IsJetTrack(maxJet, it))
+      continue;
+
+    rho += track->Pt();
+  }
+  
+  Double_t vertex[] = {0, 0, 0};
+  InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
+
+  for (Int_t ic = 0; ic < Nclusters; ic++) {
+      
+    AliVCluster *cluster = static_cast<AliVCluster*>(clusters->At(ic));
+  
+    if (!cluster) {
+      AliError(Form("Could not receive cluster %d", ic));
+      continue;
+    } 
+
+    Float_t pos[3];
+    cluster->GetPosition(pos);
+    TVector3 clusVec(pos);
+
+    if (clusVec.Eta() < fEtaMin || clusVec.Eta() > fEtaMax || clusVec.Phi() < fPhiMin || clusVec.Phi() > fPhiMax)
+      continue;
+
+    TLorentzVector nPart;
+    cluster->GetMomentum(nPart, const_cast<Double_t*>(vertex));
+
+    if (nPart.Et() < fPtMin)
+      continue;
+
+    if (maxJet && IsJetCluster(maxJet, ic))
+      continue;
+
+    rho += nPart.Et();
+  }
+  Double_t area = (fEtaMax - fEtaMin) * (fPhiMax - fPhiMin);
+
+  if (maxJet)
+    area -= maxJet->Area();
+
+  rho /= area;
+
+  fRho->SetVal(rho);
+}      
+
+//________________________________________________________________________
+Bool_t AliAnalysisTaskRhoAverage::IsJetTrack(AliEmcalJet* jet, Int_t itrack) const
+{
+  for (Int_t i = 0; i < jet->GetNumberOfTracks(); i++) {
+    Int_t ijettrack = jet->TrackAt(i);
+    if (ijettrack == itrack)
+      return kTRUE;
+  }
+  return kFALSE;
+}
+
+//________________________________________________________________________
+Bool_t AliAnalysisTaskRhoAverage::IsJetCluster(AliEmcalJet* jet, Int_t iclus) const
+{
+  for (Int_t i = 0; i < jet->GetNumberOfClusters(); i++) {
+    Int_t ijetclus = jet->ClusterAt(i);
+    if (ijetclus == iclus)
+      return kTRUE;
+  }
+  return kFALSE;
+}
+
+
+//________________________________________________________________________
+void AliAnalysisTaskRhoAverage::Terminate(Option_t *) 
+{
+
+}
diff --git a/PWGGA/EMCALJetTasks/AliAnalysisTaskRhoAverage.h b/PWGGA/EMCALJetTasks/AliAnalysisTaskRhoAverage.h
new file mode 100644 (file)
index 0000000..f8cfea0
--- /dev/null
@@ -0,0 +1,53 @@
+#ifndef ALIANALYSISTASKRHOAVERAGE_cxx
+#define ALIANALYSISTASKRHOAVERAGE_cxx
+
+// $Id$
+
+class TList;
+class TH1F;
+class TH2F;
+class TClonesArray;
+class TString;
+class TF1;
+
+#include <TParameter.h>
+
+#include "AliAnalysisTaskRhoBase.h"
+
+class AliAnalysisTaskRhoAverage : public AliAnalysisTaskRhoBase {
+
+ public:
+  AliAnalysisTaskRhoAverage();
+  AliAnalysisTaskRhoAverage(const char *name);
+  AliAnalysisTaskRhoAverage(const char *name, Bool_t histo);
+  virtual ~AliAnalysisTaskRhoAverage() {}
+  
+  virtual void           UserExec(Option_t*);
+  virtual void           Terminate(Option_t*);
+
+  void                   SetTracksName(const char *n)                          { fTracksName    = n    ; }
+  void                   SetClustersName(const char *n)                        { fClustersName  = n    ; }
+  void                   SetJetsName(const char *n)                            { fJetsName      = n    ; }  
+  void                   SetEtaLimits(Double_t emin, Double_t emax)            { fEtaMin        = emin ; fEtaMax = emax  ; }
+  void                   SetPhiLimits(Double_t pmin, Double_t pmax)            { fPhiMin        = pmin ; fPhiMax = pmax  ; }
+  void                   SetPtMin(Double_t pt)                                 { fPtMin         = pt   ; }
+  
+ protected:
+  Bool_t                 IsJetCluster(AliEmcalJet* jet, Int_t iclus) const;
+  Bool_t                 IsJetTrack(AliEmcalJet* jet, Int_t itrack)  const;
+
+  TString                fTracksName;                    // name of track collection
+  TString                fClustersName;                  // name of clusters collection
+  TString                fJetsName;                      // name of jet collection
+  Double_t               fEtaMin;                        // minimum eta
+  Double_t               fEtaMax;                        // maximum eta
+  Double_t               fPhiMin;                        // minimum phi
+  Double_t               fPhiMax;                        // maximum phi
+  Double_t               fPtMin;                         // minimum pt
+
+  AliAnalysisTaskRhoAverage(const AliAnalysisTaskRhoAverage&);             // not implemented
+  AliAnalysisTaskRhoAverage& operator=(const AliAnalysisTaskRhoAverage&);  // not implemented
+  
+  ClassDef(AliAnalysisTaskRhoAverage, 0); // Rho task, method: sum of all particle pt / full acceptance area
+};
+#endif
index 6409198..c7ba98b 100644 (file)
@@ -30,6 +30,7 @@ ClassImp(AliAnalysisTaskSAJF)
 AliAnalysisTaskSAJF::AliAnalysisTaskSAJF() : 
   AliAnalysisTaskSE("AliAnalysisTaskSAJF"),
   fAnaType(kTPC),
+  fInitialized(kFALSE),
   fMinEta(-0.9),
   fMaxEta(0.9),
   fMinPhi(-10),
@@ -102,6 +103,10 @@ AliAnalysisTaskSAJF::AliAnalysisTaskSAJF() :
     fHistDeltaPtEmb[i] = 0;
   }
 
+  fVertex[0] = 0;
+  fVertex[1] = 0;
+  fVertex[2] = 0;
+
   // Output slot #1 writes into a TH1 container
   DefineOutput(1, TList::Class()); 
 }
@@ -110,6 +115,7 @@ AliAnalysisTaskSAJF::AliAnalysisTaskSAJF() :
 AliAnalysisTaskSAJF::AliAnalysisTaskSAJF(const char *name) : 
   AliAnalysisTaskSE(name),
   fAnaType(kTPC),
+  fInitialized(kFALSE),
   fMinEta(-0.9),
   fMaxEta(0.9),
   fMinPhi(-10),
@@ -181,6 +187,10 @@ AliAnalysisTaskSAJF::AliAnalysisTaskSAJF(const char *name) :
     fHistDeltaPtEmb[i] = 0;
   }
 
+  fVertex[0] = 0;
+  fVertex[1] = 0;
+  fVertex[2] = 0;
+
   // Output slot #1 writes into a TH1 container
   DefineOutput(1, TList::Class()); 
 }
@@ -605,8 +615,6 @@ Int_t AliAnalysisTaskSAJF::GetNumberOfEmbJets() const
 //________________________________________________________________________
 void AliAnalysisTaskSAJF::FillHistograms()
 {
-  const Float_t A = fJetRadius * fJetRadius * TMath::Pi();
-
   Int_t maxJetIndex  = -1;
   Int_t max2JetIndex = -1;
 
@@ -654,14 +662,16 @@ void AliAnalysisTaskSAJF::FillHistograms()
   // Random cones
   // _________________________________
   
+  const Float_t rcArea = fJetRadius * fJetRadius * TMath::Pi();
+
   // Simple random cones
   Float_t RCpt = 0;
   Float_t RCeta = 0;
   Float_t RCphi = 0;
   GetRigidCone(RCpt, RCeta, RCphi, kFALSE, 0);
   if (RCpt > 0) {
-    fHistRCPt[fCentBin]->Fill(RCpt / A);
-    fHistDeltaPtRC[fCentBin]->Fill(RCpt - A * fRho);
+    fHistRCPt[fCentBin]->Fill(RCpt / rcArea);
+    fHistDeltaPtRC[fCentBin]->Fill(RCpt - rcArea * fRho);
   }
   
   // Random cones far from leading jet
@@ -671,15 +681,15 @@ void AliAnalysisTaskSAJF::FillHistograms()
   GetRigidCone(RCptExLJ, RCetaExLJ, RCphiExLJ, kFALSE, jet);
   if (RCptExLJ > 0) {
     fHistRCPhiEta->Fill(RCetaExLJ, RCphiExLJ);
-    fHistRhoVSRCPt->Fill(fRho, RCptExLJ / A);
+    fHistRhoVSRCPt->Fill(fRho, RCptExLJ / rcArea);
 
     Float_t dphi = RCphiExLJ - jet->Phi();
     if (dphi > 4.8) dphi -= TMath::Pi() * 2;
     if (dphi < -1.6) dphi += TMath::Pi() * 2; 
     fHistRCPtExLJVSDPhiLJ->Fill(RCptExLJ, dphi);
     
-    fHistRCPtExLJ[fCentBin]->Fill(RCptExLJ / A);
-    fHistDeltaPtRCExLJ[fCentBin]->Fill(RCptExLJ - A * fRho);
+    fHistRCPtExLJ[fCentBin]->Fill(RCptExLJ / rcArea);
+    fHistDeltaPtRCExLJ[fCentBin]->Fill(RCptExLJ - rcArea * fRho);
   }
 
   // Random cones with randomized particles
@@ -688,8 +698,8 @@ void AliAnalysisTaskSAJF::FillHistograms()
   Float_t RCphiRand = 0;
   GetRigidCone(RCptRand, RCetaRand, RCphiRand, kTRUE, 0, fRandTracks, fRandCaloClusters);
   if (RCptRand > 0) {
-    fHistRCPtRand[fCentBin]->Fill(RCptRand / A);
-    fHistDeltaPtRCRand[fCentBin]->Fill(RCptRand - A * fRho);
+    fHistRCPtRand[fCentBin]->Fill(RCptRand / rcArea);
+    fHistDeltaPtRCRand[fCentBin]->Fill(RCptRand - rcArea * fRho);
   }
 
   // ************
@@ -952,28 +962,26 @@ void AliAnalysisTaskSAJF::DoClusterLoop(Int_t maxJetIndex)
 void AliAnalysisTaskSAJF::Init()
 {
   if (fAnaType == kTPC) {
-    fMinEta = -0.9;
-    fMaxEta = 0.9;
-    fMinPhi = -10;
-    fMaxPhi = 10;
+    SetEtaLimits(-0.9, 0.9);
+    SetPhiLimits(-10, 10);
   }
   else if (fAnaType == kEMCAL) {
-    fMinEta = -0.7;
-    fMaxEta = 0.7;
-    fMinPhi = 80 * TMath::DegToRad();
-    fMaxPhi = 180 * TMath::DegToRad();
+    SetEtaLimits(-0.7, 0.7);
+    SetPhiLimits(80 * TMath::DegToRad(), 180 * TMath::DegToRad());
   }
   else {
     AliWarning("Analysis type not recognized! Assuming kTPC...");
-    fAnaType = kTPC;
+    SetAnaType(kTPC);
     Init();
   }
 
   const Float_t semiDiag = TMath::Sqrt((fMaxPhi - fMinPhi) * (fMaxPhi - fMinPhi) + (fMaxEta - fMinEta) * (fMaxEta - fMinEta)) / 2;
   if (fMinRC2LJ > semiDiag * 0.5) {
     AliWarning(Form("The parameter fMinRC2LJ = %f is too large for the considered acceptance. Will use fMinRC2LJ = %f", fMinRC2LJ, semiDiag * 0.5));
-    fMinRC2LJ = semiDiag * 0.5;
+    SetJetMinRC2LJ(semiDiag * 0.5);
   }
+
+  SetInitialized();
 }
 
 //________________________________________________________________________
@@ -1138,7 +1146,8 @@ Bool_t AliAnalysisTaskSAJF::AcceptTrack(AliVTrack* track, Bool_t acceptMC) const
 //________________________________________________________________________
 void AliAnalysisTaskSAJF::UserExec(Option_t *) 
 {
-  Init();
+  if (!fInitialized) 
+    Init();
 
   RetrieveEventObjects();
 
index 9686c66..a2b913c 100644 (file)
@@ -45,6 +45,9 @@ class AliAnalysisTaskSAJF : public AliAnalysisTaskSE {
   void                        SetPtBiasJetTrack(Float_t b)                         { fPtBiasJetTrack = b          ; }
   void                        SetPtBiasJetClus(Float_t b)                          { fPtBiasJetClus  = b          ; }
   void                        SetHistoBins(Int_t nbins, Float_t min, Float_t max)  { fNbins = nbins; fMinPt = min; fMaxPt = max; }
+  void                        SetEtaLimits(Float_t min, Float_t max)               { fMinEta = min, fMaxEta = max ; }
+  void                        SetPhiLimits(Float_t min, Float_t max)               { fMinPhi = min, fMaxPhi = max ; }
+  void                        SetInitialized(Bool_t ini = kTRUE)                   { fInitialized = ini           ; }
 
  protected:
 
@@ -73,6 +76,7 @@ class AliAnalysisTaskSAJF : public AliAnalysisTaskSE {
                                           AliEmcalJet *jet = 0, TClonesArray* tracks = 0, TClonesArray* clusters = 0) const;
 
   SAJFAnaType                 fAnaType;                    // Analysis type
+  Bool_t                      fInitialized;                // Whether or not the task has been already initialized
   Float_t                     fMinEta;                     // Minimum eta accepatance
   Float_t                     fMaxEta;                     // Maximum eta accepatance
   Float_t                     fMinPhi;                     // Minimum phi accepatance
index c57e9be..3dc4957 100644 (file)
@@ -1,16 +1,17 @@
-// $Id$
+// $Id: AddTaskEmcalJetSpectra.C 2829 2012-05-11 09:15:33Z loizides $
 
-AliAnalysisTaskRho* AddTaskEmcalJetSpectra(
+AliAnalysisTaskEmcalJetSpectra* AddTaskEmcalJetSpectra(
    const char *outfilename    = "AnalysisOutput.root",
    const char *nJets          = "Jets",
    const char *nTracks        = "PicoTracks",
    const char *nRhosCh        = "rhoCh",
    const char *nRhosChEm      = "rhoChEm",
+   const char *nRhosAve       = "rho3",
    const Double_t minPhi      = 1.8,
    const Double_t maxPhi      = 2.74,
    const Double_t minEta      = -0.3,
    const Double_t maxEta      = 0.3,
-   const Double_t minArea     = 0.0
+   const Double_t minArea     = 0.4
 )
 {  
   // Get the pointer to the existing analysis manager via the static access method.
@@ -39,11 +40,13 @@ AliAnalysisTaskRho* AddTaskEmcalJetSpectra(
   spectratask->SetJetsName(nJets);
   spectratask->SetRhos1Name(nRhosChEm);
   spectratask->SetRhos2Name(nRhosCh);
+  spectratask->SetRhos3Name(nRhosAve);
   spectratask->SetTracksName(nTracks);
   spectratask->SetJetPhi(minPhi,maxPhi);
   spectratask->SetJetEta(minEta,maxEta);
   spectratask->SetAreaCut(minArea);
 
   //-------------------------------------------------------
   // Final settings, pass to manager and set the containers
   //-------------------------------------------------------
index 23e9bc9..e520eb9 100644 (file)
@@ -51,11 +51,14 @@ AliHadCorrTask* AddTaskHadCorr(
     
   // Create containers for input/output
   mgr->ConnectInput (hcor, 0, mgr->GetCommonInputContainer() );
-  AliAnalysisDataContainer *cohcor = mgr->CreateContainer(name,
-                                                          TList::Class(),
-                                                          AliAnalysisManager::kOutputContainer,
-                                                          outputname);
-  mgr->ConnectOutput(hcor,1,cohcor);
+
+  if (histo) {
+    AliAnalysisDataContainer *cohcor = mgr->CreateContainer(name,
+                                                           TList::Class(),
+                                                           AliAnalysisManager::kOutputContainer,
+                                                           outputname);
+    mgr->ConnectOutput(hcor,1,cohcor);
+  }
     
   return hcor;
 }
index 365da93..39d37e6 100644 (file)
@@ -53,11 +53,13 @@ AliAnalysisTaskRho* AddTaskRho(
 
   // Create containers for input/output
   mgr->ConnectInput (rhotask, 0, mgr->GetCommonInputContainer() );
-  AliAnalysisDataContainer *corho = mgr->CreateContainer(name,
+  if (histo) {
+    AliAnalysisDataContainer *corho = mgr->CreateContainer(name,
                                                            TList::Class(),
                                                            AliAnalysisManager::kOutputContainer,
                                                            outfilename);
-  mgr->ConnectOutput(rhotask, 1, corho);
+    mgr->ConnectOutput(rhotask, 1, corho);
+  }
 
   return rhotask;
 }
index c13c1de..30f6108 100644 (file)
@@ -1,10 +1,10 @@
 // $Id$
 
 void runJetAna(
-  const char     *datatype     = "aod",        // aod, esd, sesd
-  const char     *runtype      = "local",      // local or grid (when local gridmode specifies input txt file)
-  const char     *gridmode     = "test",       // grid mode (can be "full", "test", "offline", "submit" or "terminate")
-  const char     *taskname     = "JetAna")     // name of grid generated macros
+  const char     *datatype     = "aod",            // aod, esd, sesd
+  const char     *runtype      = "local",          // local or grid (when local gridmode specifies input txt file)
+  const char     *gridmode     = "aod_files.txt",  // grid mode (can be "full", "test", "offline", "submit" or "terminate")
+  const char     *taskname     = "JetAna")         // name of grid generated macros
 {
 
   enum eDataType { kAod, kEsd, kSesd };
@@ -40,7 +40,9 @@ void runJetAna(
 
   // PSel task
   gROOT->LoadMacro("$ALICE_ROOT/PWGGA/EMCALTasks/macros/AddTaskEmcalPhysicsSelection.C");
-  AliPhysicsSelectionTask *physSelTask = AddTaskEmcalPhysicsSelection(kTRUE);
+  AliPhysicsSelectionTask *physSelTask = AddTaskEmcalPhysicsSelection(kTRUE, kTRUE, 
+                                                                      AliVEvent::kAnyINT | AliVEvent::kCentral| AliVEvent::kSemiCentral,
+                                                                      -1,5);
 
   // Setup task
   gROOT->LoadMacro("$ALICE_ROOT/PWGGA/EMCALTasks/macros/AddTaskEmcalSetup.C");
@@ -105,16 +107,17 @@ void runJetAna(
 
   if (1) {
     UInt_t val = AliVEvent::kAny;
-    val = AliVEvent::kAnyINT | AliVEvent::kCentral| AliVEvent::kSemiCentral;
+    //val = AliVEvent::kAnyINT | AliVEvent::kCentral| AliVEvent::kSemiCentral;
     //val = AliVEvent::kEMCEGA;
     //val = AliVEvent::kEMCEJE;
+    val = AliEmcalPhysicsSelection::kEmcalHT;
 
     TObjArray *toptasks = mgr->GetTasks();
     for (Int_t i=0; i<toptasks->GetEntries(); ++i) {
       AliAnalysisTaskSE *task = dynamic_cast<AliAnalysisTaskSE*>(toptasks->At(i));
       if (!task)
         continue;
-      TString name(task->GetName());
+      TString name(task->ClassName());
       if (name.Contains("PhysicsSelection"))
         continue;
       ::Info("setPSel", "Set physics selection for %s (%s)", task->GetName(), task->ClassName());
index 18faba0..3c16cb4 100644 (file)
@@ -65,7 +65,18 @@ void AliEmcalCompatTask::UserExec(Option_t *)
     title = header->GetTitle();
   if (title.Length()==0)
     return;
-
+/*
+  AliAnalysisManager *am = AliAnalysisManager::GetAnalysisManager();
+  am->LoadBranch("AliESDHeader.");
+  AliVHeader *header = InputEvent()->GetHeader();
+  TString title(header->GetTitle());
+  if (title.Length()>0) {
+    UInt_t offline = header->GetUniqueID();
+    if (offline!=res) {
+      AliWarning(Form("Stored offline trigger not equal computed: %ud %ud", offline, res));
+    }
+  }
+*/
   if (fDoCent) {
     am->LoadBranch("Centrality.");
     AliCentrality *centin = dynamic_cast<AliCentrality*>(esdEv->FindListObject("Centrality"));
index 3280b83..dfd0260 100644 (file)
@@ -15,5 +15,6 @@
 #pragma link C++ class AliAnalysisTaskEmcalJetSpectra+;
 #pragma link C++ class AliAnalysisTaskRhoBase+;
 #pragma link C++ class AliAnalysisTaskRho+;
+#pragma link C++ class AliAnalysisTaskRhoAverage+;
 
 #endif