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.