13#include "TofSim/BesTofGeoParameter.hh"
14#include "SimUtil/ReadBoostRoot.hh"
32 UNIT[
"deg"] = ( acos( -1 ) ) / 180.;
34 m_dataPath = getenv(
"TOFSIMROOT" );
37 G4cout <<
"BOOST environment not set!" << G4endl;
47void BesTofGeoParameter::ReadBrData() {
49 const G4String pmtDataPath = m_dataPath +
"/dat/TofBr.txt";
51 std::ifstream fin( pmtDataPath );
54 std::cerr <<
"cannot open " << pmtDataPath <<
" for initialization.";
61 string::size_type pre_position = 0;
62 string::size_type post_position = 0;
63 vector<string> stringVector;
64 while ( getline( fin, tempString,
'\n' ) )
68 pre_position = tempString.find_first_of(
"#" );
69 if ( pre_position != string::npos )
71 tempString.erase( tempString.begin() + pre_position, tempString.end() );
78 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 ) { stringVector.push_back( tempString ); }
98 vector<string>::iterator it = stringVector.begin();
99 for ( it; it != stringVector.end(); it++ )
102 std::istrstream buff( ( *it ).c_str(), strlen( ( *it ).c_str() ) );
103 buff >> scinNb >> tempEPMTgain >> tempERiseTime >> tempWPMTgain >> tempWRiseTime >>
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;
115void BesTofGeoParameter::ReadData() {
117 const G4String GeometryPath = m_dataPath +
"/dat/BesTof.txt";
120 fin.open( GeometryPath );
122 const int maxCharOfOneLine = 255;
123 char temp[maxCharOfOneLine], *p;
124 int lineNo = 0, inputNo = 0;
125 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 >>
149 AlThickness >> PVFThickness;
151 case 2: std::istrstream( p ) >> br2L >> br2TrapW1 >> br2TrapW2 >> br2TrapH >> br2R1;
break;
152 case 3: std::istrstream( p ) >> bucketDBr >> bucketLBr;
break;
154 std::istrstream( p ) >> nScinEc >> ecL >> ecTrapW1 >> ecTrapW2 >> ecTrapH >> ecTrapH1 >>
155 zPosEastEc >> zPosWestEc >> ecR1 >> ecR2;
157 case 5: std::istrstream( p ) >> bucketDEc >> bucketLEc >> bucketPosR;
break;
159 std::istrstream( p ) >> m_tau1 >> m_tau2 >> m_tau3 >> m_tauRatio >> m_refIndex >>
160 m_phNConst >> m_Cpe2pmt >> m_rAngle >> m_QE >> m_CE >> m_peCorFac;
162 std::istrstream( p ) >> m_ttsMean >> m_ttsSigma >> m_PMTgain >> m_Ce >> m_riseTime >>
163 m_LLthresh >> m_HLthresh >> m_preGain >> m_noiseSigma;
165 std::istrstream( p ) >> m_tau1Ec >> m_tau2Ec >> m_tau3Ec >> m_tauRatioEc >>
166 m_refIndexEc >> m_phNConstEc >> m_Cpe2pmtEc >> m_rAngleEc >> m_QEEc >> m_CEEc >>
167 m_peCorFacEc >> m_attenEc;
169 std::istrstream( p ) >> m_ttsMeanEc >> m_ttsSigmaEc >> m_PMTgainEc >> m_CeEc >>
170 m_riseTimeEc >> m_LLthreshEc >> m_HLthreshEc >> m_preGainEc >> m_noiseSigmaEc;
177void BesTofGeoParameter::ReadMrpcData() {
179 G4String MrpcGeometryPath = m_dataPath +
"/dat/BesTofMrpc.txt";
180 const int maxCharOfOneLine = 255;
181 char temp[maxCharOfOneLine], *p;
188 fin.open( MrpcGeometryPath );
190 while ( fin.peek() != EOF )
194 fin.getline( temp, maxCharOfOneLine );
206 while ( *p ==
' ' || *p ==
'\t' ) p++;
207 if ( *p ==
'\0' )
continue;
209 std::stringstream ss( temp );
211 container[
key] = val * UNIT[
unit];
217 double rOffset, angle, angleOffset;
218 VEC v_rOffset, v_angle, v_angleOffset;
220 G4String MrpcGeometryPath1 = m_dataPath +
"/dat/Mrpc_adjust.txt";
221 fin.open( MrpcGeometryPath1 );
223 while ( fin.peek() != EOF )
225 fin.getline( temp, maxCharOfOneLine );
237 while ( *p ==
' ' || *p ==
'\t' ) p++;
238 if ( *p ==
'\0' )
continue;
241 std::stringstream ss( temp );
242 std::stringstream name;
243 ss >> rOffset >> angle >> angleOffset;
246 container2[
"rOffset_east"] = v_rOffset;
247 container2[
"angle_east"] = v_angle;
248 container2[
"angleOffset_east"] = v_angleOffset;
252 v_angleOffset.clear();
255 v_rOffset.push_back( rOffset );
256 v_angle.push_back( angle );
257 v_angleOffset.push_back( angleOffset );
259 container2[
"rOffset_west"] = v_rOffset;
260 container2[
"angle_west"] = v_angle;
261 container2[
"angleOffset_west"] = v_angleOffset;
280 int tofid, strip, end;
281 for (
int i = 0; i < 72; i++ )
283 for (
int j = 0; j < 12; j++ ) { m_deadChannel[i][j] = -999; }
286 G4String MrpcGeometryPath2 = m_dataPath +
"/dat/BesTofMrpc_dead.txt";
287 fin.open( MrpcGeometryPath2 );
289 while ( fin.peek() != EOF )
291 fin.getline( temp, maxCharOfOneLine );
303 while ( *p ==
' ' || *p ==
'\t' ) p++;
304 if ( *p ==
'\0' )
continue;
306 std::stringstream ss( temp );
307 ss >> tofid >> strip >> end;
308 m_deadChannel[tofid][strip] = end;
309 std::cout <<
"deadC[" << tofid <<
"][" << strip <<
"]= " << m_deadChannel[tofid][strip]
317 for ( CONTAINER::iterator it = container.begin(); it != container.end(); ++it )
319 if ( ( it->first ) ==
key )
321 double val = container[
key];
326 std::cout <<
"!!!! Wrong! Please check the value name !!!!" << std::endl;
332 for ( CONTAINER2::iterator it = container2.begin(); it != container2.end(); ++it )
334 if ( ( it->first ) ==
key )
341 std::cout <<
"!!!! Wrong! Please check the value name !!!!" << std::endl;
346 for (
int i = 0; i < 72; i++ )
348 for (
int j = 0; j < 12; j++ ) { deadChannel[i][j] = m_deadChannel[i][j]; }
*******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
*************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)