StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMcParameterDB.cxx
1 /*****************************************
2  *
3  * $Id: StMcParameterDB.cxx,v 1.11 2015/03/13 18:44:44 perev Exp $
4  *
5  * Changed extension to .cxx so that it
6  * would be accessible from Root macro
7  *
8  * $Log: StMcParameterDB.cxx,v $
9  * Revision 1.11 2015/03/13 18:44:44 perev
10  * Roll back
11  *
12  * Revision 1.9 2005/11/22 21:44:16 fisyak
13  * Add Ssd to Associator, add IdTruth options for Svt and Ssd
14  *
15  * Revision 1.8 2004/03/30 03:02:02 calderon
16  * -Changed default value of the z cut to 5 mm.
17  *
18  * Revision 1.7 2003/09/02 17:55:28 perev
19  * gcc 3.2 updates + WarnOff
20  *
21  * Revision 1.6 2003/06/27 03:01:19 calderon
22  * The z cut now depends on z_mc.
23  * The parameterization is done in the parameter DB
24  * with a linearly increasing rms, symmetric in +/- z.
25  *
26  * Revision 1.5 1999/12/14 07:07:41 calderon
27  * Added Ratio Number of Common Hits / Number of Reconstructed Hits for
28  * each detector.
29  * Numbering scheme from StEvent & StMcEvent as per SVT request
30  * Added Kink, V0 and Xi vertex associations.
31  *
32  * Revision 1.4 1999/12/08 00:00:25 calderon
33  * New version of StAssociationMaker.
34  * -Uses new StEvent / StMcEvent
35  * -Includes maps using reconstructed and monte carlo objects as keys for:
36  * TPC Hits
37  * SVT Hits
38  * SSD Hits
39  * FTPC Hits
40  * Tracks (using all 3 hit multimaps)
41  *
42  * Revision 1.3 1999/10/01 14:08:58 calderon
43  * Added Local Hit resolution Histogram. It is made by default
44  * without any requirement of association, to serve
45  * as a diagnostic.
46  * Before building track multimap, check the size of the
47  * tpc hit map. If it is too small, print out a warning
48  * and exit.
49  *
50  * Revision 1.2 1999/09/23 21:25:21 calderon
51  * Added Log & Id
52  * Modified includes according to Yuri
53  *
54  *****************************************/
55 #include <Stiostream.h>
56 #include "StMcParameterDB.h"
57 #include "PhysicalConstants.h"
58 #include "SystemOfUnits.h"
59 
60 ClassImp(StMcParameterDB)
61 
62 StMcParameterDB* StMcParameterDB::mParamDB = 0;
63 
65 {
66  if (!mParamDB) mParamDB = new StMcParameterDB;
67  return mParamDB;
68 }
69 
70 StMcParameterDB::StMcParameterDB()
71  :mXCutTpc(5.*millimeter),mYCutTpc(5.*millimeter),mZCutTpc(5.*millimeter),mReqCommonHitsTpc(3),
72  mXCutSvt(1.*millimeter),mYCutSvt(1.*millimeter),mZCutSvt(1.*millimeter),mReqCommonHitsSvt(1),
73  mXCutSsd(1.*millimeter),mYCutSsd(1.*millimeter),mZCutSsd(1.*millimeter),mReqCommonHitsSsd(1),
74  mRCutFtpc(3.*millimeter),mPhiCutFtpc(5.*degree),mReqCommonHitsFtpc(2)
75 { /*noop*/ }
76 
77 void StMcParameterDB::setXCutTpc(float val) { mXCutTpc = val ;}
78 void StMcParameterDB::setYCutTpc(float val) { mYCutTpc = val ;}
79 void StMcParameterDB::setZCutTpc(float val) { mZCutTpc = val ;}
80 void StMcParameterDB::setReqCommonHitsTpc(unsigned int val) { mReqCommonHitsTpc = val;}
81 
82 void StMcParameterDB::setXCutSvt(float val) { mXCutSvt = val ;}
83 void StMcParameterDB::setYCutSvt(float val) { mYCutSvt = val ;}
84 void StMcParameterDB::setZCutSvt(float val) { mZCutSvt = val ;}
85 void StMcParameterDB::setReqCommonHitsSvt(unsigned int val) { mReqCommonHitsSvt = val;}
86 
87 void StMcParameterDB::setXCutSsd(float val) { mXCutSsd = val ;}
88 void StMcParameterDB::setYCutSsd(float val) { mYCutSsd = val ;}
89 void StMcParameterDB::setZCutSsd(float val) { mZCutSsd = val ;}
90 void StMcParameterDB::setReqCommonHitsSsd(unsigned int val) { mReqCommonHitsSsd = val;}
91 
92 void StMcParameterDB::setRCutFtpc(float val) { mRCutFtpc = val ;}
93 void StMcParameterDB::setPhiCutFtpc(float val) { mPhiCutFtpc = val ;}
94 void StMcParameterDB::setReqCommonHitsFtpc(unsigned int val) { mReqCommonHitsFtpc = val;}
95 
96 
97 float StMcParameterDB::zCutTpc(float z) const {
98  return (mZCutTpc/0.166657) * (0.166657+2.07482e-4*fabs(z));
99 }
100 
101 
102 ostream& operator<<(ostream &os, const StMcParameterDB& mcDb)
103 {
104  os << " TPC Cuts " << endl;
105  os << " X Cut : " << mcDb.xCutTpc()/millimeter << " mm" << endl;
106  os << " Y Cut : " << mcDb.yCutTpc()/millimeter << " mm" << endl;
107  os << " Z Cut : " << mcDb.zCutTpc()/millimeter << " mm" << endl;
108  os << " Required Hits for Associating Tracks: " << mcDb.reqCommonHitsTpc() << endl;
109  os << " SVT Cuts " << endl;
110  os << " X Cut : " << mcDb.xCutSvt()/millimeter << " mm" << endl;
111  os << " Y Cut : " << mcDb.yCutSvt()/millimeter << " mm" << endl;
112  os << " Z Cut : " << mcDb.zCutSvt()/millimeter << " mm" << endl;
113  os << " Required Hits for Associating Tracks: " << mcDb.reqCommonHitsSvt() << endl;
114  os << " SSD Cuts " << endl;
115  os << " X Cut : " << mcDb.xCutSsd()/millimeter << " mm" << endl;
116  os << " Y Cut : " << mcDb.yCutSsd()/millimeter << " mm" << endl;
117  os << " Z Cut : " << mcDb.zCutSsd()/millimeter << " mm" << endl;
118  os << " Required Hits for Associating Tracks: " << mcDb.reqCommonHitsSsd() << endl;
119  os << " FTPC Cuts " << endl;
120  os << " R Cut : " << mcDb.rCutFtpc()/millimeter << " mm" << endl;
121  os << " Phi Cut : " << mcDb.phiCutFtpc()/degree << " degrees" << endl;
122  os << " Required Hits for Associating Tracks: " << mcDb.reqCommonHitsFtpc() << endl;
123 
124  return os;
125 }