]>
Commit | Line | Data |
---|---|---|
d92ed900 | 1 | /////////////////////////////////////////////////////////////////////////// |
2 | // // | |
3 | // AliFemtoPicoEventCollectionVectorHideAway: a helper class for // | |
4 | // managing many mixing buffers with up to three variables used for // | |
5 | // binning. // | |
6 | // // | |
7 | /////////////////////////////////////////////////////////////////////////// | |
d0e92d9a | 8 | #include "AliFemtoPicoEventCollectionVectorHideAway.h" |
67427ff7 | 9 | |
10 | // ----------------------------------- | |
11 | AliFemtoPicoEventCollectionVectorHideAway::AliFemtoPicoEventCollectionVectorHideAway(int bx, double lx, double ux, | |
0215f606 | 12 | int by, double ly, double uy, |
13 | int bz, double lz, double uz): | |
14 | fBinsTot(0), | |
15 | fBinsx(bx), fBinsy(by), fBinsz(bz), | |
16 | fMinx(lx), fMiny(ly), fMinz(lz), | |
17 | fMaxx(ux), fMaxy(uy), fMaxz(uz), | |
18 | fStepx(0), fStepy(0), fStepz(0), | |
19 | fCollection(0), | |
20 | fCollectionVector(0) | |
21 | { | |
d92ed900 | 22 | // basic constructor |
0215f606 | 23 | fBinsTot = fBinsx * fBinsy * fBinsz; |
24 | fStepx=0; fStepx = (fMaxx-fMinx)/fBinsx; | |
25 | fStepy=0; fStepy = (fMaxy-fMiny)/fBinsy; | |
26 | fStepz=0; fStepz = (fMaxz-fMinz)/fBinsz; | |
27 | ||
28 | ||
29 | //fCollectionVector = new AliFemtoPicoEventCollectionVector(); | |
30 | fCollection = 0; | |
31 | for ( int i=0; i<fBinsTot; i++) { | |
32 | fCollection = new AliFemtoPicoEventCollection(); | |
33 | fCollectionVector.push_back(fCollection); | |
34 | } | |
67427ff7 | 35 | } |
36 | // ----------------------------------- | |
37 | AliFemtoPicoEventCollection* AliFemtoPicoEventCollectionVectorHideAway::PicoEventCollection(int ix, int iy, int iz) { | |
d92ed900 | 38 | // return mixing event collection from a given bin |
67427ff7 | 39 | if ( ix<0 || ix >= fBinsx) return 0; |
40 | if ( iy<0 || iy >= fBinsy) return 0; | |
41 | if ( iz<0 || iz >= fBinsz) return 0; | |
42 | int bin = ix + iy*fBinsx + iz*fBinsy*fBinsx; | |
43 | cout << " AliFemtoPicoEventCollectionVectorHideAway::PicoEventCollection(...) - bin(ix,iy,iz): "; | |
44 | cout << bin << "(" << ix <<"," << iy << "," << iz <<")" << endl; | |
45 | return fCollectionVector[bin]; | |
46 | } | |
47 | // ----------------------------------- | |
48 | AliFemtoPicoEventCollection* AliFemtoPicoEventCollectionVectorHideAway::PicoEventCollection(double x, double y, double z) { | |
d92ed900 | 49 | // return mixing event collection for given values on x, y, z axes |
67427ff7 | 50 | int ix,iy,iz; |
51 | ix=0;iy=0;iz=0; | |
52 | ||
53 | ix = (int)floor( (x-fMinx)/fStepx ); | |
54 | iy = (int)floor( (y-fMiny)/fStepy ); | |
55 | iz = (int)floor( (z-fMinz)/fStepz ); | |
56 | ||
57 | return PicoEventCollection( ix,iy,iz ); | |
58 | } | |
0215f606 | 59 | //___________________________________ |
60 | AliFemtoPicoEventCollectionVectorHideAway::AliFemtoPicoEventCollectionVectorHideAway(const AliFemtoPicoEventCollectionVectorHideAway& aColl): | |
61 | fBinsTot(0), | |
62 | fBinsx(0), fBinsy(0), fBinsz(0), | |
63 | fMinx(0), fMiny(0), fMinz(0), | |
64 | fMaxx(0), fMaxy(0), fMaxz(0), | |
65 | fStepx(0), fStepy(0), fStepz(0), | |
66 | fCollection(0), | |
67 | fCollectionVector(0) | |
68 | { | |
d92ed900 | 69 | // copy constructor |
0215f606 | 70 | fBinsTot = aColl.fBinsTot; |
71 | fBinsx = aColl.fBinsx; | |
72 | fBinsy = aColl.fBinsy; | |
73 | fBinsz = aColl.fBinsz; | |
74 | fMinx = aColl.fMinx; | |
75 | fMiny = aColl.fMiny; | |
76 | fMinz = aColl.fMinz; | |
77 | fMaxx = aColl.fMaxx; | |
78 | fMaxy = aColl.fMaxy; | |
79 | fMaxz = aColl.fMaxz; | |
80 | fStepx = aColl.fStepx; | |
81 | fStepy = aColl.fStepy; | |
82 | fStepz = aColl.fStepz; | |
83 | fCollection = aColl.fCollection; | |
84 | ||
85 | fCollectionVector.clear(); | |
86 | for (int iter=0; aColl.fCollectionVector.size();iter++){ | |
87 | fCollectionVector.push_back(aColl.fCollectionVector[iter]); | |
88 | } | |
89 | } | |
90 | //___________________________________ | |
91 | AliFemtoPicoEventCollectionVectorHideAway::~AliFemtoPicoEventCollectionVectorHideAway() | |
92 | { | |
d92ed900 | 93 | // destructor |
0215f606 | 94 | fCollectionVector.clear(); |
95 | } | |
96 | //___________________________________ | |
97 | AliFemtoPicoEventCollectionVectorHideAway& AliFemtoPicoEventCollectionVectorHideAway::operator=(const AliFemtoPicoEventCollectionVectorHideAway& aColl) | |
98 | { | |
d92ed900 | 99 | // assignment operator |
0215f606 | 100 | if (this == &aColl) |
101 | return *this; | |
102 | ||
103 | fBinsTot = aColl.fBinsTot; | |
104 | fBinsx = aColl.fBinsx; | |
105 | fBinsy = aColl.fBinsy; | |
106 | fBinsz = aColl.fBinsz; | |
107 | fMinx = aColl.fMinx; | |
108 | fMiny = aColl.fMiny; | |
109 | fMinz = aColl.fMinz; | |
110 | fMaxx = aColl.fMaxx; | |
111 | fMaxy = aColl.fMaxy; | |
112 | fMaxz = aColl.fMaxz; | |
113 | fStepx = aColl.fStepx; | |
114 | fStepy = aColl.fStepy; | |
115 | fStepz = aColl.fStepz; | |
116 | fCollection = aColl.fCollection; | |
117 | ||
118 | fCollectionVector.clear(); | |
119 | ||
120 | for (int iter=0; aColl.fCollectionVector.size();iter++){ | |
121 | fCollectionVector.push_back(aColl.fCollectionVector[iter]); | |
122 | } | |
123 | ||
124 | return *this; | |
125 | } |