CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Attributes
JetConstituentSelector< T > Class Template Reference
Inheritance diagram for JetConstituentSelector< T >:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef std::vector< typename
T::ConstituentTypeFwdPtr > 
ConstituentsOutput
 
typedef std::vector< TJetsOutput
 
- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

virtual void beginJob () override
 
virtual void endJob () override
 
virtual bool filter (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 JetConstituentSelector (edm::ParameterSet const &params)
 
virtual ~JetConstituentSelector ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Attributes

std::string cut_
 
bool filter_
 
StringCutObjectSelector< Tselector_
 
edm::EDGetTokenT< typename
edm::View< T > > 
srcToken_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

template<class T>
class JetConstituentSelector< T >

Definition at line 30 of file JetConstituentSelector.cc.

Member Typedef Documentation

template<class T >
typedef std::vector<typename T::ConstituentTypeFwdPtr> JetConstituentSelector< T >::ConstituentsOutput

Definition at line 35 of file JetConstituentSelector.cc.

template<class T >
typedef std::vector<T> JetConstituentSelector< T >::JetsOutput

Definition at line 34 of file JetConstituentSelector.cc.

Constructor & Destructor Documentation

template<class T >
JetConstituentSelector< T >::JetConstituentSelector ( edm::ParameterSet const &  params)
inline

Definition at line 37 of file JetConstituentSelector.cc.

37  :
38  srcToken_( consumes< typename edm::View<T> >( params.getParameter<edm::InputTag>("src") ) ),
39  cut_( params.getParameter<std::string>("cut") ),
40  filter_(false),
41  selector_( cut_ )
42  {
43  produces< JetsOutput >();
44  produces< ConstituentsOutput > ("constituents");
45  }
edm::EDGetTokenT< typename edm::View< T > > srcToken_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
StringCutObjectSelector< T > selector_
template<class T >
virtual JetConstituentSelector< T >::~JetConstituentSelector ( )
inlinevirtual

Definition at line 47 of file JetConstituentSelector.cc.

47 {}

Member Function Documentation

template<class T >
virtual void JetConstituentSelector< T >::beginJob ( void  )
inlineoverridevirtual

Reimplemented from edm::EDFilter.

Definition at line 49 of file JetConstituentSelector.cc.

49 {}
template<class T >
virtual void JetConstituentSelector< T >::endJob ( void  )
inlineoverridevirtual

Reimplemented from edm::EDFilter.

Definition at line 50 of file JetConstituentSelector.cc.

50 {}
template<class T >
virtual bool JetConstituentSelector< T >::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
inlineoverridevirtual

Implements edm::EDFilter.

Definition at line 52 of file JetConstituentSelector.cc.

References JetConstituentSelector< T >::filter_, edm::Event::getByToken(), fwrapper::jets, edm::Event::put(), JetConstituentSelector< T >::selector_, and JetConstituentSelector< T >::srcToken_.

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

52  {
53 
54  std::auto_ptr< JetsOutput > jets ( new std::vector<T>() );
55  std::auto_ptr< ConstituentsOutput > candsOut( new ConstituentsOutput );
56 
58  iEvent.getByToken( srcToken_, h_jets );
59 
60  // Now set the Ptrs with the orphan handles.
61  for ( typename edm::View<T>::const_iterator ibegin = h_jets->begin(),
62  iend = h_jets->end(), ijet = ibegin;
63  ijet != iend; ++ijet ) {
64 
65  // Check the selection
66  if ( selector_(*ijet) ) {
67  // Add the jets that pass to the output collection
68  jets->push_back( *ijet );
69  for ( unsigned int ida = 0; ida < ijet->numberOfDaughters(); ++ida ) {
70  candsOut->push_back( typename ConstituentsOutput::value_type( ijet->getPFConstituent(ida), ijet->getPFConstituent(ida) ) );
71  }
72  }
73  }
74 
75  // put in Event
76  bool pass = jets->size() > 0;
77  iEvent.put(jets);
78  iEvent.put(candsOut, "constituents");
79 
80  if ( filter_ )
81  return pass;
82  else
83  return true;
84 
85  }
edm::EDGetTokenT< typename edm::View< T > > srcToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
std::vector< typename T::ConstituentTypeFwdPtr > ConstituentsOutput
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
vector< PseudoJet > jets
Container::value_type value_type
StringCutObjectSelector< T > selector_

Member Data Documentation

template<class T >
std::string JetConstituentSelector< T >::cut_
protected

Definition at line 89 of file JetConstituentSelector.cc.

template<class T >
bool JetConstituentSelector< T >::filter_
protected

Definition at line 90 of file JetConstituentSelector.cc.

Referenced by JetConstituentSelector< T >::filter().

template<class T >
StringCutObjectSelector<T> JetConstituentSelector< T >::selector_
protected

Definition at line 91 of file JetConstituentSelector.cc.

Referenced by JetConstituentSelector< T >::filter().

template<class T >
edm::EDGetTokenT< typename edm::View<T> > JetConstituentSelector< T >::srcToken_
protected

Definition at line 88 of file JetConstituentSelector.cc.

Referenced by JetConstituentSelector< T >::filter().