elaird / supy

analyze events stored in TTrees in parallel
8 stars 7 forks source link

Display #89

Closed elaird closed 12 years ago

elaird commented 12 years ago

Hello,

Here is a skeleton event displayer that can be used as the base class of an ntuple-specific displayer. I will use this in susycaf shortly.

Ted

gerbaudo commented 12 years ago

Nice! ok with me.

betchart commented 12 years ago

I copied the susycaf displayer into displayer_ttbar a little while ago. One of the things I found convenient to change was to use class member TPads which are available to any function in the class. This contrasts with the susycaf displayer which creates a local TPad instance and draws it inside one function, for one pad, and then the same for another pad. The unfortunate thing about that design is that the drawing of objects has to be coordinated in both pads separately (whether or not to draw, color, etc). So for example, there is the pt-phi pad, which has to be draw all at once, and then the eta-phi pad, drawn later, and in order to draw the same physics object on both pads, with the same color, you have to coordinate the eta-phi function and the pt-phi function.

So in my implementation, I made class member TPads, which is nice because then I can have a DrawMET function, which draws the same physics object on both pads, with one set of style parameters.

The call to self.canvas.Clear https://github.com/elaird/supy/pull/89/files#L0R13

breaks my design, because it deletes my class member TPads. I forget how I solved the clearing problem, but I think it was for each member (TPad,TText,etc) independently.

elaird commented 12 years ago

Tested with susycaf displayer. Ok with me.

betchart commented 12 years ago

What do you think about add a prepareText function to this parent class?

betchart commented 12 years ago

ok merging now