StarRun


class description - source file - inheritance tree

class StarRun : public TNamed


    public:
StarRun StarRun() StarRun StarRun(char* name, char* title) StarRun StarRun(StarRun&) virtual void ~StarRun() virtual void Browse(TBrowser* b) TClass* Class() virtual void Clear(Option_t* opt) virtual Int_t DistancetoPrimitive(Int_t px, Int_t py) virtual void FakeDigits(Int_t nd, Int_t snd) virtual void FakeHits(Int_t nh, Int_t snh) virtual void FakeKine(Int_t nt, Int_t snt) virtual void FillTree() virtual void Finish() virtual Int_t GetDebug() virtual Int_t GetEvent(Int_t event) virtual Int_t GetGeantEvent(Option_t* option = KHD) virtual Int_t ImportGeantDigits() virtual Int_t ImportGeantDigits(StarMaker* maker, Int_t iset, Int_t ngdet, Int_t* gdet) virtual Int_t ImportGeantHits() virtual Int_t ImportGeantHits(StarMaker* maker, Int_t iset, Int_t ngdet, Int_t* gdet) virtual Int_t ImportGeantKine() virtual void Init() virtual void InitGeant() virtual void InitZebra(Int_t nzebra = 2000000) virtual TClass* IsA() virtual Bool_t IsFolder() TList* Makers() virtual void MakeTree(Option_t* option = KHD) virtual void OpenGeantFile(const char* name, Int_t lrecl = 900, const char* option = XIL) virtual void Paint(const Option_t* opt) TClonesArray* Particles() virtual void RunGeant() virtual void SetDebug(Int_t level = 1) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) TTree* TreeD() TTree* TreeH() TTree* TreeK()

Data Members

protected:
Int_t fDebug Debug level Int_t fRun Run number Int_t fEvent Event number Int_t fNvertex Number of vertices Int_t fNtrack Number of tracks TList* fMakers List of Makers TTree* fTreeK Pointer to Tree for Kinematics TTree* fTreeH Pointer to Tree for Hits TTree* fTreeD Pointer to Tree for Digits TClonesArray* fParticles Pointer to list of particles

Class Description

                                                          
  This program has been generated automatically by the    
  Root utility gh2root from a Geant RZ geometry file.     
                                                          
  The class XRun is the main processor.                  
  It contains member functions to:                        
    - Initialize Root and all detector makers.            
    - Control the processing of one event.                
    - Simulate random tracks and hits.                    
    - Import a Zebra KINE,HITS,DIGI structures from FZ.   
    - Create and Fill the Root Trees with particles/hits. 
    - Browse the generated Root file.                     
    - Control functions for graphics:                     
        . DistancetoPrimitive                             
        . Paint                                           
                                                          
  Some Root macros are also generated by gh2root:         
    - fake.C    : to generate random particles and hits.  
    - run.C     : to convert a Geant FZ file into Root.   
    - browse.C  : to browse a Root file with hits/digits. 
    - analyze.C : example of analysis code to loop on     
                  generated events and make histograms.   
                                                          
         Author:  Rene Brun                               


StarRun()

StarRun(const char *name, const char *title) : TNamed(name,title)
  Constructor for the main processor.
  Creates the list of Makers.
  Creates the list of particles.

void Browse(TBrowser *b)
 Called when the item "Run" is clicked on the left pane
 of the Root browser.
 It displays the Root Trees and all detector makers.

void Clear(Option_t *option)
  Reset all Makers. Called at the end of each event

Int_t DistancetoPrimitive(Int_t, Int_t)

void FakeDigits(Int_t nd, Int_t snd)
 Generates random digits.
 Loop on all detector makers

void FakeHits(Int_t nh, Int_t snh)
 Generates random hits.
 Loop on all detector makers

void FakeKine(Int_t nt, Int_t snt)
 Generates random particles following a gaussian
 with mean value nt and standard deviation nh.
 Generated particles are added to the list of particles.

void FillTree()

void Finish()
 Called at the end of the run.

Int_t GetEvent(const Int_t event)
 Returns event number event from the Root Trees.

Int_t GetGeantEvent(Option_t *option)
 Read the next event from the Geant FZ file.
 Search for the next HEAD record.
 If found, read VERT,KINE,HITS and DIGI records
    returns 0 if nothing read or EOF reached.
    returns 1 otherwise.

Int_t ImportGeantDigits()

Int_t ImportGeantDigits(StarMaker *maker, Int_t iset, Int_t ngdet, Int_t *gdet)
 Copy Geant3 digits for set iset and all ngdet detectors of array gdet in TClonesArray fDigits.

 The following is a description of the original Geant3
 JDIGI Zebra data structure.

-----------------------------------------------

Int_t ImportGeantHits()

Int_t ImportGeantHits(StarMaker *maker, Int_t iset, Int_t ngdet, Int_t *gdet)
 Copy Geant3 hits for set iset and all ngdet detectors of array gdet in TClonesArray fHits.

 The following is a description of the original Geant3
 JSET and JHITS Zebra data structures.

--------------------JSET-----------------------
 IUSET     set identifier (4 characters), user defined
 IUDET     detector identifier  (4 characters),   name of  an existing volume
 NV        number of volume descriptors
 NAMESV    vector of NV volume descriptors (4 characters)
 NBITSV    vector of  NV bit numbers  for packing  the volume numbers
 ISET      position of set in bank JSET
 IDET      position of detector in bank JS=IB(JSET-ISET)
 Remarks:
 - The vector NAMESV (length NV)  contains the list of volume
   names which  permit the  identification of  every physical
   detector with detector name IUDET.
 - Each  element of  the vector  NBITSV (length  NV)  is  the
   number  of  bits  used  for  packing  the  number  of  the
   corresponding volume,  when building the packed identifier
   of a given physical detector.
       IQ(JSET+ISET) = IUSET
       JS = LQ(JSET-ISET) + pointer to set parameters
       IQ(JS+IDET)=IUDET
       JD= LQ(JS-1)  = pointer to detector IDET
       IQ(JD+1)=Total number of words to store packed volumes
       IQ(JD+2)=NV
       IQ(JD+3)=Number of words required per hit
       IQ(JD+4)=Number of different hits types
       IQ(JD+5)=Number of words per digit
       IQ(JD+6)=Number of different digit types
       IQ(JD+7)=number of words for allocation of HITS banks
       IQ(JD+8)=number of words for allocation of DIGI banks
       IQ(JD+9)=Number of paths through the JVOLUM tree
       IQ(JD+10)= For an alias only, IDET of main detector
       IQ(JD+2*I+9) = name of volume i = NAMESV(I)
       IQ(JD+2*I+10)= number of bits/volume = NBITSV(I)

            The Detector Set data structure JSET
            ------------------------------------

                                        | JSET
    NSET            ISET                v         NSET
     ................................................
     |              | |               |  | Set names|
     ................................................
                     | JS
                     |
    NDET       IDET  v                    NDET
     ........................................
     |        |  |  | | Detector names      |
     ........................................
               | JD
      -3 -2 -1 v
     ................................................
     |  |  |  |  |   Parameters of GSDET            |
     ................................................
      |  |  |
      |  |  |  JDH
      |  |  |
      |  |  |           .............................
      |  |  ............| Parameters of GSDETH      |
      |  |              .............................
      |  |
      |  | JDD
      |  |
      |  |              .............................
      |  ...............|  Parameters of GSDETD     |
      |                 .............................
      |
      |  JDU
      |                 .............................
      ..................| Parameters of GSDETU      |
                        .............................

  JS = LQ(JSET-ISET) pointer to detector set number ISET
 The JSET data structure is filled by GSDET, GSDETH,
 GSDETD, GSDETU and eventually by GSDETA.

--------------------JHITS----------------------
       JH  = LQ(JHITS-ISET)
       JHD = LQ(JH-IDET)
       IQ(JH+IDET) = pointer to LAST USED word in JHD
         Each hit is packed into JHD in the following format
        --Track number ITRA not packed
        --Volume numbers packed
        --Hits transformed and packed

                The Hit data structure JHITS
                ----------------------------

                                            | JHITS
    NSET                  ISET              v
     ..........................................
     |                   |  |              |  |
     ..........................................
                           |
                           | JH
      NDET    IDET         v               NDET
        .....................................
        |      |  |      |  |               |
        .....................................
                |
                | JHD
                v
               .........................................
               |  | 1st hit        | 2nd hit, etc.     |
               .........................................
                         Bank layout
 JH            =  LQ(JHITS-ISET,)  pointer  to  hits for  set  number ISET
 JHD           = LQ(JH-IDET),   pointer to  hits of  detector IDET of set ISET
 IQ(JH+IDET)    number of words  used so far for  storing the hits of detector IDET
 IQ(JHD+1)      1st word of 1st hit
 IQ(JHD+NWH+1)  1st word of 2nd hit
                      JS=LQ(JSET-ISET)
                      JD=LQ(JS-IDET)
                      NWH=IQ(JD+3)

 The Geant3 common PAWC is defined as:
     common/pawc/paw(nwpaw)
     INTEGER   IQ(2), LQ(8000)
     REAL            Q(2)
     EQUIVALENCE (LQ(1),paw(11)),(IQ(1),paw(19)),(Q(1),paw(19))

 The Geant3 common GCLINK is defined as:
     COMMON/GCLINK/JDIGI ,JDRAW ,JHEAD ,JHITS ,JKINE ,JMATE ,JPART
     ,JROTM ,JRUNG ,JSET  ,JSTAK ,JGSTAT,JTMED ,JTRACK,JVERTX
     ,JVOLUM,JXYZ  ,JGPAR ,JGPAR2,JSKLT
-----------------------------------------------

Int_t ImportGeantKine()
  Copy the Geant data structures JVERTX and JKINE into a TClonesArray
  of GParticles

void Init()

void InitGeant()

void InitZebra(const Int_t nzebra)
 Initialize the Zebra package.
 The Zebra space is allocated dynamically
 nzebra is the size of the Zebra store in words.

void MakeTree(Option_t *option)
  Create the ROOT trees
  Loop on all makers to create the Root branch (if any)

void OpenGeantFile(const char *fname, Int_t lrecl, const char *option)
 This function assumes a Geant file in Zebra/FZ format
 created with the C I/O option "L"
 If not, one must create a Fortran routine with:
      open(unit=1,file=....)
      call fzfile(1,0,"xi")

void Paint(Option_t *option)

void RunGeant()

void Streamer(TBuffer &R__b)
 Stream an object of class XRun.



Inline Functions


                Int_t GetDebug()
               Bool_t IsFolder()
               TList* Makers()
        TClonesArray* Particles()
                 void SetDebug(Int_t level = 1)
               TTree* TreeD()
               TTree* TreeH()
               TTree* TreeK()
              TClass* Class()
              TClass* IsA()
                 void ShowMembers(TMemberInspector& insp, char* parent)
              StarRun StarRun(StarRun&)
                 void ~StarRun()


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.