35 UNIT[
"deg"]=(acos(-1))/180.;
37 m_dataPath = getenv(
"TOFSIMROOT");
39 G4cout<<
"BOOST environment not set!"<<G4endl;
51void BesTofGeoParameter::ReadBrData()
54 const G4String pmtDataPath = m_dataPath +
"/dat/TofBr.txt";
56 std::ifstream fin(pmtDataPath);
58 std::cerr <<
"cannot open " << pmtDataPath <<
" for initialization.";
65 string::size_type pre_position = 0;
66 string::size_type post_position = 0;
67 vector<string> stringVector;
68 while (getline(fin, tempString,
'\n')){
71 pre_position = tempString.find_first_of(
"#");
72 if (pre_position != string::npos){
73 tempString.erase(tempString.begin() + pre_position, tempString.end());
80 while (tempString.find_first_of(
" ", pre_position) != string::npos){
81 pre_position = tempString.find_first_of(
" ", pre_position);
82 post_position = tempString.find_first_not_of(
" ", pre_position);
83 size = post_position - pre_position;
84 tempString.replace(pre_position, size,
" ");
85 pre_position = post_position - size + 1;
89 if (tempString.size() > 10){
90 stringVector.push_back(tempString);
101 vector<string>::iterator it = stringVector.begin();
102 for (it; it != stringVector.end(); it++){
104 std::istrstream buff((*it).c_str(), strlen((*it).c_str()));
105 buff >> scinNb >> tempEPMTgain >> tempERiseTime >> tempWPMTgain >> tempWRiseTime >> tempAtten;
107 m_BrEPMTgain[scinNb] = tempEPMTgain;
108 m_BrERiseTime[scinNb] = tempERiseTime;
109 m_BrWPMTgain[scinNb] = tempWPMTgain;
110 m_BrWRiseTime[scinNb] = tempWRiseTime;
111 m_atten[scinNb] = tempAtten;
117void BesTofGeoParameter::ReadData()
120 const G4String GeometryPath = m_dataPath +
"/dat/BesTof.txt";
123 fin.open(GeometryPath);
125 const int maxCharOfOneLine=255;
126 char temp[maxCharOfOneLine],*p;
127 int lineNo=0,inputNo=0;
128 while (fin.peek()!=EOF)
130 fin.getline(temp,maxCharOfOneLine);
143 while (*p==
' '||*p==
'\t')p++;
144 if (*p==
'\0')
continue;
149 std::istrstream(p)>>nScinBr>>br1L>>br1TrapW1>>br1TrapW2>>br1TrapH>>br1R1>>AlThickness>>PVFThickness;
152 std::istrstream(p)>>br2L>>br2TrapW1>>br2TrapW2>>br2TrapH>>br2R1;
155 std::istrstream(p)>>bucketDBr>>bucketLBr;
158 std::istrstream(p)>>nScinEc>>ecL>>ecTrapW1>>ecTrapW2>>ecTrapH>>ecTrapH1
159 >>zPosEastEc>>zPosWestEc>>ecR1>>ecR2;
162 std::istrstream(p)>>bucketDEc>>bucketLEc>>bucketPosR;
165 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;
167 std::istrstream(p)>>m_ttsMean>>m_ttsSigma>>m_PMTgain>>m_Ce>>m_riseTime>>m_LLthresh>>m_HLthresh>>m_preGain>>m_noiseSigma;
169 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;
171 std::istrstream(p)>>m_ttsMeanEc>>m_ttsSigmaEc>>m_PMTgainEc>>m_CeEc>>m_riseTimeEc>>m_LLthreshEc>>m_HLthreshEc>>m_preGainEc>>m_noiseSigmaEc;
180void BesTofGeoParameter::ReadMrpcData()
183 G4String MrpcGeometryPath = m_dataPath +
"/dat/BesTofMrpc.txt";
184 const int maxCharOfOneLine=255;
185 char temp[maxCharOfOneLine],*p;
192 fin.open(MrpcGeometryPath);
194 while (fin.peek()!=EOF)
196 fin.getline(temp,maxCharOfOneLine);
208 while (*p==
' '||*p==
'\t')p++;
209 if (*p==
'\0')
continue;
211 std::stringstream ss(temp);
220 double rOffset, angle, angleOffset;
221 VEC v_rOffset, v_angle, v_angleOffset;
223 G4String MrpcGeometryPath1 = m_dataPath +
"/dat/Mrpc_adjust.txt";
224 fin.open(MrpcGeometryPath1);
226 while (fin.peek()!=EOF)
228 fin.getline(temp,maxCharOfOneLine);
240 while (*p==
' '||*p==
'\t')p++;
241 if (*p==
'\0')
continue;
244 std::stringstream ss(temp);
245 std::stringstream name;
246 ss >> rOffset >> angle >> angleOffset;
249 container2[
"rOffset_east"] = v_rOffset;
250 container2[
"angle_east"] = v_angle;
251 container2[
"angleOffset_east"] = v_angleOffset;
255 v_angleOffset.clear();
258 v_rOffset.push_back(rOffset);
259 v_angle.push_back(angle);
260 v_angleOffset.push_back(angleOffset);
262 container2[
"rOffset_west"] = v_rOffset;
263 container2[
"angle_west"] = v_angle;
264 container2[
"angleOffset_west"] = v_angleOffset;
284 int tofid, strip, end;
285 for(
int i=0; i<72; i++)
287 for(
int j=0; j<12; j++)
289 m_deadChannel[i][j] = -999;
293 G4String MrpcGeometryPath2 = m_dataPath +
"/dat/BesTofMrpc_dead.txt";
294 fin.open(MrpcGeometryPath2);
296 while (fin.peek()!=EOF)
298 fin.getline(temp,maxCharOfOneLine);
310 while (*p==
' '||*p==
'\t')p++;
311 if (*p==
'\0')
continue;
313 std::stringstream ss(temp);
314 ss >> tofid >> strip >> end;
315 m_deadChannel[tofid][strip] = end;
316 std::cout<<
"deadC["<<tofid<<
"]["<<strip<<
"]= "<<m_deadChannel[tofid][strip]<<std::endl;
326 for(CONTAINER::iterator it=container.begin(); it!=container.end(); ++it)
330 double val = container[
key];
335 std::cout<<
"!!!! Wrong! Please check the value name !!!!"<<std::endl;
342 for(CONTAINER2::iterator it=container2.begin(); it!=container2.end(); ++it)
351 std::cout<<
"!!!! Wrong! Please check the value name !!!!"<<std::endl;
357 for(
int i=0; i<72; i++)
359 for(
int j=0; j<12; j++)
361 deadChannel[i][j] = m_deadChannel[i][j];
std::vector< double > VEC
*******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
*************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)
void Get_deadChannel(int deadChannel[72][12])
static BesTofGeoParameter * GetInstance()
VEC GetVec(std::string key)