CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes

TEcnaNArrayD Class Reference

#include <TEcnaNArrayD.h>

List of all members.

Public Member Functions

void Clean ()
Double_t GetOverFlow () const
const Double_t & operator() (Int_t i1) const
Double_t & operator() (Int_t i1, Int_t i2, Int_t i3, Int_t i4)
const Double_t & operator() (Int_t i1, Int_t i2) const
const Double_t & operator() (Int_t i1, Int_t i2, Int_t i3) const
const Double_t & operator() (Int_t i1, Int_t i2, Int_t i3, Int_t i4) const
const Double_t & operator() (Int_t i1, Int_t i2, Int_t i3, Int_t i4, Int_t i5) const
const Double_t & operator() (Int_t i1, Int_t i2, Int_t i3, Int_t i4, Int_t i5, Int_t i6) const
Double_t & operator() (Int_t i1)
Double_t & operator() (Int_t i1, Int_t i2)
Double_t & operator() (Int_t i1, Int_t i2, Int_t i3)
Double_t & operator() (Int_t i1, Int_t i2, Int_t i3, Int_t i4, Int_t i5)
Double_t & operator() (Int_t i1, Int_t i2, Int_t i3, Int_t i4, Int_t i5, Int_t i6)
void ReSet (Int_t, Int_t, Int_t, Int_t, Int_t, Int_t)
void ReSet (Int_t, Int_t, Int_t)
void ReSet (Int_t, Int_t, Int_t, Int_t, Int_t)
void ReSet (Int_t, Int_t)
void ReSet (Int_t)
void ReSet (Int_t, Int_t, Int_t, Int_t)
 TEcnaNArrayD (Int_t)
 TEcnaNArrayD (Int_t, Int_t, Int_t, Int_t, Int_t, Int_t)
 TEcnaNArrayD ()
 TEcnaNArrayD (Int_t, Int_t, Int_t)
 TEcnaNArrayD (Int_t, Int_t)
 TEcnaNArrayD (const TEcnaNArrayD &)
 TEcnaNArrayD (Int_t, Int_t, Int_t, Int_t, Int_t)
 TEcnaNArrayD (Int_t, Int_t, Int_t, Int_t)
virtual ~TEcnaNArrayD ()

Protected Member Functions

void Init ()
Int_t OneDim (Int_t, Int_t, Int_t, Int_t, Int_t, Int_t) const
Int_t OneDim (Int_t, Int_t, Int_t, Int_t, Int_t) const
Int_t OneDim (Int_t, Int_t, Int_t, Int_t) const
Int_t OneDim (Int_t, Int_t, Int_t) const
Int_t OneDim (Int_t, Int_t) const
Int_t OneDim (Int_t) const

Protected Attributes

Double_t * fA
Int_t fN1
Int_t fN2
Int_t fN3
Int_t fN4
Int_t fN5
Int_t fN6
Int_t fNd
Int_t fNL

Detailed Description

Definition at line 13 of file TEcnaNArrayD.h.


Constructor & Destructor Documentation

TEcnaNArrayD::TEcnaNArrayD ( )
TEcnaNArrayD::TEcnaNArrayD ( const TEcnaNArrayD orig)

Definition at line 26 of file TEcnaNArrayD.cc.

References fA, fN1, fN2, fN3, fN4, fN5, fN6, fNd, fNL, and i.

                                                   {
//copy constructor

 // cout << "[Info Management] CLASS: TEcnaNArrayD.          CREATE OBJECT: this = " << this << endl;

  fNd = orig.fNd;
  fN1 = orig.fN1;
  fN2 = orig.fN2;
  fN3 = orig.fN3;
  fN4 = orig.fN4;
  fN5 = orig.fN5;
  fN6 = orig.fN6;
  fNL = orig.fNL;
  fA  = new Double_t [fNL];
  for (Int_t i=0;i<fNL;i++) fA[i] = orig.fA[i];
}
TEcnaNArrayD::TEcnaNArrayD ( Int_t  n1)

Definition at line 42 of file TEcnaNArrayD.cc.

References fA, fN1, fNd, fNL, i, Init(), and zero.

                                   {
//constructor for a 1 dimensional array of size n1. Array is put to 0

 // cout << "[Info Management] CLASS: TEcnaNArrayD.          CREATE OBJECT: this = " << this << endl;

  const Double_t zero = 0.0;
  Init();
  fNd  = 1;
  fN1  = n1;
  fNL  = n1 + 1;
  fA   = new Double_t [fNL];
  for (Int_t i=0;i<fNL;i++) fA[i] = zero;
}
TEcnaNArrayD::TEcnaNArrayD ( Int_t  n1,
Int_t  n2 
)

Definition at line 55 of file TEcnaNArrayD.cc.

References fA, fN1, fN2, fNd, fNL, i, Init(), and zero.

                                            {
//constructor for a 2 dimensional array of sizes n1,n2. Array is put to 0

 // cout << "[Info Management] CLASS: TEcnaNArrayD.          CREATE OBJECT: this = " << this << endl;

  const Double_t zero = 0.0;
  Init();
  fNd = 2;
  fN1 = n1;
  fN2 = n2;
  fNL = n1*n2 + 1;
  fA  = new Double_t [fNL];
  for (Int_t i=0;i<fNL;i++) fA[i] = zero;
}
TEcnaNArrayD::TEcnaNArrayD ( Int_t  n1,
Int_t  n2,
Int_t  n3 
)

Definition at line 69 of file TEcnaNArrayD.cc.

References fA, fN1, fN2, fN3, fNd, fNL, i, Init(), and zero.

                                                     {
//constructor 3 dimensional array of sizes n1,n2,n3. Array is put to 0

 // cout << "[Info Management] CLASS: TEcnaNArrayD.          CREATE OBJECT: this = " << this << endl;

  const Double_t zero = 0.0;
  Init();
  fNd  = 3;
  fN1  = n1;
  fN2  = n2;
  fN3  = n3;
  fNL  = n1*n2*n3 + 1;
  fA   = new Double_t [fNL];
  for (Int_t i=0;i<fNL;i++) fA[i] = zero;
}
TEcnaNArrayD::TEcnaNArrayD ( Int_t  n1,
Int_t  n2,
Int_t  n3,
Int_t  n4 
)

Definition at line 84 of file TEcnaNArrayD.cc.

References fA, fN1, fN2, fN3, fN4, fNd, fNL, i, Init(), and zero.

                                                              {
//constructor for a 4 dimensional array of sizes n1,n2,n3,n4. Array is put to 0

 // cout << "[Info Management] CLASS: TEcnaNArrayD.          CREATE OBJECT: this = " << this << endl;

  const Double_t zero = 0.0;
  Init();
  fNd  = 4;
  fN1  = n1;
  fN2  = n2;
  fN3  = n3;
  fN4  = n4;
  fNL  = n1*n2*n3*n4 + 1;
  fA   = new Double_t [fNL];
  for (Int_t i=0;i<fNL;i++) fA[i] = zero;
}
TEcnaNArrayD::TEcnaNArrayD ( Int_t  n1,
Int_t  n2,
Int_t  n3,
Int_t  n4,
Int_t  n5 
)

Definition at line 100 of file TEcnaNArrayD.cc.

References fA, fN1, fN2, fN3, fN4, fN5, fNd, fNL, i, Init(), and zero.

                                                                       {
//constructor for a 5 dimensional array of sizes n1,n2,n3,n4,n5. Array is put to 0

 // cout << "[Info Management] CLASS: TEcnaNArrayD.          CREATE OBJECT: this = " << this << endl;

  const Double_t zero = 0.0;
  Init();
  fNd  = 5;
  fN1  = n1;
  fN2  = n2;
  fN3  = n3;
  fN4  = n4;
  fN5  = n5;
  fNL  = n1*n2*n3*n4*n5 + 1;
  fA   = new Double_t [fNL];
  for (Int_t i=0;i<fNL;i++) fA[i] = zero;
}
TEcnaNArrayD::TEcnaNArrayD ( Int_t  n1,
Int_t  n2,
Int_t  n3,
Int_t  n4,
Int_t  n5,
Int_t  n6 
)

Definition at line 117 of file TEcnaNArrayD.cc.

References fA, fN1, fN2, fN3, fN4, fN5, fN6, fNd, fNL, i, Init(), and zero.

                                                                                {
//constructor for a 6 dimensional array of sizes n1,n2,n3,n4,n5,n6. Array is put to 0

 // cout << "[Info Management] CLASS: TEcnaNArrayD.          CREATE OBJECT: this = " << this << endl;

  const Double_t zero = 0.0;
  Init();
  fNd  = 6;
  fN1  = n1;
  fN2  = n2;
  fN3  = n3;
  fN4  = n4;
  fN5  = n5;
  fN6  = n6;
  fNL  = n1*n2*n3*n4*n5*n6 + 1;
  fA   = new Double_t [fNL];
  for (Int_t i=0;i<fNL;i++) fA[i] = zero;
}
TEcnaNArrayD::~TEcnaNArrayD ( ) [virtual]

Definition at line 135 of file TEcnaNArrayD.cc.

References Clean().

                            {
//destructor

 // cout << "[Info Management] CLASS: TEcnaNArrayD.          DESTROY OBJECT: this = " << this << endl;

  Clean();
}

Member Function Documentation

void TEcnaNArrayD::Clean ( )

Definition at line 142 of file TEcnaNArrayD.cc.

References fA, and Init().

Referenced by ReSet(), and ~TEcnaNArrayD().

                         {
//
  if (fA) delete [] fA;
  Init();
}
Double_t TEcnaNArrayD::GetOverFlow ( ) const [inline]

Definition at line 48 of file TEcnaNArrayD.h.

References fA, and fNL.

{ return fA[fNL-1]; }
void TEcnaNArrayD::Init ( void  ) [protected]

Definition at line 147 of file TEcnaNArrayD.cc.

References fA, fN1, fN2, fN3, fN4, fN5, fN6, fNd, and fNL.

Referenced by Clean(), and TEcnaNArrayD().

{
//Initialization
  fNd  = 0;
  fN1  = 1;
  fN2  = 1;
  fN3  = 1;
  fN4  = 1;
  fN5  = 1;
  fN6  = 1;
  fNL  = 0;
  fA   = 0;
}
Int_t TEcnaNArrayD::OneDim ( Int_t  i1,
Int_t  i2,
Int_t  i3 
) const [inline, protected]

Definition at line 182 of file TEcnaNArrayD.cc.

References gather_cfg::cout, fN1, fN2, fNL, and i.

                                                                  {
//Index from 3 dimension to 1 dimension
  Int_t i;
  i = i1 + fN1*(i2 + fN2*i3);
  if ((i>=fNL - 1) || (i<0)) {
    i = fNL - 1;
    Error("OneDim","Index outside bounds");
    cout << "i1  = " << i1  << ", i2 = "  << i2  << ", i3 = "  << i3
         << "; fN1 = " << fN1 << ", fN2 = " << fN2 << ", fNL = " << fNL << endl;
  }
  return i;
}
Int_t TEcnaNArrayD::OneDim ( Int_t  i1) const [inline, protected]

Definition at line 160 of file TEcnaNArrayD.cc.

References gather_cfg::cout, and fNL.

Referenced by operator()().

                                                {
//Index from 1 dimension to 1 dimension
  if ((i1>=fNL - 1) || (i1<0)) {
    i1 = fNL - 1;
    Error("OneDim","Index outside bounds");
    cout << "i1  = " << i1
    << "; fNL = " << fNL << endl;
  }
  return i1;
}
Int_t TEcnaNArrayD::OneDim ( Int_t  i1,
Int_t  i2,
Int_t  i3,
Int_t  i4 
) const [inline, protected]

Definition at line 194 of file TEcnaNArrayD.cc.

References fN1, fN2, fN3, fNL, and i.

                                                                           {
//Index from 4 dimension to 1 dimension
  Int_t i;
  i = i1 + fN1*(i2 + fN2*(i3 + fN3*i4));
  if ((i>=fNL - 1) || (i<0)) {
    i = fNL - 1;
    Error("OneDim","Index outside bounds");
  }
  return i;
}
Int_t TEcnaNArrayD::OneDim ( Int_t  i1,
Int_t  i2 
) const [inline, protected]

Definition at line 170 of file TEcnaNArrayD.cc.

References gather_cfg::cout, fN1, fNL, and i.

                                                         {
//Index from 2 dimension to 1 dimension
  Int_t i;
  i = i1 + fN1*i2;
  if ((i>=fNL - 1) || (i<0)) {
    i = fNL - 1;
    Error("OneDim","Index outside bounds");
    cout << "i1  = " << i1  << ", i2 = "  << i2
         << "; fN1 = " << fN1 << ", fNL = " << fNL << endl;
  }
  return i;
}
Int_t TEcnaNArrayD::OneDim ( Int_t  i1,
Int_t  i2,
Int_t  i3,
Int_t  i4,
Int_t  i5 
) const [inline, protected]

Definition at line 204 of file TEcnaNArrayD.cc.

References fN1, fN2, fN3, fN4, fNL, and i.

                                                                                    {
//Index from 5 dimension to 1 dimension
  Int_t i;
  i = i1 + fN1*(i2 + fN2*(i3 + fN3*(i4 + fN4*i5)));
  if ((i>=fNL - 1) || (i<0)) {
    i = fNL - 1;
    Error("OneDim","Index outside bounds");
  }
  return i;
}
Int_t TEcnaNArrayD::OneDim ( Int_t  i1,
Int_t  i2,
Int_t  i3,
Int_t  i4,
Int_t  i5,
Int_t  i6 
) const [inline, protected]

Definition at line 214 of file TEcnaNArrayD.cc.

References fN1, fN2, fN3, fN4, fN5, fNL, and i.

                                                                                             {
//Index from 6 dimension to 1 dimension
  Int_t i;
  i = i1 + fN1*(i2 + fN2*(i3 + fN3*(i4 + fN4*(i5 + fN5*i6))));
  if ((i>=fNL - 1) || (i<0)) {
    i = fNL - 1;
    Error("OneDim","Index outside bounds");
  }
  return i;
}
const Double_t & TEcnaNArrayD::operator() ( Int_t  i1,
Int_t  i2,
Int_t  i3,
Int_t  i4 
) const

Definition at line 314 of file TEcnaNArrayD.cc.

References fA, i, and OneDim().

                                                                                  {
  Int_t i;
  i = OneDim(i1,i2,i3,i4);
  return fA[i];
}
Double_t & TEcnaNArrayD::operator() ( Int_t  i1,
Int_t  i2 
)

Definition at line 333 of file TEcnaNArrayD.cc.

{
   return (Double_t&)((*(const TEcnaNArrayD *)this)(i1,i2));
}
const Double_t & TEcnaNArrayD::operator() ( Int_t  i1,
Int_t  i2 
) const

Definition at line 304 of file TEcnaNArrayD.cc.

References fA, i, and OneDim().

                                                                {
  Int_t i;
  i = OneDim(i1,i2);
  return fA[i];
}
Double_t & TEcnaNArrayD::operator() ( Int_t  i1,
Int_t  i2,
Int_t  i3,
Int_t  i4 
)

Definition at line 341 of file TEcnaNArrayD.cc.

{
   return (Double_t&)((*(const TEcnaNArrayD *)this)(i1,i2,i3,i4));
}
Double_t & TEcnaNArrayD::operator() ( Int_t  i1,
Int_t  i2,
Int_t  i3,
Int_t  i4,
Int_t  i5,
Int_t  i6 
)

Definition at line 349 of file TEcnaNArrayD.cc.

{
   return (Double_t&)((*(const TEcnaNArrayD *)this)(i1,i2,i3,i4,i5,i6));
}
const Double_t & TEcnaNArrayD::operator() ( Int_t  i1) const

Definition at line 299 of file TEcnaNArrayD.cc.

References fA, i, and OneDim().

                                                       {
  Int_t i;
  i = OneDim(i1);
  return fA[i];
}
const Double_t & TEcnaNArrayD::operator() ( Int_t  i1,
Int_t  i2,
Int_t  i3 
) const

Definition at line 309 of file TEcnaNArrayD.cc.

References fA, i, and OneDim().

                                                                         {
  Int_t i;
  i = OneDim(i1,i2,i3);
  return fA[i];
}
const Double_t & TEcnaNArrayD::operator() ( Int_t  i1,
Int_t  i2,
Int_t  i3,
Int_t  i4,
Int_t  i5 
) const

Definition at line 319 of file TEcnaNArrayD.cc.

References fA, i, and OneDim().

                                                                                           {
  Int_t i;
  i = OneDim(i1,i2,i3,i4,i5);
  return fA[i];
}
const Double_t & TEcnaNArrayD::operator() ( Int_t  i1,
Int_t  i2,
Int_t  i3,
Int_t  i4,
Int_t  i5,
Int_t  i6 
) const

Definition at line 324 of file TEcnaNArrayD.cc.

References fA, i, and OneDim().

                                                                                                    {
  Int_t i;
  i = OneDim(i1,i2,i3,i4,i5,i6);
  return fA[i];
}
Double_t & TEcnaNArrayD::operator() ( Int_t  i1)

Definition at line 329 of file TEcnaNArrayD.cc.

{
   return (Double_t&)((*(const TEcnaNArrayD *)this)(i1));
}
Double_t & TEcnaNArrayD::operator() ( Int_t  i1,
Int_t  i2,
Int_t  i3 
)

Definition at line 337 of file TEcnaNArrayD.cc.

{
   return (Double_t&)((*(const TEcnaNArrayD *)this)(i1,i2,i3));
}
Double_t & TEcnaNArrayD::operator() ( Int_t  i1,
Int_t  i2,
Int_t  i3,
Int_t  i4,
Int_t  i5 
)

Definition at line 345 of file TEcnaNArrayD.cc.

{
   return (Double_t&)((*(const TEcnaNArrayD *)this)(i1,i2,i3,i4,i5));
}
void TEcnaNArrayD::ReSet ( Int_t  n1,
Int_t  n2,
Int_t  n3 
)

Definition at line 245 of file TEcnaNArrayD.cc.

References Clean(), fA, fN1, fN2, fN3, fNd, fNL, i, and zero.

                                                   {
//Reset this to be 3 dimensional of dimension n1,n2,n3
  const Double_t zero = 0.0;
  Clean();
  fNd  = 3;
  fN1  = n1;
  fN2  = n2;
  fN3  = n3;
  fNL  = n1*n2*n3 + 1;
  fA   = new Double_t [fNL];
  for (Int_t i=0;i<fNL;i++) fA[i] = zero;
}
void TEcnaNArrayD::ReSet ( Int_t  n1,
Int_t  n2,
Int_t  n3,
Int_t  n4,
Int_t  n5,
Int_t  n6 
)

Definition at line 284 of file TEcnaNArrayD.cc.

References Clean(), fA, fN1, fN2, fN3, fN4, fN5, fN6, fNd, fNL, i, and zero.

                                                                              {
//Reset this to be 6 dimensional of dimension n1,n2,n3,n4,n5,n6
  const Double_t zero = 0.0;
  Clean();
  fNd  = 6;
  fN1  = n1;
  fN2  = n2;
  fN3  = n3;
  fN4  = n4;
  fN5  = n5;
  fN6  = n6;
  fNL  = n1*n2*n3*n4*n5*n6 + 1;
  fA   = new Double_t [fNL];
  for (Int_t i=0;i<fNL;i++) fA[i] = zero;
}
void TEcnaNArrayD::ReSet ( Int_t  n1,
Int_t  n2 
)

Definition at line 234 of file TEcnaNArrayD.cc.

References Clean(), fA, fN1, fN2, fNd, fNL, i, and zero.

                                          {
//Reset this to be 2 dimensional of dimension n1,n2
  const Double_t zero = 0.0;
  Clean();
  fNd  = 2;
  fN1  = n1;
  fN2  = n2;
  fNL  = n1*n2 + 1;
  fA   = new Double_t [fNL];
  for (Int_t i=0;i<fNL;i++) fA[i] = zero;
}
void TEcnaNArrayD::ReSet ( Int_t  n1,
Int_t  n2,
Int_t  n3,
Int_t  n4,
Int_t  n5 
)

Definition at line 270 of file TEcnaNArrayD.cc.

References Clean(), fA, fN1, fN2, fN3, fN4, fN5, fNd, fNL, i, and zero.

                                                                     {
//Reset this to be 5 dimensional of dimension n1,n2,n3,n4,n5
  const Double_t zero = 0.0;
  Clean();
  fNd  = 5;
  fN1  = n1;
  fN2  = n2;
  fN3  = n3;
  fN4  = n4;
  fN5  = n5;
  fNL  = n1*n2*n3*n4*n5 + 1;
  fA   = new Double_t [fNL];
  for (Int_t i=0;i<fNL;i++) fA[i] = zero;
}
void TEcnaNArrayD::ReSet ( Int_t  n1,
Int_t  n2,
Int_t  n3,
Int_t  n4 
)

Definition at line 257 of file TEcnaNArrayD.cc.

References Clean(), fA, fN1, fN2, fN3, fN4, fNd, fNL, i, and zero.

                                                            {
//Reset this to be 4 dimensional of dimension n1,n2,n3,n4
  const Double_t zero = 0.0;
  Clean();
  fNd  = 4;
  fN1  = n1;
  fN2  = n2;
  fN3  = n3;
  fN4  = n4;
  fNL  = n1*n2*n3*n4 + 1;
  fA   = new Double_t [fNL];
  for (Int_t i=0;i<fNL;i++) fA[i] = zero;
}
void TEcnaNArrayD::ReSet ( Int_t  n1)

Definition at line 224 of file TEcnaNArrayD.cc.

References Clean(), fA, fN1, fNd, fNL, i, and zero.

Referenced by TEcnaResultType::SetSizeHis(), and TEcnaResultType::SetSizeMat().

                                 {
//Reset this to be 1 dimensional of dimension n1
  const Double_t zero = 0.0;
  Clean();
  fNd  = 1;
  fN1  = n1;
  fNL  = n1 + 1;
  fA   = new Double_t [fNL];
  for (Int_t i=0;i<fNL;i++) fA[i] = zero;
}

Member Data Documentation

Double_t* TEcnaNArrayD::fA [protected]

Definition at line 25 of file TEcnaNArrayD.h.

Referenced by Clean(), GetOverFlow(), Init(), operator()(), ReSet(), and TEcnaNArrayD().

Int_t TEcnaNArrayD::fN1 [protected]

Definition at line 18 of file TEcnaNArrayD.h.

Referenced by Init(), OneDim(), ReSet(), and TEcnaNArrayD().

Int_t TEcnaNArrayD::fN2 [protected]

Definition at line 19 of file TEcnaNArrayD.h.

Referenced by Init(), OneDim(), ReSet(), and TEcnaNArrayD().

Int_t TEcnaNArrayD::fN3 [protected]

Definition at line 20 of file TEcnaNArrayD.h.

Referenced by Init(), OneDim(), ReSet(), and TEcnaNArrayD().

Int_t TEcnaNArrayD::fN4 [protected]

Definition at line 21 of file TEcnaNArrayD.h.

Referenced by Init(), OneDim(), ReSet(), and TEcnaNArrayD().

Int_t TEcnaNArrayD::fN5 [protected]

Definition at line 22 of file TEcnaNArrayD.h.

Referenced by Init(), OneDim(), ReSet(), and TEcnaNArrayD().

Int_t TEcnaNArrayD::fN6 [protected]

Definition at line 23 of file TEcnaNArrayD.h.

Referenced by Init(), ReSet(), and TEcnaNArrayD().

Int_t TEcnaNArrayD::fNd [protected]

Definition at line 17 of file TEcnaNArrayD.h.

Referenced by Init(), ReSet(), and TEcnaNArrayD().

Int_t TEcnaNArrayD::fNL [protected]

Definition at line 24 of file TEcnaNArrayD.h.

Referenced by GetOverFlow(), Init(), OneDim(), ReSet(), and TEcnaNArrayD().