Complete:
Data Formats in SimG4Core
RECO Data Formats
SimG4Core collections (in RECOSIM and AODSIM) |
none |
none |
none |
SimG4Core collections (in RECOSIM only) |
g4SimHits |
edm::SimTrackContainer |
collection of (selected) tracks produced during Geant4 tracing of the generator's particles through CMS detector |
g4SimHits |
edm::SimVertexContainer |
collection of vertices associated with the SimTrack's (see above) |
How to use the table
In the header of your analyzer you should have the header(s) of the data format(s) you will access. SimTrack belongs to the
SimDataFormats/Track
package, and SimVertex belongs to the
SimDataFormats/Vertex
package; the headers are located in the
/interface
subdirectories.
Thus, your
EDAnalyzer should contain the following:
#include "SimDataFormats/Track/interface/SimTrack.h"
#include "SimDataFormats/Track/interface/SimTrackContainer.h"
#include "SimDataFormats/Vertex/interface/SimVertex.h"
#include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
In the
analyze(const Event& e, const EventSetup& )
method you should do something like the following:
edm::Handle<edm::SimTrackContainer> SimTk;
edm::Handle<edm::SimVertexContainer> SimVtx;
e.getByLabel("g4SimHits",SimTk);
e.getByLabel("g4SimHits",SimVtx);
for ( edm::SimTrackContainer::const_iterator itk=SimTk->begin(); itk!=SimTk->end(); ++itk )
{
// your code here
}
for ( edm::SimVertexContainer::const_iterator ivtx=SimVtx->begin(); ivtx!=SimVtx->end(); ++ivtx )
{
// your code here
}
You can also excercise your curiosity and view more usage details in the example analyzer
SimTrackSimVertexDumper.cc
.
Note that
edm::SimTrackContainer
and
edm::SimVertexContainer
are actually
typedef, respectively, for the following:
std::vector<SimTrack>
std::vector<SimVertex>
Review status
Responsible:
Last reviewed by: