StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
lasertest_single.C
1 // $Id: lasertest_single.C,v 1.11 2011/05/11 11:55:46 jcs Exp $
2 //
3 // $Log: lasertest_single.C,v $
4 // Revision 1.11 2011/05/11 11:55:46 jcs
5 // had to change order of library loading to avoid undefined symbols
6 //
7 // Revision 1.10 2009/12/09 14:41:49 jcs
8 // delta_t0 and delta_gas can now both = 0
9 //
10 // Revision 1.9 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.8 2009/09/12 14:45:48 jcs
15 // For ROOT 5.22.00 must load libMinuit.so and libSpectrum.so
16 //
17 // Revision 1.7 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.6 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.5 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.4 2006/04/05 08:50:36 jcs
28 // set t0 = ".000001" if t0 = "0" and gas = "0" to avoid seg fault
29 //
30 // Revision 1.3 2006/04/04 11:17:15 jcs
31 // simplify macro
32 //
33 // Revision 1.2 2006/03/15 15:14:06 jcs
34 // add lines for listing CVS update info
35 //
36 
37 void lasertest_single(TString filename,int ftpc, int lsec, int straight, int gfit, char* t0, char* gas, float gastemp, float mbfield)
38 {
39 
40  Int_t minz, maxz;
41  Int_t minrad = 0;
42  Int_t maxrad = 30;
43 
44  cout<<"Starting lasertest_single.C:"<<endl;
45  cout<<" filename = "<<filename<<".root"<<endl;
46  cout<<" ftpc = "<<ftpc;
47  if ( ftpc == 1 ) cout<<" FTPC West"<<endl;
48  if ( ftpc == 2 ) cout<<" FTPC East"<<endl;
49  cout<<" lsec = "<<lsec<<endl;
50  cout<<" straight = "<<straight<<endl;
51  cout<<" gfit = "<<gfit<<endl;
52  // for FTPC West
53  if ( ftpc == 1 ) {
54  minz = 0;
55  maxz = 300;
56  }
57  // for FTPC East
58  if ( ftpc == 2 ) {
59  minz = -300;
60  maxz = 0;
61  }
62  cout<<" minz = "<<minz<<endl;
63  cout<<" maxz = "<<maxz<<endl;
64  cout<<" minrad = "<<minrad<<endl;
65  cout<<" maxrad = "<<maxrad<<endl;
66  cout<<" t0 = "<<t0<<endl;
67  cout<<" gas = "<<gas<<endl;
68  cout<<" gastemp = "<<gastemp<<endl;
69  cout<<" mbfield = "<<mbfield<<endl;
70  cout<<endl;
71 
72  if (gClassTable->GetID("TTable") < 0) gSystem->Load("libStar");
73 
74  gSystem->Load("libMinuit.so");
75  gSystem->Load("libSpectrum.so");
76 
77  gSystem->Load("St_base");
78  gSystem->Load("StChain");
79 
80  gSystem->Load("libtpc_Tables");
81 
82  gSystem->Load("StStarLogger");
83  gSystem->Load("StUtilities");
84  gSystem->Load("StarClassLibrary");
85  gSystem->Load("StEvent");
86  gSystem->Load("StarMagField");
87  gSystem->Load("StMagF");
88 
89  gSystem->Load("libStDb_Tables.so");
90  gSystem->Load("StDetectorDbMaker.so");
91  gSystem->Load("StTpcDb");
92  gSystem->Load("StDbUtilities");
93  gSystem->Load("StDbLib.so");
94  gSystem->Load("StDbBroker.so");
95  gSystem->Load("libStDb_Tables.so");
96  gSystem->Load("St_db_Maker.so");
97 
98  gSystem->Load("StFtpcCalibMaker");
99  gSystem->Load("libftpc_Tables");
100  gSystem->Load("StFtpcClusterMaker");
101  gSystem->Load("StFtpcTrackMaker");
102 
103  // Create the makers to be called by the current chain
104  const char *mysqlDB = "MySQL:StarDb";
105  const char *paramsDB = "$STAR/StarDb";
106  //const char *paramsDB = "$PWD/StarDb";
107 
108  StChain *chain = new StChain();
109 
110  StFtpcCalibMaker *laser=new StFtpcCalibMaker();
111 
112  laser->GetRunInfo(filename);
113  cout<<" run = "<<laser->RunNum()<<" date = "<<laser->Date()<<" time = "<<laser->Time()<<endl;
114 
115  St_db_Maker *dbMk = new St_db_Maker("db",mysqlDB,paramsDB);
116  dbMk->SetDateTime(laser->Date(),laser->Time());
117 
118  Bool_t laserRun = kTRUE;
119 
120  dbMk->InitRun(laser->RunNum());
121  dbMk->Init();
122  dbMk->Make();
123 
124  cout<<"dbDate = "<<dbMk->GetDateTime().GetDate()<<endl;
125  cout<<"After Database init !!!"<<endl;
126  cout<<endl;
127 
128  if (laser->DbInit(mbfield) == kStWarn) {
129  delete laser;
130  break;
131  }
132 
133  laser->DoLaserCalib(filename,ftpc,lsec,straight,gfit,minz,maxz,minrad,maxrad,t0,gas,gastemp,mbfield);
134 
135  delete laser;
136 }
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