kbat / mc-tools

Some Monte Carlo tools
GNU Lesser General Public License v3.0
41 stars 16 forks source link

angel2root: 2D histo conversion is wrong #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 9 years ago
With mesh = xyz and a 2D axis (e.g., yz), the bin contents of TH2 are read in a 
wrong sequence. It seems this is the case only when the x- and y-axes have both 
negative and positive values. An input file example is attached.

Original issue reported on code.google.com by batkov on 20 Jan 2012 at 12:43

Attachments:

kbat commented 8 years ago

@furutaka Did you try to convert 2D histograms with angel2root? Does this bug still exists?

furutaka commented 8 years ago

We often do it with angel2root.

Observing the following, it seems that it still does... At the least the conversion failed. I'll see it later when I have time.

[furutaka@peart Downloads]$ angel2root test7w.phits 
test7w.phits -> test7w.phits.root
Traceback (most recent call last):
  File "/usr/bin/angel2root", line 9, in <module>
    load_entry_point('mc-tools===v1.0.post1-6-gd361e58', 'console_scripts', 'angel2root')()
  File "/usr/lib/python2.7/site-packages/mc_tools/phits/angel2root.py", line 609, in main
    angel =  Angel(fname_in, fname_out,avBitSet=args.average)
  File "/usr/lib/python2.7/site-packages/mc_tools/phits/angel2root.py", line 116, in __init__
    pageLST.append( tuple( self.lines[:pageSepLineLST[0]] ) )
IndexError: list index out of range
kbat commented 8 years ago

test7w.phits is a PHITS input file - it should not be passed to angel2root. If you want to test it, please run it with PHITS and try to convert the output file. For me it's not easy to test since I do not currently have PHITS installed.

furutaka commented 8 years ago

The following files were obtained with https://storage.googleapis.com/google-code-attachments/mc-tools/issue-2/comment-0/test7w.phits and PHITS 2.64. Do you think that the bug you mentioned still remains?

heat-all-yz_angel.pdf was obtained by first converting heat-all-yz.dat to eps by ANGEL and then to pdf.

heat-all-yz_root.pdf was made by converting the .dat file to a .root file and then print the 2D histograms to the file.

How wrong is the 'wrong sequence'? I can't tell whether the sequence is wrong or not...

kbat commented 8 years ago

The plots look very similar. Since you are happy with results and I can't investigate the problem in more details, I suggest to close this issue.