including Salvatore's tasks (files that were not added by mistake)
authormcosenti <mcosenti@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 12 Apr 2012 07:29:41 +0000 (07:29 +0000)
committermcosenti <mcosenti@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 12 Apr 2012 07:29:41 +0000 (07:29 +0000)
PWGGA/EMCALJetTasks/macros/AddTaskEmcalJet.C [new file with mode: 0644]
PWGGA/EMCALJetTasks/macros/AddTaskHadCorr.C [new file with mode: 0644]
PWGGA/EMCALTasks/AliEmcalIsolatedPhotonsTask.cxx [new file with mode: 0644]
PWGGA/EMCALTasks/AliEmcalIsolatedPhotonsTask.h [new file with mode: 0644]
PWGGA/EMCALTasks/macros/AddTaskEmcalClusTrackMatcher.C [new file with mode: 0644]
PWGGA/EMCALTasks/macros/AddTaskEmcalEsdTpcTrack.C [new file with mode: 0644]
PWGGA/EMCALTasks/macros/AddTaskEmcalIsolatedPhotons.C [new file with mode: 0644]
PWGGA/EMCALTasks/macros/AddTaskEmcalTrackPropagator.C [new file with mode: 0644]

diff --git a/PWGGA/EMCALJetTasks/macros/AddTaskEmcalJet.C b/PWGGA/EMCALJetTasks/macros/AddTaskEmcalJet.C
new file mode 100644 (file)
index 0000000..5af0328
--- /dev/null
@@ -0,0 +1,58 @@
+AliEmcalJetTask* AddTaskEmcalJet(
+                                                      const char *ntracks        = "Tracks",
+                                                      const char *nclusters      = "CaloClusters",
+                                                      const char *njets          = "Jets",
+                                                      const Int_t a              = 1,
+                                                      const Double_t r           = 0.4,
+                                                      const Int_t t              = 0,
+                                                      const Double_t minTrPt     = 0.15,
+                                                      const Double_t minClPt     = 0.15
+                                                       )
+{  
+  // Get the pointer to the existing analysis manager via the static access method.
+  //==============================================================================
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr)
+  {
+    ::Error("AddTaskAliEmcalJet", "No analysis manager to connect to.");
+    return NULL;
+  }  
+  
+  // Check the analysis type using the event handlers connected to the analysis manager.
+  //==============================================================================
+  if (!mgr->GetInputEventHandler())
+  {
+    ::Error("AddTaskAliEmcalJet", "This task requires an input event handler");
+    return NULL;
+  }
+  
+  //-------------------------------------------------------
+  // Init the task and do settings
+  //-------------------------------------------------------
+
+  AliEmcalJetTask* jetTask = new AliEmcalJetTask();
+  jetTask->SetTracksName(ntracks);
+  jetTask->SetClusName(nclusters);
+  jetTask->SetJetsName(njets);
+  jetTask->SetAlgo(a);
+  jetTask->SetMinJetTrackPt(minTrPt);
+  jetTask->SetMinJetClusPt(minClPt);
+  jetTask->SetRadius(r);
+  jetTask->SetType(t);
+
+  //-------------------------------------------------------
+  // Final settings, pass to manager and set the containers
+  //-------------------------------------------------------
+
+  mgr->AddTask(jetTask);
+  
+  // Create containers for input/output
+  AliAnalysisDataContainer *cinput1  = mgr->GetCommonInputContainer()  ;
+  AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer() ;
+  
+  mgr->ConnectInput  (jetTask, 0,  cinput1 );
+  mgr->ConnectOutput (jetTask, 0, coutput1 );
+  
+  return jetTask;
+  
+}
diff --git a/PWGGA/EMCALJetTasks/macros/AddTaskHadCorr.C b/PWGGA/EMCALJetTasks/macros/AddTaskHadCorr.C
new file mode 100644 (file)
index 0000000..296ce13
--- /dev/null
@@ -0,0 +1,51 @@
+AliHadCorrTask* AddTaskHadCorr(
+                                                      const char *ntracks        = "Tracks",
+                                                      const char *nclusters      = "CaloClusters",
+                                                      const char *outclusname    = "CaloClustersOut",
+                                                      const Double_t hadcorr     = 1,
+                                                      const Double_t minPt       = 0.15
+                                                       )
+{  
+  // Get the pointer to the existing analysis manager via the static access method.
+  //==============================================================================
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr)
+  {
+    ::Error("AddTaskHadCorr", "No analysis manager to connect to.");
+    return NULL;
+  }  
+  
+  // Check the analysis type using the event handlers connected to the analysis manager.
+  //==============================================================================
+  if (!mgr->GetInputEventHandler())
+  {
+    ::Error("AddTaskHadCorr", "This task requires an input event handler");
+    return NULL;
+  }
+  
+  //-------------------------------------------------------
+  // Init the task and do settings
+  //-------------------------------------------------------
+
+  AliHadCorrTask *hcor = new AliHadCorrTask("hcor");
+  hcor->SetTracksName(ntracks);
+  hcor->SetHadCorr(hadcorr);
+  hcor->SetClusName(nclusters);
+  hcor->SetMinPt(minPt);
+  hcor->SetOutClusName(outclusname);  
+
+  //-------------------------------------------------------
+  // Final settings, pass to manager and set the containers
+  //-------------------------------------------------------
+
+  mgr->AddTask(hcor);
+    
+  // Create containers for input/output
+  mgr->ConnectInput (hcor, 0, mgr->GetCommonInputContainer() );
+  AliAnalysisDataContainer *cohcor = mgr->CreateContainer(Form("MatchQAktchemhcorr2"),TList::Class(),AliAnalysisManager::kOutputContainer,Form("Rosi.rho.root"));
+  mgr->ConnectOutput(hcor,0,mgr->GetCommonOutputContainer());
+  mgr->ConnectOutput(hcor,1,cohcor);
+    
+  return hcor;
+  
+}
diff --git a/PWGGA/EMCALTasks/AliEmcalIsolatedPhotonsTask.cxx b/PWGGA/EMCALTasks/AliEmcalIsolatedPhotonsTask.cxx
new file mode 100644 (file)
index 0000000..cb931d8
--- /dev/null
@@ -0,0 +1,350 @@
+// $Id: AliEmcalIsolatedPhotonsTask.cxx  $
+
+#include <TChain.h>
+#include <TClonesArray.h>
+#include <TH1F.h>
+#include <TH2F.h>
+#include <TList.h>
+#include <TLorentzVector.h>
+#include <TParticle.h>
+
+#include "AliAnalysisManager.h"
+#include "AliCentrality.h"
+#include "AliESDCaloCluster.h"
+#include "AliESDtrack.h"
+#include "AliEmcalJet.h"
+#include "AliFJWrapper.h"
+#include "AliAODTrack.h"
+#include "AliESDtrackCuts.h"
+#include "AliEmcalJet.h"
+#include "AliVEventHandler.h"
+
+#include "AliEmcalIsolatedPhotonsTask.h"
+
+ClassImp(AliEmcalIsolatedPhotonsTask)
+
+//________________________________________________________________________
+AliEmcalIsolatedPhotonsTask::AliEmcalIsolatedPhotonsTask() : 
+  AliAnalysisTaskSE("AliEmcalIsolatedPhotonsTask"),
+  fOutput(0),
+  fTracksName("Tracks"),
+  fCaloName("CaloClusters"),
+  fJetsName("Jets"),
+  fSkimmedESD(0),
+  fESDTrackCuts(0),
+  fFilterBit(16),
+  fTracks(0),
+  fCaloClusters(0),
+  fJets(0),
+  fHistTracksPt(0),
+  fHistClustersEnergy(0),
+  fHistEPcorrelation(0),
+  fHistJetsEnergy(0),
+  fHistJetsNE(0),
+  fHistJetsNEF(0),
+  fHistJetsZ(0),
+  fHistTrPhiEta(0),
+  fHistClusPhiEta(0),
+  fHistJetPhiEta(0),
+  Ptbins(100),
+  Ptlow(0),
+  Ptup(50),
+  Ebins(100),
+  Elow(0),
+  Eup(50)
+{
+  // Default constructor.
+  fBranchNames="ESD:AliESDRun.,AliESDHeader.,PrimaryVertex.";
+}
+
+//________________________________________________________________________
+AliEmcalIsolatedPhotonsTask::AliEmcalIsolatedPhotonsTask(const char *name) : 
+  AliAnalysisTaskSE("AliEmcalIsolatedPhotonsTask"),
+  fOutput(0),
+  fTracksName("Tracks"),
+  fCaloName("CaloClusters"),
+  fJetsName("Jets"),
+  fSkimmedESD(0),
+  fESDTrackCuts(0),
+  fFilterBit(16),
+  fTracks(0),
+  fCaloClusters(0),
+  fJets(0),
+  fHistTracksPt(0),
+  fHistClustersEnergy(0),
+  fHistEPcorrelation(0),
+  fHistJetsEnergy(0),
+  fHistJetsNE(0),
+  fHistJetsNEF(0),
+  fHistJetsZ(0),
+  fHistTrPhiEta(0),
+  fHistClusPhiEta(0),
+  fHistJetPhiEta(0),
+  Ptbins(100),
+  Ptlow(0),
+  Ptup(50),
+  Ebins(100),
+  Elow(0),
+  Eup(50)
+{
+  // Standard constructor.
+
+  if (!name)
+    return;
+
+  SetName(name);
+  fBranchNames="ESD:AliESDRun.,AliESDHeader.,PrimaryVertex.";
+
+  DefineInput(0,TChain::Class());
+  DefineOutput(1,TList::Class());
+}
+
+//________________________________________________________________________
+AliEmcalIsolatedPhotonsTask::~AliEmcalIsolatedPhotonsTask()
+{
+  // Destructor
+}
+
+//________________________________________________________________________
+void AliEmcalIsolatedPhotonsTask::UserCreateOutputObjects()
+{
+   // Create histograms
+  // Called once (on the worker node)
+  
+  fOutput = new TList();
+  fOutput->SetOwner();  // IMPORTANT!
+  
+  AliVEventHandler* handler = AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler();
+  
+  if( handler && handler->InheritsFrom("AliESDInputHandler") ) {
+
+    if (!fESDTrackCuts) fESDTrackCuts = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
+    
+    if (!fESDTrackCuts) {
+      AliFatal("Invalid pointer to ESDtrackCuts");
+    }
+    
+    if (fESDTrackCuts) {
+      fESDTrackCuts->DefineHistograms(kRed);
+      fOutput->Add(fESDTrackCuts);
+    }
+  }
+
+  /*
+  fGeom = AliEMCALGeometry::GetInstance("EMCAL_COMPLETEV1");
+  if (!fGeom) {
+    AliFatal("Unable to get the EMCAL_COMPLETEV1 geom");
+  }
+  */
+    
+  fHistTracksPt = new TH1F("fHistTracksPt","P_{T} spectrum of reconstructed tracks", Ptbins, Ptlow, Ptup);
+  fHistTracksPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
+  fHistTracksPt->GetYaxis()->SetTitle("counts");
+  fOutput->Add(fHistTracksPt);
+       
+  fHistClustersEnergy = new TH1F("fHistClustersEnergy","Energy spectrum of clusters", Ebins, Elow, Eup);
+  fHistClustersEnergy->GetXaxis()->SetTitle("E [GeV]");
+  fHistClustersEnergy->GetYaxis()->SetTitle("counts");
+  fOutput->Add(fHistClustersEnergy);
+
+  fHistEPcorrelation = new TH2F("fHistEPcorrelation","Energy-momentum correlation", Ptbins, Ptlow, Ptup, Ebins, Elow, Eup);
+  fHistEPcorrelation->GetXaxis()->SetTitle("P [GeV/c]");
+  fHistEPcorrelation->GetYaxis()->SetTitle("E [GeV]");
+  fOutput->Add(fHistEPcorrelation);
+  
+  fHistJetsEnergy = new TH1F("fHistJetsEnergy","Energy spectrum of jets", Ebins, Elow, Eup);
+  fHistJetsEnergy->GetXaxis()->SetTitle("E [GeV]");
+  fHistJetsEnergy->GetYaxis()->SetTitle("counts");
+  fOutput->Add(fHistJetsEnergy);
+  
+  fHistJetsNE = new TH1F("fHistJetsNE","Neutral energy spectrum of jets", Ebins, Elow, Eup);
+  fHistJetsNE->GetXaxis()->SetTitle("E [GeV]");
+  fHistJetsNE->GetYaxis()->SetTitle("counts");
+  fOutput->Add(fHistJetsNE);
+  
+  fHistJetsNEF = new TH1F("fHistJetsNEF","Jets neutral energy fraction", Ebins, 0, 1.2);
+  fHistJetsNEF->GetXaxis()->SetTitle("E [GeV]");
+  fHistJetsNEF->GetYaxis()->SetTitle("counts");
+  fOutput->Add(fHistJetsNEF);
+
+  fHistJetsZ = new TH1F("fHistJetsZ","Z of jet constituents", Ebins, 0, 1.2);
+  fHistJetsZ->GetXaxis()->SetTitle("Z");
+  fHistJetsZ->GetYaxis()->SetTitle("counts");
+  fOutput->Add(fHistJetsZ);
+
+  fHistTrPhiEta = new TH2F("fHistTrPhiEta","Phi-Eta distribution of tracks", 20, -2, 2, 32, 0, 6.4);
+  fHistTrPhiEta->GetXaxis()->SetTitle("Eta");
+  fHistTrPhiEta->GetYaxis()->SetTitle("Phi");
+  fOutput->Add(fHistTrPhiEta);
+
+  fHistClusPhiEta = new TH2F("fHistClusPhiEta","Phi-Eta distribution of clusters", 20, -2, 2, 32, 0, 6.4);
+  fHistClusPhiEta->GetXaxis()->SetTitle("Eta");
+  fHistClusPhiEta->GetYaxis()->SetTitle("Phi");
+  fOutput->Add(fHistClusPhiEta);
+
+  fHistJetPhiEta = new TH2F("fHistJetPhiEta","Phi-Eta distribution of jets", 20, -2, 2, 32, 0, 6.4);
+  fHistJetPhiEta->GetXaxis()->SetTitle("Eta");
+  fHistJetPhiEta->GetYaxis()->SetTitle("Phi");
+  fOutput->Add(fHistJetPhiEta);
+       
+  PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram
+}
+
+void AliEmcalIsolatedPhotonsTask::RetrieveEventObjects()
+{
+  fCaloClusters =  dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fCaloName));
+  fTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTracksName));
+  fJets = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fJetsName));
+
+  if (!fTracks) {
+    AliError(Form("ERROR: Could not retrieve tracks!")); 
+  }
+  if (!fCaloClusters) {
+    AliError(Form("ERROR: Could not retrieve clusters!")); 
+  }
+  if (!fJets) {
+    AliError(Form("ERROR: Could not retrieve jets!")); 
+  }
+}
+
+AliVTrack* AliEmcalIsolatedPhotonsTask::GetTrack(const Int_t i) const
+{
+  return dynamic_cast<AliVTrack*>(fTracks->At(i));
+}
+
+Int_t AliEmcalIsolatedPhotonsTask::GetNumberOfTracks() const
+{
+  return fTracks->GetEntriesFast();
+}
+
+AliVCluster* AliEmcalIsolatedPhotonsTask::GetCaloCluster(const Int_t i) const
+{
+  return dynamic_cast<AliVCluster*>(fCaloClusters->At(i));
+}
+
+Int_t AliEmcalIsolatedPhotonsTask::GetNumberOfCaloClusters() const
+{
+  return fCaloClusters->GetEntriesFast();
+}
+
+AliEmcalJet* AliEmcalIsolatedPhotonsTask::GetJet(const Int_t i) const
+{
+  return dynamic_cast<AliEmcalJet*>(fJets->At(i));
+}
+
+Int_t AliEmcalIsolatedPhotonsTask::GetNumberOfJets() const
+{
+  return fJets->GetEntriesFast();
+}
+
+void AliEmcalIsolatedPhotonsTask::FillHistograms()
+{
+  
+  // Cluster loop
+  Int_t nclusters =  GetNumberOfCaloClusters();
+  //cout << nclusters << " clusters" << endl;
+  for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) {
+    AliVCluster* cluster = GetCaloCluster(iClusters);
+    if (!cluster) {
+      printf("ERROR: Could not receive cluster %d\n", iClusters);
+      continue;
+    }  
+    
+    if (!(cluster->IsEMCAL())) continue;
+
+    fHistClustersEnergy->Fill(cluster->E());
+
+    Float_t pos[3];
+    cluster->GetPosition(pos);
+    TVector3 clusVec(pos);
+    fHistClusPhiEta->Fill(clusVec.Eta(), clusVec.Phi());
+  } //cluster loop 
+  
+
+  // Track loop 
+  Int_t ntracks = GetNumberOfTracks();
+  //cout << ntracks << " tracks" << endl;
+  for(Int_t i = 0; i < ntracks; i++) {
+    //cout << "track n. " << i << endl;
+    AliVTrack* track = GetTrack(i); // pointer to reconstructed to track          
+    if(!track) {
+      AliError(Form("ERROR: Could not retrieve esdtrack %d",i)); 
+      continue; 
+    }
+    
+    if (!AcceptTrack(track)) continue;
+
+    fHistTracksPt->Fill(track->Pt());
+    
+    //fHisTrPhiEta->Fill(track->Phi(), track->Eta());
+
+    Int_t clId = track->GetEMCALcluster();
+    if (clId > -1) {
+      AliVCluster* cluster = GetCaloCluster(clId);
+      if (cluster)
+       fHistEPcorrelation->Fill(track->P(),cluster->E());
+    } 
+    
+  }
+
+  // Jet loop
+  Int_t njets =  GetNumberOfJets();
+  //cout << njets << " jets" << endl;
+  for (Int_t ij = 0; ij < njets; ij++) {
+    AliEmcalJet* jet = GetJet(ij);
+    if (!jet) {
+      printf("ERROR: Could not receive jet %d\n", ij);
+      continue;
+    }  
+    
+    fHistJetPhiEta->Fill(jet->Eta(), jet->Phi());
+    fHistJetsEnergy->Fill(jet->E());
+    fHistJetsNEF->Fill(jet->NEF());
+    fHistJetsNE->Fill(jet->E() * jet->NEF());
+  } //jet loop 
+}
+
+//________________________________________________________________________
+Bool_t AliEmcalIsolatedPhotonsTask::AcceptTrack(AliVTrack *track)
+{
+  //if (fSkimmedESD) return 1;
+
+  if (!strcmp(track->ClassName(), "AliESDTrack") && fESDTrackCuts) {
+    AliESDtrack *esdtrack = dynamic_cast<AliESDtrack*>(track);
+    if(esdtrack) {
+      return fESDTrackCuts->AcceptTrack(esdtrack);
+    }
+    //else {
+    //cout << "no esdtrack!" << endl;
+    //}
+  }
+  else if (!strcmp(track->ClassName(), "AliAODTrack")) {
+    AliAODTrack *aodtrack = dynamic_cast<AliAODTrack*>(track);
+    if (aodtrack) {
+      //cout << "filter bit = " << fFilterBit << ", filter map = " << aodtrack->GetFilterMap() << endl;
+      return aodtrack->TestFilterBit(fFilterBit);
+      
+    }
+  }
+  return 1;
+}
+
+//________________________________________________________________________
+void AliEmcalIsolatedPhotonsTask::UserExec(Option_t *) 
+{
+  // Main loop, called for each event.
+  // Add jets to event if not yet there
+
+  RetrieveEventObjects();
+
+  FillHistograms();
+    
+  // information for this iteration of the UserExec in the container
+  PostData(1, fOutput);
+}
+
+//________________________________________________________________________
+void AliEmcalIsolatedPhotonsTask::Terminate(Option_t *) 
+{
+  // Called once at the end of the analysis.
+}
diff --git a/PWGGA/EMCALTasks/AliEmcalIsolatedPhotonsTask.h b/PWGGA/EMCALTasks/AliEmcalIsolatedPhotonsTask.h
new file mode 100644 (file)
index 0000000..47f61c5
--- /dev/null
@@ -0,0 +1,86 @@
+#ifndef ALIEMCALISOLATEDPHOTONSTASK_H
+#define ALIEMCALISOLATEDPHOTONSTASK_H
+
+// $Id: AliEmcalIsolatedPhotonsTask.h $
+
+class TClonesArray;
+class TString;
+class AliESDtrackCuts;
+class AliVTrack;
+class AliVCluster;
+class TList;
+class TH1F;
+class TH2F;
+class AliEmcalJet;
+
+#include "AliAnalysisTaskSE.h"
+
+class AliEmcalIsolatedPhotonsTask : public AliAnalysisTaskSE {
+ public:
+  AliEmcalIsolatedPhotonsTask();
+  AliEmcalIsolatedPhotonsTask(const char *name);
+  virtual ~AliEmcalIsolatedPhotonsTask();
+
+  void                        UserCreateOutputObjects();
+  void                        UserExec(Option_t *option);
+  void                        Terminate(Option_t *option);
+
+  void                        SetClusName(const char *n)                    { fCaloName      = n          ; }
+  void                        SetJetsName(const char *n)                    { fJetsName      = n          ; }
+  void                        SetTracksName(const char *n)                  { fTracksName    = n          ; }
+  virtual void                SetTrackCuts(AliESDtrackCuts *cuts)           { fESDTrackCuts = cuts        ; }
+  virtual AliESDtrackCuts    *GetTrackCuts()                          const { return fESDTrackCuts        ; }
+  virtual void                SetAODFilterBit(const Int_t b)                { fFilterBit = b              ; }
+  virtual Int_t               GetAODFilterBit()                       const { return fFilterBit           ; }
+  virtual void                SetSkimmedESD(const Bool_t s)                 { fSkimmedESD = s             ; }
+  virtual Bool_t              GetSkimmedESD()                         const { return fSkimmedESD          ; }
+
+
+ protected:
+
+  AliVTrack                  *GetTrack(const Int_t i)          const;
+  Int_t                       GetNumberOfTracks()              const;
+  AliVCluster                *GetCaloCluster(const Int_t i)    const;
+  Int_t                       GetNumberOfCaloClusters()        const;
+  AliEmcalJet                *GetJet(const Int_t i)            const;
+  Int_t                       GetNumberOfJets()                const;
+  void                        FillHistograms()                      ;
+  void                        RetrieveEventObjects()                ;
+  Bool_t                      AcceptTrack(AliVTrack *track)         ;
+
+  TList                      *fOutput;                 // Output list
+
+  TString                     fTracksName;             // name of track collection
+  TString                     fCaloName;               // name of calo cluster collection
+  TString                     fJetsName;               // name of jet collection
+  Bool_t                      fSkimmedESD;             // flag if skimmed ESD
+  AliESDtrackCuts            *fESDTrackCuts;           // Track cuts
+  Int_t                       fFilterBit;              // AOD filter bit
+  TClonesArray               *fTracks;                 //!Tracks
+  TClonesArray               *fCaloClusters;           //!Clusters
+  TClonesArray               *fJets;                   //!Jets
+  TH1F                       *fHistTracksPt;           // Pt spectrum of tracks
+  TH1F                       *fHistClustersEnergy;     // Energy spectrum of clusters
+  TH2F                       *fHistEPcorrelation;      // Energy-momentum correlation
+  TH1F                       *fHistJetsEnergy;         // Energy spectrum of jets
+  TH1F                       *fHistJetsNE;             // Jet neutral energy spectrum
+  TH1F                       *fHistJetsNEF;            // Jet neutral energy fraction
+  TH1F                       *fHistJetsZ;              // Constituent Pt over Jet E ratio
+  TH2F                       *fHistTrPhiEta;           // Phi-Eta distribution of tracks
+  TH2F                       *fHistClusPhiEta;         // Phi-Eta distribution of clusters
+  TH2F                       *fHistJetPhiEta;          // Phi-Eta distribution of jets
+
+  Int_t                       Ptbins;                  // No. of pt bins
+  Float_t                     Ptlow;                   // Min pt
+  Float_t                     Ptup;                    // Max pt
+  Int_t                       Ebins;                   // No. of e bins
+  Float_t                     Elow;                    // Min e
+  Float_t                     Eup;                     // Max e
+
+ private:
+  AliEmcalIsolatedPhotonsTask(const AliEmcalIsolatedPhotonsTask&);            // not implemented
+  AliEmcalIsolatedPhotonsTask &operator=(const AliEmcalIsolatedPhotonsTask&); // not implemented
+
+  ClassDef(AliEmcalIsolatedPhotonsTask, 1) // Isolated photons task
+};
+#endif
diff --git a/PWGGA/EMCALTasks/macros/AddTaskEmcalClusTrackMatcher.C b/PWGGA/EMCALTasks/macros/AddTaskEmcalClusTrackMatcher.C
new file mode 100644 (file)
index 0000000..9cac772
--- /dev/null
@@ -0,0 +1,50 @@
+AliEmcalClusTrackMatcherTask* AddTaskEmcalClusTrackMatcher(
+                                                      const char *ntracks        = "Tracks",
+                                                      const char *nclusters      = "CaloClusters",
+                                                       const Bool_t DoClusTrack   = 1,
+                                                       const Bool_t DoTrackClus   = 0
+                                                       )
+{  
+  // Get the pointer to the existing analysis manager via the static access method.
+  //==============================================================================
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr)
+  {
+    ::Error("AddTaskEmcalClusTrackMatcher", "No analysis manager to connect to.");
+    return NULL;
+  }  
+  
+  // Check the analysis type using the event handlers connected to the analysis manager.
+  //==============================================================================
+  if (!mgr->GetInputEventHandler())
+  {
+    ::Error("AddTaskEmcalClusTrackMatcher", "This task requires an input event handler");
+    return NULL;
+  }
+  
+  //-------------------------------------------------------
+  // Init the task and do settings
+  //-------------------------------------------------------
+
+  AliEmcalClusTrackMatcherTask* matcher = new AliEmcalClusTrackMatcherTask();
+  matcher->SetTracksName(ntracks);
+  matcher->SetClusName(nclusters);
+  matcher->SetDoClusTrackMatching(DoClusTrack);
+  matcher->SetDoTrackClusMatching(DoTrackClus);
+
+  //-------------------------------------------------------
+  // Final settings, pass to manager and set the containers
+  //-------------------------------------------------------
+
+  mgr->AddTask(matcher);
+  
+  // Create containers for input/output
+  AliAnalysisDataContainer *cinput1  = mgr->GetCommonInputContainer()  ;
+  AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer() ;
+  
+  mgr->ConnectInput  (matcher, 0,  cinput1 );
+  mgr->ConnectOutput (matcher, 0, coutput1 );
+  
+  return matcher;
+  
+}
diff --git a/PWGGA/EMCALTasks/macros/AddTaskEmcalEsdTpcTrack.C b/PWGGA/EMCALTasks/macros/AddTaskEmcalEsdTpcTrack.C
new file mode 100644 (file)
index 0000000..a7c0bae
--- /dev/null
@@ -0,0 +1,80 @@
+AliEmcalEsdTpcTrackTask* AddTaskEmcalEsdTpcTrack(
+                                                      const char *name       = "TpcSpdVertexConstrainedTracks"
+                                                       )
+{  
+  // Get the pointer to the existing analysis manager via the static access method.
+  //==============================================================================
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr)
+  {
+    ::Error("AddTaskEmcalEsdTpcTrack", "No analysis manager to connect to.");
+    return NULL;
+  }  
+  
+  // Check the analysis type using the event handlers connected to the analysis manager.
+  //==============================================================================
+  if (!mgr->GetInputEventHandler())
+  {
+    ::Error("AddTaskEmcalEsdTpcTrack", "This task requires an input event handler");
+    return NULL;
+  }
+  
+  //-------------------------------------------------------
+  // Init the task and do settings
+  //-------------------------------------------------------
+
+  // Add tpc track task.
+
+  AliESDtrackCuts *cutsp = new AliESDtrackCuts;
+  /*hybrid tracks*/
+  // TPC
+  TFormula *f1NClustersTPCLinearPtDep = new TFormula("f1NClustersTPCLinearPtDep","70.+30./20.*x");
+  cutsp->SetMinNClustersTPCPtDep(f1NClustersTPCLinearPtDep,20.);
+  cutsp->SetMinNClustersTPC(70);
+  cutsp->SetMaxChi2PerClusterTPC(4);
+  cutsp->SetRequireTPCStandAlone(kTRUE); //cut on NClustersTPC and chi2TPC Iter1
+  cutsp->SetAcceptKinkDaughters(kFALSE);
+  cutsp->SetRequireTPCRefit(kTRUE);
+  cutsp->SetMaxFractionSharedTPCClusters(0.4);
+  // ITS
+  cutsp->SetRequireITSRefit(kTRUE);
+  //accept secondaries
+  cutsp->SetMaxDCAToVertexXY(2.4);
+  cutsp->SetMaxDCAToVertexZ(3.2);
+  cutsp->SetDCAToVertex2D(kTRUE);
+  //reject fakes
+  cutsp->SetMaxChi2PerClusterITS(36);
+  cutsp->SetMaxChi2TPCConstrainedGlobal(36);
+  cutsp->SetRequireSigmaToVertex(kFALSE);
+  cutsp->SetEtaRange(-0.9,0.9);
+  cutsp->SetPtRange(0.15, 1E+15);
+  //tag = "Global tracks jet analysis with ITSrefit and NclsIter1=PtDep, noSPD requirement, no upper pt cut, golden chi2";
+  hybsp = new AliESDtrackCuts(*cutsp);
+  cutsp->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
+  //tag += " + additonal: SPD any requirement";
+  hybsp->SetRequireITSRefit(kFALSE);
+  //tag += " + additional: ITSrefit=kFALSE";
+
+  AliEmcalEsdTpcTrackTask *eTask = new AliEmcalEsdTpcTrackTask();
+  eTask->SetTrackCuts(cutsp);
+  eTask->SetHybridTrackCuts(hybsp);
+  eTask->SetTracksName(name);
+
+  cout << " *** TPC track to SPD vertex task configured *** " << endl;
+
+  //-------------------------------------------------------
+  // Final settings, pass to manager and set the containers
+  //-------------------------------------------------------
+
+  mgr->AddTask(eTask);
+  
+  // Create containers for input/output
+  AliAnalysisDataContainer *cinput1  = mgr->GetCommonInputContainer()  ;
+  //AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer() ;
+  
+  mgr->ConnectInput  (eTask, 0,  cinput1 );
+  //mgr->ConnectOutput (eTask, 0, coutput1 );
+  
+  return eTask;
+  
+}
diff --git a/PWGGA/EMCALTasks/macros/AddTaskEmcalIsolatedPhotons.C b/PWGGA/EMCALTasks/macros/AddTaskEmcalIsolatedPhotons.C
new file mode 100644 (file)
index 0000000..9254902
--- /dev/null
@@ -0,0 +1,55 @@
+AliEmcalIsolatedPhotonsTask* AddTaskEmcalIsolatedPhotons(
+                                                      const char *ntracks            = "Tracks",
+                                                      const char *nclusters          = "CaloClusters",
+                                                      const char *njets              = "Jets",
+                                                      const Bool_t skimmedESD        = 0,
+                                                      const Bool_t AODmode           = 0,
+                                                      const Int_t AODtrackFilterBit  = 256  // hybrid LHC11h tracks
+                                                       )
+{  
+  // Get the pointer to the existing analysis manager via the static access method.
+  //==============================================================================
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr)
+  {
+    ::Error("AddTaskEmcalIsolatedPhotons", "No analysis manager to connect to.");
+    return NULL;
+  }  
+  
+  // Check the analysis type using the event handlers connected to the analysis manager.
+  //==============================================================================
+  if (!mgr->GetInputEventHandler())
+  {
+    ::Error("AddTaskEmcalIsolatedPhotons", "This task requires an input event handler");
+    return NULL;
+  }
+  
+  //-------------------------------------------------------
+  // Init the task and do settings
+  //-------------------------------------------------------
+
+  AliEmcalIsolatedPhotonsTask* phTask = new AliEmcalIsolatedPhotonsTask("aiolaIsoPhotons");
+  phTask->SetTracksName(ntracks);
+  phTask->SetClusName(nclusters);
+  phTask->SetJetsName(njets);
+  phTask->SetSkimmedESD(skimmedESD);
+  if (AODmode) {
+    phTask->SetAODFilterBit(AODtrackFilterBit); // global hybrids for LHC11h
+  }
+
+  //-------------------------------------------------------
+  // Final settings, pass to manager and set the containers
+  //-------------------------------------------------------
+
+  mgr->AddTask(phTask);
+  
+  // Create containers for input/output
+  AliAnalysisDataContainer *cinput1  = mgr->GetCommonInputContainer()  ;
+  AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer() ;
+  
+  mgr->ConnectInput  (phTask, 0,  cinput1 );
+  mgr->ConnectOutput (phTask, 0, coutput1 );
+  
+  return phTask;
+  
+}
diff --git a/PWGGA/EMCALTasks/macros/AddTaskEmcalTrackPropagator.C b/PWGGA/EMCALTasks/macros/AddTaskEmcalTrackPropagator.C
new file mode 100644 (file)
index 0000000..3812b18
--- /dev/null
@@ -0,0 +1,48 @@
+AliEmcalTrackPropagatorTask* AddTaskEmcalTrackPropagator(
+                                                      const char *name         = "Tracks",
+                                                       const Double_t d         = -1,
+                                                       const Double_t pt        = -1
+                                                       )
+{  
+  // Get the pointer to the existing analysis manager via the static access method.
+  //==============================================================================
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr)
+  {
+    ::Error("AddTaskEmcalTrackPropagator", "No analysis manager to connect to.");
+    return NULL;
+  }  
+  
+  // Check the analysis type using the event handlers connected to the analysis manager.
+  //==============================================================================
+  if (!mgr->GetInputEventHandler())
+  {
+    ::Error("AddTaskEmcalTrackPropagator", "This task requires an input event handler");
+    return NULL;
+  }
+  
+  //-------------------------------------------------------
+  // Init the task and do settings
+  //-------------------------------------------------------
+
+  AliEmcalTrackPropagatorTask* propagator = new AliEmcalTrackPropagatorTask();
+  propagator->SetTracksName(name);
+  if (d > -1) propagator->SetDist(d);
+  if (pt > -1) propagator->SetMinPt(pt);
+
+  //-------------------------------------------------------
+  // Final settings, pass to manager and set the containers
+  //-------------------------------------------------------
+
+  mgr->AddTask(propagator);
+  
+  // Create containers for input/output
+  AliAnalysisDataContainer *cinput1  = mgr->GetCommonInputContainer()  ;
+  //AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer() ;
+  
+  mgr->ConnectInput  (propagator, 0,  cinput1 );
+  //mgr->ConnectOutput (propagator, 0, coutput1 );
+  
+  return propagator;
+  
+}