StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEmcPreClusterCollection.cxx
1 #include "StEmcPreClusterCollection.h"
2 
4 
6 {
7  mDetector = detector;
8 }
9 StEmcPreClusterCollection::~StEmcPreClusterCollection()
10 {
11  Delete();
12  Clear();
13 }
15 {
16  Add(cluster);
17  return;
18 }
20 {
21  StEmcPreCluster* cl = new StEmcPreCluster(mDetector);
22  Add(cl);
23  return cl;
24 }
26 {
27  return (StEmcPreCluster*)At(clId);
28 }
30 {
31  return GetSize();
32 }
34 {
35  StEmcPreCluster *cluster = getCluster(clId);
36  if(!cluster)
37  return NULL;
38  Remove(cluster);
39  return cluster;
40 }
42 {
43  if(!cl)
44  return NULL;
45  Remove(cl);
46  return cl;
47 }
49 {
50  StEmcPreCluster *cluster = getCluster(clId);
51  if(!cluster)
52  return;
53  Remove(cluster);
54  delete cluster;
55  return;
56 }
58 {
59  if(!cl)
60  return;
61  Remove(cl);
62  delete cl;
63  return;
64 }
65 
Int_t getNClusters()
gets the number of clusters in the collection
void addCluster(StEmcPreCluster *)
add a previously created cluster to the collection
StEmcPreCluster * newCluster()
creates a new cluster in the collection. Returns its pointer
void deleteCluster(Int_t)
removes and deletes a cluster from the collection
StEmcPreCluster * removeCluster(Int_t)
removes a cluster from the collection. DOES NOT delete it. Returns its pointer
StEmcPreCluster * getCluster(Int_t)
gets a cluster in the collection by its index