Refactoring of the charged particle pt task
authormfasel <mfasel@lbl.gov>
Sat, 6 Dec 2014 20:22:02 +0000 (12:22 -0800)
committermfasel <mfasel@lbl.gov>
Fri, 12 Dec 2014 01:12:31 +0000 (17:12 -0800)
=============================================================
Refactoring of the charged particle pt task in order to make it more
flexible for further studies. The analysis functionality is decoupled
from the task and moved to analysis components, which can be grouped by
common event selections. A combination of event data (reconstructed and
MC event), combined with the different EMCAL containers, are shared
among the task and the different analysis components. The task itself
only steers event building and the execution of the different analysis
components.

12 files changed:
PWGJE/CMakelibPWGJEEMCALJetTasks.pkg
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskPtEMCalTriggerV1.cxx [new file with mode: 0644]
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskPtEMCalTriggerV1.h [new file with mode: 0644]
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerEventData.cxx [new file with mode: 0644]
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerEventData.h [new file with mode: 0644]
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerEventSelection.cxx [new file with mode: 0644]
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerEventSelection.h [new file with mode: 0644]
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerTaskGroup.cxx [new file with mode: 0644]
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerTaskGroup.h [new file with mode: 0644]
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerTracksAnalysisComponent.cxx [new file with mode: 0644]
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerTracksAnalysisComponent.h [new file with mode: 0644]
PWGJE/PWGJEEMCALJetTasksLinkDef.h

index fd7663f..cab037f 100644 (file)
@@ -102,6 +102,11 @@ set ( SRCS
  EMCALJetTasks/UserTasks/AliEMCalPtTaskVTrackSelection.cxx
  EMCALJetTasks/UserTasks/AliEMCalPtTaskTrackSelectionESD.cxx
  EMCALJetTasks/UserTasks/AliEMCalPtTaskTrackSelectionAOD.cxx
+ EMCALJetTasks/UserTasks/AliEMCalTriggerEventData.cxx
+ EMCALJetTasks/UserTasks/AliEMCalTriggerEventSelection.cxx
+ EMCALJetTasks/UserTasks/AliEMCalTriggerTaskGroup.cxx
+ EMCALJetTasks/UserTasks/AliEMCalTriggerTracksAnalysisComponent.cxx
+ EMCALJetTasks/UserTasks/AliAnalysisTaskPtEMCalTriggerV1.cxx
  EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalTriggerTreeWriter.cxx
 )
 
diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskPtEMCalTriggerV1.cxx b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskPtEMCalTriggerV1.cxx
new file mode 100644 (file)
index 0000000..cb975d8
--- /dev/null
@@ -0,0 +1,146 @@
+/**************************************************************************
+ * Copyright(c) 1998-2014, 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.                  *
+ **************************************************************************/
+/*
+ * Re-structured analysis task of the pt analysis on EMCal-triggered events:
+ * Analysis steps are moved to analysis components, which are grouped by a common
+ * event selection. The analysis task steers the event builder, runs each group,
+ * and collects the output of all groups.
+ *
+ *   Author: Markus Fasel
+ */
+#include "AliJetContainer.h"
+#include "AliParticleContainer.h"
+#include "AliEMCalTriggerEventData.h"
+#include "AliEMCalTriggerTaskGroup.h"
+#include "AliAnalysisTaskPtEMCalTriggerV1.h"
+#include "AliVEvent.h"
+
+ClassImp(EMCalTriggerPtAnalysis::AliAnalysisTaskPtEMCalTriggerV1)
+
+namespace EMCalTriggerPtAnalysis {
+
+//______________________________________________________________________________
+AliAnalysisTaskPtEMCalTriggerV1::AliAnalysisTaskPtEMCalTriggerV1() :
+    AliAnalysisTaskEmcalJet(),
+    fTaskGroups(NULL),
+    fMCJetContainer(),
+    fDataJetContainer()
+{
+  /*
+   * Dummy constructor
+   */
+}
+
+//______________________________________________________________________________
+AliAnalysisTaskPtEMCalTriggerV1::AliAnalysisTaskPtEMCalTriggerV1(const char* name) :
+    AliAnalysisTaskEmcalJet(name, kTRUE),
+    fTaskGroups(NULL),
+    fMCJetContainer(),
+    fDataJetContainer()
+{
+  /*
+   * Main Constructor
+   */
+  fTaskGroups = new TObjArray;
+  fTaskGroups->SetOwner();
+  SetMakeGeneralHistograms(kTRUE);
+}
+
+//______________________________________________________________________________
+AliAnalysisTaskPtEMCalTriggerV1::~AliAnalysisTaskPtEMCalTriggerV1() {
+  /*
+   * Destructor
+   */
+}
+
+//______________________________________________________________________________
+void AliAnalysisTaskPtEMCalTriggerV1::UserCreateOutputObjects() {
+  /*
+   * Initialise all analysis components
+   */
+  AliAnalysisTaskEmcal::UserCreateOutputObjects();
+
+  TIter groupIter(fTaskGroups);
+  AliEMCalTriggerTaskGroup *mygroup(NULL);
+  TList *outputList = new TList;
+  outputList->SetName(Form("histos%s", GetName()));
+  while((mygroup = dynamic_cast<AliEMCalTriggerTaskGroup *>(groupIter()))){
+    TList *ltmp = mygroup->InitialiseAnalysisComponents();
+    // Collect output list and append it to the global output list
+    TIter listIter(ltmp);
+    TObject *hist(NULL);
+    while((hist = listIter())) outputList->Add(hist);
+  }
+  fOutput->Add(outputList);
+  PostData(1, fOutput);
+
+}
+
+//______________________________________________________________________________
+Bool_t AliAnalysisTaskPtEMCalTriggerV1::Run() {
+  /*
+   * Run the analysis:
+   * 1st build the event data shared among the tasks
+   * 2nd loop over task groups and run them
+   */
+  AliEMCalTriggerEventData *event = BuildEvent();
+  TIter groupIter(fTaskGroups);
+  AliEMCalTriggerTaskGroup *mygroup(NULL);
+  while((mygroup = dynamic_cast<AliEMCalTriggerTaskGroup *>(groupIter())))
+    mygroup->Process(event);
+
+  delete event;
+
+  PostData(1, fOutput);
+  return kTRUE;
+}
+
+//______________________________________________________________________________
+AliEMCalTriggerEventData* AliAnalysisTaskPtEMCalTriggerV1::BuildEvent() const {
+  /*
+   * Build event structure. Take the information about the different containers
+   * from the base analysis task.
+   *
+   * @return: the resulting event structure
+   */
+  AliEMCalTriggerEventData *eventstruct = new AliEMCalTriggerEventData;
+  eventstruct->SetRecEvent(fInputEvent);
+  eventstruct->SetMCEvent(fMCEvent);
+  eventstruct->SetTriggerPatchContainer(fTriggerPatchInfo);
+  eventstruct->SetClusterContainer(fCaloClusters);
+  eventstruct->SetTrackContainer(fTracks);
+  if(fMCJetContainer.Length()){
+    AliJetContainer *jcmc = dynamic_cast<AliJetContainer *>(fJetCollArray.FindObject(fMCJetContainer.Data()));
+    eventstruct->SetParticleContainer(jcmc->GetParticleContainer()->GetArray());
+    eventstruct->SetMCJetContainer(jcmc);
+  }
+  if(fDataJetContainer.Length()){
+    AliJetContainer *jcdat = dynamic_cast<AliJetContainer *>(fJetCollArray.FindObject(fDataJetContainer.Data()));
+    eventstruct->SetDataJetContainer(jcdat);
+  }
+  return eventstruct;
+}
+
+//______________________________________________________________________________
+void AliAnalysisTaskPtEMCalTriggerV1::AddAnalysisGroup(AliEMCalTriggerTaskGroup *taskGroup) {
+  /*
+   * Add group of analysis components to the task
+   *
+   * @param taskGroup: Group of analysis components
+   */
+  fTaskGroups->Add(taskGroup);
+}
+
+} /* namespace EMCalTriggerPtAnalysis */
diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskPtEMCalTriggerV1.h b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskPtEMCalTriggerV1.h
new file mode 100644 (file)
index 0000000..8674812
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef ALIANALYSISTASKPTEMCALTRIGGERV1_H
+#define ALIANALYSISTASKPTEMCALTRIGGERV1_H
+/* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+// Author: Markus Fasel
+#include "AliAnalysisTaskEmcalJet.h"
+#include <TObjArray.h>
+#include <TString.h>
+
+namespace EMCalTriggerPtAnalysis {
+
+class AliEMCalTriggerEventBuilderComponent;
+class AliEMCalTriggerEventData;
+class AliEMCalTriggerTaskGroup;
+
+class AliAnalysisTaskPtEMCalTriggerV1: public AliAnalysisTaskEmcalJet {
+public:
+  AliAnalysisTaskPtEMCalTriggerV1();
+  AliAnalysisTaskPtEMCalTriggerV1(const char *name);
+  virtual ~AliAnalysisTaskPtEMCalTriggerV1();
+
+  void AddAnalysisGroup(AliEMCalTriggerTaskGroup *taskGroup);
+  virtual void UserCreateOutputObjects();
+  virtual Bool_t Run();
+
+  void SetMCJetContainerName(const char *name)          { fMCJetContainer = name; }
+  void SetDataJetContainerName(const char *name)        { fDataJetContainer = name; }
+
+protected:
+  AliEMCalTriggerEventData *BuildEvent() const;
+
+  TObjArray                            *fTaskGroups;        // grouped analysis components
+  TString                              fMCJetContainer;     // Name of the Monte-Carlo jet container
+  TString                              fDataJetContainer;   // Data jet container name
+
+private:
+  AliAnalysisTaskPtEMCalTriggerV1(const AliAnalysisTaskPtEMCalTriggerV1 &);
+  AliAnalysisTaskPtEMCalTriggerV1 &operator=(const AliAnalysisTaskPtEMCalTriggerV1 &);
+
+  ClassDef(AliAnalysisTaskPtEMCalTriggerV1, 1);
+};
+
+} /* namespace EMCalTriggerPtAnalysis */
+
+#endif /* ALIANALYSISTASKPTEMCALTRIGGERV1_H */
diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerEventData.cxx b/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerEventData.cxx
new file mode 100644 (file)
index 0000000..ca2c137
--- /dev/null
@@ -0,0 +1,80 @@
+/**************************************************************************
+ * Copyright(c) 1998-2014, 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.                  *
+ **************************************************************************/
+/*
+ * Event Data used in exchange to the different analysis components
+ *
+ * Author:
+ *    Markus Fasel
+ */
+#include "AliEMCalTriggerEventData.h"
+
+ClassImp(EMCalTriggerPtAnalysis::AliEMCalTriggerEventData)
+
+namespace EMCalTriggerPtAnalysis {
+
+//______________________________________________________________________________
+AliEMCalTriggerEventData::AliEMCalTriggerEventData() :
+    TObject(),
+    fRecEvent(NULL),
+    fMCEvent(NULL),
+    fClusterContainer(NULL),
+    fTrackContainer(NULL),
+    fParticleContainer(NULL),
+    fTriggerPatchContainer(NULL),
+    fJetContainerMC(NULL),
+    fJetContainerData(NULL)
+{
+  /*
+   * Default constructor
+   */
+}
+
+//______________________________________________________________________________
+AliEMCalTriggerEventData::AliEMCalTriggerEventData(const AliEMCalTriggerEventData &ref) :
+    TObject(ref),
+    fRecEvent(ref.fRecEvent),
+    fMCEvent(ref.fMCEvent),
+    fClusterContainer(ref.fClusterContainer),
+    fTrackContainer(ref.fTrackContainer),
+    fParticleContainer(ref.fParticleContainer),
+    fTriggerPatchContainer(ref.fTriggerPatchContainer),
+    fJetContainerMC(ref.fJetContainerMC),
+    fJetContainerData(ref.fJetContainerData)
+{
+  /*
+   * copy constructor
+   */
+}
+
+//______________________________________________________________________________
+AliEMCalTriggerEventData &AliEMCalTriggerEventData::operator=(const AliEMCalTriggerEventData &ref) {
+  /*
+   * assignment operator
+   */
+  TObject::operator=(ref);
+  if(this != &ref){
+    fRecEvent = ref.fRecEvent;
+    fMCEvent = ref.fMCEvent;
+    fClusterContainer = ref.fClusterContainer;
+    fTrackContainer = ref.fTrackContainer;
+    fParticleContainer = ref.fParticleContainer;
+    fTriggerPatchContainer = ref.fTriggerPatchContainer;
+    fJetContainerMC = ref.fJetContainerMC;
+    fJetContainerData = ref.fJetContainerData;
+  }
+  return *this;
+}
+
+} /* namespace EMCalTriggerPtAnalysis */
diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerEventData.h b/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerEventData.h
new file mode 100644 (file)
index 0000000..fe4353c
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef ALIEMCALTRIGGEREVENTDATA_H
+#define ALIEMCALTRIGGEREVENTDATA_H
+/* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+// Author: Markus Fasel
+#include <TObject.h>
+
+class TClonesArray;
+class AliJetContainer;
+class AliMCEvent;
+class AliVEvent;
+
+namespace EMCalTriggerPtAnalysis {
+
+class AliEMCalTriggerEventData : public TObject {
+public:
+  AliEMCalTriggerEventData();
+  AliEMCalTriggerEventData(const AliEMCalTriggerEventData &ref);
+  AliEMCalTriggerEventData &operator=(const AliEMCalTriggerEventData &ref);
+  virtual ~AliEMCalTriggerEventData() {}
+
+  AliVEvent    * GetRecEvent() const { return fRecEvent; }
+  const AliMCEvent   * GetMCEvent() const { return fMCEvent; }
+  const TClonesArray * GetClusterContainer() const { return fClusterContainer; }
+  const TClonesArray * GetMatchedTrackContainer() const { return fTrackContainer; }
+  const TClonesArray * GetParticleContainer() const { return fParticleContainer; }
+  const TClonesArray * GetTriggerPatchContainer() const { return fTriggerPatchContainer; }
+  const AliJetContainer * GetJetContainerData() const { return fJetContainerData; }
+  const AliJetContainer * GetJetContainerMC() const { return fJetContainerMC; }
+
+  void SetRecEvent(AliVEvent * const ev) { fRecEvent = ev; }
+  void SetMCEvent(const AliMCEvent * const ev) { fMCEvent = ev; }
+  void SetClusterContainer(const TClonesArray *const cont) { fClusterContainer = cont; }
+  void SetTrackContainer(const TClonesArray * const cont) { fTrackContainer = cont; }
+  void SetParticleContainer(const TClonesArray * const cont) { fParticleContainer = cont ;}
+  void SetTriggerPatchContainer(const TClonesArray *const cont) { fTriggerPatchContainer = cont; }
+  void SetMCJetContainer(const AliJetContainer * const cont) { fJetContainerMC = cont; }
+  void SetDataJetContainer(const AliJetContainer * const cont) { fJetContainerData = cont; }
+
+protected:
+  AliVEvent             *fRecEvent;                     // Reconstructed event
+  const AliMCEvent      *fMCEvent;                      // Monte-Carlo event
+  const TClonesArray    *fClusterContainer;             // Container with calibrated clusters
+  const TClonesArray    *fTrackContainer;               // Container with matched tracks
+  const TClonesArray    *fParticleContainer;            // Container with MC-true filtered particles
+  const TClonesArray    *fTriggerPatchContainer;        // Container with trigger patches
+  const AliJetContainer *fJetContainerMC;               // Container with reconstructed jets
+  const AliJetContainer *fJetContainerData;             // Container with reconstructed jets
+
+  ClassDef(AliEMCalTriggerEventData, 1);          // Data structure exchanged to trigger analysis components
+};
+
+} /* namespace EMCalTriggerPtAnalysis */
+
+#endif /* ALIEMCALTRIGGEREVENTDATA_H */
diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerEventSelection.cxx b/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerEventSelection.cxx
new file mode 100644 (file)
index 0000000..401375e
--- /dev/null
@@ -0,0 +1,59 @@
+/**************************************************************************
+ * Copyright(c) 1998-2014, 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.                  *
+ **************************************************************************/
+/*
+ * Basic event selection component: Selects events according to the pA cut and a vertex-z cut
+ * For more sophisticated event selection the method IsEventSelected has to be overwritten
+ *
+ *   Author: Markus Fasel
+ */
+#include <TString.h>
+#include "AliAnalysisUtils.h"
+#include "AliEMCalTriggerEventData.h"
+#include "AliEMCalTriggerEventSelection.h"
+#include "AliVEvent.h"
+
+ClassImp(EMCalTriggerPtAnalysis::AliEMCalTriggerEventSelection)
+
+namespace EMCalTriggerPtAnalysis {
+
+//______________________________________________________________________________
+AliEMCalTriggerEventSelection::AliEMCalTriggerEventSelection():
+  TObject(),
+  fVertexCut(-10., 10.)
+{
+  /*
+   * Main Constructor
+   */
+
+}
+
+//______________________________________________________________________________
+bool AliEMCalTriggerEventSelection::IsEventSelected(const AliEMCalTriggerEventData* const ev) const {
+  /*
+   * Apply basic event selection
+   *
+   * Can be overwritten by inheriting classes
+   *
+   * @param ev: Combined event container
+   * @return: event selection decision (true if event is selected)
+   */
+  AliAnalysisUtils evutils;
+  AliVEvent *recEvent = ev->GetRecEvent();
+  if(!evutils.IsVertexSelected2013pA(recEvent)) return kFALSE;
+  if(!fVertexCut.IsInRange(recEvent->GetPrimaryVertex()->GetZ())) return kFALSE;
+  return true;
+}
+
+} /* namespace EMCalTriggerPtAnalysis */
diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerEventSelection.h b/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerEventSelection.h
new file mode 100644 (file)
index 0000000..d360911
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef ALIEMCALTRIGGEREVENTSELECTION_H
+#define ALIEMCALTRIGGEREVENTSELECTION_H
+/* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+// Author: Markus Fasel
+#include <TObject.h>
+#include "AliCutValueRange.h"
+
+namespace EMCalTriggerPtAnalysis {
+
+class AliEMCalTriggerEventData;
+
+class AliEMCalTriggerEventSelection: public TObject {
+public:
+  AliEMCalTriggerEventSelection();
+  AliEMCalTriggerEventSelection(const AliEMCalTriggerEventSelection &ref);
+  AliEMCalTriggerEventSelection &operator=(const AliEMCalTriggerEventSelection &ref);
+  virtual ~AliEMCalTriggerEventSelection() {}
+
+  void SetVertexCut(double zmin, double zmax) { fVertexCut.SetLimits(zmin, zmax); }
+
+  virtual bool IsEventSelected(const AliEMCalTriggerEventData * const ev) const;
+
+protected:
+  AliCutValueRange<double>   fVertexCut;
+
+  ClassDef(AliEMCalTriggerEventSelection, 1);
+};
+
+} /* namespace EMCalTriggerPtAnalysis */
+
+#endif /* ALIEMCALTRIGGEREVENTSELECTION_H */
diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerTaskGroup.cxx b/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerTaskGroup.cxx
new file mode 100644 (file)
index 0000000..4260820
--- /dev/null
@@ -0,0 +1,111 @@
+/**************************************************************************
+ * Copyright(c) 1998-2014, 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.                  *
+ **************************************************************************/
+/*
+ * Group of analysis components with the same event selection
+ * Analysis components are initialised via the Initialise function, and executed, if
+ * the event is selected, via the function process
+ *
+ *   Author: Markus Fasel
+ */
+#include <THashList.h>
+#include <TList.h>
+
+#include "AliEMCalTriggerTracksAnalysisComponent.h"
+#include "AliEMCalTriggerEventSelection.h"
+#include "AliEMCalTriggerTaskGroup.h"
+
+ClassImp(EMCalTriggerPtAnalysis::AliEMCalTriggerTaskGroup)
+
+namespace EMCalTriggerPtAnalysis {
+
+//______________________________________________________________________________
+AliEMCalTriggerTaskGroup::AliEMCalTriggerTaskGroup() :
+    TNamed(),
+    fAnalysisComponents(NULL),
+    fEventSelection(NULL)
+{
+  /*
+   * Dummy constructor, not to be used
+   */
+}
+
+//______________________________________________________________________________
+AliEMCalTriggerTaskGroup::AliEMCalTriggerTaskGroup(const char* name) :
+    TNamed(name, ""),
+    fAnalysisComponents(NULL),
+    fEventSelection(NULL)
+{
+  /*
+   * Main constructor: to be used by the users
+   */
+  fAnalysisComponents = new TObjArray();
+  fAnalysisComponents->SetOwner();
+}
+
+//______________________________________________________________________________
+AliEMCalTriggerTaskGroup::~AliEMCalTriggerTaskGroup() {
+  /*
+   * Destructor
+   */
+  if(fEventSelection) delete fEventSelection;
+  if(fAnalysisComponents) delete fAnalysisComponents;
+}
+
+//______________________________________________________________________________
+TList *AliEMCalTriggerTaskGroup::InitialiseAnalysisComponents() {
+  /*
+   * Initialise all analysis components. Build a global histlist for the full group
+   *
+   * @return: the global histogram list
+   */
+  TIter compIter(fAnalysisComponents);
+  AliEMCalTriggerTracksAnalysisComponent *ana(NULL);
+  // Build a global histogram list
+  TList *histlist = new TList;
+  TObject *htmp(NULL);
+  while((ana = dynamic_cast<AliEMCalTriggerTracksAnalysisComponent *>(compIter()))){
+    ana->CreateHistos();
+    TList *ltmp = ana->GetHistList();
+    TIter hiter(ltmp);
+    while((htmp = hiter())) histlist->Add(htmp);
+  }
+  return histlist;
+}
+
+//______________________________________________________________________________
+void AliEMCalTriggerTaskGroup::Process(const AliEMCalTriggerEventData* const event) {
+  /*
+   * Run analysis of the different groups. Apply event selection if requested;
+   *
+   * @param event: The combined event data
+   */
+  if(fEventSelection && !fEventSelection->IsEventSelected(event)) return;
+  TIter compIter(fAnalysisComponents);
+  AliEMCalTriggerTracksAnalysisComponent *ana(NULL);
+  while((ana = dynamic_cast<AliEMCalTriggerTracksAnalysisComponent *>(compIter())))
+    ana->Process(event);
+}
+
+//______________________________________________________________________________
+void AliEMCalTriggerTaskGroup::AddAnalysisComponent(AliEMCalTriggerTracksAnalysisComponent * const analysis) {
+  /*
+   * Add new analysis component to the task group
+   *
+   * @param analysis: the analysis component to be added
+   */
+  fAnalysisComponents->Add(analysis);
+}
+
+} /* namespace EMCalTriggerPtAnalysis */
diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerTaskGroup.h b/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerTaskGroup.h
new file mode 100644 (file)
index 0000000..e4eac61
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef ALIEMCALTRIGGERTASKGROUP_H
+#define ALIEMCALTRIGGERTASKGROUP_H
+/* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+// Author: Markus Fasel
+#include <TNamed.h>
+#include <TObjArray.h>
+
+namespace EMCalTriggerPtAnalysis {
+
+class AliEMCalTriggerEventSelection;
+class AliEMCalTriggerTracksAnalysisComponent;
+
+class AliEMCalTriggerTaskGroup : public TNamed {
+public:
+  AliEMCalTriggerTaskGroup();
+  AliEMCalTriggerTaskGroup(const char *name);
+  virtual ~AliEMCalTriggerTaskGroup();
+
+  void SetEventSelection(const AliEMCalTriggerEventSelection *sel){ fEventSelection = sel; }
+  void AddAnalysisComponent(AliEMCalTriggerTracksAnalysisComponent * const analysis);
+
+  TList * InitialiseAnalysisComponents();
+  void Process(const AliEMCalTriggerEventData * const event);
+
+protected:
+  TObjArray                                   *fAnalysisComponents;
+  const AliEMCalTriggerEventSelection         *fEventSelection;
+
+  ClassDef(AliEMCalTriggerTaskGroup, 1);    // Group of analysis components with common event selection
+};
+
+} /* namespace EMCalTriggerPtAnalysis */
+
+#endif /* ALIEMCALTRIGGERTASKGROUP_H */
diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerTracksAnalysisComponent.cxx b/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerTracksAnalysisComponent.cxx
new file mode 100644 (file)
index 0000000..891cdc4
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * AliEmcalTriggerTracksAnalysisComponent.cxx
+ *
+ *  Created on: 03.12.2014
+ *      Author: markusfasel
+ */
+
+#include <AliEMCalTriggerTracksAnalysisComponent.h>
+
+namespace EMCalTriggerPtAnalysis {
+
+AliEMCalTriggerTracksAnalysisComponent::AliEMCalTriggerTracksAnalysisComponent() {
+  // TODO Auto-generated constructor stub
+
+}
+
+AliEMCalTriggerTracksAnalysisComponent::~AliEMCalTriggerTracksAnalysisComponent() {
+  // TODO Auto-generated destructor stub
+}
+
+} /* namespace EMCalTriggerPtAnalysis */
diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerTracksAnalysisComponent.h b/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerTracksAnalysisComponent.h
new file mode 100644 (file)
index 0000000..fe29b55
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef ALIEMCALTRIGGERTRACKSANALYSISCOMPONENT_H
+#define ALIEMCALTRIGGERTRACKSANALYSISCOMPONENT_H
+/* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+// Author: Markus Fasel
+#include <TObject.h>
+#include "AliEMCalHistoContainer.h"
+
+namespace EMCalTriggerPtAnalysis {
+
+class AliEMCalTriggerEventData;
+
+class AliEMCalTriggerTracksAnalysisComponent : public TObject {
+public:
+  AliEMCalTriggerTracksAnalysisComponent();
+  AliEMCalTriggerTracksAnalysisComponent(const char *name);
+  virtual ~AliEMCalTriggerTracksAnalysisComponent();
+
+  virtual void CreateHistos();
+  virtual void Process(const AliEMCalTriggerEventData * const data) = 0;
+
+  THashList *GetHistList() const { return fHistos->GetListOfHistograms(); }
+
+protected:
+  AliEMCalHistoContainer *fHistos;
+
+  ClassDef(AliEMCalTriggerTracksAnalysisComponent, 1)
+};
+
+} /* namespace EMCalTriggerPtAnalysis */
+
+#endif /* ALIEMCALTRIGGERTRACKSANALYSISCOMPONENT_H */
index facbf30..17f9f5c 100644 (file)
 #pragma link C++ class EMCalTriggerPtAnalysis::AliCutValueRange<double>+;
 #pragma link C++ class EMCalTriggerPtAnalysis::AliCutValueRange<int>+;
 #pragma link C++ class EMCalTriggerPtAnalysis::AliAnalysisTaskPtEMCalTrigger+;
+#pragma link C++ class EMCalTriggerPtAnalysis::AliAnalysisTaskPtEMCalTriggerV1+;
 #pragma link C++ class EMCalTriggerPtAnalysis::AliEMCalPtTaskVTrackSelection+;
 #pragma link C++ class EMCalTriggerPtAnalysis::AliEMCalPtTaskTrackSelectionESD+;
 #pragma link C++ class EMCalTriggerPtAnalysis::AliEMCalPtTaskTrackSelectionAOD+;
+#pragma link C++ class EMCalTriggerPtAnalysis::AliEMCalTriggerEventData+;
+#pragma link C++ class EMCalTriggerPtAnalysis::AliEMCalTriggerEventSelection+;
+#pragma link C++ class EMCalTriggerPtAnalysis::AliEMCalTriggerTaskGroup+;
+#pragma link C++ class EMCalTriggerPtAnalysis::AliEMCalTriggerTracksAnalysisComponent+;
 #pragma link C++ class AliAnalysisTaskEmcalTriggerTreeWriter+;
 
 #ifdef HAVE_FASTJET