CMS 3D CMS Logo

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