CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
EcalUncalibRecHitProducer Class Reference

#include <EcalUncalibRecHitProducer.h>

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

Public Member Functions

 EcalUncalibRecHitProducer (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &evt, const edm::EventSetup &es) override
 
 ~EcalUncalibRecHitProducer ()
 
- 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)
 
 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 ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT
< EBDigiCollection
ebDigiCollectionToken_
 
std::string ebHitCollection_
 
edm::EDGetTokenT
< EEDigiCollection
eeDigiCollectionToken_
 
std::string eeHitCollection_
 
EcalUncalibRecHitWorkerBaseClassworker_
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
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
 
- 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 18 of file EcalUncalibRecHitProducer.h.

Constructor & Destructor Documentation

EcalUncalibRecHitProducer::EcalUncalibRecHitProducer ( const edm::ParameterSet ps)
explicit

Definition at line 22 of file EcalUncalibRecHitProducer.cc.

References EnergyCorrector::c, edm::EDConsumerBase::consumesCollector(), ebDigiCollectionToken_, ebHitCollection_, eeDigiCollectionToken_, eeHitCollection_, reco::get(), edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and worker_.

23 {
24  ebHitCollection_ = ps.getParameter<std::string>("EBhitCollection");
25  eeHitCollection_ = ps.getParameter<std::string>("EEhitCollection");
26  produces< EBUncalibratedRecHitCollection >(ebHitCollection_);
27  produces< EEUncalibratedRecHitCollection >(eeHitCollection_);
28 
29  ebDigiCollectionToken_ = consumes<EBDigiCollection>(ps.getParameter<edm::InputTag>("EBdigiCollection"));
30 
31  eeDigiCollectionToken_ = consumes<EEDigiCollection>(ps.getParameter<edm::InputTag>("EEdigiCollection"));
32 
33  std::string componentType = ps.getParameter<std::string>("algo");
34  edm::ParameterSet algoConf = ps.getParameter<edm::ParameterSet>("algoPSet");
35 
37  worker_ = EcalUncalibRecHitWorkerFactory::get()->create(componentType, algoConf, c);
38 }
T getParameter(std::string const &) const
edm::EDGetTokenT< EEDigiCollection > eeDigiCollectionToken_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
EcalUncalibRecHitWorkerBaseClass * worker_
edm::EDGetTokenT< EBDigiCollection > ebDigiCollectionToken_
T get(const Candidate &c)
Definition: component.h:55
EcalUncalibRecHitProducer::~EcalUncalibRecHitProducer ( )

Definition at line 40 of file EcalUncalibRecHitProducer.cc.

References worker_.

41 {
42  delete worker_;
43 }
EcalUncalibRecHitWorkerBaseClass * worker_

Member Function Documentation

void EcalUncalibRecHitProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 45 of file EcalUncalibRecHitProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), assert(), SurfaceDeformationFactory::create(), reco::get(), edm::ParameterSetDescription::ifValue(), benchmark_cfg::infos, HLT_FULL_cff::InputTag, or, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

45  {
46 
48  std::vector<edmplugin::PluginInfo> infos = factory->available();
49 
50  {
52  desc.add<edm::InputTag>("EBdigiCollection", edm::InputTag("ecalDigis","ebDigis"));
53  desc.add<std::string>("EEhitCollection", "EcalUncalibRecHitsEE");
54  desc.add<edm::InputTag>("EEdigiCollection", edm::InputTag("ecalDigis","eeDigis"));
55  desc.add<std::string>("EBhitCollection", "EcalUncalibRecHitsEB");
56 
57  auto itInfos = infos.begin();
58  assert(itInfos != infos.end());
59 
60  std::auto_ptr<edm::ParameterDescriptionCases<std::string>> s;
61  {
62  s = itInfos->name_ >> edm::ParameterDescription<edm::ParameterSetDescription>("algoPSet", EcalUncalibRecHitFillDescriptionWorkerFactory::get()->create(itInfos->name_)->getAlgoDescription(), true);
63  }
64  for (++itInfos; itInfos != infos.end(); ++itInfos)
65  s = s or itInfos->name_ >> edm::ParameterDescription<edm::ParameterSetDescription>("algoPSet", EcalUncalibRecHitFillDescriptionWorkerFactory::get()->create(itInfos->name_)->getAlgoDescription(), true);
66  desc.ifValue(edm::ParameterDescription<std::string>("algo", "EcalUncalibRecHitWorkerMultiFit", true), s);
67 
68  descriptions.addDefault(desc);
69  }
70 
71  for (std::vector<edmplugin::PluginInfo>::const_iterator itInfos = infos.begin(); itInfos != infos.end(); itInfos++) {
72  std::unique_ptr<EcalUncalibRecHitWorkerBaseClass> fdWorker(EcalUncalibRecHitFillDescriptionWorkerFactory::get()->create(itInfos->name_));
73 
75  desc.add<edm::InputTag>("EBdigiCollection", edm::InputTag("ecalDigis","ebDigis"));
76  desc.add<std::string>("EEhitCollection", "EcalUncalibRecHitsEE");
77  desc.add<edm::InputTag>("EEdigiCollection", edm::InputTag("ecalDigis","eeDigis"));
78  desc.add<std::string>("EBhitCollection", "EcalUncalibRecHitsEB");
79  desc.add<std::string>("algo", itInfos->name_);
80  desc.add<edm::ParameterSetDescription>("algoPSet", fdWorker->getAlgoDescription());
81 
82  std::string algoName = itInfos->name_.substr(itInfos->name_.find("Worker")+6, itInfos->name_.length());
83  descriptions.add("ecal"+algoName+"UncalibRecHit", desc);
84  }
85 }
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
assert(m_qm.get())
void addDefault(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::auto_ptr< ParameterDescriptionCases< T > > cases)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
SurfaceDeformation * create(int type, const std::vector< double > &params)
T get(const Candidate &c)
Definition: component.h:55
void EcalUncalibRecHitProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
overridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 88 of file EcalUncalibRecHitProducer.cc.

References ebDigiCollectionToken_, ebHitCollection_, eeDigiCollectionToken_, eeHitCollection_, edm::Event::getByToken(), edm::Event::put(), EcalUncalibRecHitWorkerBaseClass::run(), EcalUncalibRecHitWorkerBaseClass::set(), and worker_.

88  {
89 
90  using namespace edm;
91 
94 
95  const EBDigiCollection* ebDigis =0;
96  const EEDigiCollection* eeDigis =0;
97 
98 
99  evt.getByToken( ebDigiCollectionToken_, pEBDigis);
100  ebDigis = pEBDigis.product(); // get a ptr to the produc
101  edm::LogInfo("EcalUncalibRecHitInfo") << "total # ebDigis: " << ebDigis->size() ;
102 
103  evt.getByToken( eeDigiCollectionToken_, pEEDigis);
104  eeDigis = pEEDigis.product(); // get a ptr to the product
105  edm::LogInfo("EcalUncalibRecHitInfo") << "total # eeDigis: " << eeDigis->size() ;
106 
107 
108  // tranparently get things from event setup
109  worker_->set(es);
110  worker_->set(evt);
111 
112  // prepare output
113  std::auto_ptr< EBUncalibratedRecHitCollection > ebUncalibRechits( new EBUncalibratedRecHitCollection );
114  std::auto_ptr< EEUncalibratedRecHitCollection > eeUncalibRechits( new EEUncalibratedRecHitCollection );
115 
116  // loop over EB digis
117  if (ebDigis)
118  {
119  ebUncalibRechits->reserve(ebDigis->size());
120  for(EBDigiCollection::const_iterator itdg = ebDigis->begin(); itdg != ebDigis->end(); ++itdg) {
121  worker_->run(evt, itdg, *ebUncalibRechits);
122  }
123  }
124 
125  // loop over EB digis
126  if (eeDigis)
127  {
128  eeUncalibRechits->reserve(eeDigis->size());
129  for(EEDigiCollection::const_iterator itdg = eeDigis->begin(); itdg != eeDigis->end(); ++itdg) {
130  worker_->run(evt, itdg, *eeUncalibRechits);
131  }
132  }
133 
134  // put the collection of recunstructed hits in the event
135  evt.put( ebUncalibRechits, ebHitCollection_ );
136  evt.put( eeUncalibRechits, eeHitCollection_ );
137 }
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
virtual void set(const edm::EventSetup &es)=0
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::EDGetTokenT< EEDigiCollection > eeDigiCollectionToken_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
EcalUncalibRecHitWorkerBaseClass * worker_
virtual bool run(const edm::Event &evt, const EcalDigiCollection::const_iterator &digi, EcalUncalibratedRecHitCollection &result)=0
edm::EDGetTokenT< EBDigiCollection > ebDigiCollectionToken_

Member Data Documentation

edm::EDGetTokenT<EBDigiCollection> EcalUncalibRecHitProducer::ebDigiCollectionToken_
private

Definition at line 28 of file EcalUncalibRecHitProducer.h.

Referenced by EcalUncalibRecHitProducer(), and produce().

std::string EcalUncalibRecHitProducer::ebHitCollection_
private

Definition at line 31 of file EcalUncalibRecHitProducer.h.

Referenced by EcalUncalibRecHitProducer(), and produce().

edm::EDGetTokenT<EEDigiCollection> EcalUncalibRecHitProducer::eeDigiCollectionToken_
private

Definition at line 29 of file EcalUncalibRecHitProducer.h.

Referenced by EcalUncalibRecHitProducer(), and produce().

std::string EcalUncalibRecHitProducer::eeHitCollection_
private

Definition at line 32 of file EcalUncalibRecHitProducer.h.

Referenced by EcalUncalibRecHitProducer(), and produce().

EcalUncalibRecHitWorkerBaseClass* EcalUncalibRecHitProducer::worker_
private