StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
write_fgtSimuParams.C
1 write_fgtSimuParams()
2 {
3  gSystem->Setenv("DB_ACCESS_MODE", "write"); //jb add
4  // Load all required libraries
5  gROOT->Macro("LoadLogger.C");
6  gSystem->Load("St_base.so");
7  gSystem->Load("libStDb_Tables.so");
8  gSystem->Load("StDbLib.so");
9 
10  // Initialize db manager
12  StDbConfigNode* node = mgr->initConfig("Calibrations_fgt");
13  StDbTable* dbtable = node->addDbTable("fgtSimuParams");
14  TString storeTime = "2011-11-11 11:11:12"; // beginTime timestamp in MySQL format: "YYYY-MM-DD HH:mm:ss"
15  mgr->setStoreTime(storeTime.Data());
16 
17  // Create your c-struct
18  fgtSimuParams_st table;
19  memset(table.param,0, sizeof(table.param));
20 
21  // Fill structure with data
22 
23  /* description of the parameters */
24  strncpy(table.comment," reasonable fgt-slow-simu parametrization, ver=102, by Jan",192);
25 
26  table.param[0] =102;// fgt-simu-setup version #
27 
28  // analog signal propagation
29  table.param[1] = 9992; // meLossTab[9993-10000]=5.0E+03 to 6.0E+06 (too high) are cut off. They are replaced by meLossTab[9992]=4.78E+03 in simulation.
30  table.param[2] = 40. ; //( ions/cm) # of primary pairs produced per cm of path
31  table.param[3] = 80.e-9; // (seconds) track ignored by FGT slow sim
32  table.param[4] = 0.035 ; // cm, for 2D gauss smearing, default=0.035 for FNAL
33  table.param[5] = 0.005; // (GeV) track ignored by FGT slow sim
34  table.param[6] = 0.017; // (cm per 1 cm of path)
35  table.param[7] = 6; // # of bins in 2D distribution to store 2D gauss
36  table.param[8] = -1008; // not used
37  table.param[9] = -1009; // not used
38 
39  // digitalization
40  table.param[10] = 5.0; // drop strips below it
41  table.param[11] = 1000; // in a.u. used in simu
42  table.param[12] = 2.0; // a factor making simulated ADCs comparable to 2012 pp510 data
43  table.param[13] = 0.45; // divide charge between P/R plane
44 
45  table.param[14] = -1014; // not used
46  table.param[15] = -1015; // not used
47 
48 
49  // Store data to the StDbTable
50  dbtable->SetTable((char*)&table, 1);
51 
52  // uncomment next line to set "sim" flavor. "ofl" flavor is set by default, no need to set it.
53  // dbtable->setFlavor("sim");
54 
55  // Store table to database
56  mgr->storeDbTable(dbtable);
57 }
virtual void SetTable(char *data, int nrows, int *idList=0)
calloc'd version of data for StRoot
Definition: StDbTable.cc:550
static StDbManager * Instance()
strdup(..) is not ANSI
Definition: StDbManager.cc:155