VTX Offline software fix
See VTX volume reorganization

Test of the offline software. This is a PISA display showing tracks and hits thrown in +y and +z, hitting the VTX and FVTX. After the VTX volume reorganization, the VTX hits failed to show up in the DSTs (the FVTX hist were still there).
cfm_sngp cone is theta=25, phi=90, dphi=25°

New geometry, analyzed with Fun4all_SIM.C (from Sanghoon)
FVTX hits - OK.
New geometry,
VTX hits - OK.
Just to check that the changes are backwards compatible: old geometry,
FVTX hits - OK.
Note the tracks are thrown in a smaller cone, to make sure we are looking at the correct files.
cfm_sngp cone is theta=25, phi=90, dphi=25°
Just to check that the changes are backwards compatible: old geometry,
VTX hits - OK.
Code change in /offline/packages/svx/SvxSimulator.C:
The old path to the sensors was 
        (in /simulation/pisa2000/src/svx/svx.f):

    Character*4 namesv(6) /'HALL','SIEN','SICG'
 	     *     ,'SIxx','SISN','SDUM'/ 

and the new path is:

     Character*4 namesv(7) /'HALL','SIEN','SICG',
     &     'SVxx','SJ0x','SI0x','SISN'/

Thus the indices needed are 3,4 (for old PISAEvent.rot files) and 4,6 
(for new files).

    if ( i == SVXBARRELINDEX ) {                             // Barrel

      itemp = (int) (svx->GetHit(khit))->GetHitVolume(3);      // HvH: ladder index (was 3)
      iladder = itemp-1;
      if (iladder != -1) {                                     // 3 was OK, so pre-2016 geometry
        itemp = (int) (svx->GetHit(khit))->GetHitVolume(4);    // sensor on the ladder (was 4)
        isensor = itemp-1;
      }
      else {                                                   // 3 is the wrong index, so
        itemp = (int) (svx->GetHit(khit))->GetHitVolume(4);    // new ladder index
        iladder = itemp-1;
        itemp = (int) (svx->GetHit(khit))->GetHitVolume(6);    // new sensor index
        isensor = itemp-1;
      }
      if (isensor < 0) continue;
    } else {                                                // Endcap
       iladder = 0;
       isensor = 0;
      if(verbosity>9) { cerr << PHWHERE << " ERROR:  EndCaps Hit !!! " << endl; }
    }

Hubert van Hecke
Last modified: Fri Jun 17 16:05:16 MDT 2016