5 #include <EVENT/LCCollection.h>
6 #include <EVENT/LCIO.h>
7 #include <Exceptions.h>
13 #include <IMPL/LCCollectionVec.h>
14 #include <IMPL/ReconstructedParticleImpl.h>
17 using namespace lcio ;
18 using namespace marlin ;
26 : Processor(
"SelectReconstructedParticle") {
29 _description =
"SelectReconstructedParticle: Selects particles from all reconstructed particles to be used for the thrust finder" ;
35 registerInputCollection( LCIO::RECONSTRUCTEDPARTICLE,
36 "inputCollectionName" ,
37 "Collection of reconstructed particles to chose from" ,
39 std::string(LCIO::RECONSTRUCTEDPARTICLE) ) ;
41 registerOutputCollection( LCIO::RECONSTRUCTEDPARTICLE,
42 "outputCollectionName" ,
43 "Collection of selected reconstructed particles" ,
45 std::string(
"SelectedReconstructedParticle") ) ;
48 registerProcessorParameter(
50 "Minimum momentum a particle has to have to be used for the thrust calculation" ,
69 std::stringstream errorMsg;
74 if (inParVec->getTypeName()!=LCIO::RECONSTRUCTEDPARTICLE) {
75 errorMsg <<
"\nProcessor: SelectReconstructedParticle \n" <<
76 "Collection is of wrong type (" << inParVec->getTypeName() <<
77 "). Processor requires collection tpye " << LCIO::RECONSTRUCTEDPARTICLE <<
"\n" ;
78 throw Exception(errorMsg.str());
83 outParVec->setSubset(
true);
87 for (
int i = 0; i < inParVec->getNumberOfElements() ; i++)
90 const double *pparmom;
92 pparmom =
dynamic_cast<ReconstructedParticle*
>(inParVec->getElementAt(i))->getMomentum();
96 totparmom = sqrt( pparmom[0]*pparmom[0]
97 + pparmom[1]*pparmom[1]
98 + pparmom[2]*pparmom[2]);
101 !dynamic_cast<ReconstructedParticle*>(inParVec->getElementAt(i))->isCompound()) {
104 outParVec->addElement(inParVec->getElementAt(i));
virtual void end()
Called after data processing for clean up.
virtual void init()
Called at the begin of the job before anything is read.
std::string _inputCollectionName
Input and output collection name.
Processor for marlin selecting reconstructed particle for further use.
SelectReconstructedParticle()
virtual void processRunHeader(LCRunHeader *run)
Called for every run.
virtual void processEvent(LCEvent *evt)
Called for every event - the working horse.
std::vector< LCCollection * > LCCollectionVec
SelectReconstructedParticle aSelectReconstructedParticle
std::string _outputCollectionName