Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:48:51

0001 #!/usr/bin/env python
0002 #
0003 # Copyright (c) 2019 Opticks Team. All Rights Reserved.
0004 #
0005 # This file is part of Opticks
0006 # (see https://bitbucket.org/simoncblyth/opticks).
0007 #
0008 # Licensed under the Apache License, Version 2.0 (the "License"); 
0009 # you may not use this file except in compliance with the License.  
0010 # You may obtain a copy of the License at
0011 #
0012 #   http://www.apache.org/licenses/LICENSE-2.0
0013 #
0014 # Unless required by applicable law or agreed to in writing, software 
0015 # distributed under the License is distributed on an "AS IS" BASIS, 
0016 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
0017 # See the License for the specific language governing permissions and 
0018 # limitations under the License.
0019 #
0020 
0021 """
0022 tmeta.py : Load a single events metadata
0023 ===================================================
0024 
0025 ::
0026 
0027     simon:ana blyth$ tmeta.py --det dayabay --src torch --tag 1
0028     /Users/blyth/opticks/ana/tmeta.py --det dayabay --src torch --tag 1
0029     writing opticks environment to /tmp/blyth/opticks/opticks_env.bash 
0030     [2016-08-19 15:51:42,378] p23598 {/Users/blyth/opticks/ana/tmeta.py:21} INFO - loaded metadata from /tmp/blyth/opticks/evt/dayabay/torch/1 :                       /tmp/blyth/opticks/evt/dayabay/torch/1 571d76cd06acc1e992c211d6833dd0ff a32520a5215239cf54ee03d61ed154f6  100000     4.2878 CFG4_MODE  
0031               photonData : 571d76cd06acc1e992c211d6833dd0ff 
0032              NumGensteps : 1 
0033               NumRecords : 1000000 
0034               NumG4Event : 10 
0035                TimeStamp : 20160819_143439 
0036                BounceMax : 9 
0037                     UDet : dayabay 
0038               recordData : a32520a5215239cf54ee03d61ed154f6 
0039                      Cat :  
0040                RecordMax : 10 
0041                  cmdline :  
0042                      Tag : 1 
0043                     mode : CFG4_MODE 
0044               NumPhotons : 100000 
0045                 Detector : dayabay 
0046            genstepDigest : 871b90ef849f4c13ef95fa4015d1f210 
0047                     Type : torch 
0048                   RngMax : 3000000 
0049             sequenceData : 5964de1100b8d5784865b8e9e39dca34 
0050     NumPhotonsPerG4Event : 10000 
0051       configureGenerator : 0.064189000000624219 
0052          indexPhotonsCPU : 0.089951999998447718 
0053                     save : 0.14543499999854248 
0054                configure : 4.0000013541430235e-06 
0055                    _save : 3.9000002288958058e-05 
0056        configureStepping : 4.7999998059822246e-05 
0057                propagate : 4.2877840000001015 
0058               _propagate : 4.6000001020729542e-05 
0059               initialize : 0.008572999999159947 
0060         configurePhysics : 0.072821000001567882 
0061           postinitialize : 0.00013499999840860255 
0062        configureDetector : 0.3900549999998475 
0063 
0064 
0065 
0066 """
0067 import os, logging, numpy as np
0068 log = logging.getLogger(__name__)
0069 
0070 from opticks.ana.base import opticks_main
0071 from opticks.ana.nload import tagdir_ 
0072 from opticks.ana.metadata import Metadata
0073 
0074 if __name__ == '__main__':
0075     args = opticks_main(tag="10",src="torch", det="PmtInBox", doc=__doc__)
0076     np.set_printoptions(suppress=True, precision=3)
0077 
0078     mdir = tagdir_(args.det, args.src, args.tag)
0079     md = Metadata(mdir)
0080     log.info("loaded metadata from %s : %s " % (mdir, repr(md)))
0081     md.dump()
0082 
0083   
0084