]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added AliRsnAction, AliRsnPIDRange
authorfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 21 Mar 2012 17:58:33 +0000 (17:58 +0000)
committerfbellini <fbellini@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 21 Mar 2012 17:58:33 +0000 (17:58 +0000)
PWGLF/RESONANCES/AliRsnAction.cxx [new file with mode: 0755]
PWGLF/RESONANCES/AliRsnAction.h [new file with mode: 0755]
PWGLF/RESONANCES/AliRsnPIDRange.cxx [new file with mode: 0755]
PWGLF/RESONANCES/AliRsnPIDRange.h [new file with mode: 0755]

diff --git a/PWGLF/RESONANCES/AliRsnAction.cxx b/PWGLF/RESONANCES/AliRsnAction.cxx
new file mode 100755 (executable)
index 0000000..d566802
--- /dev/null
@@ -0,0 +1,74 @@
+//
+// *** Class AliRsnAction ***
+//
+//  Base class for Action
+//
+// authors: Martin Vala (martin.vala@cern.ch)
+//          Jan Musinsky (jan.musinsky@cern.ch)
+//
+
+#include <TObjArray.h>
+
+#include "AliRsnAction.h"
+
+ClassImp(AliRsnAction)
+
+//__________________________________________________________________________________________________
+AliRsnAction::AliRsnAction(const char *name,const char *title) : TNamed(name,title)
+{
+//
+// Default constructor
+//
+
+}
+
+//__________________________________________________________________________________________________
+AliRsnAction::AliRsnAction(const AliRsnAction &copy) : TNamed(copy)
+{
+//
+// Copy constructor
+//
+}
+
+//__________________________________________________________________________________________________
+AliRsnAction &AliRsnAction::operator=(const AliRsnAction &copy)
+{
+//
+// Assignment constructor
+//
+   TNamed::operator=(copy);
+   if (this == &copy)
+      return *this;
+
+   return (*this);
+}
+
+//__________________________________________________________________________________________________
+AliRsnAction::~AliRsnAction()
+{
+//
+// Destructor
+//
+}
+
+//__________________________________________________________________________________________________
+Bool_t AliRsnAction::InitAction(TList */*outList*/,TObjArray */*objects*/)
+{
+//
+// Init of Action
+//
+
+   return kTRUE;
+
+}
+
+//__________________________________________________________________________________________________
+Bool_t AliRsnAction::ExecAction(TObjArray */*objects*/)
+{
+//
+// Execute of action
+//
+
+   return kTRUE;
+
+}
diff --git a/PWGLF/RESONANCES/AliRsnAction.h b/PWGLF/RESONANCES/AliRsnAction.h
new file mode 100755 (executable)
index 0000000..8e95d07
--- /dev/null
@@ -0,0 +1,30 @@
+//
+// *** Class AliRsnAction ***
+//
+//  Base class for Action
+//
+// authors: Martin Vala (martin.vala@cern.ch)
+//          Jan Musinsky (jan.musinsky@cern.ch)
+//
+
+#ifndef ALIRSNACTION_H
+#define ALIRSNACTION_H
+
+#include <TNamed.h>
+
+class AliRsnAction : public TNamed {
+public:
+   AliRsnAction(const char* name="noName",const char *title="No Title");
+   AliRsnAction(const AliRsnAction &copy);
+   AliRsnAction &operator=(const AliRsnAction &copy);
+   virtual ~AliRsnAction();
+   
+   virtual Bool_t InitAction(TList *outList=0,TObjArray *objects=0);
+   virtual Bool_t ExecAction(TObjArray *objects=0);
+
+protected:
+   
+   ClassDef(AliRsnAction, 1)
+};
+
+#endif
diff --git a/PWGLF/RESONANCES/AliRsnPIDRange.cxx b/PWGLF/RESONANCES/AliRsnPIDRange.cxx
new file mode 100755 (executable)
index 0000000..57ce652
--- /dev/null
@@ -0,0 +1,62 @@
+//
+// Class AliRsnCutPIDNSigma
+//
+// General implementation of a single cut strategy, which can be:
+// - a value contained in a given interval  [--> IsBetween()   ]
+// - a value equal to a given reference     [--> MatchesValue()]
+//
+// In all cases, the reference value(s) is (are) given as data members
+// and each kind of cut requires a given value type (Int, UInt, Double),
+// but the cut check procedure is then automatized and chosen thanks to
+// an enumeration of the implemented cut types.
+// At the end, the user (or any other point which uses this object) has
+// to use the method IsSelected() to check if this cut has been passed.
+//
+// authors: Martin Vala (martin.vala@cern.ch)
+//          Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
+//
+
+#include "AliRsnPIDRange.h"
+
+ClassImp(AliRsnPIDRange)
+
+//_____________________________________________________________________________
+AliRsnPIDRange::AliRsnPIDRange(Double_t nsigma, Double_t pmin, Double_t pmax) : TObject() ,
+   fPMin(pmin),
+   fPMax(pmax),
+   fNSigmaCut(nsigma)
+{
+//
+// Default constructor
+//
+
+}
+
+//_____________________________________________________________________________
+AliRsnPIDRange::AliRsnPIDRange(const AliRsnPIDRange &copy) : TObject(copy),
+   fPMin(copy.fPMin),
+   fPMax(copy.fPMax),
+   fNSigmaCut(copy.fNSigmaCut)
+{
+//
+// Copy constructor
+//
+
+}
+
+//_____________________________________________________________________________
+AliRsnPIDRange &AliRsnPIDRange::operator=(const AliRsnPIDRange &copy)
+{
+//
+// Assignment operator.
+//
+
+   TObject::operator=(copy);
+   if (this == &copy)
+      return *this;
+   fPMin = copy.fPMin;
+   fPMax = copy.fPMax;
+   fNSigmaCut = copy.fNSigmaCut;
+
+   return (*this);
+}
diff --git a/PWGLF/RESONANCES/AliRsnPIDRange.h b/PWGLF/RESONANCES/AliRsnPIDRange.h
new file mode 100755 (executable)
index 0000000..65bdb1c
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef ALIRSNPIDRANGE_H
+#define ALIRSNPIDRANGE_H
+
+//
+// Class for n-sigma PID cuts.
+// ---
+// Requires:
+//
+// 1) the used detector, chosen from an enumeration
+// 2) the reference charged particle species, chosen from AliPID enumeration
+// 3) a momentum range: outside it, the cut is never passed
+//
+
+#include <TObject.h>
+#include <Rtypes.h>
+
+class AliRsnPIDRange : public TObject {
+public:
+
+   AliRsnPIDRange(Double_t nsigma=3.0, Double_t pmin=0.0, Double_t pmax=1E20);
+   AliRsnPIDRange(const AliRsnPIDRange &copy);
+   AliRsnPIDRange &operator=(const AliRsnPIDRange &copy);
+   virtual ~AliRsnPIDRange() { }
+
+   Double_t PMin() const      {return fPMin;}
+   Double_t PMax() const      {return fPMax;}
+   Double_t NSigmaCut() const {return fNSigmaCut;}
+
+   Bool_t IsInRange(Double_t mom)  {return (mom >= fPMin && mom <= fPMax);}
+   Bool_t CutPass(Double_t nsigma) {return (nsigma <= fNSigmaCut);}
+
+private:
+
+   Double_t fPMin;      // lower bound of momentum range
+   Double_t fPMax;      // upper bound of momentum range
+   Double_t fNSigmaCut; // cut in number of sigmas
+
+   ClassDef(AliRsnPIDRange,1)
+};
+
+#endif