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

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

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


Revision 1.2 - (download) (annotate)
Mon Dec 17 16:33:41 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-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: +7 -3 lines
add commons/config where needed
* $Id: agvoluma.age,v 1.2 2001/12/17 16:33:41 nevski Exp $
* $Name:  $
* $Log: agvoluma.age,v $
* Revision 1.2  2001/12/17 16:33:41  nevski
* add commons/config where needed
*
* Revision 1.1  2001/12/17 15:51:22  nevski
* service routines
*
#include "commons/config.h"
***********************************************************************
 function agvoluma(node,vol,pos,mot,who,copy,lpar,npar,name,nick)
*
* Description: Navigate geant volume tree and extract volume parameters
*
* Input:         node - iterator handler, starting from 0
*                       if negative, starting volume number(in GVOLU bank)
* Output (c-implied):
*  Int who            - volume number (in GVOLU bank)
*  Int name           - actual volume name
*  Int nick           - generic volume name
*  Int copy           - position copy number
*  Pointer (vol,volu) - Volu bank
*  Pointer (mot,moth) - mother molu bank
*  Pointer (pos,posu) - position bank
*  Pointer (lpar,par) - actual volume parameters
*  Int Npar           - number of actual parameters
*
************************************************************************
#include "commons/typing.inc"
#include "geant321/gcbank.inc"
#include "geant321/gcvolu.inc"
#include "geant321/gcunit.inc"

 Integer AGVOLUMA,LOCB,node,vol,pos,mot,who,copy,npar,np,ish
 Integer k,n,mother,daughter,where,found,ier,nvol
 Integer item(20),count(20),list(20),nodes(0:20),
         Lnam(20),Lnum(20),Lvol(20),birth(64000)
 Integer name,nick,lpar
 real    par(100)
 save    k,mother,daughter,where,found,birth,par
 save    item,count,list,nodes,Lnam,Lnum,Lvol

 agvoluma=0; check JVOLUM>0
 If node<=0
 {
   "first generation" found=0; call vzero(birth,64000)
   { k, where, who, copy } =1;
   if (node<0) who=-node;
   { list(1), item(1), count(1), nodes(0) } =0;
   nvol=0; if (JVOLUM>0) nvol=IQ(JVOLUM-1);
   if (Nvol<=0)   { print *,'no geometry loaded'; return }
   if (Nvol>64000)  print *,'agvoluma error: too manu volumes in geometry'
   write (*,'(3a,i7)') ' converting ',IQ(JVOLUM+1),' NV=',nvol
 }
 else
 { *** print *,' next generation '
   nodes(k)=node;
   n=Q(daughter+3); if (n<0) n=-Q(3+LQ(daughter-1));
   if n!=0 { k+=1; count(k)=n; item(k)=0; list(k)=daughter; }
   :next:;  item(k)+=1;  mother=list(k);
   if item(k)>abs(count(k))
   { k-=1; birth(Lvol(k))+=1; if (k>1) go to :next:; node=nodes(1); return }
   if count(k)>0 { where=LQ(mother-item(k)); copy=Q(where+3); }
   else          { where=LQ(mother-1);       copy=item(k);    }
   who=Q(where+2);
 }
   daughter=LQ(JVOLUM-who); found+=1;
   vol=LOCB(Q(daughter+1)); np=Q(daughter+5); ish=Q(daughter+2);
   pos=LOCB(Q(where+1));
   mot=0; if k>1 { mot=LOCB(Q(mother+1)) }
   node=nodes(k-1); agvoluma=1;
   Lnam(k)=IQ(JVOLUM+who); Lnum(k)=copy; Lvol(k)=who;
   Call GLVOLU(k,Lnam, Lnum, ier)

* have to check JGPAR later
   if np==0  { npar=Q(where+9); call UCOPY (Q(where+10),par,npar)  }
   else      { npar=np; call UCOPY (Q(LQ(JGPAR-Nlevel)+1),par,np)  }

   IF      ISH==4       " trap "
   {  NPAR=11
      call AgXY2RF(PAR(2),PAR(3));  call AgT2A(PAR(7));  call AgT2A(PAR(11))
   }
   ELSE IF ISH==10      " par "
   {  call AgXY2RF(PAR(5),PAR(6));  call AgT2A(PAR(4)) }
   ELSE IF ISH==28
   {  NPAR=12  }

* set complete description into parameters
   lpar=LOCB(par)                 " actual parameters address  "
   name=Lnam(k)                   " actual volume name (4 let) "
   nick=IQ(daughter-4)            " generic volume name(4 let) "

   if (k>1 & birth(Lvol(k-1))>0) node=0;
*   if (k<1) print *,' found objects =',found;
end

CERN Central CVS service
ViewVC Help
Powered by ViewVC 1.0.9