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

#include <EcalRawToRecHitByproductProducer.h>

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

Public Member Functions

 EcalRawToRecHitByproductProducer (const edm::ParameterSet &)
 
 ~EcalRawToRecHitByproductProducer ()
 
- 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Private Attributes

std::string workerName_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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::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 29 of file EcalRawToRecHitByproductProducer.h.

Constructor & Destructor Documentation

EcalRawToRecHitByproductProducer::EcalRawToRecHitByproductProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 11 of file EcalRawToRecHitByproductProducer.cc.

References edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and workerName_.

12 {
13  workerName_ = iConfig.getParameter<std::string>("workerName");
14 
15  produces<EBDigiCollection>("ebDigis");
16  produces<EEDigiCollection>("eeDigis");
17 
18  produces<EBSrFlagCollection>();
19  produces<EESrFlagCollection>();
20  produces<EcalRawDataCollection>();
21  produces<EcalPnDiodeDigiCollection>();
22  produces<EcalTrigPrimDigiCollection>("EcalTriggerPrimitives");
23  produces<EcalPSInputDigiCollection>("EcalPseudoStripInputs");
24 
25  // Integrity for xtal data
26  produces<EBDetIdCollection>("EcalIntegrityGainErrors");
27  produces<EBDetIdCollection>("EcalIntegrityGainSwitchErrors");
28  produces<EBDetIdCollection>("EcalIntegrityChIdErrors");
29 
30  // Integrity for xtal data - EE specific (to be rivisited towards EB+EE common collection)
31  produces<EEDetIdCollection>("EcalIntegrityGainErrors");
32  produces<EEDetIdCollection>("EcalIntegrityGainSwitchErrors");
33  produces<EEDetIdCollection>("EcalIntegrityChIdErrors");
34 
35  // Integrity Errors
36  produces<EcalElectronicsIdCollection>("EcalIntegrityTTIdErrors");
37  produces<EcalElectronicsIdCollection>("EcalIntegrityZSXtalIdErrors");
38  produces<EcalElectronicsIdCollection>("EcalIntegrityBlockSizeErrors");
39 
40  // Mem channels' integrity
41  produces<EcalElectronicsIdCollection>("EcalIntegrityMemTtIdErrors");
42  produces<EcalElectronicsIdCollection>("EcalIntegrityMemBlockSizeErrors");
43  produces<EcalElectronicsIdCollection>("EcalIntegrityMemChIdErrors");
44  produces<EcalElectronicsIdCollection>("EcalIntegrityMemGainErrors");
45 }
T getParameter(std::string const &) const
EcalRawToRecHitByproductProducer::~EcalRawToRecHitByproductProducer ( )
inline

Definition at line 32 of file EcalRawToRecHitByproductProducer.h.

32 {};

Member Function Documentation

void EcalRawToRecHitByproductProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 50 of file EcalRawToRecHitByproductProducer.cc.

References edm::EventSetup::get(), edm::Event::getByLabel(), LogDebug, EcalUnpackerWorker::productDccHeaders, EcalUnpackerWorker::productDigisEB, EcalUnpackerWorker::productDigisEE, EcalUnpackerWorker::productEBSrFlags, EcalUnpackerWorker::productEESrFlags, EcalUnpackerWorker::productInvalidBlockLengths, EcalUnpackerWorker::productInvalidChIds, EcalUnpackerWorker::productInvalidEEChIds, EcalUnpackerWorker::productInvalidEEGains, EcalUnpackerWorker::productInvalidEEGainsSwitch, EcalUnpackerWorker::productInvalidGains, EcalUnpackerWorker::productInvalidGainsSwitch, EcalUnpackerWorker::productInvalidMemBlockSizes, EcalUnpackerWorker::productInvalidMemChIds, EcalUnpackerWorker::productInvalidMemGains, EcalUnpackerWorker::productInvalidMemTtIds, EcalUnpackerWorker::productInvalidTTIds, EcalUnpackerWorker::productInvalidZSXtalIds, EcalUnpackerWorker::productPnDiodeDigis, EcalUnpackerWorker::productPSs, EcalUnpackerWorker::productTps, edm::Event::put(), EcalUnpackerWorker::update(), and workerName_.

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

51 {
52  // The next two lines are a temporary fix so that this
53  // module will run without a fatal exception in unscheduled
54  // mode. In scheduled mode, these two lines should have no
55  // effect, but in unscheduled mode this will ensure the module
56  // that creates the objects this module puts into the Event
57  // is executed before this module. This does NOT ensure the
58  // objects are properly filled. The plan is that this part
59  // of the code will be completely rewritten in the near future.
60  // In this rewrite the EcalUnpackerWorker will no longer be
61  // written to either the Event or EventSetup and this problem
62  // will be resolved in a permanent manner.
64  iEvent.getByLabel("hltEcalRawToRecHitFacility", lgetter);
65 
66  //retrieve the unpacker worker
68  iSetup.get<EcalUnpackerWorkerRecord>().get(workerName_, workerESH);
69  const EcalUnpackerWorker * worker = dynamic_cast<const EcalUnpackerWorker *>(&*workerESH);
70  if (!worker)
71  edm::LogError("IncorrectConfiguration")<<"worker "<< workerName_ <<" could not be cast in EcalUnpackerWorker type."
72  <<" this must be a configuration mistake. Expect a segfault right now.";
73 
74  LogDebug("EcalRawToRecHit|Byproducts")<<"worker retrieved.";
75 
76  //prepare output collections
77  std::auto_ptr<EBDigiCollection> productDigisEB(worker->productDigisEB);
78 
79  // create the collection of Ecal Digis
80  std::auto_ptr<EEDigiCollection> productDigisEE(worker->productDigisEE);
81 
82  // create the collection for headers
83  std::auto_ptr<EcalRawDataCollection> productDccHeaders(worker->productDccHeaders);
84 
85  // create the collection for invalid gains
86  std::auto_ptr< EBDetIdCollection> productInvalidGains(worker->productInvalidGains);
87 
88  // create the collection for invalid gain Switch
89  std::auto_ptr< EBDetIdCollection> productInvalidGainsSwitch(worker->productInvalidGainsSwitch);
90 
91  // create the collection for invalid chids
92  std::auto_ptr< EBDetIdCollection> productInvalidChIds(worker->productInvalidChIds);
93 
95 
96  // create the collection for invalid gains
97  std::auto_ptr<EEDetIdCollection> productInvalidEEGains(worker->productInvalidEEGains);
98 
99  // create the collection for invalid gain Switch
100  std::auto_ptr<EEDetIdCollection> productInvalidEEGainsSwitch(worker->productInvalidEEGainsSwitch);
101 
102  // create the collection for invalid chids
103  std::auto_ptr<EEDetIdCollection> productInvalidEEChIds(worker->productInvalidEEChIds);
104 
106 
107  // create the collection for EB srflags
108  std::auto_ptr<EBSrFlagCollection> productEBSrFlags(worker->productEBSrFlags);
109 
110  // create the collection for EB srflags
111  std::auto_ptr<EESrFlagCollection> productEESrFlags(worker->productEESrFlags);
112 
113  // create the collection for ecal trigger primitives
114  std::auto_ptr<EcalTrigPrimDigiCollection> productEcalTps(worker->productTps);
115 
116  // create the collection for ecal trigger primitives
117  std::auto_ptr<EcalPSInputDigiCollection> productEcalPSs(worker->productPSs);
118 
120 
121  // create the collection for invalid TTIds
122  std::auto_ptr<EcalElectronicsIdCollection> productInvalidTTIds(worker->productInvalidTTIds);
123 
124  // create the collection for invalid XtalIds
125  std::auto_ptr<EcalElectronicsIdCollection> productInvalidZSXtalIds(worker->productInvalidZSXtalIds);
126 
127  // create the collection for invalid BlockLengths
128  std::auto_ptr<EcalElectronicsIdCollection> productInvalidBlockLengths(worker->productInvalidBlockLengths);
129 
130  // MEMs Collections
131  // create the collection for the Pn Diode Digis
132  std::auto_ptr<EcalPnDiodeDigiCollection> productPnDiodeDigis(worker->productPnDiodeDigis);
133 
134  // create the collection for invalid Mem Tt id
135  std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemTtIds(worker->productInvalidMemTtIds);
136 
137  // create the collection for invalid Mem Block Size
138  std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemBlockSizes(worker->productInvalidMemBlockSizes);
139 
140  // create the collection for invalid Mem Block Size
141  std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemChIds(worker->productInvalidMemChIds);
142 
143  // create the collection for invalid Mem Gain Errors
144  std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemGains(worker->productInvalidMemGains);
145 
146 
147  //---------------------------
148  //write outputs to the event
149  //---------------------------
150 
151  iEvent.put(productDigisEB,"ebDigis");
152  iEvent.put(productDigisEE,"eeDigis");
153  iEvent.put(productDccHeaders);
154  iEvent.put(productInvalidGains,"EcalIntegrityGainErrors");
155  iEvent.put(productInvalidGainsSwitch, "EcalIntegrityGainSwitchErrors");
156  iEvent.put(productInvalidChIds, "EcalIntegrityChIdErrors");
157  // EE (leaving for now the same names as in EB)
158  iEvent.put(productInvalidEEGains,"EcalIntegrityGainErrors");
159  iEvent.put(productInvalidEEGainsSwitch, "EcalIntegrityGainSwitchErrors");
160  iEvent.put(productInvalidEEChIds, "EcalIntegrityChIdErrors");
161  // EE
162  iEvent.put(productInvalidTTIds,"EcalIntegrityTTIdErrors");
163  iEvent.put(productInvalidZSXtalIds,"EcalIntegrityZSXtalIdErrors");
164  iEvent.put(productInvalidBlockLengths,"EcalIntegrityBlockSizeErrors");
165  iEvent.put(productPnDiodeDigis);
166  // errors
167  iEvent.put(productInvalidMemTtIds,"EcalIntegrityMemTtIdErrors");
168  iEvent.put(productInvalidMemBlockSizes,"EcalIntegrityMemBlockSizeErrors");
169  iEvent.put(productInvalidMemChIds,"EcalIntegrityMemChIdErrors");
170  iEvent.put(productInvalidMemGains,"EcalIntegrityMemGainErrors");
171 
172  // flags
173  iEvent.put(productEBSrFlags);
174  iEvent.put(productEESrFlags);
175 
176  // trigger primitives
177  iEvent.put(productEcalTps,"EcalTriggerPrimitives");
178  iEvent.put(productEcalPSs,"EcalPseudoStripInputs");
179 
180  //make new collections.
181  worker->update(iEvent);
182 }
#define LogDebug(id)
std::auto_ptr< EEDetIdCollection > productInvalidEEGainsSwitch
std::auto_ptr< EcalTrigPrimDigiCollection > productTps
std::auto_ptr< EcalPSInputDigiCollection > productPSs
std::auto_ptr< EcalElectronicsIdCollection > productInvalidBlockLengths
std::auto_ptr< EcalPnDiodeDigiCollection > productPnDiodeDigis
std::auto_ptr< EEDetIdCollection > productInvalidEEGains
std::auto_ptr< EBSrFlagCollection > productEBSrFlags
std::auto_ptr< EESrFlagCollection > productEESrFlags
std::auto_ptr< EBDetIdCollection > productInvalidChIds
std::auto_ptr< EEDigiCollection > productDigisEE
std::auto_ptr< EcalElectronicsIdCollection > productInvalidMemTtIds
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
void update(const edm::Event &e) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
std::auto_ptr< EBDetIdCollection > productInvalidGainsSwitch
std::auto_ptr< EBDigiCollection > productDigisEB
std::auto_ptr< EBDetIdCollection > productInvalidGains
const T & get() const
Definition: EventSetup.h:55
std::auto_ptr< EcalElectronicsIdCollection > productInvalidMemBlockSizes
std::auto_ptr< EEDetIdCollection > productInvalidEEChIds
std::auto_ptr< EcalElectronicsIdCollection > productInvalidMemGains
std::auto_ptr< EcalElectronicsIdCollection > productInvalidTTIds
std::auto_ptr< EcalElectronicsIdCollection > productInvalidMemChIds
std::auto_ptr< EcalElectronicsIdCollection > productInvalidZSXtalIds
std::auto_ptr< EcalRawDataCollection > productDccHeaders

Member Data Documentation

std::string EcalRawToRecHitByproductProducer::workerName_
private

Definition at line 37 of file EcalRawToRecHitByproductProducer.h.

Referenced by EcalRawToRecHitByproductProducer(), and produce().