StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
FtpcDriftMapMaker.C
1 // $Id: FtpcDriftMapMaker.C,v 1.5 2009/11/10 11:07:09 jcs Exp $
2 // $Log: FtpcDriftMapMaker.C,v $
3 // Revision 1.5 2009/11/10 11:07:09 jcs
4 // Now necessary to also load StDetectorDbMaker library
5 //
6 // Revision 1.4 2009/11/10 10:59:26 jcs
7 // change map to Map to avoid conflict with cint
8 //
9 // Revision 1.3 2006/08/02 13:59:16 jcs
10 // add deltaAr argument to allow user to change gas compostion (default: deltaAr=0)
11 //
12 // Revision 1.2 2005/12/12 09:30:52 jcs
13 // load StarMagField library
14 //
15 // Revision 1.1 2005/12/12 09:09:11 jcs
16 // Macro used to run StFtpcDriftMapMakerZ
17 //
18 //
19 //======================================================================
20 // owner: Janet Seyboth (jcs@mppmu.mpg.de)
21 // what it does: compute drift map for FTPCs
22 //
23 // const Int_t Map = 2 use mapped field values
24 // = 1 use constant field values
25 // const Float_t |factor| > 0.8 scale from full field
26 // factor > 0 normal field
27 // factor < 0 reversed field
28 // factor is the field scaling factor
29 // const Float_t deltaAr change gas composition:
30 // % Ar + deltaAr
31 // % CO2 - deltaAr
32 //
33 // Default: const Int_t Map = 2
34 // const Float_t factor = 1.0
35 // const Float_t deltaAr = 0.0
36 //
37 //======================================================================
38 
39 void FtpcDriftMapMaker(const Int_t Map=2, const Float_t factor=1.0, const Float_t deltaAr = 0.0)
40 {
41  cout<<"FtpcDriftMapMaker.C called with:"<<endl;
42  cout<<" Map = "<<Map<<endl;
43  cout<<" factor = "<<factor<<endl;
44  cout<<" deltaAr = "<<deltaAr<<endl;
45  if (gClassTable->GetID("TTable") < 0) gSystem->Load("libTable");
46  gSystem->Load("St_base");
47  gSystem->Load("StChain");
48  gSystem->Load("St_Tables");
49  gSystem->Load("StUtilities");
50  gSystem->Load("StarClassLibrary");
51  gSystem->Load("StDetectorDbMaker");
52  gSystem->Load("StDbUtilities");
53  gSystem->Load("StDbLib");
54  gSystem->Load("StDbBroker");
55  gSystem->Load("St_db_Maker");
56  gSystem->Load("StarMagField");
57  gSystem->Load("StMagF");
58  gSystem->Load("libftpc_Tables");
59  gSystem->Load("StFtpcDriftMapMaker");
60  gSystem->Load("StFtpcClusterMaker");
61 
62  // Create the makers to be called by the current chain
63  const char *mysqlDB = "MySQL:StarDb";
64  const char *paramsDB = "$STAR/StarDb";
65  //const char *paramsDB = "$PWD/StarDb";
66  StChain *chain = new StChain();
67 
68  St_db_Maker *dbMk = new St_db_Maker("db",mysqlDB,paramsDB);
69  dbMk->SetDateTime(20010501,00000);
70 
71  // Full Field Positive ?
72  if ( factor > 0.8 ) {
73  dbMk->SetFlavor("ffp10kv","ftpcVDrift");
74  dbMk->SetFlavor("ffp10kv","ftpcdVDriftdP");
75  dbMk->SetFlavor("ffp10kv","ftpcDeflection");
76  dbMk->SetFlavor("ffp10kv","ftpcdDeflectiondP");
77  gMessMgr->Info() << "StFtpcDriftMapMaker::InitRun: flavor set to ffp10kv"<<endm;
78  }
79  else if ( factor > 0.2 ) {
80  dbMk->SetFlavor("hfp10kv","ftpcVDrift");
81  dbMk->SetFlavor("hfp10kv","ftpcdVDriftdP");
82  dbMk->SetFlavor("hfp10kv","ftpcDeflection");
83  dbMk->SetFlavor("hfp10kv","ftpcdDeflectiondP");
84  gMessMgr->Info() << "StFtpcDriftMapMaker::InitRun: flavor set to hfp10kv"<<endm;
85  }
86  else if ( factor > -0.2 ) {
87  dbMk->SetFlavor("zf10kv","ftpcVDrift");
88  dbMk->SetFlavor("zf10kv","ftpcdVDriftdP");
89  dbMk->SetFlavor("zf10kv","ftpcDeflection");
90  dbMk->SetFlavor("zf10kv","ftpcdDeflectiondP");
91  gMessMgr->Info() << "StFtpcDriftMapMaker::InitRun: flavor set to zf10kv"<<endm;
92  }
93  else if ( factor > -0.8 ) {
94  dbMk->SetFlavor("hfn10kv","ftpcVDrift");
95  dbMk->SetFlavor("hfn10kv","ftpcdVDriftdP");
96  dbMk->SetFlavor("hfn10kv","ftpcDeflection");
97  dbMk->SetFlavor("hfn10kv","ftpcdDeflectiondP");
98  gMessMgr->Info() << "StFtpcDriftMapMaker::InitRun: flavor set to hfn10kv"<<endm;
99  }
100  else {
101  dbMk->SetFlavor("ffn10kv","ftpcVDrift");
102  dbMk->SetFlavor("ffn10kv","ftpcdVDriftdP");
103  dbMk->SetFlavor("ffn10kv","ftpcDeflection");
104  dbMk->SetFlavor("ffn10kv","ftpcdDeflectiondP");
105  gMessMgr->Info() << "StFtpcDriftMapMaker::InitRun: flavor set to ffn10kv"<<endm;
106  }
107  dbMk->Init();
108  dbMk->Make();
109 
110  //b=new TBrowser();
111 
112  StFtpcDriftMapMaker *ftpcDriftMapMk = new StFtpcDriftMapMaker(Map,factor,deltaAr);
113 }
virtual Int_t Make()