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
 
typedef WorkerT< EDFilterWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

virtual void beginJob ()
 
virtual void endJob ()
 
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 ()
 
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 ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Attributes

std::string cut_
 
bool filter_
 
StringCutObjectSelector< Tselector_
 
edm::InputTag src_
 

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::EDFilter
CurrentProcessingContext const * currentContext () const
 
- 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  src_( 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  }
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  )
inlinevirtual

Reimplemented from edm::EDFilter.

Definition at line 49 of file JetConstituentSelector.cc.

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

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::getByLabel(), fwrapper::jets, edm::Event::put(), JetConstituentSelector< T >::selector_, and JetConstituentSelector< T >::src_.

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.getByLabel( src_, 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  }
std::vector< typename T::ConstituentTypeFwdPtr > ConstituentsOutput
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
vector< PseudoJet > jets
Container::value_type value_type
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
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::InputTag JetConstituentSelector< T >::src_
protected

Definition at line 88 of file JetConstituentSelector.cc.

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