Back to home page

EIC code displayed by LXR

 
 

    


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

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 tboolean.py 
0023 =============================================
0024 
0025 This is invoked by Opticks bi-simulation executables such as OKG4Test 
0026 when using the option  "--anakey tboolean".  See optickscore/OpticksAna.cc.
0027 It compares Opticks and G4 event history categories and deviations.
0028 
0029 
0030 """
0031 from __future__ import print_function
0032 import os, sys, logging, numpy as np
0033 log = logging.getLogger(__name__)
0034 
0035 from opticks.ana.main import opticks_main
0036 from opticks.ana.nload import np_load
0037 from opticks.ana.ab   import AB
0038 from opticks.ana.seq import seq2msk
0039 
0040 
0041 if __name__ == '__main__':
0042     ok = opticks_main(doc=__doc__)  
0043 
0044     log.info(ok.brief)
0045 
0046     log.info("[AB") 
0047     ab = AB(ok)
0048     log.info("]AB") 
0049     log.info("[ab.dump") 
0050     ab.dump()
0051     log.info("]ab.dump") 
0052 
0053     rc = ab.RC
0054 
0055     level = "fatal" if rc > 0 else "info"
0056     getattr(log, level)(" RC 0x%.2x %s " % (rc,bin(rc)) )
0057 
0058     #if not ok.ipython:
0059     #    log.info("early exit as non-interactive")
0060     #    sys.exit(rc)
0061     #else:
0062     #    pass
0063     #pass
0064 
0065     a = ab.a
0066     b = ab.b
0067 
0068     if ab.is_comparable:
0069         #ab.aselhis = "TO BT BT SA"     # dev aligned comparisons
0070         ab.aselhis = None    # dev aligned comparisons
0071         log.info("[ab.check_utaildebug")
0072         ab.check_utaildebug()
0073         log.info("]ab.check_utaildebug")
0074     pass
0075    
0076        
0077