fixing the trunk compilaton error by adding the correct files
authormcosenti <mcosenti@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 24 Apr 2012 08:01:39 +0000 (08:01 +0000)
committermcosenti <mcosenti@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 24 Apr 2012 08:01:39 +0000 (08:01 +0000)
PWGGA/EMCALTasks/AliEmcalIsolatedPhotonsTask.cxx
PWGGA/EMCALTasks/AliEmcalIsolatedPhotonsTask.h
PWGGA/EMCALTasks/AliEmcalPicoTrackMaker.cxx [new file with mode: 0644]
PWGGA/EMCALTasks/AliEmcalPicoTrackMaker.h [new file with mode: 0644]
PWGGA/EMCALTasks/AliEmcalTenderTask.cxx
PWGGA/EMCALTasks/AliEmcalTenderTask.h
PWGGA/EMCALTasks/macros/AddTaskEmcalAodTender.C
PWGGA/EMCALTasks/macros/AddTaskEmcalAodTrackFilter.C [deleted file]
PWGGA/EMCALTasks/macros/AddTaskEmcalPicoTrackMaker.C [new file with mode: 0644]

index 5311679..6c314da 100644 (file)
@@ -191,7 +191,7 @@ void AliEmcalIsolatedPhotonsTask::UserCreateOutputObjects()
   fHistMaxTrgCluster->GetYaxis()->SetTitle("counts");
   fOutput->Add(fHistMaxTrgCluster);
 
-  for (Int_t i = 0; i < 3; i++) {
+  for (Int_t i = 0; i < 4; i++) {
     TString histnamephi("fHistTrackPhi_");
     histnamephi += i;
     fHistTrackPhi[i] = new TH1F(histnamephi.Data(),histnamephi.Data(), 32, 0, 6.4);
@@ -211,6 +211,8 @@ void AliEmcalIsolatedPhotonsTask::UserCreateOutputObjects()
   fHistTrackEta[1]->SetLineColor(kBlue);
   fHistTrackPhi[2]->SetLineColor(kGreen);
   fHistTrackEta[2]->SetLineColor(kGreen);
+  fHistTrackPhi[3]->SetLineColor(kBlack);
+  fHistTrackEta[3]->SetLineColor(kBlack);
 
   PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram
 }
@@ -373,6 +375,8 @@ void AliEmcalIsolatedPhotonsTask::FillHistograms()
     }
 
     fHistTrPhiEta->Fill(eta, phi);
+    fHistTrackEta[3]->Fill(eta);
+    fHistTrackPhi[3]->Fill(phi);
 
     if (label >= 0 && label < 3) {
       fHistTrackEta[label]->Fill(eta);
index 65aa23f..37d4d10 100644 (file)
@@ -71,8 +71,8 @@ class AliEmcalIsolatedPhotonsTask : public AliAnalysisTaskSE {
   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
+  TH1F                       *fHistTrackPhi[4];        // Phi distribution of hybrid tracks
+  TH1F                       *fHistTrackEta[4];        // Eta distribution of hybrid tracks
 
   Int_t                       Ptbins;                  // No. of pt bins
   Float_t                     Ptlow;                   // Min pt
diff --git a/PWGGA/EMCALTasks/AliEmcalPicoTrackMaker.cxx b/PWGGA/EMCALTasks/AliEmcalPicoTrackMaker.cxx
new file mode 100644 (file)
index 0000000..230ae4b
--- /dev/null
@@ -0,0 +1,185 @@
+// $Id: AliEmcalPicoTrackMaker.cxx  $
+//
+// Class to make PicoTracks in AOD/ESD events.
+//
+//
+
+#include <TClonesArray.h>
+
+#include "AliAnalysisManager.h"
+#include "AliVEvent.h"
+#include "AliPicoTrack.h"
+#include "AliVTrack.h"
+#include "AliAODTrack.h"
+#include "AliESDtrack.h"
+#include "AliESDtrackCuts.h"
+#include "AliLog.h"
+
+#include "AliEmcalPicoTrackMaker.h"
+
+ClassImp(AliEmcalPicoTrackMaker)
+
+//________________________________________________________________________
+AliEmcalPicoTrackMaker::AliEmcalPicoTrackMaker() : 
+  AliAnalysisTaskSE("AliEmcalPicoTrackMaker"),
+  fESDtrackCuts(0),
+  fTracksOutName("PicoTracks"),
+  fTracksInName("tracks"),
+  fTracksIn(0),
+  fTracksOut(0)
+{
+  // Constructor.
+}
+
+//________________________________________________________________________
+AliEmcalPicoTrackMaker::AliEmcalPicoTrackMaker(const char *name) : 
+  AliAnalysisTaskSE("AliEmcalPicoTrackMaker"),
+  fESDtrackCuts(0),
+  fTracksOutName("PicoTracks"),
+  fTracksInName("tracks"),
+  fTracksIn(0),
+  fTracksOut(0)
+{
+  // Constructor.
+
+  if (!name)
+    return;
+
+  SetName(name);
+
+  fBranchNames = "ESD:AliESDHeader.,AliESDRun.,SPDVertex.,Tracks";
+}
+
+//________________________________________________________________________
+AliEmcalPicoTrackMaker::~AliEmcalPicoTrackMaker()
+{
+  //Destructor
+
+}
+
+//________________________________________________________________________
+void AliEmcalPicoTrackMaker::UserCreateOutputObjects()
+{
+  // Create histograms.
+
+  fTracksOut = new TClonesArray("AliPicoTrack");
+  fTracksOut->SetName(fTracksOutName);
+}
+
+//________________________________________________________________________
+void AliEmcalPicoTrackMaker::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) {
+    AliVTrack *track = GetTrack(iTracks);
+    
+    if (!AcceptTrack(track))
+      continue;
+
+    Int_t label = 0;
+
+    if (track->InheritsFrom("AliAODTrack")) {
+      AliAODTrack *aodtrack = dynamic_cast<AliAODTrack*>(track);
+      if (aodtrack->TestFilterBit(fAODfilterBits[0]))
+       label = 0;
+      else if (aodtrack->TestFilterBit(fAODfilterBits[1]))
+       label = 1;
+      else //if (aodtrack->TestFilterBit(fAODfilterBits[2]))
+       label = 2;
+    }
+    else {
+      label = track->GetLabel();
+    }
+
+    AliPicoTrack *picotrack = new ((*fTracksOut)[nacc]) AliPicoTrack(track->Pt(), track->Eta(), track->Phi(), 
+                                          track->Charge(), label, 
+                                          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 AliEmcalPicoTrackMaker::AcceptTrack(AliVTrack *track)
+{
+  if (!track)
+    return kFALSE;
+
+  if (track->InheritsFrom("AliAODTrack")) {
+    AliAODTrack *aodtrack = dynamic_cast<AliAODTrack*>(track);
+    if (aodtrack) {
+      //cout << "filter bit = " << fFilterBit << ", filter map = " << aodtrack->GetFilterMap() << endl;
+      return aodtrack->TestFilterBit(fAODfilterBits[0]+fAODfilterBits[1]+fAODfilterBits[2]);
+      //return aodtrack->IsHybridGlobalConstrainedGlobal();
+    }
+    else {
+      AliError("Could not cast AOD track!");
+      return kFALSE;
+    }
+  }
+  else if (track->InheritsFrom("AliESDtrack")) { 
+    if (fESDtrackCuts) {
+      AliESDtrack *esdtrack = dynamic_cast<AliESDtrack*>(track);
+      if (esdtrack) {
+       return fESDtrackCuts->AcceptTrack(esdtrack);
+      }
+      else {
+       AliError("Could not cast ESD track!");
+       return kFALSE;
+      }
+    }
+    else {
+      return kTRUE;
+    }
+  }
+  else if (track->InheritsFrom("PicoTrack")) {
+    AliWarning("PicoTrack: nothing to filter!");
+    return kTRUE;
+  }
+}
+
+//________________________________________________________________________
+void AliEmcalPicoTrackMaker::RetrieveEventObjects()
+{
+  fTracksIn = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTracksInName));
+
+  if (!fTracksIn) {
+    AliError(Form("ERROR: Could not retrieve tracks %s!", fTracksInName.Data())); 
+  }
+}
+
+//________________________________________________________________________
+AliVTrack* AliEmcalPicoTrackMaker::GetTrack(const Int_t i) const
+{
+  if (fTracksIn)
+    return dynamic_cast<AliVTrack*>(fTracksIn->At(i));
+  else
+    return 0;
+}
+
+//________________________________________________________________________
+Int_t AliEmcalPicoTrackMaker::GetNumberOfTracks() const
+{
+  if (fTracksIn)
+    return fTracksIn->GetEntriesFast();
+  else
+    return 0;
+}
diff --git a/PWGGA/EMCALTasks/AliEmcalPicoTrackMaker.h b/PWGGA/EMCALTasks/AliEmcalPicoTrackMaker.h
new file mode 100644 (file)
index 0000000..3f32a73
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef ALIEMCALPICOTRACKMAKER_H
+#define ALIEMCALPICOTRACKMAKER_H
+
+// $Id: AliEmcalPicoTrackMaker.h 54003 2012-01-19 16:40:42Z loizides $
+
+class TClonesArray;
+class AliVEvent;
+class AliVTrack;
+class AliESDtrackCuts;
+
+#include "AliAnalysisTaskSE.h"
+
+class AliEmcalPicoTrackMaker : public AliAnalysisTaskSE {
+ public:
+  AliEmcalPicoTrackMaker();
+  AliEmcalPicoTrackMaker(const char *name);
+  virtual ~AliEmcalPicoTrackMaker();
+
+  void UserCreateOutputObjects();
+  void UserExec(Option_t *option);
+
+  void SetAODfilterBits(Int_t b0 = 0, Int_t b1 = 0, Int_t b2 = 0)      { fAODfilterBits[0] = b0; fAODfilterBits[1] = b1; fAODfilterBits[2] = b2; }
+  void SetTracksOutName(const char *name)                              { fTracksOutName    = name; }
+  void SetTracksInName(const char *name)                               { fTracksInName     = name; }
+  void SetESDtrackCuts(AliESDtrackCuts *cuts)                          { fESDtrackCuts     = cuts; }
+
+ protected:
+  Bool_t             AcceptTrack(AliVTrack *track)        ;
+  void               RetrieveEventObjects()               ;
+  AliVTrack*         GetTrack(const Int_t i)         const;
+  Int_t              GetNumberOfTracks()             const;
+
+  Int_t              fAODfilterBits[3];     // AOD track filter bit map
+  AliESDtrackCuts   *fESDtrackCuts;         // ESD track cuts
+  TString            fTracksOutName;        // Name of output track array
+  TString            fTracksInName;         // Name of input track array
+  TClonesArray      *fTracksIn;             //!Track array in
+  TClonesArray      *fTracksOut;            //!Track array out
+
+ private:
+  AliEmcalPicoTrackMaker(const AliEmcalPicoTrackMaker&);            // not implemented
+  AliEmcalPicoTrackMaker &operator=(const AliEmcalPicoTrackMaker&); // not implemented
+
+  ClassDef(AliEmcalPicoTrackMaker, 1); // Class to make PicoTracks in AOD/ESD events
+};
+
+#endif
index 0802735..5a4557f 100644 (file)
@@ -76,81 +76,3 @@ 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();
-}
index 511e0b0..f9ab6e6 100644 (file)
@@ -36,41 +36,3 @@ public:
   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
index 6a55357..af9068b 100644 (file)
@@ -78,83 +78,3 @@ AliEmcalTenderTask *AddTaskEmcalAodTender(const char *geoname="EMCAL_COMPLETEV1"
    
   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;
-}
diff --git a/PWGGA/EMCALTasks/macros/AddTaskEmcalAodTrackFilter.C b/PWGGA/EMCALTasks/macros/AddTaskEmcalAodTrackFilter.C
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/PWGGA/EMCALTasks/macros/AddTaskEmcalPicoTrackMaker.C b/PWGGA/EMCALTasks/macros/AddTaskEmcalPicoTrackMaker.C
new file mode 100644 (file)
index 0000000..e57bc6a
--- /dev/null
@@ -0,0 +1,55 @@
+AliEmcalPicoTrackMaker* AddTaskEmcalPicoTrackMaker(
+                                                      const char *name       = "PicoTracks",
+                                                      const char *inname     = "tracks",
+                                                      const char *runPeriod  = "LHC11h",
+                                                      AliESDtrackCuts *cuts  = 0
+                                                       )
+{  
+  // Get the pointer to the existing analysis manager via the static access method.
+  //==============================================================================
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr)
+  {
+    ::Error("AddTaskEmcalPicoTrackMaker", "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("AddTaskEmcalPicoTrackMaker", "This task requires an input event handler");
+    return NULL;
+  }
+  
+  //-------------------------------------------------------
+  // Init the task and do settings
+  //-------------------------------------------------------
+
+  // Add aod track filter task.
+
+  AliEmcalPicoTrackMaker *eTask = new AliEmcalPicoTrackMaker();
+  eTask->SetTracksOutName(name);
+  eTask->SetTracksInName(inname);
+  if (!strcmp(runPeriod, "LHC11h")) {
+    eTask->SetAODfilterBits(256,512,1024); // hybrid tracks for LHC11h
+  }
+  else {
+    AliWarning(Form("Run period %s not known. AOD filter bit not set.", renPeriod));
+  }
+  eTask->SetESDtrackCuts(cuts);
+
+  //-------------------------------------------------------
+  // Final settings, pass to manager and set the containers
+  //-------------------------------------------------------
+
+  mgr->AddTask(eTask);
+  
+  // Create containers for input/output
+  AliAnalysisDataContainer *cinput1  = mgr->GetCommonInputContainer();
+  
+  mgr->ConnectInput  (eTask, 0,  cinput1 );
+  
+  return eTask;
+  
+}