Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conflict between libraries for MV and TPC with pax_v6.6.8 #629

Open
mlotfiben opened this issue Oct 18, 2017 · 5 comments
Open

conflict between libraries for MV and TPC with pax_v6.6.8 #629

mlotfiben opened this issue Oct 18, 2017 · 5 comments

Comments

@mlotfiben
Copy link

mlotfiben commented Oct 18, 2017

When initialising both the TPC and MV one after the other I have encountered a problem that seems to do with the libraries that are responsible for reading root files into pandas data frames (I am not an expert on this, I may well be wrong here). I am attaching two files one which shows the error and one python file that can help in reproducing the error.
error_message.txt
`
import os
import numpy as np
import pandas as pd
from tqdm import tqdm
from scipy import stats, optimize, interpolate
from scipy.optimize import curve_fit

from scipy.misc import factorial
from glob import glob
import matplotlib
import matplotlib.pyplot as plt
import pickle
import hax
from hax import cuts
from pax import configuration, units, datastructure
pax_version = "pax_v6.8.0"
hax.init(experiment='XENON1T',
minitree_paths =['/project2/lgrandi/xenon1t/minitrees/%s/'%pax_version],
make_minitrees = False,
detector='tpc')

data = hax.minitrees.load([11345],["Basics","Fundamentals", "TotalProperties", "LargestPeakProperties","Corrections"])
print(len(data.index))

hax.init(experiment='XENON1T',
#minitree_paths =['/project2/lgrandi/xenon1t/minitrees/%s'%pax_version, '/project/lgrandi/xenon1t/minitrees/%s'%self.pax_version],
main_data_paths=['/project2/lgrandi/xenon1t/processed/%s/'%pax_version],
detector='muon_veto')

data_mv = hax.minitrees.load(["170718_0445"],treemakers=["MuonVetoTreemaker"])

data_mv.keys()
`

@mlotfiben
Copy link
Author

An optimum, but not final solution was found with the help of Fei. Actually before I initialise the MV through hax, I need to delete the rootpy directory in .cache and also all libraries related to pax where I run my script. By the way this problem was not there when I used pax_V6.6.5.

@sanderbreur
Copy link
Contributor

sanderbreur commented Oct 19, 2017 via email

@mlotfiben
Copy link
Author

Hi Sander,
I am not sure if I consider this is a final solution because the "some reason" that you mentioned needs to be identified and if possible fixed.
Best,
Lotfi

@sanderbreur
Copy link
Contributor

sanderbreur commented Oct 19, 2017 via email

@JelleAalbers
Copy link
Contributor

I think it crashes because the muon veto and TPC event classes have a different number of channels, causing a mismatch in the compiled classes. If I'm right you'll get this issue if you use pax for any two different detectors.

Still, this is odd since, from your error message, ROOT apparently does start recompiling something when you load MV minitrees (as it should: pax will ask ROOT to recompile stuff whenever you load a file with a different C++ class, even different in a small detail). Some magic is apparently lingering...

I agree cleaning cache files when switching from TPC->MV isn't ideal, but I don't see another way at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants