12#include "BesTofGeoParameter.hh"
17#include "ReadBoostRoot.hh"
35 UNIT[
"deg"]=(acos(-1))/180.;
37 m_dataPath = getenv(
"TOFSIMROOT");
39 G4Exception(
"BOOST environment not set!");
50void BesTofGeoParameter::ReadBrData()
53 const G4String pmtDataPath = m_dataPath +
"/dat/TofBr.txt";
55 std::ifstream fin(pmtDataPath);
57 std::cerr <<
"cannot open " << pmtDataPath <<
" for initialization.";
64 string::size_type pre_position = 0;
65 string::size_type post_position = 0;
66 vector<string> stringVector;
67 while (getline(fin, tempString,
'\n')){
70 pre_position = tempString.find_first_of(
"#");
71 if (pre_position != string::npos){
72 tempString.erase(tempString.begin() + pre_position, tempString.end());
79 while (tempString.find_first_of(
" ", pre_position) != string::npos){
80 pre_position = tempString.find_first_of(
" ", pre_position);
81 post_position = tempString.find_first_not_of(
" ", pre_position);
82 size = post_position - pre_position;
83 tempString.replace(pre_position, size,
" ");
84 pre_position = post_position - size + 1;
88 if (tempString.size() > 10){
89 stringVector.push_back(tempString);
100 vector<string>::iterator it = stringVector.begin();
101 for (it; it != stringVector.end(); it++){
103 std::istrstream buff((*it).c_str(), strlen((*it).c_str()));
104 buff >> scinNb >> tempEPMTgain >> tempERiseTime >> tempWPMTgain >> tempWRiseTime >> tempAtten;
106 m_BrEPMTgain[scinNb] = tempEPMTgain;
107 m_BrERiseTime[scinNb] = tempERiseTime;
108 m_BrWPMTgain[scinNb] = tempWPMTgain;
109 m_BrWRiseTime[scinNb] = tempWRiseTime;
110 m_atten[scinNb] = tempAtten;
116void BesTofGeoParameter::ReadData()
119 const G4String GeometryPath = m_dataPath +
"/dat/BesTof.txt";
122 fin.open(GeometryPath);
124 const int maxCharOfOneLine=255;
125 char temp[maxCharOfOneLine],*p;
126 int lineNo=0,inputNo=0;
127 while (fin.peek()!=EOF)
129 fin.getline(temp,maxCharOfOneLine);
142 while (*p==
' '||*p==
'\t')p++;
143 if (*p==
'\0')
continue;
148 std::istrstream(p)>>nScinBr>>br1L>>br1TrapW1>>br1TrapW2>>br1TrapH>>br1R1>>AlThickness>>PVFThickness;
151 std::istrstream(p)>>br2L>>br2TrapW1>>br2TrapW2>>br2TrapH>>br2R1;
154 std::istrstream(p)>>bucketDBr>>bucketLBr;
157 std::istrstream(p)>>nScinEc>>ecL>>ecTrapW1>>ecTrapW2>>ecTrapH>>ecTrapH1
158 >>zPosEastEc>>zPosWestEc>>ecR1>>ecR2;
161 std::istrstream(p)>>bucketDEc>>bucketLEc>>bucketPosR;
164 std::istrstream(p)>>m_tau1>>m_tau2>>m_tau3>>m_tauRatio>>m_refIndex>>m_phNConst>>m_Cpe2pmt>>m_rAngle>>m_QE>>m_CE>>m_peCorFac;
166 std::istrstream(p)>>m_ttsMean>>m_ttsSigma>>m_PMTgain>>m_Ce>>m_riseTime>>m_LLthresh>>m_HLthresh>>m_preGain>>m_noiseSigma;
168 std::istrstream(p)>>m_tau1Ec>>m_tau2Ec>>m_tau3Ec>>m_tauRatioEc>>m_refIndexEc>>m_phNConstEc>>m_Cpe2pmtEc>>m_rAngleEc>>m_QEEc>>m_CEEc>>m_peCorFacEc>>m_attenEc;
170 std::istrstream(p)>>m_ttsMeanEc>>m_ttsSigmaEc>>m_PMTgainEc>>m_CeEc>>m_riseTimeEc>>m_LLthreshEc>>m_HLthreshEc>>m_preGainEc>>m_noiseSigmaEc;
179void BesTofGeoParameter::ReadMrpcData()
182 G4String MrpcGeometryPath = m_dataPath +
"/dat/BesTofMrpc.txt";
183 const int maxCharOfOneLine=255;
184 char temp[maxCharOfOneLine],*p;
191 fin.open(MrpcGeometryPath);
193 while (fin.peek()!=EOF)
195 fin.getline(temp,maxCharOfOneLine);
207 while (*p==
' '||*p==
'\t')p++;
208 if (*p==
'\0')
continue;
210 std::stringstream ss(temp);
219 double rOffset, angle, angleOffset;
220 VEC v_rOffset, v_angle, v_angleOffset;
222 G4String MrpcGeometryPath1 = m_dataPath +
"/dat/Mrpc_adjust.txt";
223 fin.open(MrpcGeometryPath1);
225 while (fin.peek()!=EOF)
227 fin.getline(temp,maxCharOfOneLine);
239 while (*p==
' '||*p==
'\t')p++;
240 if (*p==
'\0')
continue;
243 std::stringstream ss(temp);
244 std::stringstream name;
245 ss >> rOffset >> angle >> angleOffset;
248 container2[
"rOffset_east"] = v_rOffset;
249 container2[
"angle_east"] = v_angle;
250 container2[
"angleOffset_east"] = v_angleOffset;
254 v_angleOffset.clear();
257 v_rOffset.push_back(rOffset);
258 v_angle.push_back(angle);
259 v_angleOffset.push_back(angleOffset);
261 container2[
"rOffset_west"] = v_rOffset;
262 container2[
"angle_west"] = v_angle;
263 container2[
"angleOffset_west"] = v_angleOffset;
286 for(CONTAINER::iterator it=container.begin(); it!=container.end(); ++it)
290 double val = container[
key];
295 std::cout<<
"!!!! Wrong! Please check the value name !!!!"<<std::endl;
302 for(CONTAINER2::iterator it=container2.begin(); it!=container2.end(); ++it)
311 std::cout<<
"!!!! Wrong! Please check the value name !!!!"<<std::endl;
*******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 saves r n generator level $ !Flag for chat level in !Latex Output unit
std::vector< double > VEC
std::vector< double > VEC
*************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
double Get(std::string key)
static BesTofGeoParameter * GetInstance()
VEC GetVec(std::string key)