StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSvtHybridCluster.cc
1 /***************************************************************************
2  *
3  * $Id: StSvtHybridCluster.cc,v 1.2 2000/08/21 13:06:58 caines Exp $
4  *
5  * Author:
6  ***************************************************************************
7  *
8  * Description: Hybrid Cluster class
9  *
10  ***************************************************************************
11  *
12  * $Log: StSvtHybridCluster.cc,v $
13  * Revision 1.2 2000/08/21 13:06:58 caines
14  * Much improved hit finding and fitting
15  *
16  * Revision 1.1 2000/07/06 03:50:34 caines
17  * First version of cluster finder and fitter
18  *
19  **************************************************************************/
20 
21 #include "StSvtHybridCluster.hh"
22 
23 
24 ClassImp(StSvtHybridCluster)
25 
27 {
28  numberOfClusters = 0;
29  numberOfMembers = NULL;
30  memberInfo = NULL;
31 
32 }
33 
34 
35 
36 StSvtHybridCluster::StSvtHybridCluster(const StSvtHybridCluster& c)
37 {
38  numberOfClusters = c.numberOfClusters;
39  numberOfMembers =c.numberOfMembers;
40  memberInfo =c.memberInfo;
41 }
42 
43 
44 StSvtHybridCluster::~StSvtHybridCluster()
45 {
46  delete[] numberOfMembers;
47 
48 for(int clu = 0; clu < numberOfClusters; clu++)
49  delete[] memberInfo[clu];
50 
51  delete [] memberInfo;
52 
53 }
54 
55 int StSvtHybridCluster::setCluster(StSvtClusterFinder* cluFinder)
56 {
57 
58  numberOfClusters = cluFinder -> ClusterIndex();
59 
60  numberOfMembers = new int[numberOfClusters];
61 
62  memberInfo = new StSvtClusterMemberInfo*[numberOfClusters];
63 
64  for(int clu = 0; clu < numberOfClusters; clu++)
65  {
66  numberOfMembers[clu] = cluFinder -> ClusterMembers(clu);
67 
68  memberInfo[clu] = new StSvtClusterMemberInfo[numberOfMembers[clu]];
69 
70  for(int mem = 0; mem < numberOfMembers[clu]; mem++)
71  {
72  memberInfo[clu][mem].listAnode = cluFinder -> ClusterListAnode(clu,mem);
73  int listanode = memberInfo[clu][mem].listAnode;
74  memberInfo[clu][mem].actualAnode = cluFinder ->ClusterActualAnode(listanode);
75  memberInfo[clu][mem].seq = cluFinder -> ClusterSequence(clu,mem);
76 
77  }
78  }
79  return 0;
80 }
81 
82 int StSvtHybridCluster::getNumberOfClusters()
83  {
84  return numberOfClusters;
85  }
86 
87 
88 int StSvtHybridCluster::getNumberOfMembers(int clu)
89  {
90  return numberOfMembers[clu];
91  }
92 
93 int StSvtHybridCluster::getCluMemInfo(int clu, int &numOfMem, StSvtClusterMemberInfo** memInfo)
94  {
95  for(int i=0; i<numberOfClusters;i++)
96  if(i==clu)
97  {
98  numOfMem = numberOfMembers[i];
99  *memInfo = NULL;
100  *memInfo = memberInfo[i];
101  break;
102  }
103  return 0;
104  }
105 
106 
107 StSvtClusterMemberInfo* StSvtHybridCluster::getCluMemInfo(int clu)
108 {
109  if(clu >= 0 && clu <= numberOfClusters) {
110  return memberInfo[clu];
111  }
112  else{
113  return NULL;
114  }
115 }
116