CMS 3D CMS Logo

HcalHistogramRawToDigi.cc
Go to the documentation of this file.
8 #include <iostream>
9 
11  : unpacker_(conf.getUntrackedParameter<int>("HcalFirstFED", FEDNumbering::MINHCALFEDID)),
12  fedUnpackList_(conf.getUntrackedParameter<std::vector<int> >("FEDs")),
13  firstFED_(conf.getUntrackedParameter<int>("HcalFirstFED", FEDNumbering::MINHCALFEDID)) {
14  std::ostringstream ss;
15  for (unsigned int i = 0; i < fedUnpackList_.size(); i++)
16  ss << fedUnpackList_[i] << " ";
17  edm::LogInfo("HCAL") << "HcalHistogramRawToDigi will unpack FEDs ( " << ss.str() << ")";
18 
19  tok_data_ = consumes<FEDRawDataCollection>(conf.getParameter<edm::InputTag>("InputLabel"));
20 
21  // products produced...
22  produces<HcalHistogramDigiCollection>();
23 }
24 
25 // Virtual destructor needed.
27 
28 // Functions that gets called by framework every event
30  // Step A: Get Inputs
32  e.getByToken(tok_data_, rawraw);
33  // get the mapping
35  es.get<HcalDbRecord>().get(pSetup);
36  const HcalElectronicsMap* readoutMap = pSetup->getHcalMapping();
37 
38  // Step B: Create empty output
39  auto prod = std::make_unique<HcalHistogramDigiCollection>();
40  std::vector<HcalHistogramDigi> digis;
41 
42  // Step C: unpack all requested FEDs
43  for (std::vector<int>::const_iterator i = fedUnpackList_.begin(); i != fedUnpackList_.end(); i++) {
44  const FEDRawData& fed = rawraw->FEDData(*i);
45 
46  unpacker_.unpack(fed, *readoutMap, digis);
47  }
48 
49  // Step B2: encapsulate vectors in actual collections
50  prod->swap_contents(digis);
51 
52  // Step D: Put outputs into event
53  prod->sort();
54  e.put(std::move(prod));
55 }
FEDNumbering.h
mps_fire.i
i
Definition: mps_fire.py:355
MessageLogger.h
ESHandle.h
edm::LogInfo
Definition: MessageLogger.h:254
edm::Handle
Definition: AssociativeIterator.h:50
HcalDbService::getHcalMapping
const HcalElectronicsMap * getHcalMapping() const
Definition: HcalDbService.cc:343
FEDRawData
Definition: FEDRawData.h:19
FEDNumbering
Definition: FEDNumbering.h:17
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
HcalHistogramRawToDigi::produce
void produce(edm::Event &e, const edm::EventSetup &c) override
Definition: HcalHistogramRawToDigi.cc:29
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
HcalDigiCollections.h
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
edm::ESHandle< HcalDbService >
HcalUnpacker::unpack
void unpack(const FEDRawData &raw, const HcalElectronicsMap &emap, std::vector< HcalHistogramDigi > &histoDigis)
Definition: HcalUnpacker.cc:991
HcalDbRecord.h
HcalHistogramRawToDigi::fedUnpackList_
std::vector< int > fedUnpackList_
Definition: HcalHistogramRawToDigi.h:36
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
HcalHistogramRawToDigi::~HcalHistogramRawToDigi
~HcalHistogramRawToDigi() override
Definition: HcalHistogramRawToDigi.cc:26
edm::ParameterSet
Definition: ParameterSet.h:36
createfilelist.int
int
Definition: createfilelist.py:10
HcalHistogramRawToDigi.h
HcalHistogramRawToDigi::unpacker_
HcalUnpacker unpacker_
Definition: HcalHistogramRawToDigi.h:35
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
HcalHistogramRawToDigi::tok_data_
edm::EDGetTokenT< FEDRawDataCollection > tok_data_
Definition: HcalHistogramRawToDigi.h:34
HcalElectronicsMap
Definition: HcalElectronicsMap.h:31
HcalHistogramRawToDigi::HcalHistogramRawToDigi
HcalHistogramRawToDigi(const edm::ParameterSet &ps)
Definition: HcalHistogramRawToDigi.cc:10
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
HcalDbService.h
HcalDbRecord
Definition: HcalDbRecord.h:30
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37