StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtSectoredPicoEvent.cc
1 /***************************************************************************
2  *
3  * $Id: StHbtSectoredPicoEvent.cc,v 1.2 2000/05/25 20:57:18 laue Exp $
4  *
5  * Author: Robert Willson, Ohio State, willson@bnl.gov
6  ***************************************************************************
7  *
8  * Description: part of STAR HBT Framework: StHbtMaker package
9  * Specialized PicoEvents used in StHbtSectoredAnalysis. A single
10  * PicoEvent contains a number of particle collections for each sector
11  * in momentum space. These are grouped in a single dimensional array.
12  *
13  ***************************************************************************
14  *
15  * $Log: StHbtSectoredPicoEvent.cc,v $
16  * Revision 1.2 2000/05/25 20:57:18 laue
17  * bug fix in creating the arrays of collections. Now compiles on solaris
18  *
19  * Revision 1.1 2000/04/12 01:47:00 willson
20  * Initial Installation
21  *
22  *
23  **************************************************************************/
24 
25 #include "StHbtMaker/Infrastructure/StHbtSectoredPicoEvent.hh"
26 
27 //________________
28 StHbtSectoredPicoEvent::StHbtSectoredPicoEvent(int numbins){
29 
30  int i;
31 
32  mNumBins = numbins;
33 
34  StHbtParticleCollection **sectoredCollection1 = new StHbtParticleCollection*[mNumBins+1];
35  mFirstSectoredCollection = sectoredCollection1;
36 
37  for (i=0; i<=mNumBins; i++)
38  mFirstSectoredCollection[i] = new StHbtParticleCollection;
39 
40  StHbtParticleCollection **sectoredCollection2 = new StHbtParticleCollection*[mNumBins+1];
41  mSecondSectoredCollection = sectoredCollection2;
42 
43  for (i=0; i<=mNumBins; i++)
44  mSecondSectoredCollection[i] = new StHbtParticleCollection;
45 
46  StHbtParticleCollection **sectoredCollection3 = new StHbtParticleCollection*[mNumBins+1];
47  mThirdSectoredCollection = sectoredCollection3;
48 
49  for (i=0; i<=mNumBins; i++)
50  mThirdSectoredCollection[i] = new StHbtParticleCollection;
51 }
52 
53 //________________
54 StHbtSectoredPicoEvent::StHbtSectoredPicoEvent(int numbinsx, int numbinsy, int numbinsz){
55 
56  int i;
57 
58  mNumBins = numbinsx*numbinsy*numbinsz;
59 
60  StHbtParticleCollection **sectoredCollection1 = new StHbtParticleCollection*[mNumBins+1];
61  mFirstSectoredCollection = sectoredCollection1;
62 
63  for (i=0; i<=mNumBins; i++)
64  mFirstSectoredCollection[i] = new StHbtParticleCollection;
65 
66  StHbtParticleCollection **sectoredCollection2 = new StHbtParticleCollection*[mNumBins+1];
67  mSecondSectoredCollection = sectoredCollection2;
68 
69  for (i=0; i<=mNumBins; i++)
70  mSecondSectoredCollection[i] = new StHbtParticleCollection;
71 
72  StHbtParticleCollection **sectoredCollection3 = new StHbtParticleCollection*[mNumBins+1];
73  mThirdSectoredCollection = sectoredCollection3;
74 
75  for (i=0; i<=mNumBins; i++)
76  mThirdSectoredCollection[i] = new StHbtParticleCollection;
77 }
78 
79 //_________________
80 StHbtSectoredPicoEvent::~StHbtSectoredPicoEvent(){
81 
82  int i;
83 
84  StHbtParticleIterator iter;
85 
86  for (i=0; i<=mNumBins; i++) {
87  for (iter=mFirstSectoredCollection[i]->begin();iter!=mFirstSectoredCollection[i]->end();iter++){
88  delete *iter;
89  }
90  delete mFirstSectoredCollection[i];
91  }
92  delete [] mFirstSectoredCollection;
93 
94  for (i=0; i<=mNumBins; i++) {
95  for (iter=mSecondSectoredCollection[i]->begin();iter!=mSecondSectoredCollection[i]->end();iter++){
96  delete *iter;
97  }
98  delete mSecondSectoredCollection[i];
99  }
100  delete [] mSecondSectoredCollection;
101 
102  for (i=0; i<=mNumBins; i++) {
103  for (iter=mThirdSectoredCollection[i]->begin();iter!=mThirdSectoredCollection[i]->end();iter++){
104  delete *iter;
105  }
106  delete mThirdSectoredCollection[i];
107  }
108  delete [] mThirdSectoredCollection;
109 
110 }
111 //_________________