BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcCalibConst.cpp
Go to the documentation of this file.
2
3#include <iostream>
4
5typedef std::map<int, double>::value_type valType;
6
8 // constructor
9}
10
12 m_xtmap = calconst.m_xtmap;
13 m_t0 = calconst.m_t0;
14 m_delt0 = calconst.m_delt0;
15// m_wshift = calconst.m_wshift;
16// m_delwshift = calconst.m_delwshift;
17 m_qtpar0 = calconst.m_qtpar0;
18 m_qtpar1 = calconst.m_qtpar1;
19 m_sdmap = calconst.m_sdmap;
20}
21
22void MdcCalibConst::fillXtpar(int key, double val){
23 m_xtmap.insert( valType( key, val ) );
24}
25
26void MdcCalibConst::resetXtpar(int lay, int entr, int lr, int order, double val){
27 int key = getXtKey(lay, entr, lr, order);
28 m_xtmap[key] = val;
29}
30
31double MdcCalibConst::getXtpar(int lay, int entr, int lr, int order){
32 double xtpar = -999.0;
33 int key = getXtKey(lay, entr, lr, order);
34 if( 1 == m_xtmap.count(key) )
35 xtpar = m_xtmap[key];
36
37 return xtpar;
38}
39
40int MdcCalibConst::getXtKey(int lay, int entr, int lr, int order) const{
41 int key;
42
43 key = ( (lay << XTLAYER_INDEX) & XTLAYER_MASK ) |
44 ( (entr << XTENTRA_INDEX) & XTENTRA_MASK ) |
45 ( (lr << XTLR_INDEX) & XTLR_MASK ) |
46 ( (order << XTORDER_INDEX) & XTORDER_MASK );
47
48 return key;
49}
50
52 m_xtiter = m_xtmap.begin();
53}
54
55int MdcCalibConst::getNextXtpar(int& key, double& xtpar) {
56 if( m_xtiter != m_xtmap.end() ){
57 key = (*m_xtiter).first;
58 xtpar = (*m_xtiter).second;
59 m_xtiter++;
60 return 1;
61 }
62 else return 0;
63}
64
65void MdcCalibConst::fillQtpar(int order, double val){
66 if( 0 == order ){
67 m_qtpar0.push_back( val );
68 } else if( 1 == order ){
69 m_qtpar1.push_back( val );
70 } else {
71 std::cout << "Order of Qtpar Error in fillQtpar()!" << std::endl;
72 }
73}
74
75void MdcCalibConst::resetQtpar(int lay, int order, double val){
76 if( 0 == order ){
77 m_qtpar0[lay] = val;
78 } else if( 1 == order ){
79 m_qtpar1[lay] = val;
80 } else{
81 std::cout << "Order of Qtpar Error in resetQtpar()!" << std::endl;
82 }
83}
84
85double MdcCalibConst::getQtpar(int lay, int order) const{
86 if( 0 == order ){
87 return m_qtpar0[lay];
88 } else if( 1 == order ){
89 return m_qtpar1[lay];
90 } else{
91 std::cout << "Order of Qtpar Error in getQtpar()!" << std::endl;
92 return -9999.0;
93 }
94}
95
96void MdcCalibConst::fillSdpar(int key, double val){
97 m_sdmap.insert( valType( key, val) );
98}
99
100void MdcCalibConst::resetSdpar(int lay, int entr, int lr, int bin, double val){
101 int key = getSdKey(lay, entr, lr, bin);
102 m_sdmap[key] = val;
103}
104
105double MdcCalibConst::getSdpar(int lay, int entr, int lr, int bin){
106
107 double sdpar = -999.0;
108 int key = getSdKey(lay, entr, lr, bin);
109 if( 1 == m_sdmap.count(key) ){
110 return m_sdmap[key];
111 }
112
113 return sdpar;
114}
115
116int MdcCalibConst::getSdKey(int lay, int entr, int lr, int bin) const{
117 int key;
118
119 key = ( (lay << SDLAYER_INDEX) & SDLAYER_MASK ) |
120 ( (entr << SDENTRA_INDEX) & SDENTRA_MASK ) |
121 ( (lr << SDLR_INDEX) & SDLR_MASK ) |
122 ( (bin << SDBIN_INDEX) & SDBIN_MASK );
123
124 return key;
125}
126
128 m_sditer = m_sdmap.begin();
129}
130
131int MdcCalibConst::getNextSdpar(int& key, double& sdpar) {
132 if( m_sditer != m_sdmap.end() ){
133 key = (*m_sditer).first;
134 sdpar = (*m_sditer).second;
135 m_sditer++;
136 return 1;
137 }
138 else return 0;
139}
140
142 m_xtmap.clear();
143 m_t0.clear();
144 m_delt0.clear();
145// m_wshift.clear();
146// m_delwshift.clear();
147 m_qtpar0.clear();
148 m_qtpar1.clear();
149 m_sdmap.clear();
150}
*******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
std::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
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)