#include <EventFilter/HcalRawToDigi/plugins/HcalHistogramRawToDigi.h>
Public Member Functions | |
HcalHistogramRawToDigi (const edm::ParameterSet &ps) | |
virtual void | produce (edm::Event &e, const edm::EventSetup &c) |
virtual | ~HcalHistogramRawToDigi () |
Private Attributes | |
edm::InputTag | dataTag_ |
std::vector< int > | fedUnpackList_ |
int | firstFED_ |
HcalUnpacker | unpacker_ |
Definition at line 26 of file HcalHistogramRawToDigi.h.
HcalHistogramRawToDigi::HcalHistogramRawToDigi | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 13 of file HcalHistogramRawToDigi.cc.
References fedUnpackList_, i, and ss.
00013 : 00014 dataTag_(conf.getParameter<edm::InputTag>("InputLabel")), 00015 unpacker_(conf.getUntrackedParameter<int>("HcalFirstFED",FEDNumbering::getHcalFEDIds().first)), 00016 fedUnpackList_(conf.getUntrackedParameter<std::vector<int> >("FEDs")), 00017 firstFED_(conf.getUntrackedParameter<int>("HcalFirstFED",FEDNumbering::getHcalFEDIds().first)) 00018 { 00019 std::ostringstream ss; 00020 for (unsigned int i=0; i<fedUnpackList_.size(); i++) 00021 ss << fedUnpackList_[i] << " "; 00022 edm::LogInfo("HCAL") << "HcalHistogramRawToDigi will unpack FEDs ( " << ss.str() << ")"; 00023 00024 // products produced... 00025 produces<HcalHistogramDigiCollection>(); 00026 }
HcalHistogramRawToDigi::~HcalHistogramRawToDigi | ( | ) | [virtual] |
void HcalHistogramRawToDigi::produce | ( | edm::Event & | e, | |
const edm::EventSetup & | c | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 32 of file HcalHistogramRawToDigi.cc.
References dataTag_, fedUnpackList_, edm::EventSetup::get(), edm::Event::getByLabel(), i, edm::Event::put(), HcalUnpacker::unpack(), and unpacker_.
00033 { 00034 // Step A: Get Inputs 00035 edm::Handle<FEDRawDataCollection> rawraw; 00036 e.getByLabel(dataTag_,rawraw); 00037 // get the mapping 00038 edm::ESHandle<HcalDbService> pSetup; 00039 es.get<HcalDbRecord>().get( pSetup ); 00040 const HcalElectronicsMap* readoutMap=pSetup->getHcalMapping(); 00041 00042 // Step B: Create empty output 00043 std::auto_ptr<HcalHistogramDigiCollection> prod(new HcalHistogramDigiCollection()); 00044 std::vector<HcalHistogramDigi> digis; 00045 00046 // Step C: unpack all requested FEDs 00047 for (std::vector<int>::const_iterator i=fedUnpackList_.begin(); i!=fedUnpackList_.end(); i++) { 00048 const FEDRawData& fed = rawraw->FEDData(*i); 00049 00050 unpacker_.unpack(fed,*readoutMap,digis); 00051 } 00052 00053 // Step B2: encapsulate vectors in actual collections 00054 prod->swap_contents(digis); 00055 00056 // Step D: Put outputs into event 00057 prod->sort(); 00058 e.put(prod); 00059 }
std::vector<int> HcalHistogramRawToDigi::fedUnpackList_ [private] |
Definition at line 35 of file HcalHistogramRawToDigi.h.
Referenced by HcalHistogramRawToDigi(), and produce().
int HcalHistogramRawToDigi::firstFED_ [private] |
Definition at line 36 of file HcalHistogramRawToDigi.h.