* * $Id: guout.F 5057 2009-04-09 18:49:49Z somov $ * * $Log$ * Revision 1.5 2004/05/18 12:58:54 jonesrt * Makefile * - created a section at the top for global defines that are used to * build custom versions of the simulation [rtj] * hddm_s.c, hddm_s.h * - default i/o library modules (generated by hddm package) [rtj] * hddsGeant3.F * - default geometry module (generated by hdds package) [rtj] * hitStart.c * - changes to accomodate new vertex counter cylinder+plane structure [rtj] * guout.F, gustep.F * - defines for custom builds moved from sources to Makefile * gustep.F * - new conditional WERNERS_VTX_NTUPLE sections added for background * studies in the region of the vertex counter [rtj] * * Revision 1.4 2002/07/10 14:57:18 jonesrt * - fixed wierd problem with g77 compiler that wanted to interpret "slash star" * in a fortran comment line as a comment indicator a-la-c (complained about * unterminated comment) so I just removed the asterisk - rtj. * - corrected the statistics printout from gelh_last() -rtj. * - changed confusing use of VSCAN (card SCAP) to define the origin for single * particle generation; now gukine.F uses PKINE (card KINE) for both origin * and direction of single-particle generator, with the following format: * KINE kind energy theta phi vertex(1) vertex(2) vertex(3) * - fixed gelh_outp() to remove the BaBar-dependent code so that it correctly * updates the photo-hadronic statistics that get reported at gelh_last() -rtj. * - updated gelhad/Makefile to follow the above changes -rtj. * * Revision 1.3 2001/10/29 17:39:23 jonesrt * - added mc truth info to output event for internal track/photon generators * - added special code for background studies, selected by the conditional * #define BACKGROUND_STUDIES (in gustep.F) * - added conditional code to disable normal event output for bg studies, using * #define DISABLE_OUTPUT (in guout.F) * Both of the above defines are disabled in the distribution code by default. * -rtj- * * Revision 1.2 2001/07/24 05:37:16 jonesrt * First working prototype of hits package -rtj * * Revision 1.1 2001/07/10 18:05:46 jonesrt * imported several of the gu*.F user subroutines for Hall D customization -rtj * * Revision 1.1.1.1 1995/10/24 10:21:52 cernlib * Geant * * #include "geant321/pilot.h" *CMZ : 3.21/02 29/03/94 15.41.35 by S.Giani *-- Author : SUBROUTINE GUOUT * C. ****************************************************************** C. * * C. * User routine called at the end of each event. * C. * * C. ****************************************************************** C. C. #include "geant321/gcomis.inc" #include "geant321/gcphys.inc" #include "controlparams.inc" #include "adcgam_bk.inc" C ------------------------------------------------------------------ C. integer iskip integer iseen integer ncl real en, x, y, z, xc, yc, chi2, time integer type, dime, id z = 620. time = 10. id = 1 call gelh_outp(iskip) C GAMS ILIYA call recon_sim() do 1000 ncl=1,nadcgam write(*,102) 'dump_pht', & ncl, & energy_adcgam(1,ncl), & x_adcgam(1,ncl), & y_adcgam(1,ncl), & xc_adcgam(1,ncl), & yc_adcgam(1,ncl), & chi2_adcgam(1,ncl), & dime_adcgam(1,ncl), & type_adcgam(1,ncl) en = energy_adcgam(1,ncl) x = x_adcgam(1,ncl) y = y_adcgam(1,ncl) xc = xc_adcgam(1,ncl) yc = yc_adcgam(1,ncl) chi2 = chi2_adcgam(1,ncl) type = type_adcgam(1,ncl) dime = dime_adcgam(1,ncl) id = 1 time = 10. C xx = en; C call clustgams(en) call clustGams(en, x, y, z, xc, yc, chi2, type, dime, id, time) C call clustGams(en, x, y, z, xc_adcgam(1,ncl), yc_adcgam(1,ncl), chi2_adcgam(1,ncl), C + type_adcgam(1,ncl), dime_adcgam(1,ncl), id, time) 1000 continue 102 format(a8,1x,i4,2x,6f8.2,2i5) iseen = loadOutput() C #define WRITE_ONLY_IF_SOMETHING_WAS_SEEN 1 C #if WRITE_ONLY_IF_SOMETHING_WAS_SEEN C if (iseen.gt.0) then C #else C if (iseen.ge.0) then C #endif C call flushOutput() C endif if(writenohits.ne.0) then if (iseen.ge.0) call flushOutput() else if (iseen.gt.0) call flushOutput() endif C FDPREE() should only be called if FLUKA is being used if (IHADR.ge.3) call fdpree() END