CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HFRecoEcalCandidateProducer Class Reference

#include <HFRecoEcalCandidateProducer.h>

Inheritance diagram for HFRecoEcalCandidateProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HFRecoEcalCandidateProducer (edm::ParameterSet const &conf)
 
virtual void produce (edm::Event &e, edm::EventSetup const &iSetup)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

HFRecoEcalCandidateAlgo algo_
 
double Cut2D_
 
std::vector< double > defaultDB_
 
double defaultSlope2D_
 
bool doPU_
 
edm::EDGetToken hfclustersHFEM_
 
edm::EDGetToken hfclustersSC_
 
std::vector< double > HFDBvector_
 
int HFDBversion_
 
reco::HFValueStruct hfvars_
 
edm::EDGetToken vertices_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase 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::stream::EDProducerBase
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

Definition at line 24 of file HFRecoEcalCandidateProducer.h.

Constructor & Destructor Documentation

HFRecoEcalCandidateProducer::HFRecoEcalCandidateProducer ( edm::ParameterSet const &  conf)
explicit

Definition at line 31 of file HFRecoEcalCandidateProducer.cc.

References edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), and vertices_.

31  :
32  defaultDB_(std::vector<double>()),
33  hfclustersSC_(consumes<reco::SuperClusterCollection>(conf.getParameter<edm::InputTag>("hfclusters"))),
34  hfclustersHFEM_(consumes<reco::HFEMClusterShapeAssociationCollection>(conf.getParameter<edm::InputTag>("hfclusters"))),
35 
36  HFDBversion_(conf.existsAs<int>("HFDBversion") ? conf.getParameter<int>("HFDBversion"):99),//do nothing
37  HFDBvector_(conf.existsAs<std::vector<double> >("HFDBvector") ? conf.getParameter<std::vector<double> >("HFDBvector"):defaultDB_),
38  doPU_(false),
39  Cut2D_(conf.getParameter<double>("intercept2DCut")),
40  defaultSlope2D_((Cut2D_<=0.83)?(0.475):((Cut2D_>0.83 && Cut2D_<=0.9)?(0.275):(0.2))),//fix for hlt unable to add slope variable now
42  algo_(conf.existsAs<bool>("Correct") ? conf.getParameter<bool>("Correct") : true,
43  conf.getParameter<double>("e9e25Cut"),
44  conf.getParameter<double>("intercept2DCut"),
45  conf.existsAs<double>("intercept2DSlope") ? conf.getParameter<double>("intercept2DSlope") : defaultSlope2D_,
46  conf.getParameter<std::vector<double> >("e1e9Cut"),
47  conf.getParameter<std::vector<double> >("eCOREe9Cut"),
48  conf.getParameter<std::vector<double> >("eSeLCut"),
49  hfvars_)
50 {
51  if(conf.existsAs<edm::InputTag>("VertexCollection")){
52  vertices_ = consumes<reco::VertexCollection>(conf.getParameter<edm::InputTag>("VertexCollection"));
53  }else vertices_ = consumes<reco::VertexCollection>(edm::InputTag("offlinePrimaryVertices"));
54 
55  produces<reco::RecoEcalCandidateCollection>();
56 
57 }

Member Function Documentation

void HFRecoEcalCandidateProducer::produce ( edm::Event e,
edm::EventSetup const &  iSetup 
)
virtual

Implements edm::stream::EDProducerBase.

Definition at line 59 of file HFRecoEcalCandidateProducer.cc.

References algo_, edm::Event::getByToken(), hfclustersHFEM_, hfclustersSC_, HFDBversion_, primaryVertexFilter_cfi::maxAbsZ, primaryVertexFilter_cfi::maxd0, eostools::move(), HFRecoEcalCandidateAlgo::produce(), edm::Handle< T >::product(), edm::Event::put(), ecalDrivenElectronSeedsParameters_cff::vertices, and vertices_.

59  {
60 
61 
64 
65  e.getByToken(hfclustersSC_,super_clus);
66  e.getByToken(hfclustersHFEM_,hf_assoc);
67 
68  int nvertex = 0;
69  if(HFDBversion_!=99){
71  e.getByToken(vertices_, pvHandle);
72  const reco::VertexCollection & vertices = *pvHandle.product();
73  static const int minNDOF = 4;
74  static const double maxAbsZ = 15.0;
75  static const double maxd0 = 2.0;
76 
77  //count verticies
78 
79  for(reco::VertexCollection::const_iterator vit = vertices.begin(); vit != vertices.end(); ++vit){
80  if(vit->ndof() > minNDOF && ((maxAbsZ <= 0) || fabs(vit->z()) <= maxAbsZ) && ((maxd0 <= 0) || fabs(vit->position().rho()) <= maxd0))
81  nvertex++;
82  }
83  }else{
84  nvertex = 1;
85  }
86 
87 
88 
89  // create return data
90  auto retdata1 = std::make_unique<reco::RecoEcalCandidateCollection>();
91 
92 
93  algo_.produce(super_clus,*hf_assoc,*retdata1,nvertex);
94 
95  e.put(std::move(retdata1));
96 
97 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
T const * product() const
Definition: Handle.h:81
void produce(const edm::Handle< reco::SuperClusterCollection > &SuperClusters, const reco::HFEMClusterShapeAssociationCollection &AssocShapes, reco::RecoEcalCandidateCollection &RecoECand, int nvtx)
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

HFRecoEcalCandidateAlgo HFRecoEcalCandidateProducer::algo_
private

Definition at line 37 of file HFRecoEcalCandidateProducer.h.

Referenced by produce().

double HFRecoEcalCandidateProducer::Cut2D_
private

Definition at line 34 of file HFRecoEcalCandidateProducer.h.

std::vector<double> HFRecoEcalCandidateProducer::defaultDB_
private

Definition at line 29 of file HFRecoEcalCandidateProducer.h.

double HFRecoEcalCandidateProducer::defaultSlope2D_
private

Definition at line 35 of file HFRecoEcalCandidateProducer.h.

bool HFRecoEcalCandidateProducer::doPU_
private

Definition at line 33 of file HFRecoEcalCandidateProducer.h.

edm::EDGetToken HFRecoEcalCandidateProducer::hfclustersHFEM_
private

Definition at line 30 of file HFRecoEcalCandidateProducer.h.

Referenced by produce().

edm::EDGetToken HFRecoEcalCandidateProducer::hfclustersSC_
private

Definition at line 30 of file HFRecoEcalCandidateProducer.h.

Referenced by produce().

std::vector<double> HFRecoEcalCandidateProducer::HFDBvector_
private

Definition at line 32 of file HFRecoEcalCandidateProducer.h.

int HFRecoEcalCandidateProducer::HFDBversion_
private

Definition at line 31 of file HFRecoEcalCandidateProducer.h.

Referenced by produce().

reco::HFValueStruct HFRecoEcalCandidateProducer::hfvars_
private

Definition at line 36 of file HFRecoEcalCandidateProducer.h.

edm::EDGetToken HFRecoEcalCandidateProducer::vertices_
private

Definition at line 30 of file HFRecoEcalCandidateProducer.h.

Referenced by HFRecoEcalCandidateProducer(), and produce().