]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added partial implementation of AliPHOSClusterSelection class
authorHenrik Qvigstad <henrik.qvigstad@fys.uio.no>
Tue, 21 Jan 2014 12:29:44 +0000 (13:29 +0100)
committerHenrik Qvigstad <henrik.qvigstad@fys.uio.no>
Tue, 21 Jan 2014 12:37:40 +0000 (13:37 +0100)
PWGGA/PHOSTasks/ClusterSelection/AliPHOSClusterSelection.cxx [new file with mode: 0644]

diff --git a/PWGGA/PHOSTasks/ClusterSelection/AliPHOSClusterSelection.cxx b/PWGGA/PHOSTasks/ClusterSelection/AliPHOSClusterSelection.cxx
new file mode 100644 (file)
index 0000000..e402a1d
--- /dev/null
@@ -0,0 +1,67 @@
+#include "AliPHOSClusterSelection.h"
+
+AliPHOSClusterSelection::AliPHOSClusterSelection()
+  : fMinChargedParticleTrackDistance(-1.), 
+    fNotUnfolded(false),
+    fMaxDispR2(-1.),
+    fMaxDispCoreR2(-1.),
+    fMaxTOF(-1.)
+{
+  // Defaults to the most lenient selection allowable
+       return;
+}
+
+AliPHOSClusterSelection::~AliPHOSClusterSelection()
+{
+}
+
+Bool_t AliPHOSClusterSelection::IsSelected(AliVCluster* cluster) const
+{
+  return IsSelectedCPV(cluster)
+    && IsSelectedUnfolded(cluster)
+    && IsSelectedDisp(cluster)
+    && IsSelectedDispCore(cluster)
+    && IsSelectedTOF(cluster);
+}
+
+Bool_t IsSelectedCPV(AliVCluster* cluster) const
+{
+  if( 0 > SetMinChargedParticleTrackDistance )
+    return true; 
+  //TODO: implement positive case
+}
+
+AliPHOSClusterSelection* AliPHOSClusterSelection::SetMinChargedParticleTrackDistance(Float_t distance)
+{
+  // 'distance' set the minimal allowable distance between the cluster
+  // and the nearest extrapolated track.
+  // If 'distance' is negative, then all clusters are sellected, the selection
+  // being "not applied" or "disabled".
+  
+  fMinChargedParticleTrackDistance = distance;
+}
+
+TString AliPHOSClusterSelection::ToString() const
+{
+  // returns a string an quasi-unique string for whatever selection 
+  // parameters the instance contains. The uniqueness of the string
+  // is limited by the precision given in the formatting of the string.
+  // Take care that the precision is sufficient for your needs.
+
+  return TString::Format("%f_%i_%f_%f_%f",
+                        fMinChargedParticleTrackDistance,
+                        fNotUnfolded,
+                        fMaxDispR2,
+                        fMaxDispCoreR2,
+                        fMaxTOF
+                        );
+}
+
+
+Float_t AliPHOSClusterSelection::SetMinChargedParticleTrackDistance(const TString& string)
+{
+  TObjArray * objarray = string.Tokenize("_");
+  Float_t flt = objarray->At(0)->Atof();
+  delete objarray;
+  return flt;
+}