CMS 3D CMS Logo

Phase2TrackerCommissioningDigiProducer.cc
Go to the documentation of this file.
9 #include <iostream>
10 #include <sstream>
11 #include <iomanip>
12 
13 using namespace std;
14 
16  const edm::ParameterSet& pset) {
17  produces<edm::DetSet<Phase2TrackerCommissioningDigi>>("ConditionData");
18  token_ = consumes<FEDRawDataCollection>(pset.getParameter<edm::InputTag>("ProductLabel"));
19 }
20 
22 
24  // Retrieve FEDRawData collection
26  event.getByToken(token_, buffers);
27 
28  // Analyze strip tracker FED buffers in data
29  size_t fedIndex;
30  for (fedIndex = 0; fedIndex < Phase2Tracker::CMS_FED_ID_MAX; ++fedIndex) {
31  const FEDRawData& fed = buffers->FEDData(fedIndex);
32  if (fed.size() != 0 && fedIndex >= Phase2Tracker::FED_ID_MIN && fedIndex <= Phase2Tracker::FED_ID_MAX) {
33  // construct buffer
36 
37  // fetch condition data
38  std::map<uint32_t, uint32_t> cond_data = buffer->conditionData();
39  delete buffer;
40 
41  // print cond data for debug
42  LogTrace("Phase2TrackerCommissioningDigiProducer") << "--- Condition data debug ---" << std::endl;
43  std::map<uint32_t, uint32_t>::const_iterator it;
44  for (it = cond_data.begin(); it != cond_data.end(); it++) {
45  LogTrace("Phase2TrackerCommissioningDigiProducer")
46  << std::hex << "key: " << it->first << std::hex << " value: " << it->second << " (hex) " << std::dec
47  << it->second << " (dec) " << std::endl;
48  }
49  LogTrace("Phase2TrackerCommissioningDigiProducer") << "----------------------------" << std::endl;
50  // store it into digis
53  for (it = cond_data.begin(); it != cond_data.end(); it++) {
54  cond_data_digi->push_back(Phase2TrackerCommissioningDigi(it->first, it->second));
55  }
56  std::unique_ptr<edm::DetSet<Phase2TrackerCommissioningDigi>> cdd(cond_data_digi);
57  event.put(std::move(cdd), "ConditionData");
58  }
59  }
60 }
edm::DetSet::push_back
void push_back(const T &t)
Definition: DetSet.h:66
MessageLogger.h
Phase2Tracker::CMS_FED_ID_MAX
static const uint16_t CMS_FED_ID_MAX
Definition: utils.h:19
edm::DetSet
Definition: DetSet.h:23
utils.h
edm::Handle
Definition: AssociativeIterator.h:50
Phase2Tracker::Phase2TrackerCommissioningDigiProducer::~Phase2TrackerCommissioningDigiProducer
~Phase2TrackerCommissioningDigiProducer() override
default constructor
Definition: Phase2TrackerCommissioningDigiProducer.cc:21
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
FEDRawData
Definition: FEDRawData.h:19
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
Phase2Tracker::Phase2TrackerCommissioningDigiProducer::Phase2TrackerCommissioningDigiProducer
Phase2TrackerCommissioningDigiProducer(const edm::ParameterSet &pset)
constructor
Definition: Phase2TrackerCommissioningDigiProducer.cc:15
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
edm::ParameterSet
Definition: ParameterSet.h:36
Phase2Tracker::Phase2TrackerFEDBuffer
Definition: Phase2TrackerFEDBuffer.h:14
Phase2Tracker::FED_ID_MAX
static const uint16_t FED_ID_MAX
Definition: utils.h:18
Phase2TrackerCommissioningDigi
Definition: Phase2TrackerCommissioningDigi.h:6
edm::EventSetup
Definition: EventSetup.h:57
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
Phase2TrackerCommissioningDigi.h
Phase2TrackerCommissioningDigiProducer.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
Phase2Tracker::Phase2TrackerCommissioningDigiProducer::produce
void produce(edm::Event &event, const edm::EventSetup &es) override
Definition: Phase2TrackerCommissioningDigiProducer.cc:23
Phase2TrackerFEDHeader.h
Exception.h
DetSet.h
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
Phase2Tracker::FED_ID_MIN
static const uint16_t FED_ID_MIN
Definition: utils.h:17
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
edm::InputTag
Definition: InputTag.h:15
Phase2TrackerFEDBuffer.h
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27