Changeset 17 in ZHANGProjects for ICOSIM/CPP/trunk/source/lattice.cc


Ignore:
Timestamp:
Sep 30, 2014, 11:05:33 AM (10 years ago)
Author:
zhangj
Message:

Added comments...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ICOSIM/CPP/trunk/source/lattice.cc

    r15 r17  
    441441{
    442442
     443  cout << "bunch size is: " << bunch.size() << endl;
     444 
     445 
    443446    if (idpart >= 0) {
    444447        if (idpart > bunch.size()) {
     
    602605          read(bunch);
    603606          }*/
    604 
     607       
     608       
    605609        for (int p(0); p < bunch.size(); ++p) { //loop througt the particles
    606610
    607611            double dpopeff;
    608612
     613            // .inabs = 0, particle lost, .inabs = 1, particle not lost
    609614            if (bunch[p].inabs == 1) {
    610615
     
    743748
    744749                            int lost(bunch.size());
    745 
    746                             resColli[icop]->collipassCrystal(bunch, betgam, turn, outputpath);
    747 
    748                             nhitcolli[icop] = lost - bunch.size(); //nhitcolli(icop) gives the number particles getting lost in collimator number icop,
    749 
     750                             
     751                            long int nhit = 0;
     752                           
     753                            resColli[icop]->collipassCrystal(bunch, betgam, turn, nhit, outputpath);
     754
     755                            //nhitcolli[icop] = lost - bunch.size(); //nhitcolli(icop) gives the number particles getting lost in collimator number icop,
     756                           
     757                             nhitcolli[icop] = nhit;
     758
     759                         //    cout << "after the crystal: bunch size = " << bunch.size()<< endl;
    750760                        }
    751761
     
    924934                        if (inside == false) {
    925935                            cout <<"The particle is lost at element " << reseau[i]->NAME << endl;
     936//                           cout << "Particle ID is: " << p << endl;
     937//                           cout << "bunch size is: " << bunch.size() << endl;
     938//                           cout << "bunch status is: " << bunch[p].inabs << endl;
     939//                           
    926940                            xh0 = bunch[p].coordonnees[0][0];
    927941                            bunch[p].inabs = 0;
     
    11001114            }
    11011115        }
     1116    //    cout << "bunch size is ...." << bunch.size() << endl;
    11021117
    11031118        if (plotflag == "Yes") {
     
    11321147    vector <Particle> tempinabs;
    11331148
    1134     //we contine just with particles that are not lost
     1149    //we contine to track for the next turn; just with particles that are not lost
    11351150    for (int w(0); w < bunch.size(); ++w) {
    11361151        if (bunch[w].inabs != 0) {
     
    11391154    }
    11401155
     1156 //   cout << "bunch size before the turn: "<< bunch.size() << endl;
     1157   
    11411158    bunch.clear();
    11421159
     
    11471164    tempinabs.clear();
    11481165
    1149 }
     1166   // cout << "bunch size after the turn " <<bunch.size() << endl;
     1167}
Note: See TracChangeset for help on using the changeset viewer.