StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
tpcDbTest.C
1 class St_db_Maker;
2 class StTpcDbMaker;
3 void tpcDbTest() {
4  St_db_Maker *dbMk = 0;
5  StTpcDbMaker *tpcDbMk = 0;
6  if ( gClassTable->GetID("StTpcCoordinateTransform") < 0) {
7  gROOT->LoadMacro("bfc.C");
8  bfc(-1,"tpcDb,sdt20140201,nodefault");
9  }
10  if (! dbMk) {
11  dbMk = (St_db_Maker *) chain->Maker("db");
12  tpcDbMk = (StTpcDbMaker *) chain->Maker("tpcDB");
13  }
14  dbMk->SetDebug();
15  tpcDbMk->SetDebug();
16  chain->SetDebug();
17  chain->Init();
18  new StarMagField;
19  chain->Make();
20  StTpcCoordinateTransform tran(gStTpcDb);
21  const Double_t zGG = 208.707;
22  const Double_t zI = zGG + 1.0;
23  const Double_t zO = zGG + 1.4;
24  Double_t z = 0;
25  Double_t x = 122;
26  StTpcLocalCoordinate locP(x,0,z,1,1); cout << "locP\t" << locP << endl;
28  tran(locP,lSec);
29  StGlobalCoordinate glob;
30  StTpcPadCoordinate padP;
31  tran(locP,padP);
32  for (Int_t sector = 3; sector <= 24; sector += 12) {
33  for (Int_t row = 13; row <= 14; row++) {
34  cout << "=============== sec " << sector << " ====== row " << row << " ===============" << endl;
35 #if 0
36  Double_t x = tran.yFromRow(row);
37  if (sector > 12) x = -x;
38 #endif
39  for (Int_t iz = 0; iz < 3; iz++) {
40 #if 0
41  if (iz == 0) {z = 0;}
42  else {
43  z = zI;
44  if (row > 13) z = zO;
45  if (sector > 12) z = -z;
46  if (iz == 2) z *= 0.5;
47  }
48  cout << "============ z " << z << " ===============" << endl;
49  StTpcLocalCoordinate lTpc(x,0,z,sector,row); cout << "lTpc\t" << lTpc << endl;
50 #else
51  Double_t tb = 0;
52  if (iz == 1) tb = 100;
53  else if (iz == 2) tb = 350;
54  cout << "============ tb " << tb << " ===============" << endl;
55  Double_t pad = 10;
56  padP = StTpcPadCoordinate(sector,row,pad,tb);cout << "padP \t" << padP << endl;
57  tran(padP,lSec); cout << "padP => lSec\t" << lSec << endl;
58  tran(lSec,padP); cout << "lSec => padP\t" << padP << endl;
60  tran(lSec,lTpc); cout << "lSec => lTpc\t" << lTpc << endl;
61 #endif
62  tran(lTpc,lSec); cout << "lTpc => lSec\t" << lSec << endl;
63  tran(lTpc,glob); cout << "lTpc => glob\t" << glob << endl;
64  // tran(glob,lTpc,sector,row);
65  tran(lTpc,lSec); cout << "lTpc => lSec\t" << lSec << endl;
66  tran(lSec,padP); cout << "lSec => padP\t" << padP << endl;
67  tran(padP,lSec); cout << "padP => lSec\t" << lSec << endl;
68  tran(lSec,lTpc); cout << "lSec => lTpc\t" << lTpc << endl;
69  tran(lTpc,glob); cout << "lTpc => glob\t" << glob << endl;
70  tran(glob,lTpc,sector,row); cout << "glob => lTpc\t" << lTpc << endl;
71  tran(lTpc,lSec); cout << "lTpc => lSec\t" << lSec << endl;
72  tran(glob,lSec,sector,row); cout << "glob => lSec\t" << lSec << endl;
73  tran(lSec,padP); cout << "lSec => padP\t" << padP << endl;
74  // tran(glob,padP,sector,row); cout << "glob => padP\t" << padP << endl;
75  }
76  // break;
77  }
78  // break;
79  }
80  /*
81  StTpcCoordinateTransform tran(gStTpcDb);
82  Int_t row = 1;
83  Int_t sector = 3;
84  StTpcPadCoordinate padP(sector,row,1,0); cout << "padP\t" << padP << endl;
85  StTpcLocalCoordinate lTpc;
86  tran(padP,lTpc,kFALSE,kFALSE); cout << "lTpc\t" << lTpc << endl;
87  tran(lTpc,padP,kFALSE,kFALSE); cout << "padP\t" << padP << endl;
88  */
89 }
90 
virtual Int_t Make()
Definition: StChain.cxx:110