CMSSW collection accessors
Whenever I access a new collection I try to save the syntax for accessing it and its variables here for future reference. I try to add some info about the collection or link the twiki/web page containing the desired info from the original group / author.
CMSSW 1_5_2
SimTracks
Taken from
http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/Validation/RecoVertex/src/TrackParameterAnalyzer.cc?revision=1.10&view=markup
cfg file
InputTag simG4 = g4SimHits
include
Too many... will remove some.
//generator level
#include "SimDataFormats/HepMCProduct/interface/HepMCProduct.h"
#include "HepMC/GenEvent.h"
#include "HepMC/GenVertex.h"
#include "HepMC/GenParticle.h"
// simulated vertices,..., add <use name=SimDataFormats/Vertex> and <../Track>
#include <SimDataFormats/Track/interface/SimTrack.h>
#include <SimDataFormats/Track/interface/SimTrackContainer.h>
#include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
BuildFile
yes
code
simG4_( iConfig.getParameter<edm::InputTag>( "simG4" ) )
// get the simulated tracks, extract perigee parameters
Handle<SimTrackContainer> simTrks;
iEvent.getByLabel( simG4_, simTrks);
std::vector<ParameterVector > tsim;
for(edm::SimTrackContainer::const_iterator t=simTrks->begin(); t!=simTrks->end(); ++t){
int pdgCode=t->type();
HepLorentzVector p=t->momentum();
if(verbose_){
std::cout << "simtrk "
<< " gen=" << std::setw( 4) << t->genpartIndex()
<< " vtx=" << std::setw( 4) << t->vertIndex()
<< " pdg=" << std::setw( 5) << t->type()
<< " Q=" << std::setw( 3) << Q
<< " pt=" << std::setw(6) << p.perp()
<< " vx=" << std::setw(6) << v.x()
<< " vy=" << std::setw(6) << v.y()
<< " vz=" << std::setw(6) << v.z()
<< std::endl;
}
}
Another 2nd
another 2nd
3rd
3rd
4th
4th
a link
my fnal page
a currently broken picture link
--
IngoBloch - 15 Aug 2007