Changeset 3292 for branches

Show
Ignore:
Timestamp:
01/26/12 21:07:20 (4 months ago)
Author:
erkn
Message:

now works for xrays

commented out irrelevant code such as capture flux and He3 pressure
converted for lentghs instead of times etc

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/mcxtrace-1.0/xlib/monitors/Monitor_nD.comp

    r3291 r3292  
    195195* username2:  [str] Name assigned to User2 
    196196* username3:  [str] Name assigned to User3 
    197 * restore_neutron: [0|1] If set, the monitor does not influence the neutron state. 
     197* restore_xray: [0|1] If set, the monitor does not influence the neutron state. 
    198198*                        Equivalent to setting the 'parallel' option. 
    199199* geometry:   [str] Name of an OFF file to specify a complex geometry detector 
     
    212212DEFINITION PARAMETERS (string options=0, string filename=0,string geometry=0,  
    213213  user1=FLT_MAX, user2=FLT_MAX, user3=FLT_MAX, username1=0, username2=0,username3=0) 
    214 SETTING PARAMETERS (xwidth=0, yheight=0, zdepth=0, xmin=0, xmax=0, ymin=0, ymax=0, zmin=0, zmax=0, bins=0, min=-1e40, max=1e40, restore_neutron=0, radius=0) 
     214SETTING PARAMETERS (xwidth=0, yheight=0, zdepth=0, xmin=0, xmax=0, ymin=0, ymax=0, zmin=0, zmax=0, bins=0, min=-1e40, max=1e40, restore_xray=0, radius=0) 
    215215/* these are protected C variables */ 
    216216OUTPUT PARAMETERS (DEFS, Vars, detector) 
     
    346346     || (geometry && strlen(geometry)) ) 
    347347    { 
    348       if (t0 < 0 && t1 > 0) 
    349         t0 = t;  /* neutron was already inside ! */ 
    350       if (t1 < 0 && t0 > 0) /* neutron exit before entering !! */ 
    351         t1 = l; 
     348      if (l0 < 0 && l1 > 0) 
     349        l0 = 0;  /* photon was already inside ! */ 
     350      if (l1 < 0 && l0 > 0) /* photon exit before entering !! */ 
     351        l1 = 0; 
    352352      /* t0 is now time of incoming intersection with the sphere. */ 
    353       if ((Vars.Flag_Shape < 0) && (t1 > 0)) 
    354         PROP_DL(l1); /* t1 outgoing beam */ 
     353      if ((Vars.Flag_Shape < 0) && (l1 > 0)) 
     354        PROP_DL(l1); /* l1 outgoing beam */ 
    355355      else 
    356         PROP_DL(l0); /* t0 incoming beam */ 
     356        PROP_DL(l0); /* l0 incoming beam */ 
    357357    } 
    358358 
     
    375375 
    376376    /*this is probably irrelevant for xrays*/ 
    377     if ((Vars.He3_pressure > 0) && (t1 != t0) && ((abs(Vars.Flag_Shape) == DEFS.SHAPE_SPHERE) || (abs(Vars.Flag_Shape) == DEFS.SHAPE_CYLIND) || (abs(Vars.Flag_Shape) == DEFS.SHAPE_BOX))) 
    378     { 
    379       XY = exp(-7.417*Vars.He3_pressure*fabs(t1-t0)*2*PI*K2V); 
     377//    if ((Vars.He3_pressure > 0) && (l1 != l0) && ((abs(Vars.Flag_Shape) == DEFS.SHAPE_SPHERE) || (abs(Vars.Flag_Shape) == DEFS.SHAPE_CYLIND) || (abs(Vars.Flag_Shape) == DEFS.SHAPE_BOX))) 
     378//    { 
     379//      XY = exp(-7.417*Vars.He3_pressure*fabs(l1-l0)*2*PI*K2V); 
    380380      /* will monitor the absorbed part */ 
    381       Vars.cp *= 1-XY; 
     381//      Vars.cp *= 1-XY; 
    382382      /* and modify the neutron weight after monitor, only remains 1-p_detect */ 
    383       p *= XY; 
    384     } 
     383//      p *= XY; 
     384//    } 
    385385 
    386386    /*this is probably irrelevant for xrays*/ 
    387     if (Vars.Flag_capture) 
    388     { 
    389       XY = sqrt(Vars.cvx*Vars.cvx+Vars.cvy*Vars.cvy+Vars.cvz*Vars.cvz); 
    390       XY *= V2K; 
    391       if (XY != 0) XY = 2*PI/XY; /* lambda. lambda(2200 m/2) = 1.7985 Angs  */ 
    392       Vars.cp *= XY/1.7985; 
    393     } 
     387 //   if (Vars.Flag_capture) 
     388//    { 
     389//      XY = sqrt(Vars.cvx*Vars.cvx+Vars.cvy*Vars.cvy+Vars.cvz*Vars.cvz); 
     390//      XY *= V2K; 
     391//      if (XY != 0) XY = 2*PI/XY; /* lambda. lambda(2200 m/2) = 1.7985 Angs  */ 
     392//      Vars.cp *= XY/1.7985; 
     393//    } 
    394394 
    395395    pp = Monitor_nD_Trace(&DEFS, &Vars);