StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
lasertest.C
1 // $Id: lasertest.C,v 1.12 2011/05/11 11:55:46 jcs Exp $
2 //
3 // $Log: lasertest.C,v $
4 // Revision 1.12 2011/05/11 11:55:46 jcs
5 // had to change order of library loading to avoid undefined symbols
6 //
7 // Revision 1.11 2009/12/09 14:41:49 jcs
8 // delta_t0 and delta_gas can now both = 0
9 //
10 // Revision 1.10 2009/10/14 15:58:43 jcs
11 // change and add macros so that in addition to varying t0 and the gas compostion,
12 // the gas temperature can be varied
13 //
14 // Revision 1.9 2009/09/12 16:00:23 jcs
15 // Necessary to load the following additional libraries for ROOT 5.22.00:libMinuit.so, libSpectrum.so
16 //
17 // Revision 1.8 2009/08/04 08:42:23 jcs
18 // The 'perfect' gain table and adjustAverageWest = adjustAverageEast = 0.0
19 // are used for laser run calibration
20 //
21 // Revision 1.7 2008/05/14 21:46:01 jcs
22 // remove minz,maxz,minrad,maxrad from argument list and set values in macro
23 //
24 // Revision 1.6 2008/04/23 19:42:18 jcs
25 // load the libStDb_Tables.so and StDetectorDbMaker.so which are needed as of STAR version SL07d
26 //
27 // Revision 1.5 2006/08/02 11:02:34 jcs
28 // add comments
29 // remove commented out old code
30 //
31 // Revision 1.4 2006/04/05 08:50:36 jcs
32 // set t0 = ".000001" if t0 = "0" and gas = "0" to avoid seg fault
33 //
34 // Revision 1.3 2006/04/04 12:02:30 jcs
35 // simplify macro
36 //
37 // Revision 1.2 2006/03/15 15:14:06 jcs
38 // add lines for listing CVS update info
39 //
40 
41 void lasertest(TString filename,int ftpc, int lsec, int straight, int gfit,char* t0, char* gas,float gastemp,float mbfield)
42 {
43 
44  Int_t minz, maxz;
45  Int_t minrad = 0;
46  Int_t maxrad = 30;
47  cout<<"Starting lasertest.C:"<<endl;
48  cout<<" filename = "<<filename<<".root"<<endl;
49  cout<<" ftpc = "<<ftpc;
50  if ( ftpc == 1 ) cout<<" FTPC West"<<endl;
51  if ( ftpc == 2 ) cout<<" FTPC East"<<endl;
52  cout<<" lsec = "<<lsec<<endl;
53  cout<<" straight = "<<straight<<endl;
54  cout<<" gfit = "<<gfit<<endl;
55  // for FTPC West
56  if ( ftpc == 1 ) {
57  minz = 0;
58  maxz = 300;
59  }
60  // for FTPC East
61  if ( ftpc == 2 ) {
62  minz = -300;
63  maxz = 0;
64  }
65  cout<<" minz = "<<minz<<endl;
66  cout<<" maxz = "<<maxz<<endl;
67  cout<<" minrad = "<<minrad<<endl;
68  cout<<" maxrad = "<<maxrad<<endl;
69  cout<<" t0 = "<<t0<<endl;
70  cout<<" gas = "<<gas<<endl;
71  cout<<" gastemp = "<<gastemp<<endl;
72  cout<<" mbfield = "<<mbfield<<endl;
73  cout<<endl;
74 
75  if (gClassTable->GetID("TTable") < 0) gSystem->Load("libStar");
76 
77  gSystem->Load("libMinuit.so");
78  gSystem->Load("libSpectrum.so");
79 
80  gSystem->Load("St_base");
81  gSystem->Load("StChain");
82 
83  gSystem->Load("libtpc_Tables");
84 
85  gSystem->Load("StUtilities");
86  gSystem->Load("StarClassLibrary");
87  gSystem->Load("StEvent");
88  gSystem->Load("StarMagField");
89  gSystem->Load("StMagF");
90 
91  gSystem->Load("libStDb_Tables.so");
92  gSystem->Load("StDetectorDbMaker.so");
93  gSystem->Load("StTpcDb");
94  gSystem->Load("StDbUtilities");
95  gSystem->Load("StDbLib.so");
96  gSystem->Load("StDbBroker.so");
97  gSystem->Load("libStDb_Tables.so");
98  gSystem->Load("St_db_Maker.so");
99 
100  gSystem->Load("StFtpcCalibMaker");
101  gSystem->Load("libftpc_Tables");
102  gSystem->Load("StFtpcClusterMaker");
103  gSystem->Load("StFtpcTrackMaker");
104 
105  // Create the makers to be called by the current chain
106  const char *mysqlDB = "MySQL:StarDb";
107  const char *paramsDB = "$STAR/StarDb";
108  //const char *paramsDB = "$PWD/StarDb";
109 
110  StChain *chain = new StChain();
111 
112  StFtpcCalibMaker *laser=new StFtpcCalibMaker();
113  laser->GetRunInfo(filename);
114  cout<<" date = "<<laser->Date()<<" time = "<<laser->Time()<<endl;
115 
116  St_db_Maker *dbMk = new St_db_Maker("db",mysqlDB,paramsDB);
117  dbMk->SetDateTime(laser->Date(),laser->Time());
118 
119  dbMk->Init();
120  dbMk->Make();
121 
122  cout<<"dbDate = "<<dbMk->GetDateTime().GetDate()<<endl;
123  cout<<"After Database init !!!"<<endl;
124  cout<<endl;
125 
126  if (laser->DbInit(mbfield) == kStWarn) {
127  delete laser;
128  break;
129  }
130 
131  // Interation over tzero
132  for (int i=-5;i<7;i++)
133  {
134  float step=i/10.0;
135 
136  // Interation over gas composition
137  for (int k=-5;k<8;k++)
138  {
139  float step2=k/10.0;
140  char t[3];char g[3];
141 
142  sprintf(t,"%.2f",step);
143  sprintf(g,"%.2f",step2);
144  cout<<endl;
145  cout<<"laser->DoLaserCalib: deltat0 = "<<t<<" und deltaGas = "<<g<<endl;
146  if (k==0 && i==0)
147  cout<<"Kommt zum Schluss !!!"<<endl;
148  else
149  laser->DoLaserCalib(filename,ftpc,lsec,straight,gfit,minz,maxz,minrad,maxrad,t,g,gastemp,mbfield);
150  }
151  }
152 
153  laser->DoLaserCalib(filename,ftpc,lsec,straight,gfit,minz,maxz,minrad,maxrad,"0","0",gastemp,mbfield);
154 
155  delete laser;
156 }
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