including new changes from Salvatore
authormcosenti <mcosenti@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 23 Apr 2012 15:56:20 +0000 (15:56 +0000)
committermcosenti <mcosenti@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 23 Apr 2012 15:56:20 +0000 (15:56 +0000)
PWGGA/CMakelibPWGGAEMCALTasks.pkg
PWGGA/EMCALTasks/AliEmcalAodTrackFilterTask.cxx [deleted file]
PWGGA/EMCALTasks/AliEmcalAodTrackFilterTask.h [deleted file]
PWGGA/EMCALTasks/AliEmcalIsolatedPhotonsTask.cxx
PWGGA/EMCALTasks/AliEmcalIsolatedPhotonsTask.h
PWGGA/EMCALTasks/AliEmcalTenderTask.cxx [new file with mode: 0644]
PWGGA/EMCALTasks/AliEmcalTenderTask.h [new file with mode: 0644]
PWGGA/EMCALTasks/macros/AddTaskEmcalAodTender.C [new file with mode: 0644]
PWGGA/EMCALTasks/macros/AddTaskEmcalAodTrackFilter.C
PWGGA/EMCALTasks/macros/AddTaskEmcalIsolatedPhotons.C
PWGGA/PWGGAEMCALTasksLinkDef.h

index 56c765a..bbcb2d5 100644 (file)
@@ -46,7 +46,8 @@ set ( SRCS
  EMCALTasks/AliAnalysisTaskTrgContam.cxx
  EMCALTasks/AliAnalysisTaskEMCALPhoton.cxx
  EMCALTasks/AliEmcalIsolatedPhotonsTask.cxx
- EMCALTasks/AliEmcalAodTrackFilterTask.cxx     
+ EMCALTasks/AliEmcalPicoTrackMaker.cxx
+ EMCALTasks/AliEmcalTenderTask.cxx     
 )
 
 string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
@@ -55,4 +56,4 @@ set ( DHDR  PWGGAEMCALTasksLinkDef.h)
 
 string ( REPLACE ".cxx" ".h" EXPORT "${SRCS}" )
 
-set ( EINCLUDE PWGGA/EMCALTasks EMCAL OADB STEER/ESD STEER/STEERBase)
+set ( EINCLUDE PWGGA/EMCALTasks EMCAL OADB STEER/ESD STEER/STEERBase ANALYSIS)
diff --git a/PWGGA/EMCALTasks/AliEmcalAodTrackFilterTask.cxx b/PWGGA/EMCALTasks/AliEmcalAodTrackFilterTask.cxx
deleted file mode 100644 (file)
index de98ad5..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-// $Id: AliEmcalAodTrackFilterTask.cxx  $
-//
-// Class to filter hybrid tracks in AOD events.
-//
-//
-
-#include <TClonesArray.h>
-
-#include "AliAnalysisManager.h"
-#include "AliAODEvent.h"
-#include "AliPicoTrack.h"
-
-#include "AliEmcalAodTrackFilterTask.h"
-
-ClassImp(AliEmcalAodTrackFilterTask)
-
-//________________________________________________________________________
-AliEmcalAodTrackFilterTask::AliEmcalAodTrackFilterTask() : 
-  AliAnalysisTaskSE("AliEmcalAodTrackFilterTask"),
-  fAODfilterBit(16),
-  fTracksOutName("PicoTracks"),
-  fTracksInName("tracks"),
-  fAOD(0),
-  fTracksIn(0),
-  fTracksOut(0)
-{
-  // Constructor.
-}
-
-//________________________________________________________________________
-AliEmcalAodTrackFilterTask::AliEmcalAodTrackFilterTask(const char *name) : 
-  AliAnalysisTaskSE("AliEmcalAodTrackFilterTask"),
-  fAODfilterBit(16),
-  fTracksOutName("PicoTracks"),
-  fTracksInName("tracks"),
-  fAOD(0),
-  fTracksIn(0),
-  fTracksOut(0)
-{
-  // Constructor.
-
-  if (!name)
-    return;
-
-  SetName(name);
-
-  fBranchNames = "ESD:AliESDHeader.,AliESDRun.,SPDVertex.,Tracks";
-}
-
-//________________________________________________________________________
-AliEmcalAodTrackFilterTask::~AliEmcalAodTrackFilterTask()
-{
-  //Destructor
-
-}
-
-//________________________________________________________________________
-void AliEmcalAodTrackFilterTask::UserCreateOutputObjects()
-{
-  // Create histograms.
-
-  fTracksOut = new TClonesArray("AliPicoTrack");
-  fTracksOut->SetName(fTracksOutName);
-}
-
-//________________________________________________________________________
-void AliEmcalAodTrackFilterTask::UserExec(Option_t *) 
-{
-  // Main loop, called for each event.
-
-  AliAnalysisManager *am = AliAnalysisManager::GetAnalysisManager();
-  if (!am) {
-    AliError("Manager zero, returning");
-    return;
-  }
-
-  RetrieveEventObjects();
-
-  // add tracks to event if not yet there
-  if (!(InputEvent()->FindListObject(fTracksOutName)))
-    InputEvent()->AddObject(fTracksOut);
-
-  Int_t Ntracks = GetNumberOfTracks();
-  for (Int_t iTracks = 0, nacc = 0; iTracks < Ntracks; ++iTracks) {
-    AliAODTrack *track = GetTrack(iTracks);
-
-    if (!track)
-      continue;
-    
-    if (!AcceptTrack(track))
-      continue;
-
-    AliPicoTrack *picotrack = new ((*fTracksOut)[nacc]) AliPicoTrack(track->Pt(), track->Eta(), track->Phi(), 
-                                          track->Charge(), track->GetLabel(), 
-                                          track->GetTrackEtaOnEMCal(), track->GetTrackPhiOnEMCal(), track->IsEMCAL());
-    if (track->IsEMCAL()) {
-      picotrack->SetEMCALcluster(track->GetEMCALcluster());
-    }
-    //cout << iTracks << " - is emcal = " << track->IsEMCAL() << ", phiemc = " << track->GetTrackPhiOnEMCal() << ", etaemc = " << track->GetTrackEtaOnEMCal() << ", emcid = " << track->GetEMCALcluster() << endl;
-    ++nacc;
-  }
-}
-
-
-//________________________________________________________________________
-Bool_t AliEmcalAodTrackFilterTask::AcceptTrack(AliAODTrack *track)
-{
-  AliAODTrack *aodtrack = dynamic_cast<AliAODTrack*>(track);
-  if (aodtrack) {
-    //cout << "filter bit = " << fFilterBit << ", filter map = " << aodtrack->GetFilterMap() << endl;
-    return aodtrack->TestFilterBit(fAODfilterBit);
-    //return aodtrack->IsHybridGlobalConstrainedGlobal();
-  }
-  return 1;
-}
-
-//________________________________________________________________________
-void AliEmcalAodTrackFilterTask::SetRunPeriod(const char *p)
-{
-  if (!strcmp(p, "LHC11h")) {
-    SetAODfilterBit(256+512); // hybrid tracks for LHC11h
-  }
-  else {
-    AliWarning(Form("Run period %s not known. AOD filter bit not set.", p));
-  }
-}
-
-//________________________________________________________________________
-void AliEmcalAodTrackFilterTask::RetrieveEventObjects()
-{
-  fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
-  if (!fAOD) {
-    AliError("Task works only on AOD events, returning");
-    return;
-  }
-
-  fTracksIn = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTracksInName));
-
-  if (!fTracksIn) {
-    AliError(Form("ERROR: Could not retrieve tracks %s!", fTracksInName.Data())); 
-  }
-}
-
-//________________________________________________________________________
-AliAODTrack* AliEmcalAodTrackFilterTask::GetTrack(const Int_t i) const
-{
-  return dynamic_cast<AliAODTrack*>(fTracksIn->At(i));
-}
-
-//________________________________________________________________________
-Int_t AliEmcalAodTrackFilterTask::GetNumberOfTracks() const
-{
-  return fTracksIn->GetEntriesFast();
-}
diff --git a/PWGGA/EMCALTasks/AliEmcalAodTrackFilterTask.h b/PWGGA/EMCALTasks/AliEmcalAodTrackFilterTask.h
deleted file mode 100644 (file)
index 9031c33..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef ALIEMCALAODTRACKFILTERTASK_H
-#define ALIEMCALAODTRACKFILTERTASK_H
-
-// $Id: AliEmcalAodTrackFilterTask.h 54003 2012-01-19 16:40:42Z loizides $
-
-class TClonesArray;
-class AliAODEvent;
-class AliAODTrack;
-
-#include "AliAnalysisTaskSE.h"
-
-class AliEmcalAodTrackFilterTask : public AliAnalysisTaskSE {
- public:
-  AliEmcalAodTrackFilterTask();
-  AliEmcalAodTrackFilterTask(const char *name);
-  virtual ~AliEmcalAodTrackFilterTask();
-
-  void UserCreateOutputObjects();
-  void UserExec(Option_t *option);
-  void SetRunPeriod(const char *p);
-  Bool_t AcceptTrack(AliAODTrack *track);
-  void RetrieveEventObjects();
-  AliAODTrack* GetTrack(const Int_t i) const;
-  Int_t GetNumberOfTracks() const;
-   
-  void SetAODfilterBit(Int_t b)                  { fAODfilterBit     = b;    }
-  void SetTracksName(const char *name)           { fTracksOutName    = name; }
-  void SetTracksIn(const char *name)             { fTracksInName     = name; }
-
- protected:
-  Int_t              fAODfilterBit;         // if true then do vertex constraint
-  TString            fTracksOutName;        // name of output tracks 
-  TString            fTracksInName;         // name of input tracks
-  AliAODEvent       *fAOD;                  //!aod event
-  TClonesArray      *fTracksIn;             //!track array in
-  TClonesArray      *fTracksOut;            //!track array out
-
- private:
-  AliEmcalAodTrackFilterTask(const AliEmcalAodTrackFilterTask&);            // not implemented
-  AliEmcalAodTrackFilterTask &operator=(const AliEmcalAodTrackFilterTask&); // not implemented
-
-  ClassDef(AliEmcalAodTrackFilterTask, 1); // Class to filter hybrid tracks in AOD events
-};
-
-#endif
index 9efcaa2..5311679 100644 (file)
@@ -15,6 +15,7 @@
 #include "AliEmcalJet.h"
 #include "AliFJWrapper.h"
 #include "AliAODTrack.h"
+#include "AliESDtrack.h"
 #include "AliESDtrackCuts.h"
 #include "AliEmcalJet.h"
 #include "AliVEventHandler.h"
@@ -31,11 +32,13 @@ AliEmcalIsolatedPhotonsTask::AliEmcalIsolatedPhotonsTask() :
   fTracksName("Tracks"),
   fCaloName("CaloClusters"),
   fJetsName("Jets"),
+  fTrgClusName("ClustersL1GAMMAFEE"),
   fESDTrackCuts(0),
   fFilterBit(16),
   fTracks(0),
   fCaloClusters(0),
   fJets(0),
+  fTrgClusters(0),
   fHistTracksPt(0),
   fHistClustersEnergy(0),
   fHistEPcorrelation(0),
@@ -46,6 +49,7 @@ AliEmcalIsolatedPhotonsTask::AliEmcalIsolatedPhotonsTask() :
   fHistTrPhiEta(0),
   fHistClusPhiEta(0),
   fHistJetPhiEta(0),
+  fHistMaxTrgCluster(0),
   Ptbins(100),
   Ptlow(0),
   Ptup(50),
@@ -64,11 +68,13 @@ AliEmcalIsolatedPhotonsTask::AliEmcalIsolatedPhotonsTask(const char *name) :
   fTracksName("Tracks"),
   fCaloName("CaloClusters"),
   fJetsName("Jets"),
+  fTrgClusName("ClustersL1GAMMAFEE"),
   fESDTrackCuts(0),
   fFilterBit(16),
   fTracks(0),
   fCaloClusters(0),
   fJets(0),
+  fTrgClusters(0),
   fHistTracksPt(0),
   fHistClustersEnergy(0),
   fHistEPcorrelation(0),
@@ -79,6 +85,7 @@ AliEmcalIsolatedPhotonsTask::AliEmcalIsolatedPhotonsTask(const char *name) :
   fHistTrPhiEta(0),
   fHistClusPhiEta(0),
   fHistJetPhiEta(0),
+  fHistMaxTrgCluster(0),
   Ptbins(100),
   Ptlow(0),
   Ptup(50),
@@ -115,7 +122,7 @@ void AliEmcalIsolatedPhotonsTask::UserCreateOutputObjects()
   
   AliVEventHandler* handler = AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler();
   
-  if( handler && handler->InheritsFrom("AliESDInputHandler") ) {
+  if (handler && handler->InheritsFrom("AliESDInputHandler")) {
 
     if (!fESDTrackCuts) fESDTrackCuts = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
     
@@ -128,13 +135,6 @@ void AliEmcalIsolatedPhotonsTask::UserCreateOutputObjects()
       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]");
@@ -185,7 +185,33 @@ void AliEmcalIsolatedPhotonsTask::UserCreateOutputObjects()
   fHistJetPhiEta->GetXaxis()->SetTitle("Eta");
   fHistJetPhiEta->GetYaxis()->SetTitle("Phi");
   fOutput->Add(fHistJetPhiEta);
-       
+
+  fHistMaxTrgCluster = new TH1F("fHistMaxTrgCluster","Energy distribution of max trigger clusters", Ebins, Elow, Eup);
+  fHistMaxTrgCluster->GetXaxis()->SetTitle("E [GeV]");
+  fHistMaxTrgCluster->GetYaxis()->SetTitle("counts");
+  fOutput->Add(fHistMaxTrgCluster);
+
+  for (Int_t i = 0; i < 3; i++) {
+    TString histnamephi("fHistTrackPhi_");
+    histnamephi += i;
+    fHistTrackPhi[i] = new TH1F(histnamephi.Data(),histnamephi.Data(), 32, 0, 6.4);
+    fHistTrackPhi[i]->GetXaxis()->SetTitle("Phi");
+    fOutput->Add(fHistTrackPhi[i]);
+
+    TString histnameeta("fHistTrackEta_");
+    histnameeta += i;
+    fHistTrackEta[i] = new TH1F(histnameeta.Data(),histnameeta.Data(), 40, -2, 2);
+    fHistTrackEta[i]->GetXaxis()->SetTitle("Eta");
+    fOutput->Add(fHistTrackEta[i]);
+  }
+
+  fHistTrackPhi[0]->SetLineColor(kRed);
+  fHistTrackEta[0]->SetLineColor(kRed);
+  fHistTrackPhi[1]->SetLineColor(kBlue);
+  fHistTrackEta[1]->SetLineColor(kBlue);
+  fHistTrackPhi[2]->SetLineColor(kGreen);
+  fHistTrackEta[2]->SetLineColor(kGreen);
+
   PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram
 }
 
@@ -194,46 +220,84 @@ void AliEmcalIsolatedPhotonsTask::RetrieveEventObjects()
   fCaloClusters =  dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fCaloName));
   fTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTracksName));
   fJets = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fJetsName));
+  fTrgClusters =  dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTrgClusName));
 
   if (!fTracks) {
-    AliError(Form("ERROR: Could not retrieve tracks!")); 
+    AliWarning(Form("Could not retrieve tracks!")); 
   }
   if (!fCaloClusters) {
-    AliError(Form("ERROR: Could not retrieve clusters!")); 
+    AliWarning(Form("Could not retrieve clusters!")); 
   }
   if (!fJets) {
-    AliError(Form("ERROR: Could not retrieve jets!")); 
+    AliWarning(Form("Could not retrieve jets!")); 
+  }
+  if (!fTrgClusters) {
+    AliWarning(Form("Could not retrieve trigger clusters!")); 
   }
 }
 
 AliVTrack* AliEmcalIsolatedPhotonsTask::GetTrack(const Int_t i) const
 {
-  return dynamic_cast<AliVTrack*>(fTracks->At(i));
+  if (fTracks)
+    return dynamic_cast<AliVTrack*>(fTracks->At(i));
+  else
+    return 0;
 }
 
 Int_t AliEmcalIsolatedPhotonsTask::GetNumberOfTracks() const
 {
-  return fTracks->GetEntriesFast();
+  if (fTracks)
+    return fTracks->GetEntriesFast();
+  else
+    return 0;
 }
 
 AliVCluster* AliEmcalIsolatedPhotonsTask::GetCaloCluster(const Int_t i) const
-{
-  return dynamic_cast<AliVCluster*>(fCaloClusters->At(i));
+{ 
+  if (fCaloClusters)
+    return dynamic_cast<AliVCluster*>(fCaloClusters->At(i));
+  else
+    return 0;
 }
 
 Int_t AliEmcalIsolatedPhotonsTask::GetNumberOfCaloClusters() const
-{
-  return fCaloClusters->GetEntriesFast();
+{ 
+  if (fCaloClusters)
+    return fCaloClusters->GetEntriesFast();
+  else
+    return 0;
 }
 
 AliEmcalJet* AliEmcalIsolatedPhotonsTask::GetJet(const Int_t i) const
 {
-  return dynamic_cast<AliEmcalJet*>(fJets->At(i));
+  if (fJets)
+    return dynamic_cast<AliEmcalJet*>(fJets->At(i));
+  else
+    return 0;
 }
 
 Int_t AliEmcalIsolatedPhotonsTask::GetNumberOfJets() const
 {
-  return fJets->GetEntriesFast();
+  if (fJets)
+    return fJets->GetEntriesFast();
+  else
+    return 0;
+}
+
+AliVCluster* AliEmcalIsolatedPhotonsTask::GetTrgCluster(const Int_t i) const
+{
+  if (fTrgClusters)
+    return dynamic_cast<AliVCluster*>(fTrgClusters->At(i));
+  else
+    return 0;
+}
+
+Int_t AliEmcalIsolatedPhotonsTask::GetNumberOfTrgClusters() const
+{
+  if (fTrgClusters)
+    return fTrgClusters->GetEntriesFast();
+  else
+    return 0;
 }
 
 void AliEmcalIsolatedPhotonsTask::FillHistograms()
@@ -274,27 +338,49 @@ void AliEmcalIsolatedPhotonsTask::FillHistograms()
     if (!AcceptTrack(track)) continue;
 
     fHistTracksPt->Fill(track->Pt());
-    
-    if(track->InheritsFrom("AliExternalTrackParam")) {
-      AliExternalTrackParam *trackparam = dynamic_cast<AliExternalTrackParam*>(track);
-      fHistTrPhiEta->Fill(trackparam->Eta(), trackparam->Phi());
+
+    Int_t clId = track->GetEMCALcluster();
+    if (clId > -1) {
+      AliVCluster* cluster = GetCaloCluster(clId);
+      if (cluster)
+       fHistEPcorrelation->Fill(track->P(),cluster->E());
+    } 
+
+    Float_t eta,phi;
+    Int_t label;
+
+    if(track->InheritsFrom("AliESDtrack")) {
+      AliESDtrack *esdtrack = dynamic_cast<AliESDtrack*>(track);
+      eta = esdtrack->Eta();
+      phi = esdtrack->Phi();
+      label = esdtrack->GetLabel();
     }
     else if (track->InheritsFrom("AliAODTrack")) {
       AliAODTrack *aodtrack = dynamic_cast<AliAODTrack*>(track);
-      fHistTrPhiEta->Fill(aodtrack->Eta(), aodtrack->Phi());
+      eta = aodtrack->Eta();
+      phi = aodtrack->Phi();
+      label = aodtrack->GetLabel();
     }
     else if (track->InheritsFrom("AliPicoTrack")) {
       AliPicoTrack *picotrack = dynamic_cast<AliPicoTrack*>(track);
-      fHistTrPhiEta->Fill(picotrack->Eta(), picotrack->Phi());
+      eta = picotrack->Eta();
+      phi = picotrack->Phi();
+      label = picotrack->GetLabel();
+    }
+    else {
+      AliWarning("Track type not recognized! Will not plot phi\eta distributions!");
+      continue;
     }
 
-    Int_t clId = track->GetEMCALcluster();
-    if (clId > -1) {
-      AliVCluster* cluster = GetCaloCluster(clId);
-      if (cluster)
-       fHistEPcorrelation->Fill(track->P(),cluster->E());
-    } 
-    
+    fHistTrPhiEta->Fill(eta, phi);
+
+    if (label >= 0 && label < 3) {
+      fHistTrackEta[label]->Fill(eta);
+      fHistTrackPhi[label]->Fill(phi);
+    }
+    else {
+      AliWarning(Form("Track label %d not recognized!",label));
+    }
   }
 
   // Jet loop
@@ -326,6 +412,25 @@ void AliEmcalIsolatedPhotonsTask::FillHistograms()
        fHistJetsZ->Fill(cluster->E() / jet->E());
     }
   } //jet loop 
+
+  Int_t ntrgclusters =  GetNumberOfTrgClusters();
+  Float_t maxe = 0;
+  //cout << ntrgclusters << " clusters" << endl;
+  for (Int_t iClusters = 0; iClusters < ntrgclusters; iClusters++) {
+    AliVCluster* cluster = GetTrgCluster(iClusters);
+    if (!cluster) {
+      printf("ERROR: Could not receive cluster %d\n", iClusters);
+      continue;
+    }  
+    
+    if (!(cluster->IsEMCAL())) continue;
+
+    if (cluster->E() > maxe)
+      maxe = cluster->E();
+
+  } //cluster loop 
+  fHistMaxTrgCluster->Fill(maxe);
+  
 }
 
 //________________________________________________________________________
index 332f759..65aa23f 100644 (file)
@@ -28,6 +28,7 @@ class AliEmcalIsolatedPhotonsTask : public AliAnalysisTaskSE {
   void                        SetClusName(const char *n)                    { fCaloName      = n          ; }
   void                        SetJetsName(const char *n)                    { fJetsName      = n          ; }
   void                        SetTracksName(const char *n)                  { fTracksName    = n          ; }
+  void                        SetTrgClusName(const char *n)                 { fTrgClusName   = n          ; }
   virtual void                SetTrackCuts(AliESDtrackCuts *cuts)           { fESDTrackCuts = cuts        ; }
   virtual AliESDtrackCuts    *GetTrackCuts()                          const { return fESDTrackCuts        ; }
   virtual void                SetAODFilterBit(const Int_t b)                { fFilterBit = b              ; }
@@ -41,6 +42,8 @@ class AliEmcalIsolatedPhotonsTask : public AliAnalysisTaskSE {
   Int_t                       GetNumberOfCaloClusters()        const;
   AliEmcalJet                *GetJet(const Int_t i)            const;
   Int_t                       GetNumberOfJets()                const;
+  AliVCluster                *GetTrgCluster(const Int_t i)     const;
+  Int_t                       GetNumberOfTrgClusters()         const;
   void                        FillHistograms()                      ;
   void                        RetrieveEventObjects()                ;
   Bool_t                      AcceptTrack(AliVTrack *track)         ;
@@ -50,11 +53,13 @@ class AliEmcalIsolatedPhotonsTask : public AliAnalysisTaskSE {
   TString                     fTracksName;             // name of track collection
   TString                     fCaloName;               // name of calo cluster collection
   TString                     fJetsName;               // name of jet collection
+  TString                     fTrgClusName;            // name of trg clus name
   AliESDtrackCuts            *fESDTrackCuts;           // Track cuts
   Int_t                       fFilterBit;              // AOD filter bit
   TClonesArray               *fTracks;                 //!Tracks
   TClonesArray               *fCaloClusters;           //!Clusters
   TClonesArray               *fJets;                   //!Jets
+  TClonesArray               *fTrgClusters;            //!Trg Clusters
   TH1F                       *fHistTracksPt;           // Pt spectrum of tracks
   TH1F                       *fHistClustersEnergy;     // Energy spectrum of clusters
   TH2F                       *fHistEPcorrelation;      // Energy-momentum correlation
@@ -65,6 +70,9 @@ class AliEmcalIsolatedPhotonsTask : public AliAnalysisTaskSE {
   TH2F                       *fHistTrPhiEta;           // Phi-Eta distribution of tracks
   TH2F                       *fHistClusPhiEta;         // Phi-Eta distribution of clusters
   TH2F                       *fHistJetPhiEta;          // Phi-Eta distribution of jets
+  TH1F                       *fHistMaxTrgCluster;      // Energy distribution of max trigger clusters
+  TH1F                       *fHistTrackPhi[3];        // Phi distribution of hybrid tracks
+  TH1F                       *fHistTrackEta[3];        // Eta distribution of hybrid tracks
 
   Int_t                       Ptbins;                  // No. of pt bins
   Float_t                     Ptlow;                   // Min pt
diff --git a/PWGGA/EMCALTasks/AliEmcalTenderTask.cxx b/PWGGA/EMCALTasks/AliEmcalTenderTask.cxx
new file mode 100644 (file)
index 0000000..0802735
--- /dev/null
@@ -0,0 +1,156 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id: AliEmcalTenderTask.cxx 48689 2011-03-23 21:35:50Z agheata $ */
+
+#include <TChain.h>
+#include <TFile.h>
+
+#include "TenderSupplies/AliEMCALTenderSupply.h"
+#include "AliAnalysisManager.h"
+
+#include "AliEmcalTenderTask.h"
+
+ClassImp(AliEmcalTenderTask)
+
+//______________________________________________________________________________
+AliEmcalTenderTask::AliEmcalTenderTask():
+           AliAnalysisTaskSE(),
+           fEMCALTender(NULL)
+{
+// Dummy constructor
+}
+
+//______________________________________________________________________________
+AliEmcalTenderTask::AliEmcalTenderTask(const char* name):
+           AliAnalysisTaskSE(name),
+           fEMCALTender(NULL)
+{
+// Default constructor
+  //DefineOutput(1,  AliESDEvent::Class());
+}
+
+//______________________________________________________________________________
+AliEmcalTenderTask::~AliEmcalTenderTask()
+{
+// Destructor
+  if (fEMCALTender)
+    fEMCALTender->Delete();
+}
+
+//______________________________________________________________________________
+void AliEmcalTenderTask::SetEMCALTenderSupply(AliEMCALTenderSupply *supply)
+{
+  fEMCALTender = supply;
+  supply->SetTask(this);
+}
+   
+//______________________________________________________________________________
+void AliEmcalTenderTask::ConnectInputData(Option_t *option)
+{
+  AliAnalysisTaskSE::ConnectInputData(option);
+  fEMCALTender->Init();
+}
+
+//______________________________________________________________________________
+void AliEmcalTenderTask::UserCreateOutputObjects()
+{
+// Nothing for the moment, but we may need ESD/AOD event replication here.
+}
+
+//______________________________________________________________________________
+void AliEmcalTenderTask::UserExec(Option_t* option)
+{
+  fEMCALTender->ProcessEvent();
+}
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id: AliEmcalTenderTask.cxx 48689 2011-03-23 21:35:50Z agheata $ */
+
+#include <TChain.h>
+#include <TFile.h>
+
+#include "TenderSupplies/AliEMCALTenderSupply.h"
+#include "AliAnalysisManager.h"
+
+#include "AliEmcalTenderTask.h"
+
+ClassImp(AliEmcalTenderTask)
+
+//______________________________________________________________________________
+AliEmcalTenderTask::AliEmcalTenderTask():
+           AliAnalysisTaskSE(),
+           fEMCALTender(NULL)
+{
+// Dummy constructor
+}
+
+//______________________________________________________________________________
+AliEmcalTenderTask::AliEmcalTenderTask(const char* name):
+           AliAnalysisTaskSE(name),
+           fEMCALTender(NULL)
+{
+// Default constructor
+  //DefineOutput(1,  AliESDEvent::Class());
+}
+
+//______________________________________________________________________________
+AliEmcalTenderTask::~AliEmcalTenderTask()
+{
+// Destructor
+  if (fEMCALTender)
+    fEMCALTender->Delete();
+}
+
+//______________________________________________________________________________
+void AliEmcalTenderTask::SetEMCALTenderSupply(AliEMCALTenderSupply *supply)
+{
+  fEMCALTender = supply;
+  supply->SetTask(this);
+}
+   
+//______________________________________________________________________________
+void AliEmcalTenderTask::ConnectInputData(Option_t *option)
+{
+  AliAnalysisTaskSE::ConnectInputData(option);
+  fEMCALTender->Init();
+}
+
+//______________________________________________________________________________
+void AliEmcalTenderTask::UserCreateOutputObjects()
+{
+// Nothing for the moment, but we may need ESD/AOD event replication here.
+}
+
+//______________________________________________________________________________
+void AliEmcalTenderTask::UserExec(Option_t* option)
+{
+  fEMCALTender->ProcessEvent();
+}
diff --git a/PWGGA/EMCALTasks/AliEmcalTenderTask.h b/PWGGA/EMCALTasks/AliEmcalTenderTask.h
new file mode 100644 (file)
index 0000000..511e0b0
--- /dev/null
@@ -0,0 +1,76 @@
+#ifndef ALIEMCALTENDERTASK_H
+#define ALIEMCAKTENDERTASK_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id: AliEmcalTenderTask.h  $ */
+
+
+#ifndef ALIANALYSISTASKSE_H
+#include "AliAnalysisTaskSE.h"
+#endif
+
+class AliEMCALTenderSupply;
+
+class AliEmcalTenderTask : public AliAnalysisTaskSE {
+
+protected:
+  AliEMCALTenderSupply      *fEMCALTender;
+  
+private:
+  AliEmcalTenderTask(const AliEmcalTenderTask &other);
+  AliEmcalTenderTask& operator=(const AliEmcalTenderTask &other);
+
+public:  
+  AliEmcalTenderTask();
+  AliEmcalTenderTask(const char *name);
+  virtual ~AliEmcalTenderTask();
+
+  void                      SetEMCALTenderSupply(AliEMCALTenderSupply *supply);
+
+  // Run control
+  virtual void              ConnectInputData(Option_t *option);
+  virtual void              UserCreateOutputObjects();
+  virtual void              UserExec(Option_t *option);
+    
+  ClassDef(AliEmcalTenderTask,1) 
+};
+#endif
+#ifndef ALIEMCALTENDERTASK_H
+#define ALIEMCAKTENDERTASK_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id: AliEmcalTenderTask.h  $ */
+
+
+#ifndef ALIANALYSISTASKSE_H
+#include "AliAnalysisTaskSE.h"
+#endif
+
+class AliEMCALTenderSupply;
+
+class AliEmcalTenderTask : public AliAnalysisTaskSE {
+
+protected:
+  AliEMCALTenderSupply      *fEMCALTender;
+  
+private:
+  AliEmcalTenderTask(const AliEmcalTenderTask &other);
+  AliEmcalTenderTask& operator=(const AliEmcalTenderTask &other);
+
+public:  
+  AliEmcalTenderTask();
+  AliEmcalTenderTask(const char *name);
+  virtual ~AliEmcalTenderTask();
+
+  void                      SetEMCALTenderSupply(AliEMCALTenderSupply *supply);
+
+  // Run control
+  virtual void              ConnectInputData(Option_t *option);
+  virtual void              UserCreateOutputObjects();
+  virtual void              UserExec(Option_t *option);
+    
+  ClassDef(AliEmcalTenderTask,1) 
+};
+#endif
diff --git a/PWGGA/EMCALTasks/macros/AddTaskEmcalAodTender.C b/PWGGA/EMCALTasks/macros/AddTaskEmcalAodTender.C
new file mode 100644 (file)
index 0000000..6a55357
--- /dev/null
@@ -0,0 +1,160 @@
+AliEmcalTenderTask *AddTaskEmcalAodTender(const char *geoname="EMCAL_COMPLETEV1", const char* datatype="pp")
+{
+  // Parameters: geoname = "EMCAL_FIRSTYEARV1" or "EMCAL_COMPLETEV1" or ""
+
+  // Get the pointer to the existing analysis manager via the static access method.
+  //==============================================================================
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr) {
+    ::Error("AddTaskTrgContam", "No analysis manager to connect to.");
+    return NULL;
+  }  
+  
+  // Create the task and configure it.
+  //===========================================================================
+  AliEmcalTenderTask* ana = new  AliEmcalTenderTask("AliEmcalTenderTask");
+
+  ana->SelectCollisionCandidates( AliVEvent::kEMC1 | AliVEvent::kMB | AliVEvent::kEMC7 | AliVEvent::kINT7);
+  
+  Bool_t ismc = (mgr->GetMCtruthEventHandler() != NULL);
+
+  mgr->AddTask(ana);
+  // Adding EMCAL supply
+  AliEMCALTenderSupply *EMCALSupply=new AliEMCALTenderSupply("EMCALtender");  
+  EMCALSupply->SetDebugLevel(2);
+
+  AliEMCALRecParam *params = new AliEMCALRecParam();
+  params->SetClusteringThreshold(0.1); // 100 MeV
+  params->SetMinECut(0.05); //50 MeV  
+  params->SetW0(4.5);
+  params->SetTimeCut(1e6);//Open this cut for AODs
+  params->SetTimeMin(-1);//Open this cut for AODs
+  params->SetTimeMax(1e6);//Open this cut for AODs
+  EMCALSupply->SetRecParam(params);
+
+  EMCALSupply->SetEMCALGeometryName(geoname);  
+
+  EMCALSupply->SwitchOffCellFiducialRegion(); //Does NOT remove edge clusters
+  if (!ismc) {
+    if (1){//datatype == "pp") {
+      //::Info("AddTaskEMCALTender", "USING pp data configuration...");
+      //params->SetClusterizerFlag(AliEMCALRecParam::kClusterizerv2); //Std for pbpb
+      EMCALSupply->SwitchOnRecalDistBadChannel();
+      EMCALSupply->SwitchOnReCalibrateCluster();
+      EMCALSupply->SwitchOnRecalculateClusPos();
+      //EMCALSupply->SetNonLinearityFunction(AliEMCALTenderSupply::kBeamTestCorrected);
+      //EMCALSupply->SwitchOnUpdateCell(); // will update cells and reclusterize
+      //EMCALSupply->SwitchOnReclustering(); //SwitchOnReclustering if needed      
+    } else {
+      //::Info("AddTaskEMCALTender", "USING PbPb data configuration...");
+      //params->SetClusterizerFlag(AliEMCALRecParam::kClusterizerv2); //Std for pbpb
+      EMCALSupply->SwitchOnUpdateCell(); // will update cells and reclusterize
+      //EMCALSupply->SwitchOnReclustering(); //SwitchOnReclustering if needed      
+    }
+  } else {
+    ::Info("AddTaskEMCALTender", "USING MC configuration...");
+  }
+  EMCALSupply->SetMass(0.139);
+  //EMCALSupply->SetStep(5);
+  //EMCALSupply->SwitchOnCutEtaPhiSum(); 
+  //EMCALSupply->SetRCut(0.0025);
+
+  EMCALSupply->SwitchOnCutEtaPhiSeparate();
+  EMCALSupply->SetEtaCut(0.025);
+  EMCALSupply->SetPhiCut(0.05);
+
+  ana->SetEMCALTenderSupply(EMCALSupply);
+  // Create ONLY the output containers for the data produced by the task.
+  // Get and connect other common input/output containers via the manager as below
+  //==============================================================================
+  /*AliAnalysisDataContainer *coutput1 = 
+    mgr->CreateContainer("tender_event", 
+                         AliESDEvent::Class(), 
+                         AliAnalysisManager::kExchangeContainer,
+                         "default_tender");
+  */
+  mgr->ConnectInput  (ana, 0, mgr->GetCommonInputContainer());
+  //mgr->ConnectOutput (ana, 1, coutput1 );
+   
+  return ana;
+}
+AliEmcalTenderTask *AddTaskEmcalAodTender(const char *geoname="EMCAL_COMPLETEV1", const char* datatype="pp")
+{
+  // Parameters: geoname = "EMCAL_FIRSTYEARV1" or "EMCAL_COMPLETEV1" or ""
+
+  // Get the pointer to the existing analysis manager via the static access method.
+  //==============================================================================
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr) {
+    ::Error("AddTaskTrgContam", "No analysis manager to connect to.");
+    return NULL;
+  }  
+  
+  // Create the task and configure it.
+  //===========================================================================
+  AliEmcalTenderTask* ana = new  AliEmcalTenderTask("AliEmcalTenderTask");
+
+  ana->SelectCollisionCandidates( AliVEvent::kEMC1 | AliVEvent::kMB | AliVEvent::kEMC7 | AliVEvent::kINT7);
+  
+  Bool_t ismc = (mgr->GetMCtruthEventHandler() != NULL);
+
+  mgr->AddTask(ana);
+  // Adding EMCAL supply
+  AliEMCALTenderSupply *EMCALSupply=new AliEMCALTenderSupply("EMCALtender");  
+  EMCALSupply->SetDebugLevel(2);
+
+  AliEMCALRecParam *params = new AliEMCALRecParam();
+  params->SetClusteringThreshold(0.1); // 100 MeV
+  params->SetMinECut(0.05); //50 MeV  
+  params->SetW0(4.5);
+  params->SetTimeCut(1e6);//Open this cut for AODs
+  params->SetTimeMin(-1);//Open this cut for AODs
+  params->SetTimeMax(1e6);//Open this cut for AODs
+  EMCALSupply->SetRecParam(params);
+
+  EMCALSupply->SetEMCALGeometryName(geoname);  
+
+  EMCALSupply->SwitchOffCellFiducialRegion(); //Does NOT remove edge clusters
+  if (!ismc) {
+    if (1){//datatype == "pp") {
+      //::Info("AddTaskEMCALTender", "USING pp data configuration...");
+      //params->SetClusterizerFlag(AliEMCALRecParam::kClusterizerv2); //Std for pbpb
+      EMCALSupply->SwitchOnRecalDistBadChannel();
+      EMCALSupply->SwitchOnReCalibrateCluster();
+      EMCALSupply->SwitchOnRecalculateClusPos();
+      //EMCALSupply->SetNonLinearityFunction(AliEMCALTenderSupply::kBeamTestCorrected);
+      //EMCALSupply->SwitchOnUpdateCell(); // will update cells and reclusterize
+      //EMCALSupply->SwitchOnReclustering(); //SwitchOnReclustering if needed      
+    } else {
+      //::Info("AddTaskEMCALTender", "USING PbPb data configuration...");
+      //params->SetClusterizerFlag(AliEMCALRecParam::kClusterizerv2); //Std for pbpb
+      EMCALSupply->SwitchOnUpdateCell(); // will update cells and reclusterize
+      //EMCALSupply->SwitchOnReclustering(); //SwitchOnReclustering if needed      
+    }
+  } else {
+    ::Info("AddTaskEMCALTender", "USING MC configuration...");
+  }
+  EMCALSupply->SetMass(0.139);
+  //EMCALSupply->SetStep(5);
+  //EMCALSupply->SwitchOnCutEtaPhiSum(); 
+  //EMCALSupply->SetRCut(0.0025);
+
+  EMCALSupply->SwitchOnCutEtaPhiSeparate();
+  EMCALSupply->SetEtaCut(0.025);
+  EMCALSupply->SetPhiCut(0.05);
+
+  ana->SetEMCALTenderSupply(EMCALSupply);
+  // Create ONLY the output containers for the data produced by the task.
+  // Get and connect other common input/output containers via the manager as below
+  //==============================================================================
+  /*AliAnalysisDataContainer *coutput1 = 
+    mgr->CreateContainer("tender_event", 
+                         AliESDEvent::Class(), 
+                         AliAnalysisManager::kExchangeContainer,
+                         "default_tender");
+  */
+  mgr->ConnectInput  (ana, 0, mgr->GetCommonInputContainer());
+  //mgr->ConnectOutput (ana, 1, coutput1 );
+   
+  return ana;
+}
index dd48df0..e69de29 100644 (file)
@@ -1,51 +0,0 @@
-AliEmcalAodTrackFilterTask* AddTaskEmcalAodTrackFilter(
-                                                      const char *name       = "PicoTracks",
-                                                      const char *inname     = "tracks",
-                                                      const char *runPeriod  = "LHC11h"
-                                                       )
-{  
-  // Get the pointer to the existing analysis manager via the static access method.
-  //==============================================================================
-  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
-  if (!mgr)
-  {
-    ::Error("AddTaskEmcalAodTrackFilter", "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("AddTaskEmcalAodTrackFilter", "This task requires an input event handler");
-    return NULL;
-  }
-  
-  //-------------------------------------------------------
-  // Init the task and do settings
-  //-------------------------------------------------------
-
-  // Add aod track filter task.
-
-
-  AliEmcalAodTrackFilterTask *eTask = new AliEmcalAodTrackFilterTask();
-  eTask->SetTracksName(name);
-  eTask->SetTracksIn(inname);
-  eTask->SetRunPeriod(runPeriod);
-
-  //-------------------------------------------------------
-  // 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;
-  
-}
index 5a7a8b2..7636408 100644 (file)
@@ -2,6 +2,7 @@ AliEmcalIsolatedPhotonsTask* AddTaskEmcalIsolatedPhotons(
                                                       const char *ntracks            = "Tracks",
                                                       const char *nclusters          = "CaloClusters",
                                                       const char *njets              = "Jets",
+                                                      const char *ntrgclusters       = "ClustersL1GAMMAFEE",
                                                       const Int_t AODtrackFilterBit  = 256  // hybrid LHC11h tracks
                                                        )
 {  
@@ -30,6 +31,7 @@ AliEmcalIsolatedPhotonsTask* AddTaskEmcalIsolatedPhotons(
   phTask->SetTracksName(ntracks);
   phTask->SetClusName(nclusters);
   phTask->SetJetsName(njets);
+  phTask->SetTrgClusName(ntrgclusters);
   phTask->SetAODFilterBit(AODtrackFilterBit); // global hybrids for LHC11h
 
   //-------------------------------------------------------
index ef63213..1d063ef 100644 (file)
@@ -19,7 +19,8 @@
 #pragma link C++ class AliEmcalSetupTask+;
 #pragma link C++ class AliEmcalTrackPropagatorTask+;
 #pragma link C++ class AliEmcalIsolatedPhotonsTask+;
-#pragma link C++ class AliEmcalAodTrackFilterTask+;
+#pragma link C++ class AliEmcalPicoTrackMaker+;
+#pragma link C++ class AliEmcalTenderTask+;
 #pragma link C++ class AliEsdSkimTask+;
 #pragma link C++ class AliEsdTrackExt+;
 #pragma link C++ class AliPicoTrack+;