Changeset 14 in ZHANGProjects
- Timestamp:
- Jul 25, 2014, 11:01:45 AM (10 years ago)
- Location:
- ICOSIM/CPP/trunk/source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
ICOSIM/CPP/trunk/source/.kdev4/source.kdev4
r13 r14 12 12 13 13 [Launch][Launch Configuration 0][Data] 14 Arguments=../sample/collimatorfile_ standard_ions_nominal.csv ../outputs/test14 Arguments=../sample/collimatorfile_crystal_matlab.csv ../outputs/crystal/test 15 15 Dependencies=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x00) 16 16 Dependency Action=Nothing -
ICOSIM/CPP/trunk/source/crystal_dan_FINAL_VERSION_CHvsVR.f
r13 r14 145 145 c miscut=0.001000 146 146 c 147 write(*,*)"last miscut angle =",miscut147 c write(*,*)"last miscut angle =",miscut 148 148 c write(*,*) 'enter crystal subroutine' 149 149 c write(*,*) 'particle energy Gev :', PC -
ICOSIM/CPP/trunk/source/lattice.cc
r8 r14 440 440 441 441 if (idpart >= 0) { 442 if (idpart > =bunch.size()) {443 cerr << "Warning, the particle that you want to spy using IDPART does not exist!" << endl;442 if (idpart > bunch.size()) { 443 cerr << "Warning, the particle that you want to spy using IDPART does not exist!" << " idpart = " << idpart << ", bunch.size = " << bunch.size() <<endl; 444 444 } else { 445 445 choicePart = idpart; -
ICOSIM/CPP/trunk/source/lattice.h
r5 r14 108 108 109 109 int npart; //number of particles 110 vector <int> ips; //vector indicating the position of the collimators ( givesthe index of the collimators in the complete lattice, e.g. if the first collimator is the 5th element, we will have ips[0] = 5)110 vector <int> ips; //vector indicating the position of the collimators (the index of the collimators in the complete lattice, e.g. if the first collimator is the 5th element, we will have ips[0] = 5) 111 111 112 112 vector <int> cocount;//count the number of particles crashing on each collimator … … 118 118 119 119 vector <int> ii;//'TCI' collimators 120 vector < int > ip;//'TCP', 'CRYSTAL' and 'TCRYO' collimators 121 vector < int > is;//'TCS' collimators 120 vector < int > ip;//'TCP', 'CRYSTAL' and 'TCRYO' collimators; primary collimators, 121 // only these collimators will be used to do particle-matter simulation 122 vector < int > is;//'TCS' secondary collimators; absorbers. 122 123 vector < int > it;//'TCT' collimators 123 vector < int > itcla;//'TCLA' collimators 124 vector < int > itcla;//'TCLA' collimators; absorber. 124 125 125 126 vector < int > ipcoll; // vector giving the position like ips, but only for 'TCP' collimators -
ICOSIM/CPP/trunk/source/simulation.cc
r13 r14 995 995 996 996 997 // tracking the particles through the machine997 //nonlinear tracking the particles through the machine 998 998 cout << "FOURTH TRACKING, TRACKING THROUGHT THE MACHINE." << endl; 999 999 … … 1988 1988 1989 1989 if (plotflag == "Yes") { 1990 PlotTrajectory(emix, emiy, ibeg, iend, xco, yco, outputpath); 1990 PlotTrajectory(emix, emiy, ibeg, iend, xco, yco, outputpath); 1991 1991 } 1992 1992 … … 2010 2010 int irevloc(0), i0loc(0), imloc(0); 2011 2011 2012 //total number of lost particles on collimators + apertures 2012 2013 NLostTotal = asumhitcolli[asumhitcolli.size() - 1] + asumhits[asumhits.size() - 1]; 2013 2014 … … 2019 2020 2020 2021 vector <double> sep; 2021 vector <double> plosslocal, zlosslocal; 2022 vector <double> plosslocal, zlosslocal; // local lost power & lost position 2022 2023 2023 2024 for (double k(lat.reseau[i0loc]->S); k < lat.reseau[imloc]->S; ++k) { … … 2025 2026 } 2026 2027 2028 //calculate the location range to count the lost particles in this range, each 0.5 m 2027 2029 for (int i(0); i < sep.size() - 1; ++i) { 2028 2030 zlosslocal.push_back(sep[i] + (sep[i + 1] - sep[i]) / 2); … … 2031 2033 int count(0); 2032 2034 2035 //find the partice lost locations and number of lost particles 2033 2036 for (int i(0); i < sep.size() - 1; ++i) { 2034 2037 for (int j(0); j < hitso.size(); ++j) { … … 2065 2068 sip.push_back(lat.reseau[i]->S); 2066 2069 pos.push_back(i); 2067 } 2068 } 2069 2070 // std::cout << lat.reseau[i]->NAME << std::endl; 2071 } 2072 } 2073 2074 // std::cout << pos.size() << std::endl; 2075 // std::cout << "size of the IP number: " << sip.size() << std::endl; 2076 2070 2077 if (sip.size() != 0) { 2071 2078 … … 2124 2131 vector <int> removedCollimators; 2125 2132 2133 //if the open jar of the collimator is larger than 100 sigma, so it means 2134 // this collimator is not used in the collimation. 2126 2135 for (int i(0); i < lat.resColli.size(); ++i) { 2127 2136 if (lat.resColli[i]->nsig > 100) { … … 2211 2220 } 2212 2221 2222 /******************************************************** 2223 * 2224 * Generate GNUPLOT scripts to plot the summary data. 2225 * ******************************************************/ 2213 2226 //Writing PlotRunSummary1.p 2214 2227 … … 2287 2300 PlotRun3 << "set title \"Time Development after first impact on collimator\"" << endl << endl; 2288 2301 PlotRun3 << "set logscale y" << endl << endl; 2289 PlotRun3 << " plot \"PlotRunSummary4.dat\" using 1:2 title \' particles in beam\' with line, \"PlotRunSummary4.dat\" using 1:3 title \'particles lost on collimators\' with line, \"PlotRunSummary4.dat\" using 1:4 title \'particles lost elsewhere\' with line" << endl << endl;2302 PlotRun3 << " plot \"PlotRunSummary4.dat\" using 1:2 title \'rest particles in beam\' with line, \"PlotRunSummary4.dat\" using 1:3 title \'particles lost on collimators\' with line, \"PlotRunSummary4.dat\" using 1:4 title \'particles lost elsewhere\' with line" << endl << endl; 2290 2303 PlotRun3 << "unset logscale y" << endl; 2291 2304 PlotRun3.close();
Note: See TracChangeset
for help on using the changeset viewer.