Ignore:
Timestamp:
Jun 18, 2010, 11:42:07 AM (14 years ago)
Author:
garnier
Message:

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/incl/src/G4Incl.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4Incl.cc,v 1.29 2009/12/09 10:36:40 kaitanie Exp $
     26// $Id: G4Incl.cc,v 1.30 2010/04/27 16:02:37 kaitanie Exp $
    2727// Translation of INCL4.2/ABLA V3
    2828// Pekka Kaitaniemi, HIP (translation)
     
    34103410  bl9->l2 = bl2->jnd[imin]; //NOTE: l2 changed to bl9->l2.
    34113411
     3412#ifdef G4INCL_DEBUG_LOG
     3413  // Print the debug log
     3414  print_log_start_step();
     3415  print_log_entry(1, 1, 1, imin);
     3416  print_log_end_step();
     3417#endif
     3418
    34123419  // test le 20/3/2003: tue sinon le dernier avatar?
    34133420  if (bl2->k == 0) {
     
    77677774  }
    77687775}
     7776
     7777// C------------------------------------------------------------------------
     7778// C Logging
     7779// C
     7780
     7781// C     Start a new simulation step log entry
     7782//       subroutine print_log_start_step()
     7783void G4Incl::print_log_start_step()
     7784{
     7785  if(inside_step != 1) {
     7786    G4cout << "(simulation-step " << G4endl;
     7787    inside_step = 1;
     7788  } else {
     7789    G4cout << ";; Error: Can not start a new step inside s step" << G4endl;
     7790  }
     7791}
     7792
     7793// C     End a simulation step
     7794//       subroutine print_log_end_step()
     7795void G4Incl::print_log_end_step()
     7796{
     7797  if(inside_step == 1) {
     7798    G4cout <<") ;;ENDSIMULATIONSTEP" << G4endl;
     7799    inside_step = 0;
     7800  } else {
     7801    G4cout <<";; Error: Not inside a step" << G4endl;
     7802  }
     7803}
     7804
     7805// C     The main logging routine
     7806// C     Parameters are used to select what to print. Possible options are:
     7807// C     list of avatars, selected avatar, list of particles and
     7808// C     the index of the selected avatar
     7809//       subroutine print_log_entry(iavatars, iselected, iparticles, imin)
     7810void G4Incl::print_log_entry(G4int iavatars, G4int iselected, G4int iparticles, G4int imin)
     7811{
     7812//       COMMON/BL1/P1(300),P2(300),P3(300),EPS(300),IND1(300),IND2(300),TA
     7813//       COMMON/BL2/CROIS(19900),K,IND(20000),JND(20000)
     7814//       COMMON/BL3/R1,R2,X1(300),X2(300),X3(300),IA1,IA2,RAB2             P-N22270
     7815
     7816  if(iavatars == 1) {
     7817    G4cout <<";; List of avatars" << G4endl;
     7818    print_avatars();
     7819  }
     7820
     7821  if(iselected == 1) {
     7822    G4cout <<";; Selected avatar" << G4endl;
     7823    print_one_avatar(imin); // (avatar ...) ;; Selected avatar (index: imin)
     7824  }
     7825     
     7826  if(iparticles == 1) {
     7827    G4cout <<";; Particle avatar map" << G4endl;
     7828    print_map();      // ((list particle-avatar-map particle-avatar-map ...))
     7829  }
     7830}
     7831
     7832//       subroutine print_avatars(crois, k, ind, jnd, p1, p2, p3, eps, ind1
     7833//      s,ind2, ta, r1, r2, x1, x2, x3, ia1, ia2, rab2)
     7834void G4Incl::print_avatars()
     7835{
     7836// C      COMMON/BL1/P1(350),P2(350),P3(350),EPS(350),IND1(350),IND2(350),TA
     7837// C     -,V(350)                                                           P-N22260
     7838// C      COMMON/BL2/CROIS(19900),K,IND(20000),JND(20000)
     7839// C      COMMON/BL3/R1,R2,X1(350),X2(350),X3(350),IA1,IA2,RAB2             P-N22270
     7840     
     7841  G4cout <<"(list ;; List of avatars" << G4endl;
     7842  for(int i = 1; i <= bl2->k; ++i) { //do i=1,k
     7843    print_one_avatar(i);
     7844  }
     7845  G4cout << ")" << G4endl;
     7846}
     7847
     7848// C     Prints the information of one avatar (selected using the index
     7849// C     (values between 1 and K) in BL2 common block.
     7850//       subroutine print_one_avatar(index)
     7851void G4Incl::print_one_avatar(G4int index)
     7852{
     7853//       COMMON/BL1/P1(300),P2(300),P3(300),EPS(300),IND1(300),IND2(300),TA
     7854//       COMMON/BL2/CROIS(19900),K,IND(20000),JND(20000)
     7855//       COMMON/BL3/R1,R2,X1(300),X2(300),X3(300),IA1,IA2,RAB2             P-N22270
     7856
     7857  G4int i_ind1 = bl1->ind1[bl2->ind[index]];
     7858  //  G4int i_ind2 = bl1->ind2[bl2->ind[index]];
     7859  G4int j_ind1 = -1;
     7860  G4int j_ind2 = -1;
     7861
     7862  if(bl2->jnd[index] != -1) {
     7863    j_ind1 = bl1->ind1[bl2->jnd[index]];
     7864    j_ind2 = bl1->ind2[bl2->jnd[index]];
     7865  } else {
     7866    j_ind1 = -1;
     7867    j_ind2 = -1;
     7868  }
     7869
     7870  G4cout <<"(avatar " << bl2->crois[index] << G4endl;// Create avatar with time crois(index)
     7871
     7872// C     Now we print the avatar type
     7873  if(i_ind1 == 0 && j_ind2 == 0) { // NN collision
     7874    G4cout <<"(quote nn-collision)" << G4endl;
     7875  } else if(bl2->ind[index] != -1 && bl2->jnd[index] == -1) {
     7876    G4cout <<"(quote reflection)" << G4endl;
     7877  } else {
     7878    G4cout <<"(quote unidentified-avatar)" << G4endl;
     7879  }
     7880
     7881// C     Print the list of particles in the avatar
     7882  G4cout <<"(list ;; List of particles in the avatar" << G4endl;
     7883  print_one_particle(bl2->ind[index]);
     7884  if(bl2->jnd[index] != -1) {
     7885    print_one_particle(bl2->jnd[index]);
     7886  }
     7887  G4cout <<") ;; End of the particle list" << G4endl;
     7888
     7889  G4cout <<") ;; End of the avatar" << G4endl;
     7890}
     7891
     7892// C     Prints the information of one particle in common blocks BL1 and BL3.
     7893// C     The particle is selected by giving the index of the particle entry
     7894// C     as a parameter.
     7895//       subroutine print_one_particle(index)
     7896void G4Incl::print_one_particle(G4int index)
     7897{
     7898//       COMMON/BL1/P1(300),P2(300),P3(300),EPS(300),IND1(300),IND2(300),TA
     7899//       COMMON/BL2/CROIS(19900),K,IND(20000),JND(20000)
     7900//       COMMON/BL3/R1,R2,X1(300),X2(300),X3(300),IA1,IA2,RAB2             P-N22270
     7901
     7902// C     Particle knows its ID, type position, momentum and energy
     7903  G4cout <<"(particle " << index << G4endl;
     7904  if(bl1->ind1[index] == 0) { // Nucleon
     7905    if(bl1->ind1[index] == 1) G4cout << "(quote proton)" << G4endl;
     7906    else if(bl1->ind1[index] == -1) G4cout << "(quote neutron)" << G4endl;
     7907    else G4cout << "(quote unidentified-nucleon)" << G4endl;
     7908  } else if(bl1->ind1[index] == 1) { // Delta
     7909    if(bl1->ind2[index] >= -2 && bl1->ind2[index] <= 2) G4cout << "(quote delta-"
     7910                                                               << bl1->ind2[index]
     7911                                                               << ")" << G4endl;
     7912    else G4cout << "(quote unidentified-delta)" << G4endl;
     7913  } else {
     7914    G4cout <<"(quote unidentified-particle)" << G4endl;
     7915  }
     7916
     7917  print_three_vector (bl3->x1[index], bl3->x2[index], bl3->x3[index]);
     7918  print_three_vector (bl1->p1[index], bl1->p2[index], bl1->p3[index]);
     7919
     7920  G4cout << bl1->eps[index] << G4endl;
     7921
     7922  G4cout <<")" << G4endl; // Close the particle s-expression
     7923}
     7924
     7925//       subroutine print_three_vector(x, y, z)
     7926void G4Incl::print_three_vector(G4double x, G4double y, G4double z)
     7927{
     7928  G4cout <<"(vector3 " << x << " " << y << " " << z << ")" << G4endl;
     7929}
     7930
     7931//       subroutine print_map()
     7932void G4Incl::print_map()
     7933{
     7934//       COMMON/BL1/P1(300),P2(300),P3(300),EPS(300),IND1(300),IND2(300),TA
     7935//       COMMON/BL2/CROIS(19900),K,IND(20000),JND(20000)
     7936//       COMMON/BL3/R1,R2,X1(300),X2(300),X3(300),IA1,IA2,RAB2             P-N22270
     7937
     7938  G4cout <<"(list ;; Particles at the beginning of the avatar" << G4endl;
     7939  G4int ia = bl3->ia1 + bl3->ia2;
     7940  for(G4int i = 1; i != ia; ++i) { // do i=1,IA
     7941    print_one_particle(i);
     7942  }
     7943  G4cout <<")" << G4endl;
     7944}
Note: See TracChangeset for help on using the changeset viewer.