Parent Directory
|
Revision Log
|
Revision Graph
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 |