StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
gasTemp.C
1 // $Id: gasTemp.C,v 1.4 2011/05/11 11:55:46 jcs Exp $
2 //
3 // $Log: gasTemp.C,v $
4 // Revision 1.4 2011/05/11 11:55:46 jcs
5 // had to change order of library loading to avoid undefined symbols
6 //
7 // Revision 1.3 2009/12/09 14:41:49 jcs
8 // delta_t0 and delta_gas can now both = 0
9 //
10 // Revision 1.2 2009/11/22 20:48:30 jcs
11 // set 2D histogram limits depending on deltaT
12 //
13 // Revision 1.1 2009/10/14 15:58:43 jcs
14 // change and add macros so that in addition to varying t0 and the gas compostion,
15 // the gas temperature can be varied
16 //
17 //
18 
19 void gasTemp(TString filename,int ftpc, int lsec, int straight, int gfit,char* t0, char* gas,float gastemp,float mbfield)
20 {
21 
22  Int_t minz, maxz;
23  Int_t minrad = 0;
24  Int_t maxrad = 30;
25  cout<<"Starting lasertest.C:"<<endl;
26  cout<<" filename = "<<filename<<".root"<<endl;
27  cout<<" ftpc = "<<ftpc;
28  if ( ftpc == 1 ) cout<<" FTPC West"<<endl;
29  if ( ftpc == 2 ) cout<<" FTPC East"<<endl;
30  cout<<" lsec = "<<lsec<<endl;
31  cout<<" straight = "<<straight<<endl;
32  cout<<" gfit = "<<gfit<<endl;
33  // for FTPC West
34  if ( ftpc == 1 ) {
35  minz = 0;
36  maxz = 300;
37  }
38  // for FTPC East
39  if ( ftpc == 2 ) {
40  minz = -300;
41  maxz = 0;
42  }
43  cout<<" minz = "<<minz<<endl;
44  cout<<" maxz = "<<maxz<<endl;
45  cout<<" minrad = "<<minrad<<endl;
46  cout<<" maxrad = "<<maxrad<<endl;
47  cout<<" t0 = "<<t0<<endl;
48  cout<<" gas = "<<gas<<endl;
49  cout<<" gastemp = "<<gastemp<<endl;
50  cout<<" mbfield = "<<mbfield<<endl;
51  cout<<endl;
52 
53  if (gClassTable->GetID("TTable") < 0) gSystem->Load("libStar");
54 
55  gSystem->Load("libMinuit.so");
56  gSystem->Load("libSpectrum.so");
57 
58  gSystem->Load("St_base");
59  gSystem->Load("StChain");
60 
61  gSystem->Load("libtpc_Tables");
62 
63  gSystem->Load("StUtilities");
64  gSystem->Load("StarClassLibrary");
65  gSystem->Load("StEvent");
66  gSystem->Load("StarMagField");
67  gSystem->Load("StMagF");
68 
69  gSystem->Load("libStDb_Tables.so");
70  gSystem->Load("StDetectorDbMaker.so");
71  gSystem->Load("StTpcDb");
72  gSystem->Load("StDbUtilities");
73  gSystem->Load("StDbLib.so");
74  gSystem->Load("StDbBroker.so");
75  gSystem->Load("libStDb_Tables.so");
76  gSystem->Load("St_db_Maker.so");
77 
78  gSystem->Load("StFtpcCalibMaker");
79  gSystem->Load("libftpc_Tables");
80  gSystem->Load("StFtpcClusterMaker");
81  gSystem->Load("StFtpcTrackMaker");
82 
83  // Create the makers to be called by the current chain
84  const char *mysqlDB = "MySQL:StarDb";
85  const char *paramsDB = "$STAR/StarDb";
86  //const char *paramsDB = "$PWD/StarDb";
87 
88  StChain *chain = new StChain();
89 
91  laser->GetRunInfo(filename);
92  cout<<" date = "<<laser->Date()<<" time = "<<laser->Time()<<endl;
93 
94  St_db_Maker *dbMk = new St_db_Maker("db",mysqlDB,paramsDB);
95  dbMk->SetDateTime(laser->Date(),laser->Time());
96 
97  dbMk->Init();
98  dbMk->Make();
99 
100  cout<<"dbDate = "<<dbMk->GetDateTime().GetDate()<<endl;
101  cout<<"After Database init !!!"<<endl;
102  cout<<endl;
103 
104  if (laser->DbInit(mbfield) == kStWarn) {
105  delete laser;
106  break;
107  }
108 
109 
110  float deltaT;
111  // Interation over temperature
112  for (deltaT = gastemp-2; deltaT<gastemp+4.5; deltaT+=0.5)
113  {
114  // Interation over gas composition
115  for (int k=-5;k<8;k++)
116  {
117  float step2=k/10.0;
118  //char t[3];char g[3];
119  char g[3];
120 
121  //sprintf(T,"%.2f",step);
122  sprintf(g,"%.2f",step2);
123  cout<<endl;
124  cout<<"laser->DoLaserCalib: deltaT = "<<deltaT<<" und deltaGas = "<<g<<endl;
125  if (k==0 && deltaT==0)
126  cout<<"Comes at the end !!!"<<endl;
127  else
128  laser->DoLaserCalib(filename,ftpc,lsec,straight,gfit,minz,maxz,minrad,maxrad,t0,g,deltaT,mbfield);
129  }
130  }
131 
132  laser->DoLaserCalib(filename,ftpc,lsec,straight,gfit,minz,maxz,minrad,maxrad,"0","0",0,mbfield);
133 
134  delete laser;
135 }
virtual Int_t DbInit(float mbfield)
The FTPC calibration maker.
virtual Int_t Make()
void DoLaserCalib(TString filename, int ftpc, int lsec, int straight, int gfit, int minz, int maxz, int minrad, int maxrad, char *t0, char *gas, float gastemp, float mbfield)
Definition: Stypes.h:42