test
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
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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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 Attributes

edm::EDGetTokenT< std::vector
< T1 > > 
srcZCand_
 

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)
 

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_(consumes<std::vector<T1> >(iConfig.getParameter<edm::InputTag>("ZCandidateCollection")))
58 {
59  produces<std::vector<T1> >();
60 }
T getParameter(std::string const &) const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< std::vector< T1 > > 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::getByToken(), edm::Event::put(), reco::return(), and contentValuesCheck::ss.

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.getByToken(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 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
edm::EDGetTokenT< std::vector< T1 > > srcZCand_
return(e1-e2)*(e1-e2)+dp *dp

Member Data Documentation

template<typename T1 >
edm::EDGetTokenT<std::vector<T1> > ZllArbitrator< T1 >::srcZCand_
private

Definition at line 45 of file ZllArbitrator.cc.