NWUHEP / ntupleProducer

Northwestern ntuplizer tools for use with CMSSW.
https://twiki.cern.ch/twiki/bin/view/CMS/UserCodeNWUntupleProducer
4 stars 4 forks source link

Implement Dump() function #34

Closed andreypz closed 10 years ago

andreypz commented 10 years ago

We all have various dumping functions, more advanced individuals even have a special class for dumping stuff. We should implement this functionality in TCObjects such a that we can call it directly from any TCPhysObject: obj.Dump(). Calling it from a Muon or Electron should overload the method and print more stuff related to that object.

We could have two levels of dumps, obj.Dump(lvl), where lvl controls the amount of info two dump.

pollackscience commented 10 years ago

Dumps are now implemented, but in a cooler way. TCPhysObject and all inherited classes can use '<<' operator to dump content.

Example 1: I want all electron info cout << myElectronObj << endl;

Example 2: I only want pt,eta,phi shit for my muon cout << TCPhysObject(myMuonObj) <<endl;

andreypz commented 10 years ago

Just for the record, It is apparently possible to call Obj.Dump() and it will print out everything. This comes from ROOT's functionality.

naodell commented 10 years ago

You can also use the Obj.Print() function to just get the 4 vector info. I think this comes from the TLorentzVector inheritance. Imagine what other nice functionality has yet to be discovered...

On Wed, Jul 16, 2014 at 9:18 PM, Andrey Pozdnyakov <notifications@github.com

wrote:

Just for the record, It is apparently possible to call Obj.Dump() and it will print out everything. This comes from ROOT's functionality.

Reply to this email directly or view it on GitHub https://github.com/NWUHEP/ntupleProducer/issues/34#issuecomment-49251627 .