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
ESRecHitsMerger Class Reference

#include <ESRecHitsMerger.h>

Inheritance diagram for ESRecHitsMerger:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginJob (void)
 
void endJob (void)
 
 ESRecHitsMerger (const edm::ParameterSet &pset)
 
void produce (edm::Event &e, const edm::EventSetup &c)
 
virtual ~ESRecHitsMerger ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 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 (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

bool debug_
 
edm::InputTag EgammaSourceES_
 
edm::InputTag EtaSourceES_
 
std::string InputRecHitES_
 
edm::InputTag JetsSourceES_
 
edm::InputTag MuonsSourceES_
 
std::string OutputLabelES_
 
edm::InputTag Pi0SourceES_
 
edm::InputTag RestSourceES_
 
edm::InputTag TausSourceES_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 21 of file ESRecHitsMerger.h.

Constructor & Destructor Documentation

ESRecHitsMerger::ESRecHitsMerger ( const edm::ParameterSet pset)

Definition at line 19 of file ESRecHitsMerger.cc.

References edm::ParameterSet::getUntrackedParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

19  {
20 
21  debug_ = pset.getUntrackedParameter<bool>("debug");
22 
23  EgammaSourceES_ = pset.getUntrackedParameter<edm::InputTag>("EgammaSource_ES",edm::InputTag("dummyEgamma"));
24  MuonsSourceES_ = pset.getUntrackedParameter<edm::InputTag>("MuonsSource_ES",edm::InputTag("dummyMuons"));
25  TausSourceES_ = pset.getUntrackedParameter<edm::InputTag>("TausSource_ES",edm::InputTag("dummyTaus"));
26  JetsSourceES_ = pset.getUntrackedParameter<edm::InputTag>("JetsSource_ES",edm::InputTag("dummyJets"));
27  RestSourceES_ = pset.getUntrackedParameter<edm::InputTag>("RestSource_ES",edm::InputTag("dummyRest"));
28  Pi0SourceES_ = pset.getUntrackedParameter<edm::InputTag>("Pi0Source_ES",edm::InputTag("dummyPi0"));
29  EtaSourceES_ = pset.getUntrackedParameter<edm::InputTag>("EtaSource_ES",edm::InputTag("dummyEta"));
30 
31  OutputLabelES_ = pset.getUntrackedParameter<std::string>("OutputLabel_ES");
32  InputRecHitES_ = pset.getUntrackedParameter<std::string>("EcalRecHitCollectionES");
33 
34  consumesMany<ESRecHitCollection>();
35  produces<EcalRecHitCollection>(OutputLabelES_);
36 
37 }
T getUntrackedParameter(std::string const &, T const &) const
std::string InputRecHitES_
edm::InputTag MuonsSourceES_
edm::InputTag TausSourceES_
edm::InputTag RestSourceES_
std::string OutputLabelES_
edm::InputTag Pi0SourceES_
edm::InputTag EgammaSourceES_
edm::InputTag EtaSourceES_
edm::InputTag JetsSourceES_
ESRecHitsMerger::~ESRecHitsMerger ( )
virtual

Definition at line 57 of file ESRecHitsMerger.cc.

57  {
58 }

Member Function Documentation

void ESRecHitsMerger::beginJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 61 of file ESRecHitsMerger.cc.

61  {
62 }
void ESRecHitsMerger::endJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 64 of file ESRecHitsMerger.cc.

64  {
65 }
void ESRecHitsMerger::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 39 of file ESRecHitsMerger.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and AlCaHLTBitMon_QueryRunRegistry::string.

39  {
40 
42  desc.add<bool>("debug", false);
43  desc.add<edm::InputTag>("EgammaSource_ES", edm::InputTag("dummyEgamma"));
44  desc.add<edm::InputTag>("MuonsSource_ES",edm::InputTag("dummyMuons"));
45  desc.add<edm::InputTag>("TausSource_ES",edm::InputTag("dummyTaus"));
46  desc.add<edm::InputTag>("JetsSource_ES",edm::InputTag("dummyJets"));
47  desc.add<edm::InputTag>("RestSource_ES",edm::InputTag("dummyRest"));
48  desc.add<edm::InputTag>("Pi0Source_ES",edm::InputTag("dummyPi0"));
49  desc.add<edm::InputTag>("EtaSource_ES",edm::InputTag("dummyEta"));
50  desc.add<std::string>("OutputLabel_ES", "EcalRecHitsES");
51  desc.add<std::string>("EcalRecHitCollectionES", "EcalRecHitsES");
52  descriptions.add("hltESRecHitsMerger", desc);
53 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void ESRecHitsMerger::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDProducer.

Definition at line 67 of file ESRecHitsMerger.cc.

References begin, gather_cfg::cout, edm::EventID::event(), edm::Event::getManyByType(), i, edm::EventBase::id(), instance, edm::Event::put(), edm::EventID::run(), findQualityFiles::size, and AlCaHLTBitMon_QueryRunRegistry::string.

67  {
68 
69  if (debug_) std::cout << " ESRecHitMerger : Run " << e.id().run() << " Event " << e.id().event() << std::endl;
70 
71 
72  std::vector< edm::Handle<ESRecHitCollection> > EcalRecHits_done;
73  e.getManyByType(EcalRecHits_done);
74 
75  std::auto_ptr<EcalRecHitCollection> ESMergedRecHits(new EcalRecHitCollection);
76 
77 
78  unsigned int nColl = EcalRecHits_done.size();
79 
80  int nES = 0;
81 
82 
83  for (unsigned int i=0; i < nColl; i++) {
84 
85  std::string instance = EcalRecHits_done[i].provenance()->productInstanceName();
86  std::string module_label = EcalRecHits_done[i].provenance()->moduleLabel();
87 
88 
89  if (debug_){
90  std::cout<<"ESrechit to be merged from "<<module_label.c_str()<<" "<<instance.c_str()<<std::endl;
91  }
92 
93  if ( module_label != EgammaSourceES_.label() &&
94  module_label != MuonsSourceES_.label() &&
95  module_label != JetsSourceES_.label() &&
96  module_label != TausSourceES_.label() &&
97  module_label != RestSourceES_.label() &&
98  module_label != Pi0SourceES_.label() &&
99  module_label != EtaSourceES_.label()) continue;
100 
101  if (instance == InputRecHitES_) {
102  nES += EcalRecHits_done[i] -> size();
103  }
104 
105  }
106 
107 
108  ESMergedRecHits -> reserve(nES);
109 
110  if (debug_) std::cout << " Number of ES Rechits to merge = " << nES << std::endl;
111 
112  for (unsigned int i=0; i < nColl; i++) {
113  std::string instance = EcalRecHits_done[i].provenance()->productInstanceName();
114 
115  std::string module_label = EcalRecHits_done[i].provenance()->moduleLabel();
116  if ( module_label != EgammaSourceES_.label() &&
117  module_label != MuonsSourceES_.label() &&
118  module_label != JetsSourceES_.label() &&
119  module_label != TausSourceES_.label() &&
120  module_label != RestSourceES_.label() &&
121  module_label != Pi0SourceES_.label() &&
122  module_label != EtaSourceES_.label() ) continue;
123 
124  if (instance == InputRecHitES_) {
125  for (EcalRecHitCollection::const_iterator it=EcalRecHits_done[i]->begin(); it !=EcalRecHits_done[i]->end(); it++) {
126  ESMergedRecHits -> push_back(*it);
127  }
128  }
129 
130  }
131 
132 
133  // std::cout << " avant le put " << std::endl;
134  e.put(ESMergedRecHits,OutputLabelES_);
135  // std::cout << " apres le put " << std::endl;
136 
137 }
RunNumber_t run() const
Definition: EventID.h:39
void getManyByType(std::vector< Handle< PROD > > &results) const
Definition: Event.h:436
EventNumber_t event() const
Definition: EventID.h:41
int i
Definition: DBlmapReader.cc:9
std::string InputRecHitES_
static PFTauRenderPlugin instance
edm::InputTag MuonsSourceES_
std::vector< EcalRecHit >::const_iterator const_iterator
edm::InputTag TausSourceES_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
edm::InputTag RestSourceES_
std::string OutputLabelES_
edm::InputTag Pi0SourceES_
std::string const & label() const
Definition: InputTag.h:42
edm::EventID id() const
Definition: EventBase.h:56
#define begin
Definition: vmac.h:30
edm::InputTag EgammaSourceES_
tuple cout
Definition: gather_cfg.py:121
edm::InputTag EtaSourceES_
tuple size
Write out results.
edm::InputTag JetsSourceES_

Member Data Documentation

bool ESRecHitsMerger::debug_
private

Definition at line 44 of file ESRecHitsMerger.h.

edm::InputTag ESRecHitsMerger::EgammaSourceES_
private

Definition at line 32 of file ESRecHitsMerger.h.

edm::InputTag ESRecHitsMerger::EtaSourceES_
private

Definition at line 38 of file ESRecHitsMerger.h.

std::string ESRecHitsMerger::InputRecHitES_
private

Definition at line 41 of file ESRecHitsMerger.h.

edm::InputTag ESRecHitsMerger::JetsSourceES_
private

Definition at line 35 of file ESRecHitsMerger.h.

edm::InputTag ESRecHitsMerger::MuonsSourceES_
private

Definition at line 33 of file ESRecHitsMerger.h.

std::string ESRecHitsMerger::OutputLabelES_
private

Definition at line 39 of file ESRecHitsMerger.h.

edm::InputTag ESRecHitsMerger::Pi0SourceES_
private

Definition at line 37 of file ESRecHitsMerger.h.

edm::InputTag ESRecHitsMerger::RestSourceES_
private

Definition at line 36 of file ESRecHitsMerger.h.

edm::InputTag ESRecHitsMerger::TausSourceES_
private

Definition at line 34 of file ESRecHitsMerger.h.