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 Attributes
ZllArbitrator< T1 > Class Template Reference
Inheritance diagram for ZllArbitrator< T1 >:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void endJob () override
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ZllArbitrator (const edm::ParameterSet &iConfig)
 
virtual ~ZllArbitrator ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::InputTag srcZCand_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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::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<typename T1>
class ZllArbitrator< T1 >

Definition at line 32 of file ZllArbitrator.cc.

Constructor & Destructor Documentation

template<typename T1 >
ZllArbitrator< T1 >::ZllArbitrator ( const edm::ParameterSet iConfig)

Definition at line 56 of file ZllArbitrator.cc.

57  : srcZCand_(iConfig.getParameter<edm::InputTag>("ZCandidateCollection"))
58 {
59  produces<std::vector<T1> >();
60 }
T getParameter(std::string const &) const
edm::InputTag srcZCand_
template<typename T1 >
ZllArbitrator< T1 >::~ZllArbitrator ( )
virtual

Definition at line 65 of file ZllArbitrator.cc.

65 {}

Member Function Documentation

template<typename T1 >
void ZllArbitrator< T1 >::endJob ( void  )
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 108 of file ZllArbitrator.cc.

109 {
110 }
template<typename T1 >
void ZllArbitrator< T1 >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 73 of file ZllArbitrator.cc.

References edm::Event::getByLabel(), edm::Event::put(), and reco::return().

74 {
75  std::stringstream ss ;
76 
77  std::auto_ptr<std::vector<T1> > TheBestZ(new std::vector<T1 >);
78 
79  edm::Handle< std::vector<T1> > ZCandidatesHandle;
80  iEvent.getByLabel(srcZCand_,ZCandidatesHandle);
81 
82  if( ZCandidatesHandle->size() == 0 )
83  {
84  iEvent.put(TheBestZ);
85  return ;
86  }
87 
88  double ZmassPDG = 91.18;
89  double DeltaMass = 10000;
90 
91  typename std::vector<T1>::const_iterator ZCandIt ;
92  typename std::vector<T1>::const_iterator bestZCand ;
93 
94  for (ZCandIt = ZCandidatesHandle->begin(); ZCandIt != ZCandidatesHandle->end(); ++ZCandIt) {
95 
96  if( fabs(ZCandIt->mass()-ZmassPDG) < DeltaMass ){
97  DeltaMass = fabs(ZCandIt->mass()-ZmassPDG) ;
98  bestZCand = ZCandIt;
99  }
100  }
101 
102  TheBestZ->push_back( *bestZCand );
103  iEvent.put(TheBestZ);
104 
105 }
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
return(e1-e2)*(e1-e2)+dp *dp
edm::InputTag srcZCand_

Member Data Documentation

template<typename T1 >
edm::InputTag ZllArbitrator< T1 >::srcZCand_
private

Definition at line 45 of file ZllArbitrator.cc.