CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Attributes
L1ExtraMixerPluginT< T > Class Template Reference

#include <L1ExtraMixerPluginT.h>

Inheritance diagram for L1ExtraMixerPluginT< T >:
L1ExtraMixerPluginBase edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1ExtraMixerPluginT (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
virtual void registerProducts (edm::EDProducer &)
 
 ~L1ExtraMixerPluginT ()
 
- Public Member Functions inherited from L1ExtraMixerPluginBase
 L1ExtraMixerPluginBase (const edm::ParameterSet &)
 
 ~L1ExtraMixerPluginBase ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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 ()
 

Private Types

typedef std::vector< Tl1ExtraCollection
 
typedef std::vector< const T * > l1ExtraPtrCollection
 

Private Attributes

double dRveto1_
 
double dRveto2_
 
edm::InputTag srcSelectedMuons1_
 
edm::InputTag srcSelectedMuons2_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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)
 
- Protected Attributes inherited from L1ExtraMixerPluginBase
std::string instanceLabel_
 
edm::InputTag src1_
 
edm::InputTag src2_
 

Detailed Description

template<typename T>
class L1ExtraMixerPluginT< T >

Mix L1Extra e/mu/tau/jet objects, i.e. merge the two collections of e/mu/tau/jet objects reconstructed in the original Zmumu event and the embedded event (containing the tau decay products), keeping the 4 highest Pt objects in each collection

Author
Christian Veelken, LLR
Version
Revision:
1.3
Id:
L1ExtraMixerPluginT.h,v 1.3 2013/01/09 16:38:55 veelken Exp

Definition at line 31 of file L1ExtraMixerPluginT.h.

Member Typedef Documentation

template<typename T >
typedef std::vector<T> L1ExtraMixerPluginT< T >::l1ExtraCollection
private

Definition at line 42 of file L1ExtraMixerPluginT.h.

template<typename T >
typedef std::vector<const T*> L1ExtraMixerPluginT< T >::l1ExtraPtrCollection
private

Definition at line 43 of file L1ExtraMixerPluginT.h.

Constructor & Destructor Documentation

template<typename T >
L1ExtraMixerPluginT< T >::L1ExtraMixerPluginT ( const edm::ParameterSet cfg)
explicit

Definition at line 16 of file L1ExtraMixerPluginT.cc.

References L1ExtraMixerPluginT< T >::dRveto1_, L1ExtraMixerPluginT< T >::dRveto2_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), L1ExtraMixerPluginT< T >::srcSelectedMuons1_, and L1ExtraMixerPluginT< T >::srcSelectedMuons2_.

18 {
19  if ( cfg.exists("srcSelectedMuons1") ) {
20  srcSelectedMuons1_ = cfg.getParameter<edm::InputTag>("srcSelectedMuons1");
21  dRveto1_ = cfg.getParameter<double>("dRveto1");
22  }
23  if ( cfg.exists("srcSelectedMuons2") ) {
24  srcSelectedMuons2_ = cfg.getParameter<edm::InputTag>("srcSelectedMuons2");
25  dRveto2_ = cfg.getParameter<double>("dRveto2");
26  }
27 }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
L1ExtraMixerPluginBase(const edm::ParameterSet &)
edm::InputTag srcSelectedMuons2_
edm::InputTag srcSelectedMuons1_
template<typename T >
L1ExtraMixerPluginT< T >::~L1ExtraMixerPluginT ( )
inline

Definition at line 35 of file L1ExtraMixerPluginT.h.

35 {}

Member Function Documentation

template<typename T >
void L1ExtraMixerPluginT< T >::produce ( edm::Event evt,
const edm::EventSetup es 
)
virtual

Implements L1ExtraMixerPluginBase.

Definition at line 73 of file L1ExtraMixerPluginT.cc.

References edm::Event::getByLabel(), maxNumL1ExtraObjects, Min(), edm::Event::put(), and python.multivaluedict::sort().

74 {
75  edm::Handle<l1ExtraCollection> l1ExtraObjects1;
76  evt.getByLabel(src1_, l1ExtraObjects1);
77  l1ExtraPtrCollection l1ExtraObjects1_cleaned = getCleanedCollection(*l1ExtraObjects1, evt, srcSelectedMuons1_, dRveto1_);
78 
79  edm::Handle<l1ExtraCollection> l1ExtraObjects2;
80  evt.getByLabel(src2_, l1ExtraObjects2);
81  l1ExtraPtrCollection l1ExtraObjects2_cleaned = getCleanedCollection(*l1ExtraObjects2, evt, srcSelectedMuons2_, dRveto2_);
82 
83  l1ExtraPtrCollection l1ExtraObjects_sorted;
84  l1ExtraObjects_sorted.insert(l1ExtraObjects_sorted.end(), l1ExtraObjects1_cleaned.begin(), l1ExtraObjects1_cleaned.end());
85  l1ExtraObjects_sorted.insert(l1ExtraObjects_sorted.end(), l1ExtraObjects2_cleaned.begin(), l1ExtraObjects2_cleaned.end());
86  higherPtT<const T*> higherPt;
87  std::sort(l1ExtraObjects_sorted.begin(), l1ExtraObjects_sorted.end(), higherPt);
88 
89  std::auto_ptr<l1ExtraCollection> l1ExtraObjects_output(new l1ExtraCollection());
90 
91  size_t numL1ExtraObjects = l1ExtraObjects_sorted.size();
92  for ( size_t iObject = 0; iObject < TMath::Min(numL1ExtraObjects, maxNumL1ExtraObjects); ++iObject ) {
93  l1ExtraObjects_output->push_back(*l1ExtraObjects_sorted.at(iObject));
94  }
95 
96  evt.put(l1ExtraObjects_output, instanceLabel_);
97 }
const size_t maxNumL1ExtraObjects
std::vector< T > l1ExtraCollection
T Min(T a, T b)
Definition: MathUtil.h:39
std::vector< const T * > l1ExtraPtrCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:420
edm::InputTag srcSelectedMuons2_
edm::InputTag srcSelectedMuons1_
template<typename T >
void L1ExtraMixerPluginT< T >::registerProducts ( edm::EDProducer producer)
virtual

Implements L1ExtraMixerPluginBase.

Definition at line 30 of file L1ExtraMixerPluginT.cc.

31 {
32  producer.produces<l1ExtraCollection>(instanceLabel_);
33 }
std::vector< T > l1ExtraCollection

Member Data Documentation

template<typename T >
double L1ExtraMixerPluginT< T >::dRveto1_
private

Definition at line 46 of file L1ExtraMixerPluginT.h.

Referenced by L1ExtraMixerPluginT< T >::L1ExtraMixerPluginT().

template<typename T >
double L1ExtraMixerPluginT< T >::dRveto2_
private

Definition at line 48 of file L1ExtraMixerPluginT.h.

Referenced by L1ExtraMixerPluginT< T >::L1ExtraMixerPluginT().

template<typename T >
edm::InputTag L1ExtraMixerPluginT< T >::srcSelectedMuons1_
private

Definition at line 45 of file L1ExtraMixerPluginT.h.

Referenced by L1ExtraMixerPluginT< T >::L1ExtraMixerPluginT().

template<typename T >
edm::InputTag L1ExtraMixerPluginT< T >::srcSelectedMuons2_
private

Definition at line 47 of file L1ExtraMixerPluginT.h.

Referenced by L1ExtraMixerPluginT< T >::L1ExtraMixerPluginT().