--- /dev/null
+//------------------------------------------------------------------------------
+// Impementation of AliMCInfoCuts class. It keeps selection cuts for MC tracks.
+//
+//
+// Author: J.Otwinowski 04/02/2008
+//------------------------------------------------------------------------------
+
+#include <iostream>
+#include <TArrayI.h>
+#include <TList.h>
+
+#include "AliLog.h"
+#include "AliMCInfoCuts.h"
+
+using namespace std;
+
+ClassImp(AliMCInfoCuts)
+
+//_____________________________________________________________________________
+AliMCInfoCuts::AliMCInfoCuts(const Char_t* name,const Char_t *title) :
+AliAnalysisCuts(name, title)
+, fMinRowsWithDigits(0)
+, fMaxR(0)
+, fMaxVz(0)
+, fMinTPCSignal(0)
+, fMaxTPCSignal(0)
+, aTrackParticles(0)
+{
+ // default constructor
+
+ // init data members with defaults
+ Init();
+}
+
+//_____________________________________________________________________________
+AliMCInfoCuts::~AliMCInfoCuts()
+{
+ // destructor
+ if(aTrackParticles != 0)
+ {
+ delete aTrackParticles;
+ aTrackParticles = 0;
+ }
+}
+
+//_____________________________________________________________________________
+void AliMCInfoCuts::Init()
+{
+ // set default values
+ SetMinRowsWithDigits();
+ SetMaxR();
+ SetMaxVz();
+ SetRangeTPCSignal();
+
+ // create aTrackParticles array
+ aTrackParticles = new TArrayI(kNParticles); // max nb. of particles
+ aTrackParticles->Reset(0);
+
+ // create an array of track particles: e, muons, pions, kaons, protons
+ if(aTrackParticles != 0)
+ {
+ // keep order adding a new particles
+ AddPdgParticle(0,ep); // e+
+ AddPdgParticle(1,em); // e-
+ AddPdgParticle(2,mup); // mu+
+ AddPdgParticle(3,mum); // mu-
+ AddPdgParticle(4,pip); // pi+
+ AddPdgParticle(5,pim); // pi-
+ AddPdgParticle(6,kp); // K+
+ AddPdgParticle(7,km); // K-
+ AddPdgParticle(8,prot); // p
+ AddPdgParticle(9,protbar); // p_bar
+ }
+}
+
+//_____________________________________________________________________________
+void AliMCInfoCuts::AddPdgParticle(Int_t idx, Int_t pdgcode) const
+{
+ // add particle to the array
+ if(aTrackParticles != 0) aTrackParticles->AddAt(pdgcode,idx);
+ else AliDebug(AliLog::kError, "ERROR: Cannot add particle to the array");
+}
+
+//_____________________________________________________________________________
+Bool_t AliMCInfoCuts::IsPdgParticle(Int_t pdgcode) const
+{
+ // check PDG particle
+ if(aTrackParticles == 0) {
+ AliDebug(AliLog::kError, "ERROR: Cannot get particle array");
+ return kFALSE;
+ }
+
+ Int_t size = aTrackParticles->GetSize();
+ for(int i=0; i<size; ++i) {
+ if(pdgcode == aTrackParticles->At(i)) return kTRUE;
+ }
+ return kFALSE;
+}
+
+//_____________________________________________________________________________
+Long64_t AliMCInfoCuts::Merge(TCollection* list)
+{
+ // Merge list of objects (needed by PROOF)
+ if (!list)
+ return 0;
+
+ if (list->IsEmpty())
+ return 1;
+
+ TIterator* iter = list->MakeIterator();
+ TObject* obj = 0;
+
+ Int_t count=0;
+ while((obj = iter->Next()) != 0)
+ {
+ AliMCInfoCuts* entry = dynamic_cast<AliMCInfoCuts*>(obj);
+ if (entry == 0)
+ continue;
+
+ count++;
+ }
+
+return count;
+}
--- /dev/null
+#ifndef ALIMCINFOCUTS_H
+#define ALIMCINFOCUTS_H
+
+//------------------------------------------------------------------------------
+// Class to keep selection cuts for MC tracks.
+//
+// Author: J.Otwinowski 04/02/2008
+//------------------------------------------------------------------------------
+
+#include "AliAnalysisCuts.h"
+
+class TArrayI;
+
+class AliMCInfoCuts : public AliAnalysisCuts
+{
+public:
+ AliMCInfoCuts(const Char_t* name ="AliMCInfoCuts", const Char_t *title ="");
+ virtual ~AliMCInfoCuts();
+
+ // setters
+ void SetMinRowsWithDigits(const Int_t min=0) {fMinRowsWithDigits = min;}
+ void SetMaxR(const Float_t max=1e99) {fMaxR = max;}
+ void SetMaxVz(const Float_t max=1e99) {fMaxVz = max;}
+ void SetRangeTPCSignal(const Float_t min=0, const Float_t max=1e99) {fMinTPCSignal = min; fMaxTPCSignal = max;}
+
+ // getters
+ Int_t GetMinRowsWithDigits() const {return fMinRowsWithDigits;}
+ Float_t GetMaxR() const {return fMaxR;}
+ Float_t GetMaxVz() const {return fMaxVz;}
+ Float_t GetMinTPCSignal() const {return fMinTPCSignal;}
+ Float_t GetMaxTPCSignal() const {return fMaxTPCSignal;}
+
+ Float_t GetEP() const {return ep;}
+ Float_t GetEM() const {return em;}
+ Float_t GetMuP() const {return mup;}
+ Float_t GetMuM() const {return mum;}
+ Float_t GetPiP() const {return pip;}
+ Float_t GetPiM() const {return pim;}
+ Float_t GetKP() const {return kp;}
+ Float_t GetKM() const {return km;}
+ Float_t GetProt() const {return prot;}
+ Float_t GetProtBar() const {return protbar;}
+
+ // cuts init function
+ void Init();
+
+ // check MC tracks
+ Bool_t IsSelected(TObject *) {return kTRUE;}
+
+ // add particle to array
+ void AddPdgParticle(Int_t idx=-1, Int_t pdgcode=0) const;
+
+ // check particle in array
+ Bool_t IsPdgParticle(Int_t pdgcode=0) const;
+
+ // Merge output objects (needed by PROOF)
+ virtual Long64_t Merge(TCollection* list);
+
+private:
+ Int_t fMinRowsWithDigits; // min. number of TPC raws with digits
+ Float_t fMaxR; // max. R distance from MC vertex
+ Float_t fMaxVz; // max. Z distance from MC vertex
+ Float_t fMinTPCSignal; // min. TPC Signal calculated from Bethe Bloch formula
+ Float_t fMaxTPCSignal; // max. TPC Signal calculated from Bethe Bloch formula
+
+ TArrayI* aTrackParticles; // array of tracked particles
+
+ // PDG tracked particles (later added to aTrackParticles)
+ enum enumData {
+ kNParticles = 10, // number of particles below
+ ep = 11,
+ em = -11,
+ mup = 13,
+ mum = -13,
+ pip = 211,
+ pim = -211,
+ kp = 321,
+ km = -321,
+ prot = 2212,
+ protbar = -2212
+ };
+
+ AliMCInfoCuts(const AliMCInfoCuts&); // not implemented
+ AliMCInfoCuts& operator=(const AliMCInfoCuts&); // not implemented
+
+ ClassDef(AliMCInfoCuts, 1)
+};
+
+#endif // ALIMCINFOCUTS_H
--- /dev/null
+//------------------------------------------------------------------------------
+// Implementation of the AliRecInfoCuts class. It keeps selection cuts for
+// reconstructed tracks.
+//
+// Author: J.Otwinowski 04/02/2008
+//------------------------------------------------------------------------------
+
+#include "AliRecInfoCuts.h"
+
+ClassImp(AliRecInfoCuts)
+
+//_____________________________________________________________________________
+AliRecInfoCuts::AliRecInfoCuts(const Char_t* name,const Char_t *title) : AliESDtrackCuts(name, title)
+, fMinTPCsignalN(0)
+, fMaxAbsTanTheta(0)
+{
+ // init data members with defaults
+ Init();
+}
+
+//_____________________________________________________________________________
+void AliRecInfoCuts::Init()
+{
+ // set default values
+ SetMinTPCsignalN();
+ SetMaxAbsTanTheta();
+}
+
+
+//_____________________________________________________________________________
+/*
+Long64_t AliRecInfoCuts::Merge(TCollection* list) const
+{
+ // Merge list of objects (needed by PROOF)
+
+ if (!list)
+ return 0;
+
+ if (list->IsEmpty())
+ return 1;
+
+ TIterator* iter = list->MakeIterator();
+ TObject* obj = 0;
+
+ Int_t count=0;
+ while((obj = iter->Next()) != 0)
+ {
+ AliRecInfoCuts* entry = dynamic_cast<AliRecInfoCuts*>(obj);
+ if (entry == 0)
+ continue;
+
+ count++;
+ }
+
+return count;
+}
+*/
+
--- /dev/null
+#ifndef ALIRECINFOCUTS_H
+#define ALIRECINFOCUTS_H
+
+//------------------------------------------------------------------------------
+// Class to keep selection cuts for reconstructed tracks.
+//
+// Author: J.Otwinowski 04/02/2008
+//------------------------------------------------------------------------------
+
+#include "esdTrackCuts/AliESDtrackCuts.h"
+
+class AliRecInfoCuts : public AliESDtrackCuts
+{
+public:
+ AliRecInfoCuts(const Char_t* name ="AliRecInfoCuts", const Char_t *title ="");
+ virtual ~AliRecInfoCuts() {;}
+
+ // setters
+ void SetMinTPCsignalN(const Int_t min=0) {fMinTPCsignalN = min;}
+ void SetMaxAbsTanTheta(const Float_t max=1e99) {fMaxAbsTanTheta = max;}
+
+ // getters
+ Int_t GetMinTPCsignalN() const {return fMinTPCsignalN;}
+ Float_t GetMaxAbsTanTheta() const {return fMaxAbsTanTheta;}
+
+ // getters for selected AliESDtrackCuts data members
+ Float_t GetPtMin() const {return fPtMin;}
+ Float_t GetPtMax() const {return fPtMax;}
+ Int_t GetMinNClustersTPC() const {return fCutMinNClusterTPC;}
+
+ // cuts init function
+ void Init();
+
+private:
+ Int_t fMinTPCsignalN; // min. number of TPC hits
+ Float_t fMaxAbsTanTheta; // max. absolute value of tan(theta)
+
+ AliRecInfoCuts(const AliRecInfoCuts&); // not implemented
+ AliRecInfoCuts& operator=(const AliRecInfoCuts&); // not implemented
+
+ ClassDef(AliRecInfoCuts, 1)
+};
+
+#endif //ALIRECINFOCUTS_H