BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcCalibConst.cxx
Go to the documentation of this file.
3
4#include <iostream>
5
6using namespace std;
7
8typedef map<int, double>::value_type valType;
9
11}
12
14 m_xtmap = calconst.m_xtmap;
15 m_t0 = calconst.m_t0;
16 m_delt0 = calconst.m_delt0;
17 m_qtpar0 = calconst.m_qtpar0;
18 m_qtpar1 = calconst.m_qtpar1;
19 m_sdmap = calconst.m_sdmap;
20}
21
23 int lay;
24 int lr;
25 int entr;
26 int ord;
27 int key;
28 double val;
29 for(lay=0; lay<MdcCalNLayer; lay++){
30 for(entr=0; entr<MdcCalNENTRXT; entr++){
31 for(lr=0; lr<MdcCalLR; lr++){
32 for(ord=0; ord<MdcCalXtNPars; ord++){
33 key = getXtKey(lay, entr, lr, ord);
34 if(1 == ord){
35 val = 0.03;
36 } else if(6 == ord){
37 val = 999.0;
38 } else{
39 val = 0.0;
40 }
41 m_xtmap.insert( valType(key, val) );
42 }
43 }
44 }
45 }
46
47 int wir;
48 double t0 = 0.0;
49 double dt0 = 0.0;
50 for(wir=0; wir<MdcCalTotCell; wir++){
51 m_t0.push_back(t0);
52 m_delt0.push_back(dt0);
53 }
54
55 double qtpar0 = 0.0;
56 double qtpar1 = 0.0;
57 for(lay=0; lay<MdcCalNLayer; lay++){
58 m_qtpar0.push_back(qtpar0);
59 m_qtpar1.push_back(qtpar1);
60 }
61
62 int bin;
63 double sdpar = 0.16;
64 for(lay=0; lay<MdcCalNLayer; lay++){
65 for(entr=0; entr<MdcCalNENTRSD; entr++){
66 for(lr=0; lr<2; lr++){
67 for(bin=0; bin<MdcCalSdNBIN; bin++){
68 key = getSdKey(lay, entr, lr, ord);
69 m_sdmap.insert( valType( key, sdpar) );
70 }
71 }
72 }
73 }
74}
75
76void MdcCalibConst::fillXtpar(int key, double val){
77 m_xtmap.insert( valType( key, val ) );
78}
79
80void MdcCalibConst::resetXtpar(int lay, int entr, int lr, int order, double val){
81 int key = getXtKey(lay, entr, lr, order);
82 m_xtmap[key] = val;
83}
84
85double MdcCalibConst::getXtpar(int lay, int entr, int lr, int order){
86 double xtpar = -999.0;
87 int key = getXtKey(lay, entr, lr, order);
88 if( 1 == m_xtmap.count(key) )
89 xtpar = m_xtmap[key];
90
91 return xtpar;
92}
93
94int MdcCalibConst::getXtKey(int lay, int entr, int lr, int order) const{
95 int key;
96
97 key = ( (lay << XTLAYER_INDEX) & XTLAYER_MASK ) |
98 ( (entr << XTENTRA_INDEX) & XTENTRA_MASK ) |
99 ( (lr << XTLR_INDEX) & XTLR_MASK ) |
100 ( (order << XTORDER_INDEX) & XTORDER_MASK );
101
102 return key;
103}
104
106 m_xtiter = m_xtmap.begin();
107}
108
109int MdcCalibConst::getNextXtpar(int& key, double& xtpar) {
110 if( m_xtiter != m_xtmap.end() ){
111 key = (*m_xtiter).first;
112 xtpar = (*m_xtiter).second;
113 m_xtiter++;
114 return 1;
115 }
116 else return 0;
117}
118
119void MdcCalibConst::fillQtpar(int order, double val){
120 if( 0 == order ){
121 m_qtpar0.push_back( val );
122 } else if( 1 == order ){
123 m_qtpar1.push_back( val );
124 } else {
125 cout << "Order of Qtpar Error in fillQtpar()!" << endl;
126 }
127}
128
129void MdcCalibConst::resetQtpar(int lay, int order, double val){
130 if( 0 == order ){
131 m_qtpar0[lay] = val;
132 } else if( 1 == order ){
133 m_qtpar1[lay] = val;
134 } else{
135 cout << "Order of Qtpar Error in resetQtpar()!" << endl;
136 }
137}
138
139double MdcCalibConst::getQtpar(int lay, int order) const{
140 if( 0 == order ){
141 return m_qtpar0[lay];
142 } else if( 1 == order ){
143 return m_qtpar1[lay];
144 } else{
145 cout << "Order of Qtpar Error in getQtpar()!" << endl;
146 return -9999.0;
147 }
148}
149
150void MdcCalibConst::fillSdpar(int key, double val){
151 m_sdmap.insert( valType( key, val) );
152}
153
154void MdcCalibConst::resetSdpar(int lay, int entr, int lr, int bin, double val){
155 int key = getSdKey(lay, entr, lr, bin);
156 m_sdmap[key] = val;
157}
158
159double MdcCalibConst::getSdpar(int lay, int entr, int lr, int bin){
160
161 double sdpar = -999.0;
162 int key = getSdKey(lay, entr, lr, bin);
163 if( 1 == m_sdmap.count(key) ){
164 return m_sdmap[key];
165 }
166
167 return sdpar;
168}
169
170int MdcCalibConst::getSdKey(int lay, int entr, int lr, int bin) const{
171 int key;
172
173 key = ( (lay << SDLAYER_INDEX) & SDLAYER_MASK ) |
174 ( (entr << SDENTRA_INDEX) & SDENTRA_MASK ) |
175 ( (lr << SDLR_INDEX) & SDLR_MASK ) |
176 ( (bin << SDBIN_INDEX) & SDBIN_MASK );
177
178 return key;
179}
180
182 m_sditer = m_sdmap.begin();
183}
184
185int MdcCalibConst::getNextSdpar(int& key, double& sdpar) {
186 if( m_sditer != m_sdmap.end() ){
187 key = (*m_sditer).first;
188 sdpar = (*m_sditer).second;
189 m_sditer++;
190 return 1;
191 }
192 else return 0;
193}
194
196 m_xtmap.clear();
197 m_t0.clear();
198 m_delt0.clear();
199 m_qtpar0.clear();
200 m_qtpar1.clear();
201 m_sdmap.clear();
202}
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per bin
Definition: FoamA.h:85
const int MdcCalNLayer
Definition: MdcCalParams.h:6
const int MdcCalNENTRSD
Definition: MdcCalParams.h:19
const int MdcCalXtNPars
Definition: MdcCalParams.h:14
const int MdcCalSdNBIN
Definition: MdcCalParams.h:20
const int MdcCalNENTRXT
Definition: MdcCalParams.h:12
const int MdcCalTotCell
Definition: MdcCalParams.h:9
const int MdcCalLR
Definition: MdcCalParams.h:10
map< int, double >::value_type valType
std::map< int, double >::value_type valType
Definition: MdcCalibData.h:12
*************DOUBLE PRECISION m_pi *DOUBLE PRECISION m_HvecTau2 DOUBLE PRECISION m_HvClone2 DOUBLE PRECISION m_gamma1 DOUBLE PRECISION m_gamma2 DOUBLE PRECISION m_thet1 DOUBLE PRECISION m_thet2 INTEGER m_IFPHOT *COMMON c_Taupair $ !Spin Polarimeter vector first Tau $ !Spin Polarimeter vector second Tau $ !Clone Spin Polarimeter vector first Tau $ !Clone Spin Polarimeter vector second Tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !phi of HvecTau1 $ !theta of HvecTau1 $ !phi of HvecTau2 $ !theta of HvecTau2 $ !super key
Definition: Taupair.h:42
void initCalibConst()
int getXtKey(int lay, int entr, int lr, int order) const
void fillXtpar(int key, double val)
void resetSdpar(int lay, int entr, int lr, int bin, double val)
void resetXtpar(int lay, int entr, int lr, int order, double val)
double getXtpar(int lay, int entr, int lr, int order)
void fillQtpar(int order, double val)
double getQtpar(int lay, int order) const
int getNextXtpar(int &key, double &xtpar)
void resetQtpar(int lay, int order, double val)
double getSdpar(int lay, int entr, int lr, int bin)
int getSdKey(int lay, int entr, int lr, int bin) const
int getNextSdpar(int &key, double &sdpar)
void fillSdpar(int key, double val)