10 #include <EVENT/LCCollection.h>
11 #include <IMPL/LCCollectionVec.h>
12 #include <EVENT/ReconstructedParticle.h>
13 #include <IMPL/ReconstructedParticleImpl.h>
14 #include <UTIL/LCTypedVector.h>
15 #include <marlin/Exceptions.h>
18 #include "marlin/VerbosityLevels.h"
20 using namespace lcio ;
21 using namespace marlin ;
30 _description =
"JetPFOsProcessor does whatever it does ..." ;
35 registerInputCollection( LCIO::RECONSTRUCTEDPARTICLE,
36 "InputJetCollection" ,
37 "Name of the input jet collection" ,
39 std::string(
"JetsFromKt") ) ;
41 registerOutputCollection( LCIO::RECONSTRUCTEDPARTICLE,
42 "OutputPFOsCollection",
43 "Name of the output PFOs collection",
45 std::string(
"PFOsFromKtJet") );
51 streamlog_out(DEBUG) <<
" JetPFOs Processor init called "
61 LCCollection *colJet = evt->getCollection(
_colJet);
63 std::cerr <<
"No Input Jet Collection Found!" << std::endl;
64 throw marlin::SkipEventException(
this);
67 pPFOsFromJetCollection->setSubset(
true);
68 int nJets = colJet->getNumberOfElements();
69 for (
int i=0;i<nJets;i++) {
70 ReconstructedParticle *jet =
dynamic_cast<ReconstructedParticle*
>(colJet->getElementAt(i));
71 std::vector<lcio::ReconstructedParticle*> partVec = jet->getParticles();
72 for (std::vector<lcio::ReconstructedParticle*>::const_iterator iPart=partVec.begin();iPart!=partVec.end();++iPart) {
73 pPFOsFromJetCollection->addElement((*iPart));
std::string _colJet
Input collection name.
virtual void check(LCEvent *evt)
std::string _colPFOsFromJet
Output collection name.
virtual void end()
Called after data processing for clean up.
std::vector< LCCollection * > LCCollectionVec
A simple processor for to save particles from jets to a PFO collection.
JetPFOsProcessor aJetPFOsProcessor
virtual void processEvent(LCEvent *evt)
Called for every event - the working horse.
virtual void processRunHeader(LCRunHeader *run)
Called for every run.
virtual void init()
Called at the begin of the job before anything is read.