StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Bin.cxx
1 #include "Bin.h"
2 #include <iostream>
3 using namespace Bin;
4 
5 void Bin::initPtAry(TArrayD* ary, int type)
6 {
7  double ptAry0[]=
8  {
9  1.6,1.7,1.8,1.9,2.0,2.2,2.45,2.7,3.0,3.35,3.8,4.4,5.1,6.0,7.0,8.0
10  };
11  int n0 = (int)sizeof(ptAry0)/sizeof(double);
12 
13  double ptAry1[]=
14  {
15  1.6,1.7,1.8,1.9,2.0,2.2,2.4,2.6,2.8,3.0,3.25,3.5,3.75,4.0,4.3,4.6,5.1,6.0,7.0,8.0
16  };
17  int n1 = (int)sizeof(ptAry1)/sizeof(double);
18  switch(type){
19  case 0: ary->Set(n0,ptAry0); break;
20  case 1: ary->Set(n1,ptAry1); break;
21  default:
22  cout << "ERROR. type " << type << "out of range" << endl; exit(1);
23  }
24 
25 }