Fork me on GitHub

Opened 9 years ago

Last modified 8 years ago

#866 accepted How to

some questions on DelphesAnalysis ( python ) — at Version 1

Reported by: Li Huang Owned by:
Priority: minor Milestone:
Component: Delphes code Version: Delphes 3
Keywords: Cc:

Description (last modified by Pavel Demin)

Hi,

I have some questions to bother you, in the file Delphes/python/DelphesAnalysis/AnalysisEvent.py :


  1. self.BuildIndex("Event[0].Number") #: why Event[0].Number ? we have a tree named Event.Number but no tree named Event[0].Number
  2. how a TObjArray behaviour like a 'real' array ? This question may not be a Delphes's question but I find that in root's guide , it said using operate[], but I failed. I just want to display the content of the array as the 'real' one.
  3. return self.Event.At(0).Number #: when added branch Event, a bug:AttributeError: 'TObject' object has no attribute 'Number' . Also the same question, why it is Event.At(0).Number but not Event.Number 4. self._weightCache = {} self._weightEngines = {} self._collections = {} self._producers = {} I have some confusion about the usage of _collections and _producers , what are they used for ? And I am confused about since we have _weightEngines to store our weight dictionary , why we need a _weightCache ?


When I go through the AnalysisEvent.py file I got many confusions. Maybe I can learn something from your examples and understand your idea of design DelphesAnalysis better. But now I am so confusion why you not just provide a python version of ExRootAnalysis or something to read Trees using python. The way ( using a configure file , plot file ..etc) really bother me now.

And I can not follow the README:

. ./DelphesEnv.sh
cd python
# run the analysis
DelphesAnalysis/ControlPlots.py -i ../files/ -o controlPlots_demo.root --all -c topConfig.py

since I don't know the meaning of ". ./DelphesEnv.sh" , I guess I can instead it by "sh DelphesEnv.sh" ? and I don't know "DelphesAnalysis/ControlPlots.py -i ../files/ -o controlPlots_demo.root --all -c topConfig.py

" , as the bug said:

ui@ui:~/tools/package/Delphes-3.3.2/python$ DelphesAnalysis/ControlPlots.py -i ../files/ -o ../zhh.root --all -c topConfig.py
bash: DelphesAnalysis/ControlPlots.py: Permission denied
ui@ui:~/tools/package/Delphes-3.3.2/python$ sudo DelphesAnalysis/ControlPlots.py -i ../files/ -o ../zhh.root --all -c topConfig.py
[sudo] password for ui: 
sudo: DelphesAnalysis/ControlPlots.py: command not found
ui@ui:~/tools/package/Delphes-3.3.2/python$ python DelphesAnalysis/ControlPlots.py -i ../files/ -o ../zhh.root --all -c topConfig.py
Error in <TUnixSystem::DynamicPathName>: libDelphes[.so | .dll | .dylib | .sl | .dl | .a] does not exist in :/home/ui/tools/root/lib:.:/home/ui/tools/root/lib::/home/ui/tools/root/cint/cint/stl
Traceback (most recent call last):
  File "DelphesAnalysis/ControlPlots.py", line 45, in <module>
    import Delphes
  File "/home/ui/tools/package/Delphes-3.3.2/python/DelphesAnalysis/Delphes.py", line 14, in <module>
    _root.MakeRootClass( "Event" ).__str__    = _Event__str__
TypeError: requested class 'ROOT::Event' does not exist

I want to turn to python coding and I really appreciate you have provided a python interface for Delphes. But now I need some help to be familiar with it.

Best,
Li

Change History (1)

comment:1 by Pavel Demin, 9 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.