Go to the documentation of this file.00001 #include "EventFilter/EcalRawToDigi/plugins/EcalRawToRecHitByproductProducer.h"
00002 #include "EventFilter/EcalRawToDigi/interface/EcalUnpackerWorkerRecord.h"
00003 #include "EventFilter/EcalRawToDigi/interface/EcalUnpackerWorker.h"
00004 #include "DataFormats/Common/interface/Handle.h"
00005 #include "DataFormats/Common/interface/LazyGetter.h"
00006 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
00007 #include "DataFormats/EcalRecHit/interface/EcalRecHitComparison.h"
00008 #include "FWCore/Framework/interface/Event.h"
00009
00010
00011 EcalRawToRecHitByproductProducer::EcalRawToRecHitByproductProducer(const edm::ParameterSet& iConfig)
00012 {
00013 workerName_ = iConfig.getParameter<std::string>("workerName");
00014
00015 produces<EBDigiCollection>("ebDigis");
00016 produces<EEDigiCollection>("eeDigis");
00017
00018 produces<EBSrFlagCollection>();
00019 produces<EESrFlagCollection>();
00020 produces<EcalRawDataCollection>();
00021 produces<EcalPnDiodeDigiCollection>();
00022 produces<EcalTrigPrimDigiCollection>("EcalTriggerPrimitives");
00023 produces<EcalPSInputDigiCollection>("EcalPseudoStripInputs");
00024
00025
00026 produces<EBDetIdCollection>("EcalIntegrityGainErrors");
00027 produces<EBDetIdCollection>("EcalIntegrityGainSwitchErrors");
00028 produces<EBDetIdCollection>("EcalIntegrityChIdErrors");
00029
00030
00031 produces<EEDetIdCollection>("EcalIntegrityGainErrors");
00032 produces<EEDetIdCollection>("EcalIntegrityGainSwitchErrors");
00033 produces<EEDetIdCollection>("EcalIntegrityChIdErrors");
00034
00035
00036 produces<EcalElectronicsIdCollection>("EcalIntegrityTTIdErrors");
00037 produces<EcalElectronicsIdCollection>("EcalIntegrityZSXtalIdErrors");
00038 produces<EcalElectronicsIdCollection>("EcalIntegrityBlockSizeErrors");
00039
00040
00041 produces<EcalElectronicsIdCollection>("EcalIntegrityMemTtIdErrors");
00042 produces<EcalElectronicsIdCollection>("EcalIntegrityMemBlockSizeErrors");
00043 produces<EcalElectronicsIdCollection>("EcalIntegrityMemChIdErrors");
00044 produces<EcalElectronicsIdCollection>("EcalIntegrityMemGainErrors");
00045 }
00046
00047
00048
00049 void
00050 EcalRawToRecHitByproductProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
00051 {
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063 edm::Handle<edm::LazyGetter<EcalRecHit> > lgetter;
00064 iEvent.getByLabel("hltEcalRawToRecHitFacility", lgetter);
00065
00066
00067 edm::ESHandle<EcalUnpackerWorkerBase> workerESH;
00068 iSetup.get<EcalUnpackerWorkerRecord>().get(workerName_, workerESH);
00069 const EcalUnpackerWorker * worker = dynamic_cast<const EcalUnpackerWorker *>(&*workerESH);
00070 if (!worker)
00071 edm::LogError("IncorrectConfiguration")<<"worker "<< workerName_ <<" could not be cast in EcalUnpackerWorker type."
00072 <<" this must be a configuration mistake. Expect a segfault right now.";
00073
00074 LogDebug("EcalRawToRecHit|Byproducts")<<"worker retrieved.";
00075
00076
00077 std::auto_ptr<EBDigiCollection> productDigisEB(worker->productDigisEB);
00078
00079
00080 std::auto_ptr<EEDigiCollection> productDigisEE(worker->productDigisEE);
00081
00082
00083 std::auto_ptr<EcalRawDataCollection> productDccHeaders(worker->productDccHeaders);
00084
00085
00086 std::auto_ptr< EBDetIdCollection> productInvalidGains(worker->productInvalidGains);
00087
00088
00089 std::auto_ptr< EBDetIdCollection> productInvalidGainsSwitch(worker->productInvalidGainsSwitch);
00090
00091
00092 std::auto_ptr< EBDetIdCollection> productInvalidChIds(worker->productInvalidChIds);
00093
00095
00096
00097 std::auto_ptr<EEDetIdCollection> productInvalidEEGains(worker->productInvalidEEGains);
00098
00099
00100 std::auto_ptr<EEDetIdCollection> productInvalidEEGainsSwitch(worker->productInvalidEEGainsSwitch);
00101
00102
00103 std::auto_ptr<EEDetIdCollection> productInvalidEEChIds(worker->productInvalidEEChIds);
00104
00106
00107
00108 std::auto_ptr<EBSrFlagCollection> productEBSrFlags(worker->productEBSrFlags);
00109
00110
00111 std::auto_ptr<EESrFlagCollection> productEESrFlags(worker->productEESrFlags);
00112
00113
00114 std::auto_ptr<EcalTrigPrimDigiCollection> productEcalTps(worker->productTps);
00115
00116
00117 std::auto_ptr<EcalPSInputDigiCollection> productEcalPSs(worker->productPSs);
00118
00120
00121
00122 std::auto_ptr<EcalElectronicsIdCollection> productInvalidTTIds(worker->productInvalidTTIds);
00123
00124
00125 std::auto_ptr<EcalElectronicsIdCollection> productInvalidZSXtalIds(worker->productInvalidZSXtalIds);
00126
00127
00128 std::auto_ptr<EcalElectronicsIdCollection> productInvalidBlockLengths(worker->productInvalidBlockLengths);
00129
00130
00131
00132 std::auto_ptr<EcalPnDiodeDigiCollection> productPnDiodeDigis(worker->productPnDiodeDigis);
00133
00134
00135 std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemTtIds(worker->productInvalidMemTtIds);
00136
00137
00138 std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemBlockSizes(worker->productInvalidMemBlockSizes);
00139
00140
00141 std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemChIds(worker->productInvalidMemChIds);
00142
00143
00144 std::auto_ptr<EcalElectronicsIdCollection> productInvalidMemGains(worker->productInvalidMemGains);
00145
00146
00147
00148
00149
00150
00151 iEvent.put(productDigisEB,"ebDigis");
00152 iEvent.put(productDigisEE,"eeDigis");
00153 iEvent.put(productDccHeaders);
00154 iEvent.put(productInvalidGains,"EcalIntegrityGainErrors");
00155 iEvent.put(productInvalidGainsSwitch, "EcalIntegrityGainSwitchErrors");
00156 iEvent.put(productInvalidChIds, "EcalIntegrityChIdErrors");
00157
00158 iEvent.put(productInvalidEEGains,"EcalIntegrityGainErrors");
00159 iEvent.put(productInvalidEEGainsSwitch, "EcalIntegrityGainSwitchErrors");
00160 iEvent.put(productInvalidEEChIds, "EcalIntegrityChIdErrors");
00161
00162 iEvent.put(productInvalidTTIds,"EcalIntegrityTTIdErrors");
00163 iEvent.put(productInvalidZSXtalIds,"EcalIntegrityZSXtalIdErrors");
00164 iEvent.put(productInvalidBlockLengths,"EcalIntegrityBlockSizeErrors");
00165 iEvent.put(productPnDiodeDigis);
00166
00167 iEvent.put(productInvalidMemTtIds,"EcalIntegrityMemTtIdErrors");
00168 iEvent.put(productInvalidMemBlockSizes,"EcalIntegrityMemBlockSizeErrors");
00169 iEvent.put(productInvalidMemChIds,"EcalIntegrityMemChIdErrors");
00170 iEvent.put(productInvalidMemGains,"EcalIntegrityMemGainErrors");
00171
00172
00173 iEvent.put(productEBSrFlags);
00174 iEvent.put(productEESrFlags);
00175
00176
00177 iEvent.put(productEcalTps,"EcalTriggerPrimitives");
00178 iEvent.put(productEcalPSs,"EcalPseudoStripInputs");
00179
00180
00181 worker->update(iEvent);
00182 }