Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-9783 RDataFrame-related tickets
  3. ROOT-9736

[DF] Make ROOT::RDataFrame consider type inheritance for its columns

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed (View Workflow)
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 6.14/04
    • Fix Version/s: 6.18/00
    • Component/s: Other, TTree
    • Labels:
      None
    • Environment:

      x86_84-slc6-gcc62-opt and x86_64-mac1013-clang100-opt, but it shouldn't matter.

      Description

      Hi,

      I mentioned this a few days ago in person, but I thought I should write it down as well.

      I recently started playing with ROOT::RDataFrame, taking the code developed by Umesh Dharmaji Worlikar, and trying to make it a bit sleeker. You can find the code I'm working on over here:

      https://gitlab.cern.ch/akraszna/xAODDataSource

      While trying to find the limits of the data frame code, I found that it's not really aware that columns held in the data frame may have "some inheritance".

      In ATLAS our EDM has some convenient features. One of them is that all our particle container types (like xAOD::ElectronContainer) inherit from xAOD::IParticleContainer. Allowing us to write "generic code" that would work with electrons, muons, etc.

      Unfortunately RDataFrame doesn't allow for this at the moment. Look at

      https://gitlab.cern.ch/akraszna/xAODDataSource/blob/master/xAODDataFrameTests/util/rdfTypeConversionTest.cxx

      Note that the xAOD data source can absolutely serve the "Electrons" branch as both xAOD::IParticleContainer or xAOD::ElectronContainer. But as soon as I try to use the same branch as both, I get:

      [bash][tauriel]:run > rdfTypeConversionTest -i ~/ATLAS/data/mc16_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.merge.AOD.e3601_s3126_r9546_r9551/AOD.11372544._000001.pool.root.1 
      xAOD::Init                INFO    Environment initialised for data access
      TBB Warning: Exact exception propagation is requested by application but the linked library is built without support for it
      libc++abi.dylib: terminating with uncaught exception of type tbb::captured_exception: TColumnValue: type specified for column "Electrons" is DataVector<xAOD::Electron_v1> but temporary column has type DataVector<xAOD::IParticle>
      el_pt_from_iparticle.Mean() = Abort trap: 6
      [bash][tauriel]:run >
      

      For us it would certainly be very desirable to add support for this sort of a thing. As it would allow us to provide common functors for analyses (for example).

      Cheers,
      Attila

      P.S. It's also not clear to me what ROOT::RDF::RDataSource::GetTypeName(...) is used for at the moment... My data source returns the type of the concrete object. (Of course.) But it doesn't stop RDataFrame from using the object as xAOD::IParticleContainer. And I don't really understand why/how...

        Attachments

          Activity

            People

            • Assignee:
              dpiparo Danilo Piparo
              Reporter:
              akraszna Attila Krasznahorkay
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                PlannedEnd:
                PlannedStart:
                Actual Start:
                Actual End: