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 Member Functions | Private Attributes
reco::modules::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init > Class Template Reference

#include <NamedCandCombiner.h>

Inheritance diagram for reco::modules::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init >:
reco::modules::NamedCandCombinerBase edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 NamedCandCombiner (const edm::ParameterSet &cfg)
 constructor from parameter settypedef More...
 
virtual ~NamedCandCombiner ()
 destructor More...
 
- Public Member Functions inherited from reco::modules::NamedCandCombinerBase
 NamedCandCombinerBase (const edm::ParameterSet &cfg)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

void produce (edm::Event &evt, const edm::EventSetup &es)
 process an event More...
 

Private Attributes

::NamedCandCombiner< Selector,
PairSelector, Cloner, Setup > 
combiner_
 combiner utility More...
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 
- Protected Attributes inherited from reco::modules::NamedCandCombinerBase
std::vector< int > dauCharge_
 daughter charges More...
 
std::vector
< cand::parser::ConjInfo
labels_
 label vector More...
 
std::string name_
 Name of this candidate. More...
 
int pdgId_
 which pdgId to set More...
 
std::vector< std::string > roles_
 
bool setLongLived_
 set long lived flag More...
 
bool setMassConstraint_
 set mass constraint flag More...
 
bool setPdgId_
 set pdgId flag More...
 

Detailed Description

template<typename Selector, typename PairSelector = AnyPairSelector, typename Cloner = ::combiner::helpers::NormalClone, typename Setup = AddFourMomenta, typename Init = typename ::reco::modules::EventSetupInit<Setup>::type>
class reco::modules::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init >

Definition at line 107 of file NamedCandCombiner.h.

Constructor & Destructor Documentation

template<typename Selector , typename PairSelector = AnyPairSelector, typename Cloner = ::combiner::helpers::NormalClone, typename Setup = AddFourMomenta, typename Init = typename ::reco::modules::EventSetupInit<Setup>::type>
reco::modules::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init >::NamedCandCombiner ( const edm::ParameterSet cfg)
inlineexplicit

constructor from parameter settypedef

Definition at line 110 of file NamedCandCombiner.h.

110  :
111  NamedCandCombinerBase( cfg ),
112  combiner_( name_,
113  reco::modules::make<Selector>( cfg ),
114  reco::modules::make<PairSelector>( cfg ),
115  Setup( cfg ),
116  cfg.existsAs<bool>("checkCharge") ? cfg.getParameter<bool>("checkCharge") : true,
117  cfg.existsAs<bool>("checkOverlap") ? cfg.getParameter<bool>("checkOverlap") : true,
118  dauCharge_ ) {
119  produces<reco::NamedCompositeCandidateCollection>();
120  }
T getParameter(std::string const &) const
std::string name_
Name of this candidate.
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:187
NamedCandCombinerBase(const edm::ParameterSet &cfg)
std::vector< int > dauCharge_
daughter charges
::NamedCandCombiner< Selector, PairSelector, Cloner, Setup > combiner_
combiner utility
template<typename Selector , typename PairSelector = AnyPairSelector, typename Cloner = ::combiner::helpers::NormalClone, typename Setup = AddFourMomenta, typename Init = typename ::reco::modules::EventSetupInit<Setup>::type>
virtual reco::modules::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init >::~NamedCandCombiner ( )
inlinevirtual

destructor

Definition at line 122 of file NamedCandCombiner.h.

122 { }

Member Function Documentation

template<typename Selector , typename PairSelector = AnyPairSelector, typename Cloner = ::combiner::helpers::NormalClone, typename Setup = AddFourMomenta, typename Init = typename ::reco::modules::EventSetupInit<Setup>::type>
void reco::modules::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init >::produce ( edm::Event evt,
const edm::EventSetup es 
)
inlineprivatevirtual

process an event

Implements edm::EDProducer.

Definition at line 126 of file NamedCandCombiner.h.

References trackerHits::c, alignCSCRings::e, edm::Event::getByLabel(), i, init, reco::modules::NamedCandCombinerBase::labels_, n, reco::modules::NamedCandCombinerBase::name_, dbtoconf::out, reco::modules::NamedCandCombinerBase::pdgId_, edm::PtrVector< T >::push_back(), edm::Event::put(), alignCSCRings::r, dt_dqm_sourceclient_common_cff::reco, reco::modules::NamedCandCombinerBase::roles_, reco::modules::NamedCandCombinerBase::setLongLived_, reco::modules::NamedCandCombinerBase::setMassConstraint_, and reco::modules::NamedCandCombinerBase::setPdgId_.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

126  {
127  using namespace std;
128  using namespace reco;
129  Init::init(combiner_.setup(), evt, es);
130  int n = labels_.size();
131  std::vector<edm::Handle<CandidateView> > colls(n);
132  for(int i = 0; i < n; ++i) {
133  evt.getByLabel(labels_[i].tag_, colls[i]);
134  }
135  std::vector<CandidatePtrVector> cv;
136  for(typename std::vector<edm::Handle<CandidateView> >::const_iterator c = colls.begin();
137  c != colls.end(); ++ c) {
139  CandidateView::size_type n_view = (*c)->size();
140  for ( CandidateView::size_type iview = 0; iview < n_view; ++iview ) {
141  CandidatePtr ri( *c, iview );
142  r.push_back( ri );
143  }
144  cv.push_back(r);
145  }
146  std::auto_ptr<NamedCompositeCandidateCollection> out = combiner_.combine(cv, roles_);
148  typename NamedCompositeCandidateCollection::iterator i = out->begin(), e = out->end();
149  for(; i != e; ++i) {
150  i->setName( name_ );
151  i->setRoles( roles_ );
152  i->applyRoles();
153  if(setLongLived_) i->setLongLived();
154  if(setMassConstraint_) i->setMassConstraint();
155  if(setPdgId_) i->setPdgId(pdgId_);
156  }
157  }
158  evt.put(out);
159  }
int i
Definition: DBlmapReader.cc:9
std::string name_
Name of this candidate.
bool setMassConstraint_
set mass constraint flag
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:137
int init
Definition: HydjetWrapper.h:63
std::vector< std::string > roles_
std::vector< cand::parser::ConjInfo > labels_
label vector
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
unsigned int size_type
Definition: View.h:85
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
tuple out
Definition: dbtoconf.py:99
bool setLongLived_
set long lived flag
::NamedCandCombiner< Selector, PairSelector, Cloner, Setup > combiner_
combiner utility

Member Data Documentation

template<typename Selector , typename PairSelector = AnyPairSelector, typename Cloner = ::combiner::helpers::NormalClone, typename Setup = AddFourMomenta, typename Init = typename ::reco::modules::EventSetupInit<Setup>::type>
::NamedCandCombiner<Selector, PairSelector, Cloner, Setup> reco::modules::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init >::combiner_
private

combiner utility

Definition at line 161 of file NamedCandCombiner.h.