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

Errors with 12_3_X #295

Closed
michael-pitt opened this issue Jan 3, 2022 · 3 comments
Closed

Errors with 12_3_X #295

michael-pitt opened this issue Jan 3, 2022 · 3 comments

Comments

@michael-pitt
Copy link

The following sequence is working:

cmsrel CMSSW_10_6_27
cd CMSSW_10_6_27/src
cmsenv
git clone https://github.com/cms-nanoAOD/nanoAOD-tools.git PhysicsTools/NanoAODTools
cd PhysicsTools/NanoAODTools
scram b
python scripts/nano_postproc.py

The next one throwing ImportError: No module named PhysicsTools.NanoAODTools.postprocessing.framework.postprocessor

cmsrel CMSSW_12_3_0_pre1
cd CMSSW_12_3_0_pre1/src
cmsenv
git clone https://github.com/cms-nanoAOD/nanoAOD-tools.git PhysicsTools/NanoAODTools
cd PhysicsTools/NanoAODTools
scram b
python scripts/nano_postproc.py

I'm trying to run the nanoAOD production with the recent release.

@sroychow
Copy link
Contributor

sroychow commented Jan 3, 2022

Hi @michael-pitt , I think this has to do with python version. Can you try:-

python3 scripts/nano_postproc.py

@michael-pitt
Copy link
Author

Hi @sroychow, Thanks! new errors

tree._ttreereader = ROOT.TTreeReader(tree, tree._entrylist)
TypeError: none of the 5 overloaded methods succeeded. Full details:
  TTreeReader::TTreeReader(TTree* tree, TEntryList* entryList = nullptr) =>
    TypeError: could not convert argument 2
  TTreeReader::TTreeReader(const char* keyname, TDirectory* dir, TEntryList* entryList = nullptr) =>
    TypeError: could not convert argument 1 (bad argument type for built-in operation)
  TTreeReader::TTreeReader(const TTreeReader&) =>
    TypeError: takes at most 1 arguments (2 given)
  TTreeReader::TTreeReader() =>
    TypeError: takes at most 0 arguments (2 given)
  TTreeReader::TTreeReader(const char* keyname, TEntryList* entryList = nullptr) =>
    TypeError: could not convert argument 1 (bad argument type for built-in operation)

I make it work after modifying treeReaderArrayTools.py

tree._ttreereader = ROOT.TTreeReader(tree, tree._entrylist)
...
_ttreereader = ROOT.TTreeReader(tree, getattr(tree, '_entrylist', None))

to

tree._ttreereader = ROOT.TTreeReader(tree)
...
_ttreereader = ROOT.TTreeReader(tree)

Michael

@meisonlikesicecream
Copy link
Contributor

meisonlikesicecream commented Feb 14, 2022

I also noticed some errors when using python3 with the later CMSSW versions for modules puWeightProducer.py and btagSFProducer.py. In case anyone else stumbles upon this, I solved it by changing the following in line 63 puWeightProducer.py:
hist.SetDirectory(None) to hist.SetDirectory(0)

And line 249 btagSFProducer.py:
self.algo, os.path.join(self.inputFilePath, self.inputFileName)) to self.algo, os.path.join(self.inputFilePath, self.inputFileName), True)

UPDATE: These issues seems to have been solved properly now. The issue with treeReaderArrayTools was solved by: #293

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

No branches or pull requests

4 participants