![]() |
![]() |
Public Types | |
typedef std::vector< typename T::ConstituentTypeFwdPtr > | ConstituentsOutput |
typedef std::vector< T > | JetsOutput |
Public Member Functions | |
virtual void | beginJob () |
virtual void | endJob () |
virtual bool | filter (edm::Event &iEvent, const edm::EventSetup &iSetup) override |
JetConstituentSelector (edm::ParameterSet const ¶ms) | |
virtual | ~JetConstituentSelector () |
Protected Attributes | |
std::string | cut_ |
bool | filter_ |
StringCutObjectSelector< T > | selector_ |
edm::InputTag | src_ |
Definition at line 30 of file JetConstituentSelector.cc.
typedef std::vector<typename T::ConstituentTypeFwdPtr> JetConstituentSelector< T >::ConstituentsOutput |
Definition at line 35 of file JetConstituentSelector.cc.
typedef std::vector<T> JetConstituentSelector< T >::JetsOutput |
Definition at line 34 of file JetConstituentSelector.cc.
JetConstituentSelector< T >::JetConstituentSelector | ( | edm::ParameterSet const & | params | ) | [inline] |
Definition at line 37 of file JetConstituentSelector.cc.
: src_( params.getParameter<edm::InputTag>("src") ), cut_( params.getParameter<std::string>("cut") ), filter_(false), selector_( cut_ ) { produces< JetsOutput >(); produces< ConstituentsOutput > ("constituents"); }
virtual JetConstituentSelector< T >::~JetConstituentSelector | ( | ) | [inline, virtual] |
Definition at line 47 of file JetConstituentSelector.cc.
{}
virtual void JetConstituentSelector< T >::beginJob | ( | void | ) | [inline, virtual] |
virtual void JetConstituentSelector< T >::endJob | ( | void | ) | [inline, virtual] |
virtual bool JetConstituentSelector< T >::filter | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [inline, override, virtual] |
Implements edm::EDFilter.
Definition at line 52 of file JetConstituentSelector.cc.
References JetConstituentSelector< T >::filter_, edm::Event::getByLabel(), fwrapper::jets, edm::Event::put(), JetConstituentSelector< T >::selector_, and JetConstituentSelector< T >::src_.
{ std::auto_ptr< JetsOutput > jets ( new std::vector<T>() ); std::auto_ptr< ConstituentsOutput > candsOut( new ConstituentsOutput ); edm::Handle< typename edm::View<T> > h_jets; iEvent.getByLabel( src_, h_jets ); // Now set the Ptrs with the orphan handles. for ( typename edm::View<T>::const_iterator ibegin = h_jets->begin(), iend = h_jets->end(), ijet = ibegin; ijet != iend; ++ijet ) { // Check the selection if ( selector_(*ijet) ) { // Add the jets that pass to the output collection jets->push_back( *ijet ); for ( unsigned int ida = 0; ida < ijet->numberOfDaughters(); ++ida ) { candsOut->push_back( typename ConstituentsOutput::value_type( ijet->getPFConstituent(ida), ijet->getPFConstituent(ida) ) ); } } } // put in Event bool pass = jets->size() > 0; iEvent.put(jets); iEvent.put(candsOut, "constituents"); if ( filter_ ) return pass; else return true; }
std::string JetConstituentSelector< T >::cut_ [protected] |
Definition at line 89 of file JetConstituentSelector.cc.
bool JetConstituentSelector< T >::filter_ [protected] |
Definition at line 90 of file JetConstituentSelector.cc.
Referenced by JetConstituentSelector< T >::filter().
StringCutObjectSelector<T> JetConstituentSelector< T >::selector_ [protected] |
Definition at line 91 of file JetConstituentSelector.cc.
Referenced by JetConstituentSelector< T >::filter().
edm::InputTag JetConstituentSelector< T >::src_ [protected] |
Definition at line 88 of file JetConstituentSelector.cc.
Referenced by JetConstituentSelector< T >::filter().