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, C > Class Template Reference
Inheritance diagram for JetConstituentSelector< T, C >:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef C 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 Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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::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, typename C = std::vector<typename T::ConstituentTypeFwdPtr>>
class JetConstituentSelector< T, C >

Definition at line 32 of file JetConstituentSelector.cc.

Member Typedef Documentation

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

Definition at line 37 of file JetConstituentSelector.cc.

template<class T , typename C = std::vector<typename T::ConstituentTypeFwdPtr>>
typedef std::vector<T> JetConstituentSelector< T, C >::JetsOutput

Definition at line 36 of file JetConstituentSelector.cc.

Constructor & Destructor Documentation

template<class T , typename C = std::vector<typename T::ConstituentTypeFwdPtr>>
JetConstituentSelector< T, C >::JetConstituentSelector ( edm::ParameterSet const &  params)
inline

Definition at line 39 of file JetConstituentSelector.cc.

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

Definition at line 49 of file JetConstituentSelector.cc.

49 {}

Member Function Documentation

template<class T , typename C = std::vector<typename T::ConstituentTypeFwdPtr>>
virtual void JetConstituentSelector< T, C >::beginJob ( void  )
inlineoverridevirtual

Reimplemented from edm::EDFilter.

Definition at line 51 of file JetConstituentSelector.cc.

51 {}
template<class T , typename C = std::vector<typename T::ConstituentTypeFwdPtr>>
virtual void JetConstituentSelector< T, C >::endJob ( void  )
inlineoverridevirtual

Reimplemented from edm::EDFilter.

Definition at line 52 of file JetConstituentSelector.cc.

52 {}
template<class T , typename C = std::vector<typename T::ConstituentTypeFwdPtr>>
virtual bool JetConstituentSelector< T, C >::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
inlineoverridevirtual

Implements edm::EDFilter.

Definition at line 54 of file JetConstituentSelector.cc.

References JetConstituentSelector< T, C >::filter_, edm::Event::getByToken(), fwrapper::jets, edm::Event::put(), JetConstituentSelector< T, C >::selector_, and JetConstituentSelector< T, C >::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().

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

Member Data Documentation

template<class T , typename C = std::vector<typename T::ConstituentTypeFwdPtr>>
std::string JetConstituentSelector< T, C >::cut_
protected

Definition at line 91 of file JetConstituentSelector.cc.

template<class T , typename C = std::vector<typename T::ConstituentTypeFwdPtr>>
bool JetConstituentSelector< T, C >::filter_
protected

Definition at line 92 of file JetConstituentSelector.cc.

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

template<class T , typename C = std::vector<typename T::ConstituentTypeFwdPtr>>
StringCutObjectSelector<T> JetConstituentSelector< T, C >::selector_
protected

Definition at line 93 of file JetConstituentSelector.cc.

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

template<class T , typename C = std::vector<typename T::ConstituentTypeFwdPtr>>
edm::EDGetTokenT< typename edm::View<T> > JetConstituentSelector< T, C >::srcToken_
protected

Definition at line 90 of file JetConstituentSelector.cc.

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