How to add your own class to a plain Root Tree - (no EDM) - in CMSSW

Documentation

TWikis:

Code

cvs co -d JetEventDataformat UserCode/aosorio/UCT2015/JetEventDataformat
cvs co -d UCT15Additions UserCode/aosorio/UCT2015/UCT15Additions

Procedure

  • First you need to define your class in a new package (I used the mkedanlzr to give it the usual structure).
  • Write your class (put in the src directory if you want). For this example, my classes are Region and SimpleJet
  • At the end of my class declaration file, we need to add a type definition:

typedef std::vector< Region > RegionCollection;
typedef std::vector< SimpleJet > JetEventCollection;
  • When you are done with your class declaration and definition, you need to create a xml file classes_def.xml inside the src/ directory. This file tells what classes are you adding to the dictionary:

< lcgdict>
 < class name="Region"/ >
 < class name="std::vector< Region >"/ >
 < class name="edm::Wrapper< std::vector< Region > >"/ >
 < class name="SimpleJet"/ >
 < class name="std::vector< SimpleJet >"/ >
 < class name="edm::Wrapper< std::vector >"/ >
< /lcgdict >

  • Check the buildfile. This is how mine looks like currently:

< use name="FWCore/Framework"/ >
< use name="FWCore/ParameterSet"/ >
< use name="PhysicsTools/UtilAlgos"/ >
< use name="FWCore/ServiceRegistry"/ >
< use name="DataFormats/Candidate"/ >
< use name="root"/ >
< use name="rootrflx"/ >
< use name="FWCore/Utilities"/ >
< export >
  
< /export >

  • Build your classes. If everything goes well, then you are ready to add this class to a plain Root tree in CMSSW.
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r3 - 2013-01-30 - AndresOsorio
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback