CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalRawToRecHitByproductProducer.cc
Go to the documentation of this file.
9 
10 
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 }
46 
47 
48 // ------------ method called to produce the data ------------
49 void
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)
T getParameter(std::string const &) const
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
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
void update(const edm::Event &e) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
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
virtual void produce(edm::Event &, const edm::EventSetup &)
EcalRawToRecHitByproductProducer(const edm::ParameterSet &)
std::auto_ptr< EcalElectronicsIdCollection > productInvalidZSXtalIds
std::auto_ptr< EcalRawDataCollection > productDccHeaders