Further development of the analysis package:
authormfasel <mfasel@lbl.gov>
Tue, 9 Dec 2014 02:56:58 +0000 (18:56 -0800)
committermfasel <mfasel@lbl.gov>
Fri, 12 Dec 2014 01:12:32 +0000 (17:12 -0800)
=====================================================
- Add classes:
  + Binning factory initalising default binning
  + Kine cuts for track kinematic cuts
- First component for MC particles

15 files changed:
PWGJE/CMakelibPWGJEEMCALJetTasks.pkg
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskPtEMCalTriggerV1.cxx
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskPtEMCalTriggerV1.h
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerBinningComponent.cxx
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerBinningComponent.h
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerBinningFactory.cxx [new file with mode: 0644]
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerBinningFactory.h [new file with mode: 0644]
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerEventData.h
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerKineCuts.cxx [new file with mode: 0644]
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerKineCuts.h [new file with mode: 0644]
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerMCParticleAnalysisComponent.cxx [new file with mode: 0644]
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerMCParticleAnalysisComponent.h [new file with mode: 0644]
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerTracksAnalysisComponent.cxx
PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerTracksAnalysisComponent.h
PWGJE/PWGJEEMCALJetTasksLinkDef.h

index df0e758..d82ef97 100644 (file)
@@ -106,7 +106,10 @@ set ( SRCS
  EMCALJetTasks/UserTasks/AliEMCalTriggerEventSelection.cxx
  EMCALJetTasks/UserTasks/AliEMCalTriggerTaskGroup.cxx
  EMCALJetTasks/UserTasks/AliEMCalTriggerTracksAnalysisComponent.cxx
+ EMCALJetTasks/UserTasks/AliEMCALTriggerMCParticleAnalysisComponent.cxx
  EMCALJetTasks/UserTasks/AliEMCalTriggerBinningComponent.cxx
+ EMCALJetTasks/UserTasks/AliEMCalTriggerBinningFactory.cxx
+ EMCALJetTasks/UserTasks/AliEMCalTriggerKineCuts.cxx
  EMCALJetTasks/UserTasks/AliAnalysisTaskPtEMCalTriggerV1.cxx
  EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalTriggerTreeWriter.cxx
 )
index 080fe9b..225d905 100644 (file)
@@ -23,6 +23,7 @@
 #include "AliJetContainer.h"
 #include "AliParticleContainer.h"
 #include "AliEMCalTriggerBinningComponent.h"
+#include "AliEMCalTriggerBinningFactory.h"
 #include "AliEMCalTriggerEventData.h"
 #include "AliEMCalTriggerTaskGroup.h"
 #include "AliAnalysisTaskPtEMCalTriggerV1.h"
@@ -77,6 +78,9 @@ void AliAnalysisTaskPtEMCalTriggerV1::UserCreateOutputObjects() {
    */
   AliAnalysisTaskEmcal::UserCreateOutputObjects();
 
+  AliEMCalTriggerBinningFactory binmaker;
+  binmaker.Create(fBinning);
+
   TIter groupIter(fTaskGroups);
   AliEMCalTriggerTaskGroup *mygroup(NULL);
   TList *outputList = new TList;
@@ -126,6 +130,16 @@ void AliAnalysisTaskPtEMCalTriggerV1::SetBinning(const char* dimname, int nbins,
 }
 
 //______________________________________________________________________________
+void AliAnalysisTaskPtEMCalTriggerV1::SetBinning(const char* dimname, const TArrayD &binning) {
+  /*
+   * Set binning for a give dimension
+   *
+   * @param binning: the bin limits
+   */
+  fBinning->SetBinning(dimname, binning);
+}
+
+//______________________________________________________________________________
 AliEMCalTriggerEventData* AliAnalysisTaskPtEMCalTriggerV1::BuildEvent() const {
   /*
    * Build event structure. Take the information about the different containers
index ec8f420..8a82a74 100644 (file)
@@ -8,6 +8,8 @@
 #include <TObjArray.h>
 #include <TString.h>
 
+class TArrayD;
+
 namespace EMCalTriggerPtAnalysis {
 
 class AliEMCalTriggerBinningComponent;
@@ -27,6 +29,7 @@ public:
   void SetMCJetContainerName(const char *name)          { fMCJetContainer = name; }
   void SetDataJetContainerName(const char *name)        { fDataJetContainer = name; }
   void SetBinning(const char *dimname, int nbins, double *binning);
+  void SetBinning(const char *dimname, const TArrayD &binning);
 
 protected:
   AliEMCalTriggerEventData *BuildEvent() const;
index e6a2dbc..c325541 100644 (file)
@@ -81,7 +81,7 @@ AliEMCalTriggerBinningComponent::~AliEMCalTriggerBinningComponent() {
 }
 
 //______________________________________________________________________________
-AliEMCalTriggerBinningDimension* AliEMCalTriggerBinningComponent::GetBinning(const char* name) {
+AliEMCalTriggerBinningDimension* AliEMCalTriggerBinningComponent::GetBinning(const char* name) const {
   /*
    * Get binning information for a given axis. Return nullpointer if axis is not yet defined
    *
@@ -108,4 +108,22 @@ void AliEMCalTriggerBinningComponent::SetBinning(const char* dimname, int nbins,
   }
 }
 
+//______________________________________________________________________________
+void AliEMCalTriggerBinningComponent::SetBinning(const char* dimname, const TArrayD& binning) {
+  /*
+   * Set binning for dimension. If not yet existing, create it
+   *
+   * @param dimname: axis name
+   * @param nbins: Number of bins
+   * @param binning: array of bin limits (size nbins+1)
+   */
+  AliEMCalTriggerBinningDimension *dim = GetBinning(dimname);
+  if(dim) dim->Set(binning);
+  else {
+    dim = new AliEMCalTriggerBinningDimension(dimname, binning);
+    fDimensions->Add(dim);
+  }
+}
+
 } /* namespace EMCalTriggerPtAnalysis */
+
index 1ffdb1d..526901e 100644 (file)
@@ -25,6 +25,10 @@ public:
     TNamed(name, ""),
     fBinning(nbins+1, binning)
   {}
+  AliEMCalTriggerBinningDimension(const char *name, const TArrayD &binning):
+    TNamed(name, ""),
+    fBinning(binning.GetSize()-1, binning.GetArray())
+  {}
   ~AliEMCalTriggerBinningDimension() {}
 
   void Set(int nbins, double *binning) { fBinning.Set(nbins+1, binning); }
@@ -45,8 +49,9 @@ public:
   AliEMCalTriggerBinningComponent &operator=(const AliEMCalTriggerBinningComponent &ref);
   virtual ~AliEMCalTriggerBinningComponent();
 
-  AliEMCalTriggerBinningDimension *GetBinning(const char *name);
+  AliEMCalTriggerBinningDimension *GetBinning(const char *name) const;
   void SetBinning(const char *dimname, int nbins, double *binning);
+  void SetBinning(const char *dimname, const TArrayD &binning);
 
 private:
   TObjArray       *fDimensions;           // List of binnings (dimensions)
diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerBinningFactory.cxx b/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerBinningFactory.cxx
new file mode 100644 (file)
index 0000000..fc7e913
--- /dev/null
@@ -0,0 +1,132 @@
+/**************************************************************************
+ * 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.                  *
+ **************************************************************************/
+/*
+ * Create default binning and initalise the binning component with this. In case
+ * users already defined a binning, do not overwrite this.
+ *
+ *   Author: Markus Fasel
+ */
+#include <map>
+#include <vector>
+
+#include "TArrayD.h"
+
+#include "AliEMCalTriggerBinningComponent.h"
+#include "AliEMCalTriggerBinningFactory.h"
+
+namespace EMCalTriggerPtAnalysis {
+
+//______________________________________________________________________________
+AliEMCalTriggerBinningFactory::AliEMCalTriggerBinningFactory() {
+  /*
+   * Default constructor, nothing to do
+   */
+}
+
+
+//______________________________________________________________________________
+void AliEMCalTriggerBinningFactory::Create(AliEMCalTriggerBinningComponent* const data) {
+  /*
+   * Initialise binning component with default binning
+   *
+   * @param data: the binning component to be initialised
+   */
+  AliEMCalTriggerBinningDimension *mybinning(NULL);
+  TArrayD binLimits;
+  if(!data->GetBinning("pt")){
+    CreateDefaultPtBinning(binLimits);
+    data->SetBinning("pt", binLimits);
+  }
+  if(!data->GetBinning("eta")){
+    CreateDefaultEtaBinning(binLimits);
+    data->SetBinning("eta", binLimits);
+  }
+  if(!data->GetBinning("zvertex")){
+    CreateDefaultZVertexBinning(binLimits);
+    data->SetBinning("zvertex", binLimits);
+  }
+}
+
+//______________________________________________________________________________
+void AliEMCalTriggerBinningFactory::CreateDefaultPtBinning(TArrayD &binning) const{
+  /*
+   * Creating the default pt binning.
+   *
+   * @param binning: Array where to store the results.
+   */
+  std::vector<double> mybinning;
+  std::map<double,double> definitions;
+  definitions.insert(std::pair<double,double>(2.5, 0.1));
+  definitions.insert(std::pair<double,double>(7., 0.25));
+  definitions.insert(std::pair<double,double>(15., 0.5));
+  definitions.insert(std::pair<double,double>(25., 1.));
+  definitions.insert(std::pair<double,double>(40., 2.5));
+  definitions.insert(std::pair<double,double>(50., 5.));
+  definitions.insert(std::pair<double,double>(100., 10.));
+  double currentval = 0;
+  for(std::map<double,double>::iterator id = definitions.begin(); id != definitions.end(); ++id){
+    double limit = id->first, binwidth = id->second;
+    while(currentval < limit){
+      currentval += binwidth;
+      mybinning.push_back(currentval);
+    }
+  }
+  binning.Set(mybinning.size());
+  int ib = 0;
+  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
+    binning[ib++] = *it;
+}
+
+//______________________________________________________________________________
+void AliEMCalTriggerBinningFactory::CreateDefaultZVertexBinning(TArrayD &binning) const {
+  /*
+   * Creating default z-Vertex binning.
+   *
+   * @param binning: Array where to store the results.
+   */
+  std::vector<double> mybinning;
+  double currentval = -10;
+  mybinning.push_back(currentval);
+  while(currentval <= 10.){
+    currentval += 5.;
+    mybinning.push_back(currentval);
+  }
+  binning.Set(mybinning.size());
+  int ib = 0;
+  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
+    binning[ib++] = *it;
+}
+
+//______________________________________________________________________________
+void AliEMCalTriggerBinningFactory::CreateDefaultEtaBinning(TArrayD& binning) const {
+  /*
+   * Creating default z-Vertex binning.
+   *
+   * @param binning: Array where to store the results.
+   */
+  std::vector<double> mybinning;
+  double currentval = -0.8;
+  mybinning.push_back(currentval);
+  while(currentval <= 0.8){
+    currentval += 0.1;
+    mybinning.push_back(currentval);
+  }
+  binning.Set(mybinning.size());
+  int ib = 0;
+  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
+    binning[ib++] = *it;
+}
+
+} /* namespace EMCalTriggerPtAnalysis */
diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerBinningFactory.h b/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerBinningFactory.h
new file mode 100644 (file)
index 0000000..6c55a0a
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef ALIEMCALTRIGGERBINNINGFACTORY_H
+#define ALIEMCALTRIGGERBINNINGFACTORY_H
+/* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+// Author: Markus Fasel
+
+namespace EMCalTriggerPtAnalysis {
+
+class AliEMCalTriggerBinningFactory {
+public:
+  AliEMCalTriggerBinningFactory();
+  virtual ~AliEMCalTriggerBinningFactory(){}
+
+  void Create(AliEMCalTriggerBinningComponent * const data);
+
+protected:
+  void CreateDefaultPtBinning(TArrayD &binning) const;
+  void CreateDefaultEtaBinning(TArrayD& binning) const;
+  void CreateDefaultZVertexBinning(TArrayD &binning) const;
+};
+
+} /* namespace EMCalTriggerPtAnalysis */
+
+#endif /* ALIEMCALTRIGGERBINNINGFACTORY_H */
index fe4353c..92df21e 100644 (file)
@@ -21,7 +21,7 @@ public:
   virtual ~AliEMCalTriggerEventData() {}
 
   AliVEvent    * GetRecEvent() const { return fRecEvent; }
-  const AliMCEvent   * GetMCEvent() const { return fMCEvent; }
+  AliMCEvent   * GetMCEvent() const { return fMCEvent; }
   const TClonesArray * GetClusterContainer() const { return fClusterContainer; }
   const TClonesArray * GetMatchedTrackContainer() const { return fTrackContainer; }
   const TClonesArray * GetParticleContainer() const { return fParticleContainer; }
@@ -30,7 +30,7 @@ public:
   const AliJetContainer * GetJetContainerMC() const { return fJetContainerMC; }
 
   void SetRecEvent(AliVEvent * const ev) { fRecEvent = ev; }
-  void SetMCEvent(const AliMCEvent * const ev) { fMCEvent = ev; }
+  void SetMCEvent(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 ;}
@@ -40,7 +40,7 @@ public:
 
 protected:
   AliVEvent             *fRecEvent;                     // Reconstructed event
-  const AliMCEvent      *fMCEvent;                      // Monte-Carlo event
+  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
diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerKineCuts.cxx b/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerKineCuts.cxx
new file mode 100644 (file)
index 0000000..1751db8
--- /dev/null
@@ -0,0 +1,46 @@
+/**************************************************************************
+ * 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 kinematic cuts for single track selection
+ *
+ *   Author: Markus Fasel
+ */
+#include <TMath.h>
+#include "AliVParticle.h"
+#include "AliEMCalTriggerKineCuts.h"
+
+namespace EMCalTriggerPtAnalysis {
+
+//______________________________________________________________________________
+AliEMCalTriggerKineCuts::AliEMCalTriggerKineCuts():
+  TObject(),
+  fPtCut(0.1, 1000.),
+  fEtaCut(-0.8, 0.8),
+  fPhiCut()
+{
+}
+
+//______________________________________________________________________________
+bool AliEMCalTriggerKineCuts::IsSelected(const AliVParticle* const track) const {
+  /*
+   * Kinematic track selection
+   */
+  if(!fPtCut.IsInRange(TMath::Abs(track->Pt()))) return false;
+  if(!fEtaCut.IsInRange(track->Eta())) return false;
+  if(!fPhiCut.IsInRange(track->Eta())) return false;
+  return true;
+}
+
+} /* namespace EMCalTriggerPtAnalysis */
diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerKineCuts.h b/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerKineCuts.h
new file mode 100644 (file)
index 0000000..46f08b7
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef ALIEMCALTRIGGERKINECUTS_H
+#define ALIEMCALTRIGGERKINECUTS_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"
+
+class AliVParticle;
+
+namespace EMCalTriggerPtAnalysis {
+
+class AliEMCalTriggerKineCuts: public TObject {
+public:
+  AliEMCalTriggerKineCuts();
+  virtual ~AliEMCalTriggerKineCuts() {}
+
+  void SetPtRange(double ptmin, double ptmax) { fPtCut.SetLimits(ptmin, ptmax); }
+  void SetEtaRange(double etamin, double etamax) { fEtaCut.SetLimits(etamin, etamax); }
+  void SetPhiRange(double phimin, double phimax) { fPhiCut.SetLimits(phimin, phimax); }
+
+  bool IsSelected(const AliVParticle *const track) const;
+
+protected:
+  AliCutValueRange<double>     fPtCut;
+  AliCutValueRange<double>     fEtaCut;
+  AliCutValueRange<double>     fPhiCut;
+
+  ClassDef(AliEMCalTriggerKineCuts, 1);
+};
+
+} /* namespace EMCalTriggerPtAnalysis */
+
+#endif /* ALIEMCALTRIGGERKINECUTS_H */
diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerMCParticleAnalysisComponent.cxx b/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerMCParticleAnalysisComponent.cxx
new file mode 100644 (file)
index 0000000..0295c48
--- /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.                  *
+ **************************************************************************/
+/*
+ * Analysis component for simple Monte-Carlo particles. Loops over all particles, selects
+ * those which are physical primary, and fills a THnSparse with them.
+ *
+ *   Author: Markus Fasel
+ */
+#include <TAxis.h>
+#include <TMath.h>
+
+#include "AliMCEvent.h"
+#include "AliVParticle.h"
+#include "AliVEvent.h"
+#include "AliVVertex.h"
+
+#include "AliEMCalHistoContainer.h"
+#include "AliEMCalTriggerBinningComponent.h"
+#include "AliEMCalTriggerEventData.h"
+#include "AliEMCalTriggerKineCuts.h"
+#include "AliEMCalTriggerMCParticleAnalysisComponent.h"
+
+ClassImp(EMCalTriggerPtAnalysis::AliEMCalTriggerMCParticleAnalysisComponent)
+
+namespace EMCalTriggerPtAnalysis {
+
+//______________________________________________________________________________
+AliEMCalTriggerMCParticleAnalysisComponent::AliEMCalTriggerMCParticleAnalysisComponent() :
+  AliEMCalTriggerTracksAnalysisComponent()
+{
+  /*
+   * Dummy Constructor for I/O
+   */
+}
+
+//______________________________________________________________________________
+AliEMCalTriggerMCParticleAnalysisComponent::AliEMCalTriggerMCParticleAnalysisComponent(const char* name) :
+  AliEMCalTriggerTracksAnalysisComponent(name)
+{
+  /*
+   * Main Constructor, to be called by the users
+   */
+}
+
+  //______________________________________________________________________________
+void AliEMCalTriggerMCParticleAnalysisComponent::CreateHistos() {
+  /*
+   * Create histograms for the MC truth analysis component
+   */
+
+  const AliEMCalTriggerBinningDimension *ptbinning = fBinning->GetBinning("pt"),
+      *etabinning = fBinning->GetBinning("eta"),
+      *phibinning = fBinning->GetBinning("phi"),
+      *vertexbinning = fBinning->GetBinning("vertex");
+  AliEMCalTriggerTracksAnalysisComponent::CreateHistos();
+  const TAxis *trackaxes[4] = {
+      DefineAxis("pt", ptbinning),
+      DefineAxis("eta", etabinning),
+      DefineAxis("phi", phibinning),
+      DefineAxis("zvertex", vertexbinning)
+  };
+  fHistos->CreateTHnSparse("hMCtrueParticles", "Particle-based histogram for MC-true particles", 4, trackaxes, "s");
+}
+
+//______________________________________________________________________________
+void AliEMCalTriggerMCParticleAnalysisComponent::Process(const AliEMCalTriggerEventData* const data) {
+  AliMCEvent *mc = data->GetMCEvent();
+  if(!mc) return;
+  AliVEvent *rec = data->GetRecEvent();
+  Double_t values[4];
+  for(int itrk = 0; itrk < mc->GetNumberOfTracks(); itrk++){
+    AliVParticle *track = mc->GetTrack(itrk);
+    if(!track->Charge()) continue;
+    if(!mc->IsPhysicalPrimary(itrk)) continue;
+    if(!fKineCuts->IsSelected(track)) continue;
+
+    values[0] = TMath::Abs(track->Pt());
+    values[1] = track->Eta();
+    values[2] = track->Phi();
+    values[3] = rec->GetPrimaryVertex()->GetZ();
+    fHistos->FillTHnSparse("hMCtrueParticles", values);
+  }
+}
+
+//______________________________________________________________________________
+TAxis* AliEMCalTriggerMCParticleAnalysisComponent::DefineAxis(const char* name, const AliEMCalTriggerBinningDimension* binning) {
+  /*
+   * Create and define axis
+   *
+   * @param name: Name of the axis
+   * @param binning: binning information
+   * @return: the new axis
+   */
+  TAxis *result = new TAxis(binning->GetNumberOfBins(), binning->GetBinLimits());
+  result->SetName(name);
+  return result;
+}
+
+} /* namespace EMCalTriggerPtAnalysis */
diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerMCParticleAnalysisComponent.h b/PWGJE/EMCALJetTasks/UserTasks/AliEMCalTriggerMCParticleAnalysisComponent.h
new file mode 100644 (file)
index 0000000..65acef6
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef ALIEMCALTRIGGERMCPARTICLEANALYSISCOMPONENT_H
+#define ALIEMCALTRIGGERMCPARTICLEANALYSISCOMPONENT_H
+/* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+// Author: Markus Fasel
+
+#include "AliEMCalTriggerTracksAnalysisComponent.h"
+
+class TAxis;
+
+namespace EMCalTriggerPtAnalysis {
+
+class AliEMCalTriggerBinningDimension;
+class AliEMCalTriggerEventData;
+
+class AliEMCalTriggerMCParticleAnalysisComponent: public AliEMCalTriggerTracksAnalysisComponent {
+public:
+  AliEMCalTriggerMCParticleAnalysisComponent();
+  AliEMCalTriggerMCParticleAnalysisComponent(const char *name);
+  virtual ~AliEMCalTriggerMCParticleAnalysisComponent() {}
+
+  virtual void CreateHistos();
+  virtual void Process(const AliEMCalTriggerEventData * const data);
+
+protected:
+  TAxis *DefineAxis(const char *name, const AliEMCalTriggerBinningDimension *binning);
+
+  ClassDef(AliEMCalTriggerMCParticleAnalysisComponent, 1);
+};
+
+} /* namespace EMCalTriggerPtAnalysis */
+
+#endif /* ALIEMCALTRIGGERMCPARTICLEANALYSISCOMPONENT_H */
index 347bad9..9df9988 100644 (file)
@@ -24,14 +24,49 @@ ClassImp(EMCalTriggerPtAnalysis::AliEMCalTriggerTracksAnalysisComponent)
 
 namespace EMCalTriggerPtAnalysis {
 
+//______________________________________________________________________________
 AliEMCalTriggerTracksAnalysisComponent::AliEMCalTriggerTracksAnalysisComponent() :
-  TObject(),
+  TNamed(),
   fHistos(NULL),
-  fBinning(NULL)
+  fBinning(NULL),
+  fKineCuts(NULL)
 {
   /*
-   * Default constructor
+   * Dummy (I/O) constructor
    */
 }
 
+//______________________________________________________________________________
+AliEMCalTriggerTracksAnalysisComponent::~AliEMCalTriggerTracksAnalysisComponent() {
+  /*
+   * Release histogram container
+   */
+  if(fHistos) delete fHistos;
+}
+
+//______________________________________________________________________________
+AliEMCalTriggerTracksAnalysisComponent::AliEMCalTriggerTracksAnalysisComponent(const char* name) :
+  TNamed(name,""),
+  fHistos(NULL),
+  fBinning(NULL),
+  fKineCuts(NULL)
+{
+  /*
+   * Main constructor, to be called by the user
+   *
+   * @param name: component name
+   */
+}
+
+//______________________________________________________________________________
+void AliEMCalTriggerTracksAnalysisComponent::CreateHistos() {
+  /*
+   * Create Container for histograms. Inheriting classes overwrite this method, in which they call
+   * this and add the histograms of their choise.
+   */
+  fHistos = new AliEMCalHistoContainer(Form("Histos%s", GetName()));
+  fHistos->ReleaseOwner();
+}
+
 } /* namespace EMCalTriggerPtAnalysis */
+
index 0e35bf5..b9989aa 100644 (file)
@@ -4,29 +4,32 @@
  * See cxx source for full Copyright notice                               */
 
 // Author: Markus Fasel
-#include <TObject.h>
+#include <TNamed.h>
 #include "AliEMCalHistoContainer.h"
 
 namespace EMCalTriggerPtAnalysis {
 
 class AliEMCalTriggerBinningComponent;
 class AliEMCalTriggerEventData;
+class AliEMCalTriggerKineCuts;
 
-class AliEMCalTriggerTracksAnalysisComponent : public TObject {
+class AliEMCalTriggerTracksAnalysisComponent : public TNamed {
 public:
   AliEMCalTriggerTracksAnalysisComponent();
   AliEMCalTriggerTracksAnalysisComponent(const char *name);
-  virtual ~AliEMCalTriggerTracksAnalysisComponent() {}
+  virtual ~AliEMCalTriggerTracksAnalysisComponent();
 
   virtual void CreateHistos();
   virtual void Process(const AliEMCalTriggerEventData * const data) = 0;
 
   THashList *GetHistList() const { return fHistos->GetListOfHistograms(); }
   void SetBinning(const AliEMCalTriggerBinningComponent * const binning) { fBinning = binning; }
+  void SetKineCuts(const AliEMCalTriggerKineCuts * const cuts) { fKineCuts = cuts; }
 
 protected:
   AliEMCalHistoContainer                      *fHistos;
   const AliEMCalTriggerBinningComponent       *fBinning;
+  const AliEMCalTriggerKineCuts               *fKineCuts;
 
   ClassDef(AliEMCalTriggerTracksAnalysisComponent, 1)
 };
index 35e9e8c..13535bd 100644 (file)
@@ -98,6 +98,8 @@
 #pragma link C++ class EMCalTriggerPtAnalysis::AliEMCalTriggerTracksAnalysisComponent+;
 #pragma link C++ class EMCalTriggerPtAnalysis::AliEMCalTriggerBinningDimension+;
 #pragma link C++ class EMCalTriggerPtAnalysis::AliEMCalTriggerBinningComponent+;
+#pragma link C++ class EMCalTriggerPtAnalysis::AliEMCalTriggerKineCuts+;
+#pragma link C++ class EMCalTriggerPtAnalysis::AliEMCalTriggerMCParticleAnalysisComponent+;
 #pragma link C++ class AliAnalysisTaskEmcalTriggerTreeWriter+;
 
 #ifdef HAVE_FASTJET