]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/PHOSTasks/ClusterSelection/AliPHOSClusterSelection.cxx
Added partial implementation of AliPHOSClusterSelection class
[u/mrichter/AliRoot.git] / PWGGA / PHOSTasks / ClusterSelection / AliPHOSClusterSelection.cxx
1 #include "AliPHOSClusterSelection.h"
2
3 AliPHOSClusterSelection::AliPHOSClusterSelection()
4   : fMinChargedParticleTrackDistance(-1.), 
5     fNotUnfolded(false),
6     fMaxDispR2(-1.),
7     fMaxDispCoreR2(-1.),
8     fMaxTOF(-1.)
9 {
10   // Defaults to the most lenient selection allowable
11         return;
12 }
13
14 AliPHOSClusterSelection::~AliPHOSClusterSelection()
15 {
16 }
17
18 Bool_t AliPHOSClusterSelection::IsSelected(AliVCluster* cluster) const
19 {
20   return IsSelectedCPV(cluster)
21     && IsSelectedUnfolded(cluster)
22     && IsSelectedDisp(cluster)
23     && IsSelectedDispCore(cluster)
24     && IsSelectedTOF(cluster);
25 }
26
27 Bool_t IsSelectedCPV(AliVCluster* cluster) const
28 {
29   if( 0 > SetMinChargedParticleTrackDistance )
30     return true; 
31   //TODO: implement positive case
32 }
33
34 AliPHOSClusterSelection* AliPHOSClusterSelection::SetMinChargedParticleTrackDistance(Float_t distance)
35 {
36   // 'distance' set the minimal allowable distance between the cluster
37   // and the nearest extrapolated track.
38   // If 'distance' is negative, then all clusters are sellected, the selection
39   // being "not applied" or "disabled".
40   
41   fMinChargedParticleTrackDistance = distance;
42 }
43
44 TString AliPHOSClusterSelection::ToString() const
45 {
46   // returns a string an quasi-unique string for whatever selection 
47   // parameters the instance contains. The uniqueness of the string
48   // is limited by the precision given in the formatting of the string.
49   // Take care that the precision is sufficient for your needs.
50
51   return TString::Format("%f_%i_%f_%f_%f",
52                          fMinChargedParticleTrackDistance,
53                          fNotUnfolded,
54                          fMaxDispR2,
55                          fMaxDispCoreR2,
56                          fMaxTOF
57                          );
58 }
59
60
61 Float_t AliPHOSClusterSelection::SetMinChargedParticleTrackDistance(const TString& string)
62 {
63   TObjArray * objarray = string.Tokenize("_");
64   Float_t flt = objarray->At(0)->Atof();
65   delete objarray;
66   return flt;
67 }