[atlas] / offline / atlsim / atgeant / agsdetv.age Repository:
ViewVC logotype

View of /offline/atlsim/atgeant/agsdetv.age

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (download) (annotate)
Fri Dec 14 18:15:07 2001 UTC (11 years, 5 months ago) by nevski
Branch: MAIN
CVS Tags: offline-04-00-00, offline-04-00-01, offline-10-03-00, offline-10-00-03, offline-10-00-02, offline-10-00-01, offline-10-00-00, offline-07-01-00, offline-10-00-06, offline-10-00-04, offline-08-00-04, offline-08-00-05, offline-08-00-06, offline-08-00-07, offline-08-00-00, offline-08-00-01, offline-08-00-02, offline-08-00-03, offline-08-00-08, offline-04-01-00, offline-07-05-00, atlsim-01-42-24, offline-11-02-00, atlsim-01-42-22, atlsim-01-42-21, offline-08-05-00, offline-09-03-00, offline-06-01-00, offline-11-00-06, offline-09-00-00, offline-11-00-04, offline-11-00-05, offline-11-00-02, offline-11-00-03, offline-11-00-00, offline-11-00-01, offline-02-06-00, offline-07-02-00, offline-10-05-00, offline-05-00-00, offline-07-06-00, offline-09-02-00, offline-08-02-00, offline-11-01-00, atlsim-01-41-04, atlsim-01-41-05, atlsim-01-41-06, atlsim-01-41-07, offline-10-02-00, atlsim-01-42-01, atlsim-01-42-03, atlsim-01-42-02, atlsim-01-42-05, offline-08-03-00, offline-04-06-00, atlsim-01-42-06, atlsim-01-42-09, atlsim-01-42-08, offline-04-05-00, offline-08-04-00, offline-04-02-00, atlsim-01-42-09-01, atlsim-01-42-18, atlsim-01-42-19, atlsim-01-42-16, atlsim-01-42-23, atlsim-01-42-14, atlsim-01-42-15, atlsim-01-42-12, atlsim-01-42-13, atlsim-01-42-10, atlsim-01-42-11, offline-07-08-00, offline-09-04-00, atlsim-01-42-20, offline-04-04-00, offline-04-03-00, offline-11-00-41, offline-06-04-00, atlsim-01-42-17, offline-06-06-00, offline-03-02-00, offline-03-00-01, offline-03-00-00, offline-06-05-00, offline-09-00-01, offline-09-00-03, offline-09-00-02, offline-03-01-00, offline-09-00-04, offline-08-06-00, offline-05-02-00, offline-06-03-00, offline-02-05-00, offline-07-04-00, offline-09-01-02, offline-07-03-00, offline-07-00-03, offline-07-00-02, offline-07-00-01, offline-07-00-00, offline-08-01-00, offline-05-03-00, offline-07-07-00, atlsim-01-42-04, offline-06-02-00, atlsim-01-42-07, offline-08-08-00, offline-08-08-01, offline-10-04-01, offline-08-07-00, offline-06-00-04, offline-10-04-00, offline-06-00-02, offline-06-00-03, offline-06-00-00, offline-06-00-01, HEAD
Changes since 1.1: +15 -12 lines
update atlsim library to the atlsimmain
*
* $Id: agsdetv.age,v 1.2 2001/12/14 18:15:07 nevski Exp $
*
* $Name:  $
*
* ---------------------------------------------------------
#include <commons/config.h>
**********************************************************************
*                                                                    *
                Subroutine   A g S D E T V (title)
*                                                                    *
*  Description: for a given (SET,DET) create GEANT sensetive         *
*  detector with corresponding DETU user structure filled later.     *
* In a Geometry module global %iset,%idet are set only for the call  *
* when this set is created to allow next routine (Agsdetu) to store  *
* hit or digi definitions in DETU bank, otherwise they are set to 0. *
* Local Iset,Idet are save in attributes of each calling Nick volume.*
*    In a Digitisation module global %iset,%idet are set always,     *
*    to allow not only set creation, but a modification as well.     *
***GsDETv definition for DIGI erases Iset,Idet,Idtype in the volume. *
*  this is corrected by saving them in sdt and then restoring attrib.*
***If %Type is changed, a new copy of DETU bank is created and       *
* %iset/%idet are set to allow DETU filling in AgsDETH/AgSDETU       *
*                                                                    *
*  Called from users code at the beginning of the hit definition     *
* 16/05/96 PN: bug corrected in %JDU selection for USER bank change  *
**********************************************************************
#include "commons/typing.inc"
#include "commons/agecom.inc"
#include "geant321/gcbank.inc"
#include "geant321/gcunit.inc"
#include "geant321/gcnum.inc"
   Character title*(*),Cdet*4,Cset*4,Cbank*4,T*1,Cpar*4,Modulo*8/' '/
   Integer   LENOCC,JATTF,JV,J,Iset,Idet,Jdet,Iv,Js,Jd,JDN,JDU,
             NWHI/1000/,NWDI/1000/,Lcumu/15/
   Real      Sdt(3),Upar(%LDETU)" up to 15 levels of volumes and hits "
   JATTF(JV) = JV+int(Q(JV+5))+6
                            * * *
 " Set is always the same as 3 letters of the module name plus H or D "
 T=%EXNAME;  Cset=%Module(1:3)//T;  Cdet=Title;
 { %iset,%idet,Iset,Idet,Jdet,Jd,Iv,JDU }=0;
 If (Jset > 0)  Call GLOOK(Cset,IQ(JSET+1),IQ(JSET-1),Iset)
 If (Iset > 0)  JDET = LQ(JSET-ISET)
 If (Jdet > 0)  Call GLOOK(Cdet,IQ(JDET+1),IQ(JDET-1),Idet)
 If (Idet > 0)  JD   = LQ(JDET-IDET)
 If (Jd>0 & %Module!=Modulo) { Call MZDROP(IxCons,Jd,' '); Jd=0 }
 Modulo = %Module
                            * * *
 If Iset<=0 | Idet<=0 | JD <=0
 {  "              for digi, save previous volume set/det reference       "
    If (T='D') Call GLOOK (Cdet,IQ(JVOLUM+1), Nvolum, Iv)
    If (iv>0)  Call UCopy (Q(JATTF(LQ(JVOLUM-Iv))+7),sdt,3)
    Call GsDETv (Cset,Cdet,%Idtype,NWHI,NWDI,Iset,Idet)
    If Idet<=0|Iset<=0 {%error(' can not define sensitive detector ',Title)}
    "              set empty hit or digi bank with maximum size           "
    Call Vzero (Upar,%LDETU)
    If (T='H') Call GsDETH (Cset,Cdet,Lcumu,Cpar,Upar,Upar,Upar)
    If (T='D') Call GsDETD (Cset,Cdet,Lcumu,Cpar,Upar)
    "              now set users bank - also with max.size                "
    Upar(1)=10;  Upar(8)=%Type;   Upar(9)=%Idtype;  Upar(10)=-1;
    Call GsDETU (Cset,Cdet,%LDETU,Upar); %Iset=Iset; %Idet=Idet;
*pn: 16/03/96 - to get nice bank NID reset it for the first bank
    JDU=LQ(LQ(LQ(Jset-Iset)-Idet)-3); Cbank=' ';
    If (JDU>0) Call UHTOC(IQ(JDU-4),4,Cbank,4)
    If Cbank!='SJDU' {%error('can not create User Hit/Digi bank for',Cset,Cdet)}
    IQ(JDU-5)=1
 }
                            * * *
 If      %Module(5:5)='G' & T='H' " mark each volume with its HIT set/detector"
 {  j=JATTF(LQ(JVOLUM-%Ivolume)); Q(j+7)=Iset; Q(j+8)=Idet; Q(j+9)=%IdType; }
 else If %Module(5:5)='D' & T='D' " only digitisation re-definition accepted "
 { if(Iv>0) Call UCopy(sdt,Q(JATTF(LQ(JVOLUM-Iv))+7),3);%iset=Iset;%idet=Idet;}
 else       {%error('HITS or DIGI can not be redefined for ',Cset,Cdet)}

                            * * *
 " find DETU bank with corresponding serial number and keep its link in %JDU "
 JS=LQ(JSET-Iset);  JD=LQ(JS-Idet);  JDU=LQ(JD-3);  %JDU=JDU;
 While Q(JDU+8)!=%Type & LQ(JDU)>0 { JDU=LQ(JDU);   %JDU=JDU; }
 If %Type!=Q(JDU+8)       " make a new user bank "
 {  Call MZBOOK(IxCons,JDN,JDU,0,'SJDU',0,0,%LDETU,3,0)
    If JDN<=0  {%error(' cant create new copy of DETU bank ',%Type)}
    Call Ucopy (Q(JDU+1),Q(JDN+1),%LDETU);    Q(JDN+8)=%Type;
    %iset=Iset;  %idet=Idet;  %JDU=JDN;
 }
   END



CERN Central CVS service
ViewVC Help
Powered by ViewVC 1.0.9