25 #include "StHbtMaker/Infrastructure/StHbtPicoEventCollectionVectorHideAway.hh"
28 StHbtPicoEventCollectionVectorHideAway::StHbtPicoEventCollectionVectorHideAway(
int bx,
double lx,
double ux,
29 int by,
double ly,
double uy,
30 int bz,
double lz,
double uz) {
31 mBinsx = bx; mMinx = lx; mMaxx = ux;
32 mBinsy = by; mMiny = ly; mMaxy = uy;
33 mBinsz = bz; mMinz = lz; mMaxz = uz;
35 mBinsTot = mBinsx * mBinsy * mBinsz;
36 mStepx=0; mStepx = (mMaxx-mMinx)/mBinsx;
37 mStepy=0; mStepy = (mMaxy-mMiny)/mBinsy;
38 mStepz=0; mStepz = (mMaxz-mMinz)/mBinsz;
43 for (
int i=0; i<mBinsTot; i++) {
44 mCollection =
new StHbtPicoEventCollection();
45 mCollectionVector.push_back(mCollection);
49 StHbtPicoEventCollection* StHbtPicoEventCollectionVectorHideAway::PicoEventCollection(
int ix,
int iy,
int iz) {
50 if ( ix<0 || ix >= mBinsx)
return 0;
51 if ( iy<0 || iy >= mBinsy)
return 0;
52 if ( iz<0 || iz >= mBinsz)
return 0;
53 int bin = ix + iy*mBinsx + iz*mBinsy*mBinsx;
54 cout <<
" StHbtPicoEventCollectionVectorHideAway::PicoEventCollection(...) - bin(ix,iy,iz): ";
55 cout << bin <<
"(" << ix <<
"," << iy <<
"," << iz <<
")" << endl;
56 return mCollectionVector[bin];
59 StHbtPicoEventCollection* StHbtPicoEventCollectionVectorHideAway::PicoEventCollection(
double x,
double y,
double z) {
63 ix = (int)floor( (x-mMinx)/mStepx );
64 iy = (int)floor( (y-mMiny)/mStepy );
65 iz = (int)floor( (z-mMinz)/mStepz );
67 return PicoEventCollection( ix,iy,iz );