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
HGCalRecHitProducer Class Reference
Inheritance diagram for HGCalRecHitProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

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

Private Attributes

const std::string eeRechitCollection_
 
const edm::EDGetTokenT
< HGCeeUncalibratedRecHitCollection
eeUncalibRecHitCollection_
 
const std::string hebRechitCollection_
 
const edm::EDGetTokenT
< HGChebUncalibratedRecHitCollection
hebUncalibRecHitCollection_
 
const std::string hefRechitCollection_
 
const edm::EDGetTokenT
< HGChefUncalibratedRecHitCollection
hefUncalibRecHitCollection_
 
std::unique_ptr
< HGCalRecHitWorkerBaseClass
worker_
 

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
 
- 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

produce HGCAL rechits from uncalibrated rechits

simplified version of Ecal code

Author
Valeri Andreev (ported to 76X by L. Gray)

Definition at line 28 of file HGCalRecHitProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 47 of file HGCalRecHitProducer.cc.

References beamerCreator::create(), eeRechitCollection_, reco::get(), edm::ParameterSet::getParameter(), hebRechitCollection_, hefRechitCollection_, AlCaHLTBitMon_QueryRunRegistry::string, and worker_.

47  :
48  eeUncalibRecHitCollection_( consumes<HGCeeUncalibratedRecHitCollection>( ps.getParameter<edm::InputTag>("HGCEEuncalibRecHitCollection") ) ),
49  hefUncalibRecHitCollection_( consumes<HGChefUncalibratedRecHitCollection>( ps.getParameter<edm::InputTag>("HGCHEFuncalibRecHitCollection") ) ),
50  hebUncalibRecHitCollection_( consumes<HGChebUncalibratedRecHitCollection>( ps.getParameter<edm::InputTag>("HGCHEBuncalibRecHitCollection") ) ),
51  eeRechitCollection_( ps.getParameter<std::string>("HGCEErechitCollection") ),
52  hefRechitCollection_( ps.getParameter<std::string>("HGCHEFrechitCollection") ),
53  hebRechitCollection_( ps.getParameter<std::string>("HGCHEBrechitCollection") ) {
54  produces< HGCeeRecHitCollection >(eeRechitCollection_);
55  produces< HGChefRecHitCollection >(hefRechitCollection_);
56  produces< HGChebRecHitCollection >(hebRechitCollection_);
57 
58  const std::string& componentType = ps.getParameter<std::string>("algo");
59  worker_.reset( HGCalRecHitWorkerFactory::get()->create(componentType, ps) );
60 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< HGChefUncalibratedRecHitCollection > hefUncalibRecHitCollection_
const edm::EDGetTokenT< HGCeeUncalibratedRecHitCollection > eeUncalibRecHitCollection_
const std::string hefRechitCollection_
const std::string eeRechitCollection_
const std::string hebRechitCollection_
std::unique_ptr< HGCalRecHitWorkerBaseClass > worker_
const edm::EDGetTokenT< HGChebUncalibratedRecHitCollection > hebUncalibRecHitCollection_
T get(const Candidate &c)
Definition: component.h:55
HGCalRecHitProducer::~HGCalRecHitProducer ( )

Definition at line 62 of file HGCalRecHitProducer.cc.

62  {
63 }

Member Function Documentation

void HGCalRecHitProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
virtual

Implements edm::stream::EDProducerBase.

Definition at line 66 of file HGCalRecHitProducer.cc.

References eeRechitCollection_, eeUncalibRecHitCollection_, edm::Event::getByToken(), hebRechitCollection_, hebUncalibRecHitCollection_, hefRechitCollection_, hefUncalibRecHitCollection_, edm::Event::put(), and worker_.

66  {
67  using namespace edm;
68 
72 
73  const HGCeeUncalibratedRecHitCollection* eeUncalibRecHits = 0;
74  const HGChefUncalibratedRecHitCollection* hefUncalibRecHits = 0;
75  const HGChebUncalibratedRecHitCollection* hebUncalibRecHits = 0;
76 
77  // get the HGC uncalib rechit collection
78  evt.getByToken( eeUncalibRecHitCollection_, pHGCeeUncalibRecHits);
79  eeUncalibRecHits = pHGCeeUncalibRecHits.product();
80 
81  evt.getByToken( hefUncalibRecHitCollection_, pHGChefUncalibRecHits);
82  hefUncalibRecHits = pHGChefUncalibRecHits.product();
83 
84  evt.getByToken( hebUncalibRecHitCollection_, pHGChebUncalibRecHits);
85  hebUncalibRecHits = pHGChebUncalibRecHits.product();
86 
87  // collection of rechits to put in the event
88  std::auto_ptr< HGCeeRecHitCollection > eeRecHits( new HGCeeRecHitCollection );
89  std::auto_ptr< HGChefRecHitCollection > hefRecHits( new HGChefRecHitCollection );
90  std::auto_ptr< HGChebRecHitCollection > hebRecHits( new HGChebRecHitCollection );
91 
92  worker_->set(es);
93 
94  // loop over uncalibrated rechits to make calibrated ones
95  for(auto it = eeUncalibRecHits->begin(); it != eeUncalibRecHits->end(); ++it) {
96  worker_->run(evt, *it, *eeRecHits);
97  }
98 
99  // loop over uncalibrated rechits to make calibrated ones
100  for(auto it = hefUncalibRecHits->begin(); it != hefUncalibRecHits->end(); ++it) {
101  worker_->run(evt, *it, *hefRecHits);
102  }
103 
104  // loop over uncalibrated rechits to make calibrated ones
105  for(auto it = hebUncalibRecHits->begin(); it != hebUncalibRecHits->end(); ++it) {
106  worker_->run(evt, *it, *hebRecHits);
107  }
108 
109  // sort collections before attempting recovery, to avoid insertion of double recHits
110  eeRecHits->sort();
111  hefRecHits->sort();
112  hebRecHits->sort();
113 
114  // put the collection of recunstructed hits in the event
115  LogInfo("HGCalRecHitInfo") << "total # HGCee calibrated rechits: " << eeRecHits->size();
116  LogInfo("HGCalRecHitInfo") << "total # HGChef calibrated rechits: " << hefRecHits->size();
117  LogInfo("HGCalRecHitInfo") << "total # HGCheb calibrated rechits: " << hebRecHits->size();
118 
119  evt.put( eeRecHits, eeRechitCollection_ );
120  evt.put( hefRecHits, hefRechitCollection_ );
121  evt.put( hebRecHits, hebRechitCollection_ );
122 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
const edm::EDGetTokenT< HGChefUncalibratedRecHitCollection > hefUncalibRecHitCollection_
const edm::EDGetTokenT< HGCeeUncalibratedRecHitCollection > eeUncalibRecHitCollection_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
const std::string hefRechitCollection_
const std::string eeRechitCollection_
const std::string hebRechitCollection_
std::unique_ptr< HGCalRecHitWorkerBaseClass > worker_
const edm::EDGetTokenT< HGChebUncalibratedRecHitCollection > hebUncalibRecHitCollection_

Member Data Documentation

const std::string HGCalRecHitProducer::eeRechitCollection_
private

Definition at line 40 of file HGCalRecHitProducer.cc.

Referenced by HGCalRecHitProducer(), and produce().

const edm::EDGetTokenT<HGCeeUncalibratedRecHitCollection> HGCalRecHitProducer::eeUncalibRecHitCollection_
private

Definition at line 37 of file HGCalRecHitProducer.cc.

Referenced by produce().

const std::string HGCalRecHitProducer::hebRechitCollection_
private

Definition at line 42 of file HGCalRecHitProducer.cc.

Referenced by HGCalRecHitProducer(), and produce().

const edm::EDGetTokenT<HGChebUncalibratedRecHitCollection> HGCalRecHitProducer::hebUncalibRecHitCollection_
private

Definition at line 39 of file HGCalRecHitProducer.cc.

Referenced by produce().

const std::string HGCalRecHitProducer::hefRechitCollection_
private

Definition at line 41 of file HGCalRecHitProducer.cc.

Referenced by HGCalRecHitProducer(), and produce().

const edm::EDGetTokenT<HGChefUncalibratedRecHitCollection> HGCalRecHitProducer::hefUncalibRecHitCollection_
private

Definition at line 38 of file HGCalRecHitProducer.cc.

Referenced by produce().

std::unique_ptr<HGCalRecHitWorkerBaseClass> HGCalRecHitProducer::worker_
private

Definition at line 44 of file HGCalRecHitProducer.cc.

Referenced by HGCalRecHitProducer(), and produce().